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

re-enable resource lookup policies #37

Merged
merged 5 commits into from
Mar 26, 2020

Conversation

nhakmiller
Copy link
Contributor

Background

For a period of time we had resource lookup based policies disabled because the Panther backend and packing tools did not fully support them. Now that they are fully supported again, they have been re-enabled.

Changes

  • re-enabled resource lookup policies

Testing

  • make ci

Copy link
Contributor

@jacknagz jacknagz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! Can we add context about unit tests?

# Verify that the bucket exists in the same account
resource['Bucket']['Location'] is None)
bucket_arn = 'arn:aws:s3:::' + resource['S3BucketName']
bucket = resource_lookup(bucket_arn)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does resource_lookup behave if there's nothing found?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It raises an exception. I thought about catching the exception, but then users wouldn't know if there bucket was messed up. For example, we have a cloudtrail raising an exception here because it's logging to a bucket that no longer exists! Not sure if that info should just be tossed away. Although I suppose that could be a different policy...

@nhakmiller
Copy link
Contributor Author

Thanks for doing this! Can we add context about unit tests?

I updated the README and the policy specification files with warnings. Unfortunately, we currently do not support mocking function calls so unit testing is not possible with functions that need that type of thing.

@nhakmiller nhakmiller merged commit 62fd5b7 into master Mar 26, 2020
@nhakmiller nhakmiller deleted the nhakmiller-enable-resource-lookup branch March 26, 2020 00:50
lindsey-w pushed a commit that referenced this pull request Sep 24, 2020
* Added imports for And, Regex from schemas -- Added Regex match for
DisplayName, GlobalID, PolicyID, and RuleID

* Added '(' and ')' to the allowable characters

* Hotfix: Rule Schema DisplayName improper definition

* Update panther_analysis_tool/schemas.py

Removed character escaping for readability

Co-authored-by: Austin Byers <austin.byers@runpanther.io>

* Added unit tests

* Removed unnecessary &

Co-authored-by: Austin Byers <austin.byers@runpanther.io>
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

Successfully merging this pull request may close these issues.

2 participants