howler-sentinel-plugin 0.2.0.dev21__py3-none-any.whl → 0.2.0.dev31__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {howler_sentinel_plugin-0.2.0.dev21.dist-info → howler_sentinel_plugin-0.2.0.dev31.dist-info}/METADATA +1 -1
- {howler_sentinel_plugin-0.2.0.dev21.dist-info → howler_sentinel_plugin-0.2.0.dev31.dist-info}/RECORD +7 -5
- sentinel/actions/ingestion.py +59 -0
- sentinel/actions/synchronization.py +60 -0
- {howler_sentinel_plugin-0.2.0.dev21.dist-info → howler_sentinel_plugin-0.2.0.dev31.dist-info}/LICENSE +0 -0
- {howler_sentinel_plugin-0.2.0.dev21.dist-info → howler_sentinel_plugin-0.2.0.dev31.dist-info}/WHEEL +0 -0
- {howler_sentinel_plugin-0.2.0.dev21.dist-info → howler_sentinel_plugin-0.2.0.dev31.dist-info}/entry_points.txt +0 -0
{howler_sentinel_plugin-0.2.0.dev21.dist-info → howler_sentinel_plugin-0.2.0.dev31.dist-info}/RECORD
RENAMED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
sentinel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
sentinel/actions/ingestion.py,sha256=_t7wrmozhoT_MmktDmNxYiXrA1Q0LCiDt0rTwHBkwbc,1669
|
|
3
|
+
sentinel/actions/synchronization.py,sha256=g5c34410zINWb4fSEzj94drnk5alRj_ju9xMrB39z0s,1818
|
|
2
4
|
sentinel/odm/hit.py,sha256=hAuO2ONMK3Ml8Xu6E7tHrmZ7M6HG5tT38RD9ZxwY254,666
|
|
3
5
|
sentinel/odm/models/sentinel.py,sha256=XT3XdT92uoCV5vmY9dT1jmcxRyuu9vp1gE8AwZdKBIc,337
|
|
4
6
|
sentinel/routes/__init__.py,sha256=JYmKRwIfEsiPos1XuMQ2mlGDbxk6TN_cVEM0K_RNze4,130
|
|
5
7
|
sentinel/routes/ingest.py,sha256=zcKQmLStIh1uU_kWO6KBgqr-ZBkAGcFwvXWBiwjOuC8,1067
|
|
6
|
-
howler_sentinel_plugin-0.2.0.
|
|
7
|
-
howler_sentinel_plugin-0.2.0.
|
|
8
|
-
howler_sentinel_plugin-0.2.0.
|
|
9
|
-
howler_sentinel_plugin-0.2.0.
|
|
10
|
-
howler_sentinel_plugin-0.2.0.
|
|
8
|
+
howler_sentinel_plugin-0.2.0.dev31.dist-info/LICENSE,sha256=Wg2luVnxEkP2NSn11nh1US6W_nFFbICBAVTG9iG3t5M,1091
|
|
9
|
+
howler_sentinel_plugin-0.2.0.dev31.dist-info/METADATA,sha256=ZYY3PQKPTdpwQc5x55fldX7rRx5EfTcSuEChFiDwfdo,694
|
|
10
|
+
howler_sentinel_plugin-0.2.0.dev31.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
11
|
+
howler_sentinel_plugin-0.2.0.dev31.dist-info/entry_points.txt,sha256=4IJyMY0V49s3Wp659ngN_7U8g66-czeKxI-_dNAFP5g,60
|
|
12
|
+
howler_sentinel_plugin-0.2.0.dev31.dist-info/RECORD,,
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from howler.common.loader import datastore
|
|
2
|
+
from howler.datastore.operations import OdmHelper
|
|
3
|
+
from howler.odm.models.hit import Hit
|
|
4
|
+
|
|
5
|
+
hit_helper = OdmHelper(Hit)
|
|
6
|
+
|
|
7
|
+
OPERATION_ID = "sentinel_ingestion"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def execute(query: str, **kwargs):
|
|
11
|
+
"""Handle ingestion of howler alerts into sentinel.
|
|
12
|
+
|
|
13
|
+
Args:
|
|
14
|
+
query (str): The query specifying alerts to ingest into sentinel.
|
|
15
|
+
"""
|
|
16
|
+
report = [
|
|
17
|
+
{
|
|
18
|
+
"query": query,
|
|
19
|
+
"outcome": "skipped",
|
|
20
|
+
"title": "Not Yet Implemented",
|
|
21
|
+
"message": "This functionality hasn't been implemented yet.",
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
ds = datastore()
|
|
26
|
+
|
|
27
|
+
skipped_hits = ds.hit.search(
|
|
28
|
+
f"({query}) AND _exists_:sentinel.id",
|
|
29
|
+
fl="howler.id",
|
|
30
|
+
)["items"]
|
|
31
|
+
|
|
32
|
+
if len(skipped_hits) > 0:
|
|
33
|
+
report.append(
|
|
34
|
+
{
|
|
35
|
+
"query": f"howler.id:({' OR '.join(h.howler.id for h in skipped_hits)})",
|
|
36
|
+
"outcome": "skipped",
|
|
37
|
+
"title": "Skipped Hit with matching sentinel alert",
|
|
38
|
+
"message": "These hits already have a matching incident in sentinel.",
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
print("Ingest alerts into sentinel that match this query:", query) # noqa: T201
|
|
43
|
+
|
|
44
|
+
return report
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def specification():
|
|
48
|
+
"""Specify various properties of the action, such as title, descriptions, permissions and input steps."""
|
|
49
|
+
return {
|
|
50
|
+
"id": OPERATION_ID,
|
|
51
|
+
"title": "Ingest into Sentinel",
|
|
52
|
+
"priority": 15,
|
|
53
|
+
"description": {
|
|
54
|
+
"short": "Ingest alerts into sentinel",
|
|
55
|
+
"long": execute.__doc__,
|
|
56
|
+
},
|
|
57
|
+
"roles": ["automation_basic"],
|
|
58
|
+
"triggers": ["create"],
|
|
59
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
from howler.common.loader import datastore
|
|
2
|
+
from howler.datastore.operations import OdmHelper
|
|
3
|
+
from howler.odm.models.action import VALID_TRIGGERS
|
|
4
|
+
from howler.odm.models.hit import Hit
|
|
5
|
+
|
|
6
|
+
hit_helper = OdmHelper(Hit)
|
|
7
|
+
|
|
8
|
+
OPERATION_ID = "sentinel_synchronization"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def execute(query: str, **kwargs):
|
|
12
|
+
"""Handle synchronization of howler alerts into sentinel.
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
query (str): The query specifying alerts to syncrhonize with sentinel.
|
|
16
|
+
"""
|
|
17
|
+
report = [
|
|
18
|
+
{
|
|
19
|
+
"query": query,
|
|
20
|
+
"outcome": "skipped",
|
|
21
|
+
"title": "Not Yet Implemented",
|
|
22
|
+
"message": "This functionality hasn't been implemented yet.",
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
ds = datastore()
|
|
27
|
+
|
|
28
|
+
skipped_hits = ds.hit.search(
|
|
29
|
+
f"({query}) AND -_exists_:sentinel.id",
|
|
30
|
+
fl="howler.id",
|
|
31
|
+
)["items"]
|
|
32
|
+
|
|
33
|
+
if len(skipped_hits) > 0:
|
|
34
|
+
report.append(
|
|
35
|
+
{
|
|
36
|
+
"query": f"howler.id:({' OR '.join(h.howler.id for h in skipped_hits)})",
|
|
37
|
+
"outcome": "skipped",
|
|
38
|
+
"title": "No matching sentinel alert",
|
|
39
|
+
"message": "These hits do not have a matching incident in sentinel.",
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
print("Update alerts into sentinel that match this query:", f"({query}) AND _exists_:sentinel.id") # noqa: T201
|
|
44
|
+
|
|
45
|
+
return report
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def specification():
|
|
49
|
+
"""Specify various properties of the action, such as title, descriptions, permissions and input steps."""
|
|
50
|
+
return {
|
|
51
|
+
"id": OPERATION_ID,
|
|
52
|
+
"title": "Synchronize with Sentinel",
|
|
53
|
+
"priority": 16,
|
|
54
|
+
"description": {
|
|
55
|
+
"short": "Synchronize alerts with sentinel",
|
|
56
|
+
"long": execute.__doc__,
|
|
57
|
+
},
|
|
58
|
+
"roles": ["automation_basic"],
|
|
59
|
+
"triggers": [trigger for trigger in VALID_TRIGGERS if trigger != "create"],
|
|
60
|
+
}
|
|
File without changes
|
{howler_sentinel_plugin-0.2.0.dev21.dist-info → howler_sentinel_plugin-0.2.0.dev31.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|