Skip to content
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

Question, how to invalidate assumed role cred? #841

Closed
retzero opened this issue Sep 12, 2023 · 4 comments
Closed

Question, how to invalidate assumed role cred? #841

retzero opened this issue Sep 12, 2023 · 4 comments

Comments

@retzero
Copy link

retzero commented Sep 12, 2023

Describe the bug

Hello.
Do you invalidate the OIDC session token (I'm not sure this is the right word?) after the workflows or job finished even if the duration has not been expired?
Or how can I manually trigger invalidate procedure?

Expected Behavior

Session token should not be reused if the workflows finished.

Current Behavior

n/a

Reproduction Steps

n/a

Possible Solution

No response

Additional Information/Context

No response

@retzero retzero added bug Something isn't working needs-triage This issue still needs to be triaged labels Sep 12, 2023
@peterwoodworth
Copy link
Contributor

peterwoodworth commented Sep 12, 2023

Hey @retzero,

In your workflow after all your defined steps have completed, you should see a "Post <name of configure aws credentials step>" step. In this cleanup step, we unset all AWS environment variables. Check out the file here https://github.com/aws-actions/configure-aws-credentials/blob/main/src/cleanup/index.ts

Hope this answers your question, let me know if I can clarify anything else

@peterwoodworth peterwoodworth added response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 5 days. and removed needs-triage This issue still needs to be triaged bug Something isn't working labels Sep 12, 2023
@kellertk
Copy link
Contributor

While what Peter said will happen - we remove all the credentials from the environment - the temporary credentials that we fetch are still technically valid. If your workflow takes these credentials and then exports them somewhere else, they can still be used to make requests for the duration you've specified.

Actually invalidating the credentials is more involved, and requires making changes to the associated IAM roles. Please see this documentation: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_disable-perms.html

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 5 days. label Sep 12, 2023
@retzero
Copy link
Author

retzero commented Sep 12, 2023

Thanks @peterwoodworth @kellertk
The docs you shared helped me a lot!

@retzero retzero closed this as completed Sep 12, 2023
@github-actions
Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants