Skip to content

Commit db8a689

Browse files
authored
Merge pull request #118 from prdngr/fix-privesc-false-positive
Fix false positive where GitHub Actions subject was not recognized
2 parents 0ba9e2d + 11763f0 commit db8a689

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

aws/role-trusts.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,8 @@ func parseFederatedTrustPolicy(statement policy.RoleTrustStatementEntry) (string
466466
subjects = append(subjects, statement.Condition.StringLike.TokenActionsGithubusercontentComSub...)
467467
} else if len(statement.Condition.StringEquals.TokenActionsGithubusercontentComSub) > 0 {
468468
subjects = append(subjects, statement.Condition.StringEquals.TokenActionsGithubusercontentComSub...)
469+
} else if len(statement.Condition.ForAllValuesStringLike.TokenActionsGithubusercontentComSub) > 0 {
470+
subjects = append(subjects, statement.Condition.ForAllValuesStringLike.TokenActionsGithubusercontentComSub...)
469471
} else {
470472
subjects = append(subjects, "ALL REPOS!!!")
471473
}

internal/aws/policy/role-trust-policies.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ type RoleTrustStatementEntry struct {
6464
CircleCISub ListOfPrincipals `json:"CircleCISub"`
6565
// Add patterns for provider-specific claims that support wildcards or partial matches
6666
} `json:"StringLike"`
67+
ForAllValuesStringLike struct {
68+
TokenActionsGithubusercontentComSub ListOfPrincipals `json:"token.actions.githubusercontent.com:sub"`
69+
} `json:"ForAllValues:StringLike"`
6770
ForAnyValueStringLike struct {
6871
CognitoAMR string `json:"cognito-identity.amazonaws.com:amr"`
6972
//Auth0Amr ListOfPrincipals `json:"Auth0Amr"`

0 commit comments

Comments
 (0)