-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First prototype of the Elastic output platform * quickfix to add interval * refactor: use parameter for license value in ElasticPlatform class * adding raw export for ESQL * adding custom raw language selector * refactor: update is_raw_rule function to handle ESQL platform correctly * added index parsing with fallback there needs to be more intelligence here, ideas welcome * refactor: update ElasticPlatform class to handle ESQL platform correctly * added custom disabled handling * improved import mechanism to use json instead of ndjson import, this improves performance and allows for enabling and disabling rules * adding eql converting capabilities * improving EQL support * adding requests as requirement since it's used in elastic.py * improving error handling * added prefix * added error handling for correlation rule failure * add remove search * Update src/droid/__main__.py Co-authored-by: Mathieu <[email protected]> * removed quickfix * refactored the buildingblock process * fixed if no tags are set in sigma rule * quality fixes * bugfix to make index information more stable * adding eql support * changed encoding to utf8, we are in the EU after all * added index field into elastic output * adding search * added elasticsearch dependency * added ESQL implementation for search * add: abstraction and index catching * added language transitioning for rules * fix: stop unsupported rule to go further * refined index selection * adding warning if defaulting to logs-* * not self. * logic fix, always default to index_value logs-* * adding more stability to index search * adding EQL and ESQL Search * removing index from search * added debugging * add: improvements and search range config for eql and esql * added integrity checking * added checking if update is necessary * chore: Update default value for 'eql_search_range_gte' to 24 hours * deduplication function added for ESQL * fix for older elastic versions * bracketstory v2 and bugfix of policy integrity check * added bugfix for index unknown in raw rules * add: new get_rule abstraction and fix some issues in elastic and defender * add: building block prefix option * changed default behaviour for buildingblock * reworked index matching since it was not perfect. Now it only counts actual sigma related fields * upd: logger in Elastic * fix: bug in finding the index from pipeline * upd: required modules * add: test for pull request as well * upd: job name in CI --------- Co-authored-by: Mathieu <[email protected]>
- Loading branch information
1 parent
f1bb0dd
commit 16214db
Showing
12 changed files
with
874 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from abc import ABC, abstractmethod | ||
|
||
|
||
class AbstractPlatform(ABC): | ||
""" | ||
AbstractRule is an abstract base class that defines the structure for a platform. | ||
It has three abstract methods: create_rule, remove_rule | ||
""" | ||
|
||
def __init__(self, name: str): | ||
""" | ||
Initialize the platform. | ||
""" | ||
self.platform_name = name | ||
|
||
@abstractmethod | ||
def create_rule(self): | ||
""" | ||
Create a detection rule. This method should be implemented by subclasses. | ||
""" | ||
raise NotImplemented() | ||
|
||
@abstractmethod | ||
def get_rule(self): | ||
""" | ||
Get the parameter from a rule. This method should be implemented by subclasses. | ||
""" | ||
raise NotImplemented() | ||
|
||
@abstractmethod | ||
def remove_rule(self): | ||
""" | ||
Remove a rule. This method should be implemented by subclasses. | ||
""" | ||
raise NotImplemented() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.