fix(terraform): CKV_AZURE_249 & CKV_AWS_358 - better support for OIDC 'repo' detection regex and conditions order #6994
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
Description
condition
blocks order would matter - it does not (CKV_AWS_358 is (seemingly unintentionally) enforcing condition ordering in OIDC policies #6986)repo
claim usage within OIDC configs so it will match GitHub's naming allowance and restrictions (CKV_AZURE_249 scan fail for OIDC subject claims analysis for GitHub x Azure on Check on our CI #6978)Fixes
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Enhances OIDC support for GitHub Actions in AWS and Azure. Improves the
gh_repo_regex
inoidc_utils.py
to better match GitHub repository naming conventions. Modifies theGithubActionsOIDCTrustPolicy
check in AWS to handle multiple conditions and their order. Updates test files to reflect these changes and adds new test cases for special characters in repo names.oidc_utils.py
to support more complex repository namesModified files (1)
Latest Contributors(1)
GithubActionsOIDCTrustPolicy
check for AWS to handle multiple conditions and their orderModified files (5)
Latest Contributors(2)