-
Notifications
You must be signed in to change notification settings - Fork 166
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
Test NotPrincipal, NotAction, NotResource policies #9676
Conversation
Signed-off-by: Mahesh Shetty <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mashetty330 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Mahesh Shetty <[email protected]>
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.
- Looks like you're covering "standard" bucket policies here. The
NotPrincipal
,NotAction
, andNotResource
are properties with different behaviors of their own.
For example the following NotPrincipal AWS S3 bucket policy (generated by ChatGPT) denies all access to the bucket except for the specified user:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"NotPrincipal": {
"AWS": "arn:aws:iam::ACCOUNT-ID-WITHOUT-ACCESS:root"
},
"Action": "s3:*",
"Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
}
]
}
To test this you would need to make adjustments to gen_bucket_policy
, and probably change the flow of the test cases themselves. Please check the AWS documentation to be sure about the expected behaviors.
- Please separate this to three different test functions - there's little to no shared logic between the three since each param is basically handled in its own if-else block. I think you should be able to reuse the same polarion and bz decorators on each of them.
@sagihirshfeld the point 1, is you are correct absolutely about the functionality of NotPrincipal, NotAction and NotResource. but then my test covers the exact mentioned scenario right? For example, in case of NotPrincipal accesss should be denied to every user except the one mentioned under NotPrincipal. What is wrong there? am i missing something? |
closing this PR because its been part of https://issues.redhat.com/browse/RHSTOR-5151 and covered here #9688 |
No description provided.