Skip to content
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_only_allow_ssl KeyError: 'Statement' #150

Open
mbassett opened this issue May 20, 2022 · 0 comments
Open

s3_only_allow_ssl KeyError: 'Statement' #150

mbassett opened this issue May 20, 2022 · 0 comments

Comments

@mbassett
Copy link

Hey guys, when activating the s3_only_allow_ssl bot I'm getting a KeyError: 'Statement'

doing a little digging, I can see that
policy_bucket = s3_client.get_bucket_policy(Bucket=entity['name'])

returns back a response element, but it does not have a property 'Statement'

'Statement' is instead found under 'Policy'

when i look at policy_bucket['Policy'] the results are a string

so I think maybe this needs to be something like

policy_bucket = s3_client.get_bucket_policy(Bucket=entity['name'])
policy = json.loads(policy_bucket['Policy'])

In short, this whole script seems to be keying off a field that has been moved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant