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
fix None type scenario in get_actions_for_service #246
Conversation
@kmcquade please review , this is my first PR for this repo. Hoping to make more contributions soon |
|
Hey @reetasingh! Thanks for making a PR. I think that you might have made the fix in the wrong file.
The above indicates two different options to investigate:
get_service_prefix_dataThe section you chose - I use Policy Sentry as a library, as do several others that I'm aware of - most notably in Cloudsplaining. Cloudsplaining pulls live AWS IAM Policies for analysis. Sometimes these IAM Policies reference AWS Services that have not yet been included in the IAM Definition that we store at policy_sentry/shared/data/iam-definition.json. Our IAM definition gets updated once a month. But for Cloudsplaining, we need to make sure that if a service does not exist, that Policy Sentry just logs the issue and does not break the scan by throwing an exception. I've encountered this issue a few times - where Policy Sentry gets a new version at the beginning of the month, and AWS releases 4 new service prefixes within that same month, before we have time to release a new version of Policy Sentry. That would break the scan. So, given the above - get_actions_for_serviceI think this is the one that actually needs fixing. The function below looks like it will still try to add an object of type policy_sentry/policy_sentry/querying/actions.py Lines 26 to 30 in a8502ce
I think this means you would have to change your PR to be focused on |
Thanks for the background @kmcquade actually, do you want me to add a check for also, given that |
Yeah that works! Thank you! |
@kmcquade addressed the review comments |
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.
Good stuff. Thanks!
* fix NoneType error in get_actions_for_service
What does this PR do?
Address NoneType error raised as part of issue #239
What gif best describes this PR or how it makes you feel?
Completion checklist