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

fix:v3.1.1 #108

Merged
merged 28 commits into from
May 4, 2022
Merged

fix:v3.1.1 #108

merged 28 commits into from
May 4, 2022

Conversation

brivu
Copy link
Contributor

@brivu brivu commented May 2, 2022

@adamdmharvey
Copy link

Note: this PR does not remove the unused executor, suggested via my closed PR #107. You may have decided it should stay, and that's fine; just fyi. :)

fi

# shellcheck disable=SC2034
AWS_STS_COMMAND=$(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks to me like it'll attempt to assume role twice, both here on line 9 and again on line 21? i'll admit to not being familiar with the pipe status exiting you're doing. curious on how this works :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the dev published version of this orb via this PR and tested on our side. While it works, I confirm our CloudTrail logs show duplicate assume roles with web identities with this code?

Screen shot shows me testing the pipeline twice, but you can see four (2x2) logs recorded of attempted assume roles with web identities:

image

This of course is not ideal as it means double audit logs; every user will look like they're logging in twice with OpenID. So this needs to somehow be refactored into a single call I believe?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(and btw i did note in my issue report that the root here, the failing when there is a failed Assume Role for Web Identity, now correctly fails; so we just want this to not double authenticate)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamdmharvey, thanks for letting me know, I really appreciate it! Having double logs is definitely not ideal. Let me investigate some more and see what we can do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamdmharvey - I don't know why I had to make is so hard 😂 I've added validation that checks to see if the keys and session token were actually generated. If the aws sts assume-role-with-web-identity command fails, the keys and token will be null. I tested it by forcing it to fail and it gave me the correct error from AWS and the job did fail.

image

As for the executor, we decided to leave it in case there are others using it.

@brivu brivu merged commit da3cf00 into master May 4, 2022
@brivu brivu deleted the v3.1.1 branch May 4, 2022 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants