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

Improve GitHub Webhook Modified rule #1324

Conversation

geoffg-sentry
Copy link
Contributor

Background

The original Github.Repo.HookModified rule is inappropriately named and had some errors in its tests. The hook.* audit log events capture any webhook event that occurs in a repository, organization, GitHub Marketplace account, GitHub Sponsors account, or GitHub App. The rule initially was designed to capture any webhook modification but labelled and titled as repo-specific.

This corrects the minor error with an appropriately named rule, fixes the tests, and improves the alert title. The core logic remains the same.

Changes

  • Disable GitHub.Repo.HookModified, remove from packs
  • Replicate original rule and create GitHub.Webhook.Modified, add to packs
  • Enhances alert context and improves title
  • Fix previous tests using incorrect field names, adds fuller test for an app webhook created

Testing

pat test, make lint

### Background

The original `Github.Repo.HookModified` rule is inappropriately named and had some errors in its tests. The `hook.*` audit log events capture any webhook event that occurs [in a repository, organization, GitHub Marketplace account, GitHub Sponsors account, or GitHub App](https://docs.github.com/en/webhooks/using-webhooks/creating-webhooks#:~:text=in%20a%20repository%2C%20organization%2C%20GitHub%20Marketplace%20account%2C%20GitHub%20Sponsors%20account%2C%20or%20GitHub%20App). The rule initially was designed to capture any webhook modification but labelled and titled as repo-specific.

This corrects the minor error with a appropriately named rule, fixes the tests, and improves the alert title. The core logic remains the same.

### Changes

- Disable GitHub.Repo.HookModified, remove from packs
- Replicate original rule and create GitHub.Webhook.Modified, add to packs
- Enhances alert context and improves title
- Fix previous tests using incorrect field names, add test for GitHub App webhook

### Testing

pat test, make lint
@geoffg-sentry geoffg-sentry requested a review from a team as a code owner August 9, 2024 17:20
Copy link
Contributor

@arielkr256 arielkr256 left a comment

Choose a reason for hiding this comment

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

@geoffg-sentry this looks good to me, thank you for your contribution!

@arielkr256 arielkr256 merged commit 14932ca into panther-labs:release Aug 22, 2024
5 of 6 checks passed
@arielkr256 arielkr256 added the tuning detection tuning label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tuning detection tuning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants