Skip to content

Commit

Permalink
Stop more checks if invalid resources are found (#159)
Browse files Browse the repository at this point in the history
* 🎓 Update managed policies repo link to @z0ph's

* 🐛 Stop more checks if invalid resources are found

* 🎓 Fix spelling
  • Loading branch information
KevinHock committed Dec 7, 2020
1 parent 1c37001 commit 66c6588
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This example is showing that the action s3:GetObject requires a resource matchin
The different input types allowed include:
- --file: Filename
- --directory: A directory path, for exmaple: `--directory . --include_policy_extension json --exclude_pattern ".*venv.*"`
- --aws-managed-policies: For use specifically with the repo https://github.com/SummitRoute/aws_managed_policies
- --aws-managed-policies: For use specifically with the repo https://github.com/z0ph/aws_managed_policies
- --auth-details-file: For use with the file returned by "aws iam get-account-authorization-details"
- --string: Provide a string such as '{"Version": "2012-10-17","Statement": {"Effect": "Allow","Action": ["s3:GetObject", "s3:PutBucketPolicy"],"Resource": ["arn:aws:s3:::bucket1", "arn:aws:s3:::bucket2/*"]}}'

Expand Down
4 changes: 2 additions & 2 deletions parliament/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def override_config(override_config_path):
for finding_type, settings in override_config.items():
if finding_type not in config:
config[finding_type] = {}
for setting, settting_value in settings.items():
config[finding_type][setting] = settting_value
for setting, setting_value in settings.items():
config[finding_type][setting] = setting_value


def enhance_finding(finding):
Expand Down
4 changes: 2 additions & 2 deletions parliament/statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ def analyze_statement(self):
"""
Given a statement, look for problems and extract out the parts.
If it is maformed, return False
If it is malformed, return False
"""
actions = []
resources = []
Expand Down Expand Up @@ -955,4 +955,4 @@ def analyze_statement(self):
"RESOURCE_STAR", detail=sorted(self.resource_star), location=self.stmt
)

return True
return not has_malformed_resource

0 comments on commit 66c6588

Please sign in to comment.