-
Notifications
You must be signed in to change notification settings - Fork 176
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
Add a config system for Panther detections #950
Conversation
33cc510
to
cbab551
Compare
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.
Awesome PR, thanks for opening it. Should add this file .gitattributes with ours
ownership so it always overrides the upstream?
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.
Yeah, I think that probably makes sense. From my user-perspective, we only ever merge upstream into our fork (or rebase). So long as we're never merging in the other direction (fork->upstream), this seems like the right choice.
Will add.
748bc44
to
137c10e
Compare
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.
@jof I like the idea of centralizing config values, but want to make sure the changes don't break things in other environments. The 3 new global helper functions need to be added to the pack files for the log types where rules have been updated so that environments using packs get the new helper functions.
137c10e
to
14a43b4
Compare
@arielkr256 Good call on the Packs -- I updated the affected ones with the new modules |
14a43b4
to
6d17228
Compare
6d17228
to
6800a1e
Compare
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.
We were able to confirm these changes will not overwrite configs for customers using packs, good to go!
This adds a fork-friendly way to define some configuration values for detections inside of this repository to consume.
Additionally, this implements this configuration scheme for all existing uses of
example.com
as a way to demonstrate how to consume the API and use it with some tests and Mocks.In the current state:
This is leading to:
The hope of the configuration system proposed in here is that the public fork (
panther-labs/panther-analysis
) of this repo contains a bunch of reasonable default values inside ofglobal_helpers/panther_config_defaults.py
and a mostly emptyglobal_helpers/panther_config_overrides.py
.Then, at lookup-time, users can import and reference
panther_config.config
; accesses to attributes of this object will first look for values inpanther_config_overrides.py
and fall back to the defaults inpanther_config_defaults.py
.Importantly, for testing, these configuration values should probably get imported into the top-most scope of each rule, such that they can be easily overridden with
Mocks:
content for the test cases.