I'm testing IAMSpy and it looks like policy conditions in resource policy are / may not be enforced. What behavior is expected?
I've created a failing test case here:
skuenzli@3614947
But basically the test case uses:
- allow-testing-s3.json GAAD which grants no permissions to role
testing via Identity policies
- a bucket policy that Allows
s3:GetObject to principal * and narrows that with an aws:PrincipalArn condition
Statement:
{
"Sid": "AllowNonExistentPrincipal",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": [
"arn:aws:s3:::bucket",
"arn:aws:s3:::bucket/*"
],
"Condition": {
"ArnEquals": {
"aws:PrincipalArn": [
"arn:aws:iam::111111111111:user/some-other-user"
]
}
}
}
IAMSpy can_i reports the testing principal has the s3:GetObject permission to the bucket.
FWIW, I have tried both strict_conditions=True and False
Is this behavior expected?
AFAICT (from debug output in my private library integration), the condition is parsed from the statement in the resource policy.
I'm testing IAMSpy and it looks like policy conditions in resource policy are / may not be enforced. What behavior is expected?
I've created a failing test case here:
skuenzli@3614947
But basically the test case uses:
testingvia Identity policiess3:GetObjectto principal*and narrows that with anaws:PrincipalArnconditionStatement:
IAMSpy
can_ireports thetestingprincipal has the s3:GetObject permission to the bucket.FWIW, I have tried both strict_conditions=
TrueandFalseIs this behavior expected?
AFAICT (from debug output in my private library integration), the condition is parsed from the statement in the resource policy.