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

Prevent unexpected privileges escalation #136

Merged
merged 8 commits into from
Feb 28, 2023

Conversation

gillg
Copy link
Contributor

@gillg gillg commented Dec 21, 2022

what

The current variable input_metadata_http_put_response_hop_limit condition, prevent to protect users of this module, to be protected against privileges escalation.
The first intent of IMDSv2 is to prevent containers beeing able to assume an EC2 instance profile. It's not a bad idea at all to prevent that. The good practice then is to use the module cloudposse/eks-iam-role/aws to create a kubernetes service account mapped with IAM permissions throug an OIDC IdP.

references

@gillg gillg requested review from a team as code owners December 21, 2022 10:00
@gillg
Copy link
Contributor Author

gillg commented Jan 26, 2023

Does anyone can take a look ? randomly @Gowiem

max-lobur
max-lobur previously approved these changes Jan 26, 2023
@max-lobur
Copy link
Contributor

Makes sense, thanks for this. I think we will change default too, but will check regression first

@gillg
Copy link
Contributor Author

gillg commented Jan 26, 2023

Makes sense, thanks for this. I think we will change default too, but will check regression first

Fine to me, but be careful with the default... ^^ A lot of people will have unexpected permissions not working anymore. It's a breaking change.

@max-lobur
Copy link
Contributor

/test all

@max-lobur
Copy link
Contributor

Both failures unrelated, I will fix in separate PR

@xeivieni
Copy link
Contributor

Any update on this PR ? I would love to see this released 🤗

@nitrocode nitrocode added the patch A minor, backward compatible change label Feb 28, 2023
@nitrocode
Copy link
Member

/test test/readme

@nitrocode
Copy link
Member

nitrocode commented Feb 28, 2023

@max-lobur this is odd. It seems like it's trying to revert it back to 2022 instead of using 2023.

It should be using the latest build-harness which grabs rhe current year.

https://github.com/cloudposse/build-harness/blob/c7b01d772017cc78b3902c0a7fcd54f6b6131dca/templates/README.md.gotmpl#L288

-Copyright © 2017-2023 [Cloud Posse, LLC](https://cpco.io/copyright)
+Copyright © 2017-2022 [Cloud Posse, LLC](https://cpco.io/copyright)

@max-lobur max-lobur self-assigned this Feb 28, 2023
@nitrocode
Copy link
Member

Oh I see the issue. We just need to run the auto format again on this pr since this pr was submitted in 2022. Now its 2023 and the year should be 2023 in the readme.

Please run make pr/auto-format locally

@nitrocode
Copy link
Member

/test all

nitrocode
nitrocode previously approved these changes Feb 28, 2023
@nitrocode nitrocode enabled auto-merge (squash) February 28, 2023 12:43
@nitrocode
Copy link
Member

/test test/terratest

@nitrocode
Copy link
Member

/test test/terratest

@nitrocode
Copy link
Member

/test test/terratest

@nitrocode
Copy link
Member

/test test/terratest

@nitrocode
Copy link
Member

/test all

@nitrocode nitrocode merged commit 31d0b8a into cloudposse:master Feb 28, 2023
@nitrocode
Copy link
Member

Thank you @gillg for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch A minor, backward compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants