I can see that there is a policy evaluation rule for Secrets Manager here.
I have a policy attached to the secrets manager resource as follows
{
"Version" : "2012-10-17",
"Statement" : [ {
"Sid" : "minimumNeeded",
"Effect" : "Allow",
"Principal" : {
"AWS" : [ "arn:aws:sts::SLJFLSDKFJLSJDKF:assumed-role/xxx/USER1", "arn:aws:sts::SLJFLSDKFJLSJDKF:assumed-role/xxx/USER2" ]
},
"Action" : "secretsmanager:*",
"Resource" : "*"
}]
}
When a different user tried to do a put-secret-value
from aws CLI targeting the above resource, it worked and the above policy didn't stop them. My understanding from the AWS doc above is:
- USER2 will have an ALLOW if the role XXX has explicitly allowed secrets manager operations.
Is this assumption correct ? If so, how can I block everyone but certain individuals?
Regards,
I think I would need to do
NotPrincipal with DENY
as mentioned in the docshttps://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_notprincipal.html