-
Notifications
You must be signed in to change notification settings - Fork 449
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
Include IAM role in ec2 data (issue #1524) #1525
Conversation
those test failures don't seem related to this change but lmk if there's something I need to do there. |
This seems like a good addition, but it makes me wonder if there's more relevant information here or a more complete way to handle this. In other words I'm suspicious that this satisfies one use case and could lead to a creeping addition of more things. |
You're correct, the CI failures are unrelated. |
This is the full structure:
The only other bits that seem potentially interesting to me are |
It feels to me like keeping all of |
lmk how you like this. grabs info. moves role_name under an iam key as well. If anything additional is desired in the future, it can be added to the |
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 code seems good to me 👍
In order to merge this PR all commits will need a DCO signoff though.
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 @phiggins says you need to fix your DCO. Just squash them all together and forcepush, or amend your last commit and forcepush, either way.
ff1fd6b
to
369bfb7
Compare
Signed-off-by: KC Braunschweig <[email protected]> Co-authored-by: pete higgins <[email protected]>
369bfb7
to
0c11a79
Compare
Looks good, thanks. I'll wait for someone internal to merge, or ping me tomorrow to merge if they haven't. |
Hey @lamont-granquist @tas50 @phiggins ... forgot I'm an approver, not an owner, so I don't have access to merge. Can one of you click the button? |
Description
Currently the ohai ec2 plugin reads from the AWS metadata service but strips out all IAM data to prevent leaking security credentials. Change modifies this filtering slightly to still include the IAM role-name which is part of the metadata at:
iam/security-credentials/role-name
see: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html
Don't include the data returned in the document under role-name as that includes actually includes credentials, but the name part isn't a security concern and is useful to people to know the IAM identity of the instance where chef is running.
In the solution i'm being fairly paranoid checking explicitly for the security-credentials key and that it has exactly 1 key below it. As far as I can tell 'security-credentials' will only exist at all if there's an associated role, in fact if there's no role 'iam' won't exist at all and there can only be 1 associated role at any one time ever. So in reality if the IAM key exists at all, then there should be exactly 1 role name for us to find always. But yay paranoia, happy to do it however people like.
Related Issue
#1524
Types of changes
Checklist: