-
Notifications
You must be signed in to change notification settings - Fork 23
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
(S3): Rule S3_BUCKET_SSL_REQUESTS_ONLY is overly permissive #243
Comments
Thank you for submitting this issue. We are reviewing on our side with the tests you provided. |
@fabiodouek looking at this we can require that it has the Action, Resource * and Principal * in the statement to tighten down. Have you tested anything similar that meets the requirements? |
Hi @grolston , the Conditions also have to be tweaked. Unfortunately it seems to be a challenge in Guard to do a dict exact match in a simple way. So it has to check the non-presence of the unexpected attributes. Following an example of a rule and tests tweaked. Maybe there is a way to simplify this? Rule
Tests
|
I ran into the exact same issue: "Unfortunately it seems to be a challenge in Guard to do a dict exact match in a simple way" My first pass through I made it pretty rigid by defining the exact match. Let me take a look at what you have here and see if that works out. |
@fabiodouek this looks fine. Is there any areas you are looking for improvements on this check? Would you mind opening up a pull-request for this? |
@fabiodouek looking at what you have above, we are looking at adding the following to the check:
/cc @akshayrane |
Hi @grolston , @akshayrane , The enforcement in the rule you are presenting does not achieve the desired outcome and it cannot be trusted. On the other hand, the rule I've provided does a strict check and would prevent the rule to be bypassed either intentionally or unintentionally. In case you decide to go with a more relaxed rule, I would suggest to add a disclaimer saying that the rule does not prevent to be bypassed, as there are customers trusting that the rules in this repo are reliable. Regards, |
What is the problem?
The rule https://github.com/aws-cloudformation/aws-guard-rules-registry/blob/main/rules/aws/amazon_s3/s3_bucket_ssl_requests_only.guard is overly permissive.
Following the main points:
Reproduction Steps
Example below specifying an Action in the Deny to force a no match rule. The same applies for Principal, Resource.
Example below specifying an additional Condition so the statement returns false
What did you expect to happen?
I expected the rule to provide the intended guardrail for all scenarios.
What actually happened?
The rule is overly permissive, it does not provide its main objective.
CloudFormation Guard Version
2.1.3
OS
Amazon Linux
OS Version
No response
Other information
The rule should have additional assertions to cover the possible scenarios.
The text was updated successfully, but these errors were encountered: