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

Fix methodName lookups for Cloud Run rules, add tests #1296

Conversation

geoffg-sentry
Copy link
Contributor

Background

This unsafe lookup is triggering AttributeError("'NoneType' object has no attribute 'endswith'") every GCP.AuditLog event that has no event.methodName

Changes

  • Add a default to the deep_get()

Testing

  • Test cases without an event.methodName included for both.

Initial cloud run correlation rules throw NoneType errors on every GCP.AuditLog that has no event.methodName because of a `deep_get()` without a `default`. One was fixed in a recent PR panther-labs#1292, the other wasn't. Here's the same fix for both and tests to prove them.
@geoffg-sentry geoffg-sentry requested a review from a team as a code owner July 22, 2024 16:56
@ben-githubs
Copy link
Contributor

We just merged a PR yesterday for the same issue, but we only fixed GCP.Cloud.Run.Set.IAM.Policy. I've updated this PR to use just fix GCP.Cloud.Run.Service.Created, and to match the previous PR in aesthetics.

Copy link
Contributor

@ben-githubs ben-githubs left a comment

Choose a reason for hiding this comment

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

All good. Thanks for catching this!

@ben-githubs ben-githubs merged commit c8031bd into panther-labs:release Jul 23, 2024
5 of 6 checks passed
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