Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ class Detection_Abstract(SecurityContentObject):
search: str = Field(...)
how_to_implement: str = Field(..., min_length=4)
known_false_positives: str = Field(..., min_length=4)
explanation: None | str = Field(
default=None,
exclude=True, #Don't serialize this value when dumping the object
description="Provide an explanation to be included "
"in the 'Explanation' field of the Detection in "
"the Use Case Library. If this field is not "
"defined in the YML, it will default to the "
"value of the 'description' field when "
"serialized in analyticstories_detections.j2",
)

enabled_by_default: bool = False
file_path: FilePath = Field(...)
Expand Down
2 changes: 1 addition & 1 deletion contentctl/output/templates/analyticstories_detections.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
type = detection
asset_type = {{ detection.tags.asset_type.value }}
confidence = medium
explanation = {{ detection.description | escapeNewlines() }}
explanation = {{ (detection.explanation if detection.explanation else detection.description) | escapeNewlines() }}
{% if detection.how_to_implement is defined %}
how_to_implement = {{ detection.how_to_implement | escapeNewlines() }}
{% else %}
Expand Down
Loading