feat(jira): push Attack Contained field (customfield_11885) on BT submit
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled

Maps Test.containment_result (contained/partially_contained/not_contained)
to Yes/Partial/No, mirroring the existing Attack Success/Attack Detected
field push in push_bt_submitted. Field ID was the last missing piece
blocking this from Block 4.
This commit is contained in:
kitos
2026-07-07 15:46:17 +02:00
parent 1ddbd6989f
commit b6da0e22c2
2 changed files with 29 additions and 1 deletions
+12 -1
View File
@@ -80,6 +80,7 @@ JIRA_FIELD_ATTACK_DETECTED = "customfield_11809"
JIRA_FIELD_TIME_TO_DETECT = "customfield_11810"
JIRA_FIELD_TIME_TO_CONTAIN = "customfield_11811"
JIRA_FIELD_DATA_SENSITIVITY = "customfield_11233"
JIRA_FIELD_ATTACK_CONTAINED = "customfield_11885"
_ATTACK_SUCCESS_TO_JIRA = {
"successful": "Yes",
@@ -93,6 +94,12 @@ _DETECTION_TO_JIRA = {
"partially_detected": "Partial",
}
_CONTAINMENT_TO_JIRA = {
"contained": "Yes",
"not_contained": "No",
"partially_contained": "Partial",
}
_DATA_CLASSIFICATION_TO_JIRA = {
"public_release": "Public Release",
"general_use": "General Use",
@@ -995,13 +1002,17 @@ def push_bt_started(db: Session, test: Test) -> None:
def push_bt_submitted(db: Session, test: Test) -> None:
"""Set BT End Date, Attack Detected, and time-to-detect/contain — Blue submits for review."""
"""Set BT End Date, Attack Detected/Contained, and time-to-detect/contain — Blue submits for review."""
fields: dict = {JIRA_FIELD_BT_END_DATE: datetime.utcnow().strftime("%Y-%m-%d")}
detection_result = _enum_value(test.detection_result)
if detection_result in _DETECTION_TO_JIRA:
fields[JIRA_FIELD_ATTACK_DETECTED] = _DETECTION_TO_JIRA[detection_result]
containment_result = _enum_value(test.containment_result)
if containment_result in _CONTAINMENT_TO_JIRA:
fields[JIRA_FIELD_ATTACK_CONTAINED] = _CONTAINMENT_TO_JIRA[containment_result]
time_to_detect = _compute_hours(test.execution_end_time, test.detection_time)
if time_to_detect is not None:
fields[JIRA_FIELD_TIME_TO_DETECT] = time_to_detect