-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Okta Dep Update #28121
base: main
Are you sure you want to change the base?
Okta Dep Update #28121
Conversation
CI Results: |
3b6fa3b
to
57bed20
Compare
fada61e
to
80a05ad
Compare
80a05ad
to
b96116b
Compare
Build Results: |
@@ -2070,21 +2070,25 @@ func (c *Core) validateOkta(ctx context.Context, mConfig *mfa.Config, username s | |||
return err | |||
} | |||
|
|||
// Okta doesn't return the transactionID as a parameter in the response, but it's encoded in the URL | |||
// this approach comes from: https://github.com/okta/okta-sdk-golang/issues/300, but it's not ideal. | |||
// It is, however, what the dotnet library by Okta themselves does. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is also the inverse of what GetFactorTransactionStatus does.
} | ||
} | ||
|
||
if !factorFound { | ||
return fmt.Errorf("no push-type MFA factor found for user") | ||
} | ||
|
||
result, _, err := client.UserFactor.VerifyFactor(ctx, user.Id, userFactor.Id, okta.VerifyFactorRequest{}, userFactor, nil) | ||
result, _, err := client.UserFactorAPI.VerifyFactor(ctx, user.GetId(), userFactor.GetId()).Execute() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The difference between the approach here and the approach in path_login.go
is for 'light touch' reasons - path_login.go
uses the "shim", since the setting a token is optional there. The code here already used the okta API directly, and so the updated version can be similarly updated, without using the "write the request yourself" escape hatch.
Description
This PR updates our Okta SDK dependency to v4, so that we transitively remove a go-jose dependency CVE-2024-28180. There have been a series of other tasks to purge the vulnerable dependency from
vault
, this is the only one that requires larger code changes.Unfortunately, to get rid of the <=v2.6.2 vulerability, we had to move the
okta-sdk
to at least v3, which causes these breaking changes below. There didn't appear to be additional (relevant) changes between v3 and v5, so I moved to v5 directly.This code retains the "shim" that was written that integrates
github.com/chrismalek/oktasdk-go
, only in the case of operating without an API token - a mode that was deprecated in Vault 1.4. I think this might be removable, and an alternative option used for the "no token" case, but that might only be viable for a version of this PR that isn't targeted at backporting.TODO only if you're a HashiCorp employee
to N, N-1, and N-2, using the
backport/ent/x.x.x+ent
labels. If this PR is in the CE repo, you should only backport to N, using thebackport/x.x.x
label, not the enterprise labels.in the PR description, commit message, or branch name.