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

feat: Add support for custom trust policy conditions on iam-github-oidc-role #547

Merged
merged 15 commits into from
Mar 7, 2025

Conversation

JBSchami
Copy link
Contributor

@JBSchami JBSchami commented Jan 28, 2025

Description

This adds support for custom trust policy conditions to the iam-github-oidc-role module.

Motivation and Context

The GitHub documentation on [security hardening with OpenID connect] (https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/about-security-hardening-with-openid-connect) specifies that:

You can define granular OIDC policies by using additional OIDC token claims, such as repository_id and repository_visibility. See Understanding the OIDC token.

However, this module currently only supports validation of iss, aud and sub. I have a use case where I also want to validate actor and workflow but without this change, the module doesn't support that.

Breaking Changes

I do not believe this breaks any backwards compatibility. The added variable defaults to an empty array of entries, much like in the iam-assumable-role-with-oidc modules and the dynamic configuration will not add anything if no values are provided.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects

caveat: I don't have a space where I can deploy the examples but I have successfully tested the updated module against corporate accounts where I am employed.

  • I have executed pre-commit run -a on my pull request

caveat: terraform-docs also affected 8 other REAMDE files (for modules I have not touched in this PR) but I have not checked those changes in. I can if you'd like. All other pre-commmit checks passed. this was due to using an outdated version of TF (1.5.5, I updated to 1.10.5 and it resolved this)

Sorry, something went wrong.

@JBSchami JBSchami changed the title Add support for custom trust policy conditions on iam-github-oidc-role feat: Add support for custom trust policy conditions on iam-github-oidc-role Jan 28, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link

github-actions bot commented Mar 2, 2025

This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days

@github-actions github-actions bot added the stale label Mar 2, 2025
@JBSchami
Copy link
Contributor Author

JBSchami commented Mar 2, 2025

Hello @antonbabenko any chance I can get a review on this please?

@github-actions github-actions bot removed the stale label Mar 3, 2025
Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

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

Thank you for the valuable addition! There are just a few small comments before we can merge it.

JBSchami and others added 6 commits March 5, 2025 08:37

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
Co-authored-by: Anton Babenko <anton@antonbabenko.com>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Anton Babenko <anton@antonbabenko.com>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fmt

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@JBSchami JBSchami requested a review from antonbabenko March 6, 2025 00:45
@antonbabenko antonbabenko merged commit 3eca351 into terraform-aws-modules:master Mar 7, 2025
34 checks passed
antonbabenko pushed a commit that referenced this pull request Mar 7, 2025
## [5.53.0](v5.52.2...v5.53.0) (2025-03-07)

### Features

* Add support for custom trust policy conditions on `iam-github-oidc-role` ([#547](#547)) ([3eca351](3eca351))
@antonbabenko
Copy link
Member

This PR is included in version 5.53.0 🎉

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

Successfully merging this pull request may close these issues.

None yet

2 participants