Skip to content

Commit 3e4532a

Browse files
authored
Merge pull request #243 from splunk/role_enum
New observable role enum
2 parents 6826bcc + 3ab7cc2 commit 3e4532a

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

contentctl/objects/constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,8 @@
132132
"Exfiltration": "TA0010",
133133
"Impact": "TA0040"
134134
}
135+
136+
RBA_OBSERVABLE_ROLE_MAPPING = {
137+
"Attacker": 0,
138+
"Victim": 1
139+
}

contentctl/objects/observable.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pydantic import BaseModel, field_validator
2-
from contentctl.objects.constants import SES_OBSERVABLE_TYPE_MAPPING, SES_OBSERVABLE_ROLE_MAPPING
2+
from contentctl.objects.constants import SES_OBSERVABLE_TYPE_MAPPING, RBA_OBSERVABLE_ROLE_MAPPING
33

44

55
class Observable(BaseModel):
@@ -26,10 +26,12 @@ def check_type(cls, v: str):
2626
def check_roles(cls, v: list[str]):
2727
if len(v) == 0:
2828
raise ValueError("Error, at least 1 role must be listed for Observable.")
29+
if len(v) > 1:
30+
raise ValueError("Error, each Observable can only have one role.")
2931
for role in v:
30-
if role not in SES_OBSERVABLE_ROLE_MAPPING.keys():
32+
if role not in RBA_OBSERVABLE_ROLE_MAPPING.keys():
3133
raise ValueError(
3234
f"Invalid role '{role}' provided for observable. Valid observable types are "
33-
f"{SES_OBSERVABLE_ROLE_MAPPING.keys()}"
35+
f"{RBA_OBSERVABLE_ROLE_MAPPING.keys()}"
3436
)
3537
return v

contentctl/templates/detections/endpoint/anomalous_usage_of_7zip.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ tags:
5353
- name: parent_process_name
5454
type: Process
5555
role:
56-
- Parent Process
56+
- Attacker
5757
- name: process_name
5858
type: Process
5959
role:
60-
- Child Process
60+
- Attacker
6161
product:
6262
- Splunk Enterprise
6363
- Splunk Enterprise Security

0 commit comments

Comments
 (0)