Skip to content

Commit a199c72

Browse files
authored
Merge pull request #296 from splunk/ryanplasma_add_explanation
Ryanplasma add explanation
2 parents a17256b + eedd07e commit a199c72

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

contentctl/objects/abstract_security_content_objects/detection_abstract.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ class Detection_Abstract(SecurityContentObject):
6767
search: str = Field(...)
6868
how_to_implement: str = Field(..., min_length=4)
6969
known_false_positives: str = Field(..., min_length=4)
70+
explanation: None | str = Field(
71+
default=None,
72+
exclude=True, #Don't serialize this value when dumping the object
73+
description="Provide an explanation to be included "
74+
"in the 'Explanation' field of the Detection in "
75+
"the Use Case Library. If this field is not "
76+
"defined in the YML, it will default to the "
77+
"value of the 'description' field when "
78+
"serialized in analyticstories_detections.j2",
79+
)
7080

7181
enabled_by_default: bool = False
7282
file_path: FilePath = Field(...)

contentctl/output/templates/analyticstories_detections.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
type = detection
88
asset_type = {{ detection.tags.asset_type.value }}
99
confidence = medium
10-
explanation = {{ detection.description | escapeNewlines() }}
10+
explanation = {{ (detection.explanation if detection.explanation else detection.description) | escapeNewlines() }}
1111
{% if detection.how_to_implement is defined %}
1212
how_to_implement = {{ detection.how_to_implement | escapeNewlines() }}
1313
{% else %}

0 commit comments

Comments
 (0)