contentctl 5.0.3__py3-none-any.whl → 5.0.5__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.
- contentctl/objects/constants.py +1 -0
- contentctl/objects/dashboard.py +19 -12
- contentctl/templates/app_template/default/data/ui/nav/default.xml +3 -3
- {contentctl-5.0.3.dist-info → contentctl-5.0.5.dist-info}/METADATA +1 -1
- {contentctl-5.0.3.dist-info → contentctl-5.0.5.dist-info}/RECORD +8 -8
- {contentctl-5.0.3.dist-info → contentctl-5.0.5.dist-info}/WHEEL +1 -1
- {contentctl-5.0.3.dist-info → contentctl-5.0.5.dist-info}/LICENSE.md +0 -0
- {contentctl-5.0.3.dist-info → contentctl-5.0.5.dist-info}/entry_points.txt +0 -0
contentctl/objects/constants.py
CHANGED
|
@@ -123,6 +123,7 @@ ES_MAX_STANZA_LENGTH = 99
|
|
|
123
123
|
CONTENTCTL_DETECTION_STANZA_NAME_FORMAT_TEMPLATE = (
|
|
124
124
|
"{app_label} - {detection_name} - Rule"
|
|
125
125
|
)
|
|
126
|
+
|
|
126
127
|
CONTENTCTL_BASELINE_STANZA_NAME_FORMAT_TEMPLATE = "{app_label} - {detection_name}"
|
|
127
128
|
CONTENTCTL_RESPONSE_TASK_NAME_FORMAT_TEMPLATE = (
|
|
128
129
|
"{app_label} - {detection_name} - Response Task"
|
contentctl/objects/dashboard.py
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import pathlib
|
|
3
|
+
from enum import StrEnum
|
|
1
4
|
from typing import Any
|
|
2
|
-
from pydantic import Field, Json, model_validator
|
|
3
5
|
|
|
4
|
-
import pathlib
|
|
5
6
|
from jinja2 import Environment
|
|
6
|
-
import
|
|
7
|
-
|
|
7
|
+
from pydantic import Field, Json, model_validator
|
|
8
|
+
|
|
8
9
|
from contentctl.objects.config import build
|
|
9
|
-
from
|
|
10
|
+
from contentctl.objects.security_content_object import SecurityContentObject
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
<label>{{ dashboard.
|
|
12
|
+
DEFAULT_DASHBOARD_JINJA2_TEMPLATE = """<dashboard version="2" theme="{{ dashboard.theme }}">
|
|
13
|
+
<label>{{ dashboard.name }}</label>
|
|
13
14
|
<description></description>
|
|
14
15
|
<definition><![CDATA[
|
|
15
16
|
{{ dashboard.pretty_print_json_obj() }}
|
|
@@ -31,7 +32,7 @@ class DashboardTheme(StrEnum):
|
|
|
31
32
|
|
|
32
33
|
class Dashboard(SecurityContentObject):
|
|
33
34
|
j2_template: str = Field(
|
|
34
|
-
default=
|
|
35
|
+
default=DEFAULT_DASHBOARD_JINJA2_TEMPLATE,
|
|
35
36
|
description="Jinja2 Template used to construct the dashboard",
|
|
36
37
|
)
|
|
37
38
|
description: str = Field(
|
|
@@ -48,9 +49,6 @@ class Dashboard(SecurityContentObject):
|
|
|
48
49
|
..., description="Valid JSON object that describes the dashboard"
|
|
49
50
|
)
|
|
50
51
|
|
|
51
|
-
def label(self, config: build) -> str:
|
|
52
|
-
return f"{config.app.label} - {self.name}"
|
|
53
|
-
|
|
54
52
|
@model_validator(mode="before")
|
|
55
53
|
@classmethod
|
|
56
54
|
def validate_fields_from_json(cls, data: Any) -> Any:
|
|
@@ -98,7 +96,16 @@ class Dashboard(SecurityContentObject):
|
|
|
98
96
|
return json.dumps(self.json_obj, indent=4)
|
|
99
97
|
|
|
100
98
|
def getOutputFilepathRelativeToAppRoot(self, config: build) -> pathlib.Path:
|
|
101
|
-
|
|
99
|
+
if self.file_path is None:
|
|
100
|
+
raise FileNotFoundError(
|
|
101
|
+
f"Dashboard {self.name} file_path was None. Dashboards must be backed by a file."
|
|
102
|
+
)
|
|
103
|
+
# Prefix with the appLabel__ in order to make a search for these easy with match="__"
|
|
104
|
+
# in the default.xml file
|
|
105
|
+
filename = f"{config.app.label}__{self.file_path.stem}.xml".lower().replace(
|
|
106
|
+
" ", "_"
|
|
107
|
+
)
|
|
108
|
+
|
|
102
109
|
return pathlib.Path("default/data/ui/views") / filename
|
|
103
110
|
|
|
104
111
|
def writeDashboardFile(self, j2_env: Environment, config: build):
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<nav search_view="search" color="#65A637">
|
|
2
2
|
<view name="escu_summary" default="true"/>
|
|
3
|
-
<view name="feedback"/>
|
|
4
3
|
<view name="search"/>
|
|
5
|
-
<
|
|
6
|
-
|
|
4
|
+
<collection label="Dashboards">
|
|
5
|
+
<view source="unclassified" match="__"/>
|
|
6
|
+
</collection>
|
|
7
7
|
</nav>
|
|
@@ -42,9 +42,9 @@ contentctl/objects/base_test_result.py,sha256=TYYzTPKWqp9rHTebWoid50uxAp_iALZour
|
|
|
42
42
|
contentctl/objects/baseline.py,sha256=grzM56KCpROjMnJQIan-fG0LCYfRGA2GHui4FwBwb8A,3172
|
|
43
43
|
contentctl/objects/baseline_tags.py,sha256=Eomy8y3HV-E6Lym5B5ZZTtsmQJYi6Jd4y8GZpTWGYgQ,1643
|
|
44
44
|
contentctl/objects/config.py,sha256=3l8tFVwrBDpAnS7aBgj6to0Kc8_s4bxuZY5Bm5vel8k,48605
|
|
45
|
-
contentctl/objects/constants.py,sha256=
|
|
45
|
+
contentctl/objects/constants.py,sha256=VwwQtJBGC_zb3ukjb3A7P0CwAlyhacWiXczwAW5Jiog,5466
|
|
46
46
|
contentctl/objects/correlation_search.py,sha256=ab6v-0nbzujhTMpwaXynQiInWpRO1zB5KR4eZLCav_M,45234
|
|
47
|
-
contentctl/objects/dashboard.py,sha256=
|
|
47
|
+
contentctl/objects/dashboard.py,sha256=9DiHP_Nx2XBQv4-zUaz6v9XH5yeTJhxaGDlaQqCsbIU,4468
|
|
48
48
|
contentctl/objects/data_source.py,sha256=qt4W14DEwKGO69oLGdJeuYqbWvGkZ6j5Nz0R1RhDQEQ,1491
|
|
49
49
|
contentctl/objects/deployment.py,sha256=FRsgsX2T1gvA_0A44_sFPr22rsedxXVIhtO7o9F7eZM,2902
|
|
50
50
|
contentctl/objects/deployment_email.py,sha256=_Sdr_BNjvXECiFonRHLkiOrIQp3slnUaERbptqRbD0Q,206
|
|
@@ -135,7 +135,7 @@ contentctl/templates/app_template/README/essoc_usage_dashboard.txt,sha256=xYUKKV
|
|
|
135
135
|
contentctl/templates/app_template/README.md,sha256=RT-J9bgRSFsEFgNr9qV6yc2LkfUH_uiMJ2RV4NM9Ymo,366
|
|
136
136
|
contentctl/templates/app_template/default/analytic_stories.conf,sha256=zWuCOOl8SiP7Kit2s-de4KRu3HySLtBSXcp1QnJx0ec,168
|
|
137
137
|
contentctl/templates/app_template/default/commands.conf,sha256=U2ccwUeGXKKKt5jo14QY5swi-p9_TSJtaNquOkeF3Yk,319
|
|
138
|
-
contentctl/templates/app_template/default/data/ui/nav/default.xml,sha256=
|
|
138
|
+
contentctl/templates/app_template/default/data/ui/nav/default.xml,sha256=Tfvl7YUGYBbVI4o5BZ5pfsR3urzxF2r1E-8bonIQ560,213
|
|
139
139
|
contentctl/templates/app_template/default/data/ui/views/escu_summary.xml,sha256=jQhkIthPgEEptCJ2wUCj2lWGHBvUl6JGsKkDfONloxI,8635
|
|
140
140
|
contentctl/templates/app_template/default/data/ui/views/feedback.xml,sha256=uM71EMK2uFz8h68nOTNKGnYxob3HhE_caSL6yA-3H-k,696
|
|
141
141
|
contentctl/templates/app_template/default/use_case_library.conf,sha256=zWuCOOl8SiP7Kit2s-de4KRu3HySLtBSXcp1QnJx0ec,168
|
|
@@ -161,8 +161,8 @@ contentctl/templates/detections/web/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
|
|
|
161
161
|
contentctl/templates/macros/security_content_ctime.yml,sha256=Gg1YNllHVsX_YB716H1SJLWzxXZEfuJlnsgB2fuyoHU,159
|
|
162
162
|
contentctl/templates/macros/security_content_summariesonly.yml,sha256=9BYUxAl2E4Nwh8K19F3AJS8Ka7ceO6ZDBjFiO3l3LY0,162
|
|
163
163
|
contentctl/templates/stories/cobalt_strike.yml,sha256=uj8idtDNOAIqpZ9p8usQg6mop1CQkJ5TlB4Q7CJdTIE,3082
|
|
164
|
-
contentctl-5.0.
|
|
165
|
-
contentctl-5.0.
|
|
166
|
-
contentctl-5.0.
|
|
167
|
-
contentctl-5.0.
|
|
168
|
-
contentctl-5.0.
|
|
164
|
+
contentctl-5.0.5.dist-info/LICENSE.md,sha256=hQWUayRk-pAiOZbZnuy8djmoZkjKBx8MrCFpW-JiOgo,11344
|
|
165
|
+
contentctl-5.0.5.dist-info/METADATA,sha256=lOd3L_c_TdnKj_63UvFyAFgNgf8cZ52BxiJ2Z1GB7PI,21539
|
|
166
|
+
contentctl-5.0.5.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
167
|
+
contentctl-5.0.5.dist-info/entry_points.txt,sha256=5bjZ2NkbQfSwK47uOnA77yCtjgXhvgxnmCQiynRF_-U,57
|
|
168
|
+
contentctl-5.0.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|