Skip to content

Commit 3d19600

Browse files
authored
Merge pull request #479 from splunk/mitre_19_fixes
Mitre v19 fixes Confirmed with a team mate they agree this is good to go! Bypassing rules and merging myself.
2 parents 09442c2 + 71424b4 commit 3d19600

7 files changed

Lines changed: 33 additions & 25 deletions

File tree

.github/workflows/test_against_escu.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
python_version: ["3.11", "3.12", "3.13"]
20-
20+
2121
operating_system: ["ubuntu-24.04", "macos-15"]
2222
# Do not test against ESCU until known character encoding issue is resolved
2323
# operating_system: ["ubuntu-20.04", "ubuntu-22.04", "macos-latest", "macos-14", "windows-2022"]
@@ -32,7 +32,7 @@ jobs:
3232
# Checkout the develop (default) branch of security_content
3333
- name: Checkout repo
3434
uses: actions/checkout@v5
35-
with:
35+
with:
3636
path: security_content
3737
repository: splunk/security_content
3838

@@ -42,30 +42,26 @@ jobs:
4242
with:
4343
python-version: ${{ matrix.python_version }}
4444
architecture: "x64"
45-
45+
4646
- name: Install Poetry
47-
run:
48-
python -m pip install poetry
47+
run: python -m pip install poetry
4948

5049
- name: Install contentctl and activate the shell
5150
run: |
5251
poetry install --no-interaction
5352
54-
55-
- name: Clone the AtomicRedTeam Repo and the Mitre/CTI repos for testing enrichments
53+
- name: Clone the AtomicRedTeam Repo and the Mitre/CTI repos for testing
54+
enrichments
5655
run: |
5756
cd security_content
5857
git clone --single-branch https://github.com/redcanaryco/atomic-red-team external_repos/atomic-red-team
59-
git clone --single-branch https://github.com/mitre/cti external_repos/cti
58+
git clone --depth=1 --single-branch --branch="master" https://github.com/mitre-attack/attack-stix-data external_repos/cti
6059
61-
62-
# We do not separately run validate and build
60+
# We do not separately run validate and build
6361
# since a build ALSO performs a validate
6462
- name: Run contentctl build
6563
run: |
6664
cd security_content
6765
poetry run contentctl build --enrichments
68-
6966
# Do not run a test - it will take far too long!
7067
# Do not upload any artifacts
71-

contentctl/enrichments/attack_enrichment.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from contentctl.objects.annotated_types import MITRE_ATTACK_ID_TYPE
1212
from contentctl.objects.config import validate
13+
from contentctl.objects.constants import MITRE_ATTACK_VERSION
1314
from contentctl.objects.mitre_attack_enrichment import (
1415
MitreAttackEnrichment,
1516
MitreTactics,
@@ -121,8 +122,13 @@ def get_attack_lookup(
121122
flush=True,
122123
)
123124
enterprise_path = input_path / "enterprise-attack"
124-
mobile_path = input_path / "ics-attack"
125-
ics_path = input_path / "mobile-attack"
125+
enterprise_file = (
126+
enterprise_path / f"enterprise-attack-{MITRE_ATTACK_VERSION}.json"
127+
)
128+
mobile_path = input_path / "mobile-attack"
129+
mobile_file = mobile_path / f"mobile-attack-{MITRE_ATTACK_VERSION}.json"
130+
ics_path = input_path / "ics-attack"
131+
ics_file = ics_path / f"ics-attack-{MITRE_ATTACK_VERSION}.json"
126132
if not (
127133
enterprise_path.is_dir() and mobile_path.is_dir() and ics_path.is_dir()
128134
):
@@ -132,11 +138,12 @@ def get_attack_lookup(
132138
f"Please ensure that the {input_path} directory "
133139
"has been git cloned correctly."
134140
)
141+
135142
lift = attack_client(
136143
local_paths={
137-
"enterprise": str(enterprise_path),
138-
"mobile": str(mobile_path),
139-
"ics": str(ics_path),
144+
"enterprise": str(enterprise_file),
145+
"mobile": str(mobile_file),
146+
"ics": str(ics_file),
140147
}
141148
)
142149

contentctl/objects/config.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -491,12 +491,12 @@ def ensureEnrichmentReposPresent(self) -> Self:
491491
missing_repos: list[str] = []
492492
if not self.atomic_red_team_repo_path.is_dir():
493493
missing_repos.append(
494-
f"https://github.com/redcanaryco/atomic-red-team {self.atomic_red_team_repo_path}"
494+
f"--single-branch https://github.com/redcanaryco/atomic-red-team {self.atomic_red_team_repo_path}"
495495
)
496496

497497
if not self.mitre_cti_repo_path.is_dir():
498498
missing_repos.append(
499-
f"https://github.com/mitre/cti {self.mitre_cti_repo_path}"
499+
f"""--depth=1 --single-branch --branch="master" https://github.com/mitre-attack/attack-stix-data {self.mitre_cti_repo_path}"""
500500
)
501501

502502
if len(missing_repos) > 0:
@@ -506,10 +506,7 @@ def ensureEnrichmentReposPresent(self) -> Self:
506506
"Please check them out using the following commands:"
507507
]
508508
msg_list.extend(
509-
[
510-
f"git clone --single-branch {repo_string}"
511-
for repo_string in missing_repos
512-
]
509+
[f"git clone {repo_string}" for repo_string in missing_repos]
513510
)
514511
msg = "\n\t".join(msg_list)
515512
raise FileNotFoundError(msg)

