Skip to content

Commit 15abbf7

Browse files
committed
Merge branch 'main' into pydantic2.
resolve minor merge conflicts
2 parents a063d81 + b14038b commit 15abbf7

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

contentctl/objects/abstract_security_content_objects/detection_abstract.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class Detection_Abstract(SecurityContentObject):
5151
# https://docs.pydantic.dev/latest/concepts/unions/#left-to-right-mode
5252
# https://github.com/pydantic/pydantic/issues/9101#issuecomment-2019032541
5353
tests: List[Annotated[Union[UnitTest, IntegrationTest], Field(union_mode='left_to_right')]] = []
54-
5554
# A list of groups of tests, relying on the same data
5655
test_groups: Union[list[TestGroup], None] = Field(None,validate_default=True)
5756

@@ -678,4 +677,13 @@ def get_summary(
678677
summary_dict["tests"].append(result)
679678

680679
# Return the summary
681-
return summary_dict
680+
681+
return summary_dict
682+
683+
684+
def getMetadata(self)->dict[str,str]:
685+
return {'detection_id':str(self.id),
686+
'deprecated':'1' if self.status==DetectionStatus.deprecated.value else '0',
687+
'detection_version':str(self.version)}
688+
689+

contentctl/output/templates/savedsearches_detections.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ action.correlationsearch.label = {{APP_NAME}} - RIR - {{ detection.name }} - Rul
6767
action.correlationsearch.label = {{APP_NAME}} - {{ detection.name }} - Rule
6868
{% endif %}
6969
action.correlationsearch.annotations = {{ detection.annotations | tojson }}
70-
action.correlationsearch.metadata = {{ detection.metadata | tojson }}
70+
action.correlationsearch.metadata = {{ detection.getMetadata() | tojson }}
7171
{% if detection.deployment.scheduling.schedule_window is defined %}
7272
schedule_window = {{ detection.deployment.scheduling.schedule_window }}
7373
{% endif %}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "contentctl"
3-
version = "3.5.0"
3+
version = "3.6.0"
44
description = "Splunk Content Control Tool"
55
authors = ["STRT <[email protected]>"]
66
license = "Apache 2.0"

0 commit comments

Comments
 (0)