-
Notifications
You must be signed in to change notification settings - Fork 19
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
Policy conditions not enforced in resource policy? #17
Comments
Yup this is currently a known issue. So condition support has started, but the ties between the various condition keys haven't been fully setup yet. At the moment, it will enforce that the PrincipalArn as a string matches should multiple policies require them to be different, but it is yet to compare this against the source ARN. Once the SCP branch has been merged in, that is next on my todo list :) |
Thanks for confirming the issue and those details. I will look into the issue and try to fix it in the meantime. |
@Skybound1 - quick update: I spent a couple days getting acquainted with IAMSpy and trying to figure out where to add/copy the condition key constraints. It seems like parse.py's
But I'm stuck and don't feel like I really understand what I'm doing. If you can provide some guidance on how to implement this, or even some recommended reading about using z3 String expressions, I'm happy to work on this some more. |
🤔 TBH, considering the scale of work that needs to go into conditions, I don't think putting it into that function would be the cleanest, imho we should have a separate function that is called to generate all the condition constraints. Also, so I would make a few tweaks to that:
Annoyingly, I haven't found that many great docs on using Python Z3, so it's been a lot of experimenting myself, reading through general Z3 docs and trying to figure out how to conver that to Python, etc |
Thanks for the detailed guidance. I had similar thoughts that:
I'll try to give this another shot next week. |
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:
testing
via Identity policiess3:GetObject
to principal*
and narrows that with anaws:PrincipalArn
conditionStatement:
IAMSpy
can_i
reports thetesting
principal has the s3:GetObject permission to the bucket.FWIW, I have tried both strict_conditions=
True
andFalse
Is this behavior expected?
AFAICT (from debug output in my private library integration), the condition is parsed from the statement in the resource policy.
The text was updated successfully, but these errors were encountered: