Skip to content

Commit 5633363

Browse files
committed
Add more fields to savedsearches.conf
1 parent a6ab65e commit 5633363

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

contentctl/objects/abstract_security_content_objects/detection_abstract.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class Detection_Abstract(SecurityContentObject):
5757
runtime: str = None
5858
enabled_by_default: bool = False
5959

60+
6061
class Config:
6162
use_enum_values = True
6263

@@ -346,3 +347,10 @@ def get_summary(
346347

347348
# Return the summary
348349
return summary_dict
350+
351+
352+
def getMetadata(self)->dict[str,str]:
353+
return {'detection_id':str(self.id),
354+
'deprecated':'1' if self.status==DetectionStatus.deprecated.value else '0',
355+
'detection_version':str(self.version)}
356+

contentctl/output/templates/savedsearches_detections.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ action.correlationsearch.label = {{APP_NAME}} - RIR - {{ detection.name }} - Rul
6464
action.correlationsearch.label = {{APP_NAME}} - {{ detection.name }} - Rule
6565
{% endif %}
6666
action.correlationsearch.annotations = {{ detection.annotations | tojson }}
67+
action.correlationsearch.metadata = {{ detection.getMetadata() | tojson }}
6768
{% if detection.deployment.scheduling.schedule_window is defined %}
6869
schedule_window = {{ detection.deployment.scheduling.schedule_window }}
6970
{% endif %}

0 commit comments

Comments
 (0)