1
1
from __future__ import annotations
2
2
from typing import List
3
- import enum
3
+ from enum import StrEnum , IntEnum
4
4
5
5
6
- class AnalyticsType (str , enum . Enum ):
6
+ class AnalyticsType (StrEnum ):
7
7
TTP = "TTP"
8
8
Anomaly = "Anomaly"
9
9
Hunting = "Hunting"
10
10
Correlation = "Correlation"
11
11
12
- class DeploymentType (str , enum . Enum ):
12
+ class DeploymentType (StrEnum ):
13
13
TTP = "TTP"
14
14
Anomaly = "Anomaly"
15
15
Hunting = "Hunting"
@@ -18,7 +18,7 @@ class DeploymentType(str, enum.Enum):
18
18
Embedded = "Embedded"
19
19
20
20
21
- class DataModel (str , enum . Enum ):
21
+ class DataModel (StrEnum ):
22
22
ENDPOINT = "Endpoint"
23
23
NETWORK_TRAFFIC = "Network_Traffic"
24
24
AUTHENTICATION = "Authentication"
@@ -40,11 +40,11 @@ class DataModel(str,enum.Enum):
40
40
SPLUNK_AUDIT = "Splunk_Audit"
41
41
42
42
43
- class PlaybookType (str , enum . Enum ):
43
+ class PlaybookType (StrEnum ):
44
44
INVESTIGATION = "Investigation"
45
45
RESPONSE = "Response"
46
46
47
- class SecurityContentType (enum . Enum ):
47
+ class SecurityContentType (IntEnum ):
48
48
detections = 1
49
49
baselines = 2
50
50
stories = 3
@@ -68,20 +68,15 @@ class SecurityContentType(enum.Enum):
68
68
# json_objects = "json_objects"
69
69
70
70
71
- class SecurityContentProduct (enum .Enum ):
72
- SPLUNK_APP = 1
73
- API = 3
74
- CUSTOM = 4
75
71
76
-
77
- class SecurityContentProductName (str , enum .Enum ):
72
+ class SecurityContentProductName (StrEnum ):
78
73
SPLUNK_ENTERPRISE = "Splunk Enterprise"
79
74
SPLUNK_ENTERPRISE_SECURITY = "Splunk Enterprise Security"
80
75
SPLUNK_CLOUD = "Splunk Cloud"
81
76
SPLUNK_SECURITY_ANALYTICS_FOR_AWS = "Splunk Security Analytics for AWS"
82
77
SPLUNK_BEHAVIORAL_ANALYTICS = "Splunk Behavioral Analytics"
83
78
84
- class SecurityContentInvestigationProductName (str , enum . Enum ):
79
+ class SecurityContentInvestigationProductName (StrEnum ):
85
80
SPLUNK_ENTERPRISE = "Splunk Enterprise"
86
81
SPLUNK_ENTERPRISE_SECURITY = "Splunk Enterprise Security"
87
82
SPLUNK_CLOUD = "Splunk Cloud"
@@ -90,33 +85,20 @@ class SecurityContentInvestigationProductName(str, enum.Enum):
90
85
SPLUNK_PHANTOM = "Splunk Phantom"
91
86
92
87
93
- class DetectionStatus (enum .Enum ):
94
- production = "production"
95
- deprecated = "deprecated"
96
- experimental = "experimental"
97
- validation = "validation"
98
-
99
-
100
- class DetectionStatusSSA (enum .Enum ):
88
+ class DetectionStatus (StrEnum ):
101
89
production = "production"
102
90
deprecated = "deprecated"
103
91
experimental = "experimental"
104
92
validation = "validation"
105
93
106
94
107
- class LogLevel (enum . Enum ):
95
+ class LogLevel (StrEnum ):
108
96
NONE = "NONE"
109
97
ERROR = "ERROR"
110
98
INFO = "INFO"
111
99
112
100
113
- class AlertActions (enum .Enum ):
114
- notable = "notable"
115
- rba = "rba"
116
- email = "email"
117
-
118
-
119
- class StoryCategory (str , enum .Enum ):
101
+ class StoryCategory (StrEnum ):
120
102
ABUSE = "Abuse"
121
103
ADVERSARY_TACTICS = "Adversary Tactics"
122
104
BEST_PRACTICES = "Best Practices"
@@ -139,37 +121,18 @@ class StoryCategory(str, enum.Enum):
139
121
UNAUTHORIZED_SOFTWARE = "Unauthorized Software"
140
122
141
123
142
- class PostTestBehavior (str , enum . Enum ):
124
+ class PostTestBehavior (StrEnum ):
143
125
always_pause = "always_pause"
144
126
pause_on_failure = "pause_on_failure"
145
127
never_pause = "never_pause"
146
128
147
129
148
- class DetectionTestingMode (str , enum . Enum ):
130
+ class DetectionTestingMode (StrEnum ):
149
131
selected = "selected"
150
132
all = "all"
151
133
changes = "changes"
152
134
153
135
154
- class DetectionTestingTargetInfrastructure (str , enum .Enum ):
155
- container = "container"
156
- server = "server"
157
-
158
-
159
- class InstanceState (str , enum .Enum ):
160
- starting = "starting"
161
- running = "running"
162
- error = "error"
163
- stopping = "stopping"
164
- stopped = "stopped"
165
-
166
-
167
- class SigmaConverterTarget (enum .Enum ):
168
- CIM = 1
169
- RAW = 2
170
- OCSF = 3
171
- ALL = 4
172
-
173
136
# It's unclear why we use a mix of constants and enums. The following list was taken from:
174
137
# contentctl/contentctl/helper/constants.py.
175
138
# We convect it to an enum here
@@ -183,7 +146,7 @@ class SigmaConverterTarget(enum.Enum):
183
146
# "Command And Control": 6,
184
147
# "Actions on Objectives": 7
185
148
# }
186
- class KillChainPhase (str , enum . Enum ):
149
+ class KillChainPhase (StrEnum ):
187
150
UNKNOWN = "Unknown"
188
151
RECONNAISSANCE = "Reconnaissance"
189
152
WEAPONIZATION = "Weaponization"
@@ -194,7 +157,7 @@ class KillChainPhase(str, enum.Enum):
194
157
ACTIONS_ON_OBJECTIVES = "Actions on Objectives"
195
158
196
159
197
- class DataSource (str , enum . Enum ):
160
+ class DataSource (StrEnum ):
198
161
OSQUERY_ES_PROCESS_EVENTS = "OSQuery ES Process Events"
199
162
POWERSHELL_4104 = "Powershell 4104"
200
163
SYSMON_EVENT_ID_1 = "Sysmon EventID 1"
@@ -234,7 +197,7 @@ class DataSource(str,enum.Enum):
234
197
WINDOWS_SECURITY_5145 = "Windows Security 5145"
235
198
WINDOWS_SYSTEM_7045 = "Windows System 7045"
236
199
237
- class ProvidingTechnology (str , enum . Enum ):
200
+ class ProvidingTechnology (StrEnum ):
238
201
AMAZON_SECURITY_LAKE = "Amazon Security Lake"
239
202
AMAZON_WEB_SERVICES_CLOUDTRAIL = "Amazon Web Services - Cloudtrail"
240
203
AZURE_AD = "Azure AD"
@@ -302,7 +265,7 @@ def getProvidingTechFromSearch(search_string:str)->List[ProvidingTechnology]:
302
265
return sorted (list (matched_technologies ))
303
266
304
267
305
- class Cis18Value (str , enum . Enum ):
268
+ class Cis18Value (StrEnum ):
306
269
CIS_0 = "CIS 0"
307
270
CIS_1 = "CIS 1"
308
271
CIS_2 = "CIS 2"
@@ -323,15 +286,15 @@ class Cis18Value(str,enum.Enum):
323
286
CIS_17 = "CIS 17"
324
287
CIS_18 = "CIS 18"
325
288
326
- class SecurityDomain (str , enum . Enum ):
289
+ class SecurityDomain (StrEnum ):
327
290
ENDPOINT = "endpoint"
328
291
NETWORK = "network"
329
292
THREAT = "threat"
330
293
IDENTITY = "identity"
331
294
ACCESS = "access"
332
295
AUDIT = "audit"
333
296
334
- class AssetType (str , enum . Enum ):
297
+ class AssetType (StrEnum ):
335
298
AWS_ACCOUNT = "AWS Account"
336
299
AWS_EKS_KUBERNETES_CLUSTER = "AWS EKS Kubernetes cluster"
337
300
AWS_FEDERATED_ACCOUNT = "AWS Federated Account"
@@ -382,7 +345,7 @@ class AssetType(str, enum.Enum):
382
345
WEB_APPLICATION = "Web Application"
383
346
WINDOWS = "Windows"
384
347
385
- class NistCategory (str , enum . Enum ):
348
+ class NistCategory (StrEnum ):
386
349
ID_AM = "ID.AM"
387
350
ID_BE = "ID.BE"
388
351
ID_GV = "ID.GV"
@@ -406,7 +369,7 @@ class NistCategory(str, enum.Enum):
406
369
RC_IM = "RC.IM"
407
370
RC_CO = "RC.CO"
408
371
409
- class RiskSeverity (str , enum . Enum ):
372
+ class RiskSeverity (StrEnum ):
410
373
# Levels taken from the following documentation link
411
374
# https://docs.splunk.com/Documentation/ES/7.3.2/User/RiskScoring
412
375
# 20 - info (0-20 for us)
0 commit comments