Skip to content

Commit

Permalink
Merge branch 'master' into gabrielcorado/add-session-recording-access…
Browse files Browse the repository at this point in the history
…-new-fields
  • Loading branch information
gabrielcorado authored Nov 12, 2024
2 parents 798f99b + 169128d commit e3ca4b7
Show file tree
Hide file tree
Showing 22 changed files with 1,732 additions and 1,532 deletions.
1,945 changes: 999 additions & 946 deletions api/client/proto/authservice.pb.go

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions api/mfa/ceremony.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,8 @@ type CreateAuthenticateChallengeFunc func(ctx context.Context, req *proto.Create
// req may be nil if ceremony.CreateAuthenticateChallenge does not require it, e.g. in
// the moderated session mfa ceremony which uses a custom stream rpc to create challenges.
func (c *Ceremony) Run(ctx context.Context, req *proto.CreateAuthenticateChallengeRequest, promptOpts ...PromptOpt) (*proto.MFAAuthenticateResponse, error) {
switch {
case c.CreateAuthenticateChallenge == nil:
if c.CreateAuthenticateChallenge == nil {
return nil, trace.BadParameter("mfa ceremony must have CreateAuthenticateChallenge set in order to begin")
case req == nil:
// req may be nil in cases where the ceremony's CreateAuthenticateChallenge sources
// its own req or uses a different rpc, e.g. moderated sessions.
case req.ChallengeExtensions == nil:
return nil, trace.BadParameter("missing challenge extensions")
case req.ChallengeExtensions.Scope == mfav1.ChallengeScope_CHALLENGE_SCOPE_UNSPECIFIED:
return nil, trace.BadParameter("mfa challenge scope must be specified")
}

// If available, prepare an SSO MFA ceremony and set the client redirect URL in the challenge
Expand All @@ -78,6 +70,14 @@ func (c *Ceremony) Run(ctx context.Context, req *proto.CreateAuthenticateChallen
slog.DebugContext(ctx, "Failed to attempt SSO MFA, continuing with other MFA methods", "error", err)
} else {
defer ssoMFACeremony.Close()

// req may be nil in cases where the ceremony's CreateAuthenticateChallenge sources
// its own req or uses a different e.g. login. We should still provide the sso client
// redirect URL in case the custom CreateAuthenticateChallenge handles it.
if req == nil {
req = new(proto.CreateAuthenticateChallengeRequest)
}

req.SSOClientRedirectURL = ssoMFACeremony.GetClientCallbackURL()
promptOpts = append(promptOpts, withSSOMFACeremony(ssoMFACeremony))
}
Expand Down
3 changes: 3 additions & 0 deletions api/proto/teleport/legacy/client/proto/authservice.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2169,6 +2169,9 @@ message UpdateSessionTrackerRequest {
message PresenceMFAChallengeRequest {
// SessionID is unique identifier of the session you want to request presence for.
string SessionID = 1 [(gogoproto.jsontag) = "session_id,omitempty"];
// SSOClientRedirectURL should be supplied If the client supports SSO MFA checks.
// If unset, the server will only return non-SSO challenges.
string SSOClientRedirectURL = 2 [(gogoproto.jsontag) = "sso_client_redirect_url,omitempty"];
}

// PresenceMFAChallengeSend is a presence challenge request or response.
Expand Down
6 changes: 6 additions & 0 deletions api/proto/teleport/legacy/types/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7795,6 +7795,12 @@ message OktaOptions {
message AccessGraphSync {
// AWS is a configuration for AWS Access Graph service poll service.
repeated AccessGraphAWSSync AWS = 1 [(gogoproto.jsontag) = "aws,omitempty"];
// PollInterval is the frequency at which to poll for AWS resources
google.protobuf.Duration PollInterval = 2 [
(gogoproto.jsontag) = "poll_interval,omitempty",
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true
];
}

// AccessGraphAWSSync is a configuration for AWS Access Graph service poll service.
Expand Down
3 changes: 2 additions & 1 deletion api/types/discoveryconfig/derived.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

776 changes: 412 additions & 364 deletions api/types/types.pb.go

Large diffs are not rendered by default.

11 changes: 2 additions & 9 deletions api/utils/keys/privatekey.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,8 @@ func TLSCertificateForSigner(signer crypto.Signer, certPEMBlock []byte) (tls.Cer

// PPKFile returns a PuTTY PPK-formatted keypair
func (k *PrivateKey) PPKFile() ([]byte, error) {
rsaKey, ok := k.Signer.(*rsa.PrivateKey)
if !ok {
return nil, trace.BadParameter("only RSA keys are supported for PPK files, found private key of type %T", k.Signer)
}
ppkFile, err := ppk.ConvertToPPK(rsaKey, k.MarshalSSHPublicKey())
if err != nil {
return nil, trace.Wrap(err)
}
return ppkFile, nil
ppkFile, err := ppk.ConvertToPPK(k.Signer, k.sshPub)
return ppkFile, trace.Wrap(err)
}

// SoftwarePrivateKeyPEM returns the PEM encoding of the private key. If the key
Expand Down
Loading

0 comments on commit e3ca4b7

Please sign in to comment.