Home Learning Paths ECU Lab Assessments Interview Preparation Arena Pricing Log In Sign Up

Incident Response Phases -- ISO/SAE 21434 Clause 13

PhaseActivitiesTarget Timeline
DetectVSOC alert or external researcher report via PSIRTAutomated detection: <5 min; analyst acknowledgement: <1h
TriageCVSS severity; affected VIN count; safety impact assessment4 hours for initial triage of any High/Critical alert
ContainOTA disable of affected feature; kill-switch via UDS RoutineControl 0x31≤ 4 hours for safety-critical incidents
InvestigateRoot cause analysis; exploit path reconstruction; forensics72 hours for initial root cause report
RemediatePatch development; security review; integration + regression testing≤ 30 days for CVSS ≥ 9.0; ≤ 90 days for CVSS 7.0–8.9
RecoverOTA patch deployment fleet-wide; regression test confirmationWithin 7 days of patch approval for Critical
Post-incidentTARA update; lessons learned; PSIRT disclosure if required30 days after recovery

Vehicle Forensics Data Collection

Pythonvehicle_forensics.py
#!/usr/bin/env python3
# Vehicle forensics: collect security artefacts from ECU via OTA/UDS
import socket, struct, json
from datetime import datetime

def collect_forensics(vehicle_ip: str, oem_session_token: str) -> dict:
    # Collect IDS log, DTC history, and SW versions for forensic analysis
    forensics = {"vehicle_ip": vehicle_ip, "collected_at": datetime.utcnow().isoformat()}

    # 1. Connect via DoIP (requires OEM mTLS session token in practice)
    s = socket.create_connection((vehicle_ip, 13400), timeout=10)

    # 2. Read all ECU extended DTCs (UDS 0x19 0x02 0xFF = all stored DTCs)
    dtc_req = struct.pack(">HHIB", 0xFFFE, 0x8001, 3, 0) + bytes([0x03, 0x19, 0x02, 0xFF])
    s.sendall(dtc_req)
    dtc_resp = s.recv(4096)
    forensics["dtc_dump_hex"] = dtc_resp.hex()

    # 3. Read IDS event log via custom DID 0xF1A0
    ids_req = struct.pack(">HHIB", 0xFFFE, 0x8001, 4, 0) + bytes([0x03, 0x22, 0xF1, 0xA0])
    s.sendall(ids_req)
    ids_resp = s.recv(4096)
    forensics["ids_log_hex"] = ids_resp.hex()
    forensics["ids_event_count"] = (len(ids_resp) - 5) // 8  # estimated

    # 4. Read SW fingerprint (VIN + SW version hash for chain-of-custody)
    sw_req = struct.pack(">HHIB", 0xFFFE, 0x8001, 4, 0) + bytes([0x03, 0x22, 0xF1, 0x89])
    s.sendall(sw_req)
    sw_resp = s.recv(256)
    forensics["sw_version_hex"] = sw_resp.hex()

    s.close()
    return forensics

# forensics = collect_forensics("192.168.1.100", "OEM_SESSION_TOKEN_HERE")
# with open(f"forensics_{datetime.now().strftime('%Y%m%d_%H%M')}.json","w") as f:
#     json.dump(forensics, f, indent=2)

Example Incident Timeline: SecOC Key Extraction Attack

72-Hour Incident Timeline
  Hour 0:    VSOC SIEM fires: SecOC FAILED rate > threshold on 23 VINs (campaign)
  Hour 0.5:  Analyst escalates to Critical; safety impact: braking PDU affected
  Hour 1:    Contain: OTA push to disable remote CAN write access on affected VINs
  Hour 2:    Forensics: collect IDS logs + DTCs from 5 representative VINs
  Hour 4:    Root cause: CAN adapter obtained from compromised workshop tool
             key extracted via power analysis (ChipWhisperer) on bench
  Hour 8:    KMS emergency key rotation: new ESKs derived with incident context
  Hour 24:   OTA: new ESKs deployed to 100% of affected VINs; verified in VSOC
  Hour 48:   TARA update: key-extraction feasibility revised (now AFR Medium → High)
             New countermeasure: SHE slot set to secure-debug-disabled in production
  Hour 72:   ISO/SAE 21434 Clause 13 incident report filed internally
  Day 30:    PSIRT coordinated disclosure (workshop tool vendor + AUTO-ISAC)

Post-Incident Reporting

Pythonincident_report_gen.py
#!/usr/bin/env python3
import json
from datetime import date

def generate_incident_report(incident: dict) -> str:
    return f"""
ISO/SAE 21434 INCIDENT REPORT
Report ID:      {incident['id']}
Date:           {incident['date']}
Severity:       {incident['severity']} (CVSS {incident['cvss']})

1. INCIDENT SUMMARY
   {incident['summary']}

2. TIMELINE
{chr(10).join(f"   {t['time']}: {t['event']}" for t in incident['timeline'])}

3. ROOT CAUSE ANALYSIS
   {incident['root_cause']}

4. AFFECTED VEHICLES
   VINs affected: {incident['affected_vins']:,}
   Models:        {', '.join(incident['affected_models'])}

5. CONTAINMENT ACTIONS
{chr(10).join(f"   - {a}" for a in incident['containment'])}

6. CORRECTIVE ACTIONS
{chr(10).join(f"   - {a}" for a in incident['corrective_actions'])}

7. TARA IMPACT
   Threat scenario {incident['tara_ts']} residual risk revised from
   {incident['old_risk']} to {incident['new_risk']}

8. DISCLOSURE
   {incident['disclosure_decision']}
"""