contentctl/objects/constants.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"Command And Control": "Command and Control",
1717
"Exfiltration": "Actions on Objectives",
1818
"Impact": "Actions on Objectives",
19+
"Stealth": "Exploitation",
20+
"Defense Impairment": "Exploitation",
1921
}
2022

2123
SES_CONTEXT_MAPPING = {
@@ -148,3 +150,5 @@
148150

149151
DEPRECATED_TEMPLATE = "**WARNING**, this {content_type} has been marked **DEPRECATED** by the Splunk Threat Research Team. This means that it will no longer be maintained or supported. If you have any questions feel free to email us at: research@splunk.com. {description}"
150152
EXPERIMENTAL_TEMPLATE = "**WARNING**, this {content_type} is marked **EXPERIMENTAL** by the Splunk Threat Research Team. This means that the {content_type} has been manually tested but we do not have the associated attack data to perform automated testing or cannot share this attack dataset due to its sensitive nature. If you have any questions feel free to email us at: research@splunk.com. {description}"
153+
154+
MITRE_ATTACK_VERSION = "19.0"

contentctl/objects/mitre_attack_enrichment.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class MitreTactics(StrEnum):
2424
COMMAND_AND_CONTROL = "Command And Control"
2525
EXFILTRATION = "Exfiltration"
2626
IMPACT = "Impact"
27+
STEALTH = "Stealth"
28+
DEFENSE_IMPAIRMENT = "Defense Impairment"
2729

2830

2931
class AttackGroupMatrix(StrEnum):

contentctl/output/attack_nav_output.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from datetime import datetime
55
from typing import Any, TypedDict
66

7+
from contentctl.objects.constants import MITRE_ATTACK_VERSION
8+
79
# Third-party imports
810
from contentctl.objects.detection import Detection
911

@@ -88,7 +90,7 @@ def writeObjects(
8890
layer: LayerData = {
8991
"name": self.layer_name,
9092
"versions": {
91-
"attack": "17", # Update as needed
93+
"attack": MITRE_ATTACK_VERSION,
9294
"navigator": "5.1.0",
9395
"layer": "4.5",
9496
},

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tool.poetry]
22
name = "contentctl"
33

4-
version = "5.5.16"
4+
version = "5.6.0"
55

66
description = "Splunk Content Control Tool"
77
authors = ["STRT <research@splunk.com>"]

0 commit comments

Comments
 (0)