howler-sentinel-plugin 0.1.0.dev50__py3-none-any.whl → 0.2.0.dev19__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: howler-sentinel-plugin
3
- Version: 0.1.0.dev50
3
+ Version: 0.2.0.dev19
4
4
  Summary: A howler plugin for integration with Microsoft's Sentinel API
5
5
  License: MIT
6
6
  Author: CCCS
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.12
14
14
  Classifier: Programming Language :: Python :: 3.13
15
15
  Description-Content-Type: text/markdown
16
16
 
17
- # Howler Internal Plugins
17
+ # Howler Sentinel Plugin
18
18
 
19
- This plugin contains modules for internal authentication and OBO in the aurora platform.
19
+ This plugin contains modules for Microsoft Sentinel integration in Howler.
20
20
 
@@ -0,0 +1,10 @@
1
+ sentinel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ sentinel/odm/hit.py,sha256=hAuO2ONMK3Ml8Xu6E7tHrmZ7M6HG5tT38RD9ZxwY254,666
3
+ sentinel/odm/models/sentinel.py,sha256=XT3XdT92uoCV5vmY9dT1jmcxRyuu9vp1gE8AwZdKBIc,337
4
+ sentinel/routes/__init__.py,sha256=JYmKRwIfEsiPos1XuMQ2mlGDbxk6TN_cVEM0K_RNze4,130
5
+ sentinel/routes/ingest.py,sha256=P6jgTJmuCLrF3_mrZwzm7Fn2k4TNJCmYOte3hIKT0js,1069
6
+ howler_sentinel_plugin-0.2.0.dev19.dist-info/LICENSE,sha256=Wg2luVnxEkP2NSn11nh1US6W_nFFbICBAVTG9iG3t5M,1091
7
+ howler_sentinel_plugin-0.2.0.dev19.dist-info/METADATA,sha256=iykCHnHcYF8MZ9qjsTXF9fsF5SwMHhA3ty2WGg2OYXg,694
8
+ howler_sentinel_plugin-0.2.0.dev19.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
9
+ howler_sentinel_plugin-0.2.0.dev19.dist-info/entry_points.txt,sha256=4IJyMY0V49s3Wp659ngN_7U8g66-czeKxI-_dNAFP5g,60
10
+ howler_sentinel_plugin-0.2.0.dev19.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ from flask.blueprints import Blueprint
2
+
3
+ from sentinel.routes.ingest import sentinel_api
4
+
5
+ ROUTES: list[Blueprint] = [sentinel_api]
@@ -0,0 +1,41 @@
1
+ import os
2
+ import re
3
+
4
+ from flask import request
5
+ from howler.api import make_subapi_blueprint, ok, unauthorized
6
+ from howler.common.logging import get_logger
7
+ from howler.common.swagger import generate_swagger_docs
8
+
9
+ SUB_API = "sentinel"
10
+ sentinel_api = make_subapi_blueprint(SUB_API, api_version=1)
11
+ sentinel_api._doc = "Interact with spellbook"
12
+
13
+ logger = get_logger(__file__)
14
+
15
+ SECRET = os.environ["SENTINEL_LINK_KEY"]
16
+
17
+
18
+ @generate_swagger_docs()
19
+ @sentinel_api.route("/ingest", methods=["POST"])
20
+ def ingest_alert(**kwargs):
21
+ """Ingest a sentinel alert into howler
22
+
23
+ Variables:
24
+ None
25
+
26
+ Optional Arguments:
27
+ None
28
+
29
+ Result Example:
30
+ """
31
+ if apikey := request.headers.get("Authorization", "Basic ", type=str).split(" ")[1]:
32
+ logger.info("Recieved authorization header with value %s", re.sub(r"^(.{3}).+(.{3})$", r"\1...\2", apikey))
33
+
34
+ if apikey != SECRET:
35
+ return unauthorized(err="API Key does not match expected value.")
36
+
37
+ sentinel_alert = request.json
38
+
39
+ logger.info("Sentinel Alert:\n%s", sentinel_alert)
40
+
41
+ return ok()
@@ -1,8 +0,0 @@
1
- sentinel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- sentinel/odm/hit.py,sha256=hAuO2ONMK3Ml8Xu6E7tHrmZ7M6HG5tT38RD9ZxwY254,666
3
- sentinel/odm/models/sentinel.py,sha256=XT3XdT92uoCV5vmY9dT1jmcxRyuu9vp1gE8AwZdKBIc,337
4
- howler_sentinel_plugin-0.1.0.dev50.dist-info/LICENSE,sha256=Wg2luVnxEkP2NSn11nh1US6W_nFFbICBAVTG9iG3t5M,1091
5
- howler_sentinel_plugin-0.1.0.dev50.dist-info/METADATA,sha256=3OehY5iBgB0iLcN6wM4iED83r94nvWDkw3obIAE_PL0,709
6
- howler_sentinel_plugin-0.1.0.dev50.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
7
- howler_sentinel_plugin-0.1.0.dev50.dist-info/entry_points.txt,sha256=4IJyMY0V49s3Wp659ngN_7U8g66-czeKxI-_dNAFP5g,60
8
- howler_sentinel_plugin-0.1.0.dev50.dist-info/RECORD,,