example = {
    "id":"INC-2026-001","date":str(date.today()),
    "severity":"Critical","cvss":8.9,
    "summary":"SecOC symmetric key extracted via power analysis from compromised workshop tool; used to forge engine torque CAN messages on 23 vehicles",
    "timeline":[
        {"time":"00:00","event":"VSOC SIEM alert: SecOC FAILED campaign detected"},
        {"time":"01:00","event":"Remote CAN write disabled via OTA kill-switch"},
        {"time":"24:00","event":"Emergency ESK rotation deployed fleet-wide"},
    ],
    "root_cause":"Workshop tool compromised; SHE KEY_1 extracted via CPA; slot lacked debug-disabled fuse",
    "affected_vins":23,"affected_models":["Model X 2025","Model X 2026"],
    "containment":["OTA disable remote CAN write","Emergency key rotation within 24h"],
    "corrective_actions":["Set SHE KEY_1 to debug-disabled in production fusing SOP",
                          "Workshop tool security requirements added to CIA"],
    "tara_ts":"TS-11","old_risk":"Acceptable (Very Low feasibility)","new_risk":"High (Medium feasibility -- exploit demonstrated)",
    "disclosure_decision":"Coordinated with workshop tool vendor and AUTO-ISAC; 90-day embargo; public advisory Day 90",
}

print(generate_incident_report(example))

Summary

Automotive incident response follows the ISO/SAE 21434 Clause 13 lifecycle: Detect → Triage → Contain → Investigate → Remediate → Recover → Post-incident review. The 4-hour containment SLA for safety-critical incidents requires a pre-built OTA kill-switch capability -- reactive kill-switches cannot be built during an active incident. Vehicle forensics (DTCs + IDS logs via UDS) provide the artefacts for root-cause analysis. Every incident must trigger a TARA update: if a countermeasure was bypassed in the field, the feasibility rating that justified accepting the residual risk was wrong and must be revised.

🔬 Deep Dive — Core Concepts Expanded

This section builds on the foundational concepts covered above with additional technical depth, edge cases, and configuration nuances that separate competent engineers from experts. When working on production ECU projects, the details covered here are the ones most commonly responsible for integration delays and late-phase defects.

Key principles to reinforce:

  • Configuration over coding: In AUTOSAR and automotive middleware environments, correctness is largely determined by ARXML configuration, not application code. A correctly implemented algorithm can produce wrong results due to a single misconfigured parameter.
  • Traceability as a first-class concern: Every configuration decision should be traceable to a requirement, safety goal, or architecture decision. Undocumented configuration choices are a common source of regression defects when ECUs are updated.
  • Cross-module dependencies: In tightly integrated automotive software stacks, changing one module's configuration often requires corresponding updates in dependent modules. Always perform a dependency impact analysis before submitting configuration changes.

🏭 How This Topic Appears in Production Projects

  • Project integration phase: The concepts covered in this lesson are most commonly encountered during ECU integration testing — when multiple software components from different teams are combined for the first time. Issues that were invisible in unit tests frequently surface at this stage.
  • Supplier/OEM interface: This is a topic that frequently appears in technical discussions between Tier-1 ECU suppliers and OEM system integrators. Engineers who can speak fluently about these details earn credibility and are often brought into critical design review meetings.
  • Automotive tool ecosystem: Vector CANoe/CANalyzer, dSPACE tools, and ETAS INCA are the standard tools used to validate and measure the correct behaviour of the systems described in this lesson. Familiarity with these tools alongside the conceptual knowledge dramatically accelerates debugging in real projects.

⚠️ Common Mistakes and How to Avoid Them

  1. Assuming default configuration is correct: Automotive software tools ship with default configurations that are designed to compile and link, not to meet project-specific requirements. Every configuration parameter needs to be consciously set. 'It compiled' is not the same as 'it is correctly configured'.
  2. Skipping documentation of configuration rationale: In a 3-year ECU project with team turnover, undocumented configuration choices become tribal knowledge that disappears when engineers leave. Document why a parameter is set to a specific value, not just what it is set to.
  3. Testing only the happy path: Automotive ECUs must behave correctly under fault conditions, voltage variations, and communication errors. Always test the error handling paths as rigorously as the nominal operation. Many production escapes originate in untested error branches.
  4. Version mismatches between teams: In a multi-team project, the BSW team, SWC team, and system integration team may use different versions of the same ARXML file. Version management of all ARXML files in a shared repository is mandatory, not optional.

📊 Industry Note

Engineers who master both the theoretical concepts and the practical toolchain skills covered in this course are among the most sought-after professionals in the automotive software industry. The combination of AUTOSAR standards knowledge, safety engineering understanding, and hands-on configuration experience commands premium salaries at OEMs and Tier-1 suppliers globally.

← PreviousIntrusion Detection Systems (IDS)Next →OTA Security & Secure Update