-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: Support verifying govcloud aws sessions #4087
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
base: main
Are you sure you want to change the base?
feat: Support verifying govcloud aws sessions #4087
Conversation
Add support to query govcloud sts endpoints for session tokens.
I believe you meant they are never verified, not "detected," right? That said, does the verification API return a specific error when a token is checked against the wrong endpoint? |
Correct, I meant verified.
Yes, there seems to be no difference in the pattern, it is just a base64'ed protobuf blob - per the comments in the code. I attempted to decode them with the referenced links, in hope that the region was accessible (which would give an indication of govcloud or not) however it is not a fully parsed protobuf with any determinable differences.
|
return true, data, nil | ||
} | ||
|
||
ok, data, err = s.attemptVerifyMatch(ctx, resIDMatch, resSecretMatch, resSessionMatch, retryOn403, regionGovCloud, hostGovCloud) |
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.
As you mentioned, there isn’t a clear way to identify the specific endpoint. The changes look good to me overall.
My only concern is that we might end up attempting GovCloud verification for every error we receive from Commercial.
That said, I’m approving this from my side. If anyone has suggestions for a better approach, feel free to add.
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.
Please correct me if I am wrong, Everytime attemptVerifyMatch
returns with err = nil
and ok = false
, The changes will try to verify for gov
region ?
Even If the token has been expired, attemptVerifyMatch
will returns err = nil
and ok = false
. Aren't we confident that credentials are unverified
in this case?
Correct
No, if you find gov cloud credentials, they look like expired and unverifiable credentials when hitting the regular endpoint. Upon trying the gov cloud endpoint, it can be seen these are valid and unexpired gov cloud specific credentials. |
Add support to query govcloud sts endpoints for session tokens.
Description:
While doing some experimentation I noticed that govcloud sessions would never detect, so I added the logic to the session verifier to perform these.
I'm unsure exactly if this is the best way to add the logic in, as if the commercial check fails it will then check if it is a valid govcloud account. So essentially a true-negative will now make two http calls. This might possibly be something that should be gated behind a feature? I was hoping someone at Truffle would have more information on which would be preferred. Part of me thought, no one has ever complained this didn't work so no one else might want it. Though this also could mean no one else has ever realized it wasn't working? Lastly, if this ends up being merged, we may want to do the same with the account check code as well since this also utilizes a similar endpoint.
Checklist:
make test-community
)?make lint
this requires golangci-lint)?