mirror of
https://github.com/Sea-Haven-Industries/.github.git
synced 2026-09-30 07:03:11 +00:00
fix(iam): match org-baseline policy-check OIDC subject (PLAT-234) (#155)
Some checks are pending
ci / ci / ci (push) Waiting to run
Some checks are pending
ci / ci / ci (push) Waiting to run
Pull request tokens use repo:ORG/seahaven-org-baseline:pull_request. Merge queue tokens use the gh-readonly-queue ref. The previous refs/pull/* subject never matched either. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Adam Moussa <amoussa1229@users.noreply.github.com>
This commit is contained in:
parent
c9134742ce
commit
892580d7d7
1 changed files with 13 additions and 5 deletions
|
|
@ -1177,6 +1177,18 @@ Resources:
|
||||||
AssumeRolePolicyDocument:
|
AssumeRolePolicyDocument:
|
||||||
Version: "2012-10-17"
|
Version: "2012-10-17"
|
||||||
Statement:
|
Statement:
|
||||||
|
- Effect: Allow
|
||||||
|
Principal:
|
||||||
|
Federated: !Sub arn:aws:iam::${AWS::AccountId}:oidc-provider/token.actions.githubusercontent.com
|
||||||
|
Action: sts:AssumeRoleWithWebIdentity
|
||||||
|
# pull_request jobs with no environment use sub
|
||||||
|
# repo:ORG/seahaven-org-baseline:pull_request. refs/pull/N/merge is
|
||||||
|
# the ref claim, not sub. A second statement is required: StringEquals
|
||||||
|
# and StringLike in one condition are AND.
|
||||||
|
Condition:
|
||||||
|
StringEquals:
|
||||||
|
token.actions.githubusercontent.com:aud: sts.amazonaws.com
|
||||||
|
token.actions.githubusercontent.com:sub: !Sub repo:${GitHubOrg}/seahaven-org-baseline:pull_request
|
||||||
- Effect: Allow
|
- Effect: Allow
|
||||||
Principal:
|
Principal:
|
||||||
Federated: !Sub arn:aws:iam::${AWS::AccountId}:oidc-provider/token.actions.githubusercontent.com
|
Federated: !Sub arn:aws:iam::${AWS::AccountId}:oidc-provider/token.actions.githubusercontent.com
|
||||||
|
|
@ -1185,11 +1197,7 @@ Resources:
|
||||||
StringEquals:
|
StringEquals:
|
||||||
token.actions.githubusercontent.com:aud: sts.amazonaws.com
|
token.actions.githubusercontent.com:aud: sts.amazonaws.com
|
||||||
StringLike:
|
StringLike:
|
||||||
token.actions.githubusercontent.com:sub:
|
token.actions.githubusercontent.com:sub: !Sub repo:${GitHubOrg}/seahaven-org-baseline:ref:refs/heads/gh-readonly-queue/main/*
|
||||||
- !Sub repo:${GitHubOrg}/seahaven-org-baseline:ref:refs/heads/main
|
|
||||||
# use_immutable_subject is false, so pull_request tokens use
|
|
||||||
# repo:ORG/seahaven-org-baseline:ref:refs/pull/N/merge.
|
|
||||||
- !Sub repo:${GitHubOrg}/seahaven-org-baseline:ref:refs/pull/*
|
|
||||||
Policies:
|
Policies:
|
||||||
- PolicyName: access-analyzer-policy-check
|
- PolicyName: access-analyzer-policy-check
|
||||||
PolicyDocument:
|
PolicyDocument:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue