-
Notifications
You must be signed in to change notification settings - Fork 86
Support the wildcard principal ("*")
in STS role config
#8257
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
Support the wildcard principal ("*")
in STS role config
#8257
Conversation
662ef1d
to
7548ab2
Compare
"*"
) in STS role config"*"
) in STS role config
@@ -216,7 +216,7 @@ function _is_statements_fit(statements, method, cur_account_email) { | |||
// who can do that action | |||
for (const principal of statement.principal) { | |||
dbg.log0('assume_role_policy: principal fit?', principal.unwrap().toString(), cur_account_email); | |||
if (principal.unwrap() === cur_account_email) { | |||
if ((principal.unwrap() === cur_account_email) || (principal.unwrap() === '*')) { |
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.
Do you know why STS doesn't use the code in s3_bucket_policy_utils
?
It seems that this fix is already there...
noobaa-core/src/endpoint/s3/s3_bucket_policy_utils.js
Lines 169 to 173 in 3882f49
for (const principal of _.flatten([statement_principal])) { | |
dbg.log1('bucket_policy: ', statement.Principal ? 'Principal' : 'NotPrincipal', ' fit?', principal, account); | |
if ((principal.unwrap() === '*') || (principal.unwrap() === account)) { | |
principal_fit = true; | |
} |
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.
One difference I found is that the STS checks check for action === 'sts:*'
, which the S3 bucket utils don't, and rightfully so.
@romayalon - do you remember why you reimplemented the checks instead of importing them? Any additional reasons?
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.
@shirady this is out of this PR scope
Could you open a GH issue for it?
Hey @Neon-White
|
Adding @liranmauda @nimrod-becker for assigning #8257 (comment)
|
@@ -216,7 +216,7 @@ function _is_statements_fit(statements, method, cur_account_email) { | |||
// who can do that action | |||
for (const principal of statement.principal) { | |||
dbg.log0('assume_role_policy: principal fit?', principal.unwrap().toString(), cur_account_email); | |||
if (principal.unwrap() === cur_account_email) { | |||
if ((principal.unwrap() === cur_account_email) || (principal.unwrap() === '*')) { |
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.
@shirady this is out of this PR scope
Could you open a GH issue for it?
7548ab2
to
13f0093
Compare
"*"
) in STS role confighas_policy_permission
function
2f0ad5f
to
27df4f7
Compare
has_policy_permission
function("*")
in STS role config
Signed-off-by: Ben <[email protected]>
4607118
to
8a1d91d
Compare
Explain the changes
Testing Instructions: