-
Notifications
You must be signed in to change notification settings - Fork 424
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
fix arn comparison for IAM ARN #674
Conversation
/ok-to-test |
afc28b6
to
61b6ec4
Compare
67fd86a
to
8e336e5
Compare
@@ -46,31 +47,35 @@ func (m *DynamicFileMapper) Map(identity *token.Identity) (*config.IdentityMappi | |||
} | |||
|
|||
if roleMapping, err := m.RoleMapping(key); err == nil { | |||
if err := m.match(identity, roleMapping.RoleARN, roleMapping.UserId); err != nil { | |||
if err := m.match(canonicalARN, roleMapping.RoleARN); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So should we remove the match call for role since only user ARNs can change?
There was a problem hiding this 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 comments! yeah we can refactor it in future
pkg/mapper/dynamicfile/mapper.go
Outdated
if m.userIDStrict { | ||
// If ARN is provided, ARN must be validated along with UserID. This avoids having to | ||
// support IAM user name/ARN changes. Without preventing this the mapping would look | ||
// invalid but still work and auditing would be difficult/impossible. | ||
strippedArn, _ := arn.StripPath(mappedARN) | ||
if strippedArn != "" && token.CanonicalARN != strings.ToLower(strippedArn) { | ||
// compare arn additionally for IAM user if principalId is used in mapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is just restating the text above, I dont think it needs to be added.
There was a problem hiding this 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 comments! yeah we can refactor it in future
8e336e5
to
50a3dd9
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nckturner, nnmin-aws The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/merge |
/retest |
What this PR does / why we need it:
this PR fix the issue in PR 669. The original fix doesn't work.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #