External interfaces (attack surface): ├── LTE/5G modem (internet-facing: OTA server, remote diagnostics, V2X backend) ├── Bluetooth 5.0 (short-range: smartphone app pairing, audio, TPMS) ├── Wi-Fi 802.11ac (hotspot / home charging station) └── OBD-II Ethernet port (physical access: diagnostic tool, charging EV) Internal interfaces: ├── Ethernet backbone (100BASE-T1: gateway, ADAS, camera) └── CAN gateway interface (access to powertrain + body CAN buses) Functions hosted on TCU: ├── OTA update client (downloads + verifies firmware packages) ├── Remote diagnostics server (UDS over IP via DoIP) ├── V2X stack (C-V2X PC5 + ITS-G5) ├── Bluetooth stack (HSP, A2DP, SPP for smartphone integration) └── Connected services (location sharing, remote door lock/unlock) Security-sensitive assets: 12 identified (see asset register)
Target System: TCU Definition
Asset Enumeration and Damage Scenarios
#!/usr/bin/env python3
# Full TCU TARA: 12 assets with damage scenarios
tcu_assets = [
{"id":"A-01","asset":"LTE Credentials (SIM/key)","S":0,"F":2,"O":2,"P":0},
{"id":"A-02","asset":"CAN Gateway Routing Table","S":3,"F":2,"O":3,"P":0},
{"id":"A-03","asset":"OTA Package Verification Key","S":3,"F":3,"O":3,"P":0},
{"id":"A-04","asset":"UDS Session Manager","S":3,"F":2,"O":2,"P":0},
{"id":"A-05","asset":"Bluetooth Pairing Database","S":0,"F":1,"O":1,"P":2},
{"id":"A-06","asset":"Stored PII/Location History","S":0,"F":1,"O":0,"P":3},
{"id":"A-07","asset":"ECU Firmware Image","S":3,"F":2,"O":3,"P":0},
{"id":"A-08","asset":"Secure Boot Chain","S":3,"F":3,"O":3,"P":0},
{"id":"A-09","asset":"CAN Message Integrity","S":3,"F":2,"O":3,"P":0},
{"id":"A-10","asset":"Remote Access Token","S":2,"F":2,"O":2,"P":1},
{"id":"A-11","asset":"Diagnostic Session Auth","S":3,"F":2,"O":2,"P":0},
{"id":"A-12","asset":"Diagnostic Log Files","S":0,"F":1,"O":0,"P":1},
]
print(f"TCU Asset Register: {len(tcu_assets)} assets, {sum(len([x for x in [a['S'],a['F'],a['O'],a['P']] if x > 0]) for a in tcu_assets)} damage scenarios")
for a in tcu_assets:
overall = max(a["S"], a["F"], a["O"], a["P"])
cats = [k for k in ["S","F","O","P"] if a[k] > 0]
print(f" [{a['id']}] {a['asset']}: max impact {overall} ({'/'.join(cats)})")Attack Path Construction: TS-09
#!/usr/bin/env python3
# TS-09: Remote attacker obtains valid UDS extended diagnostic session
# Attack path AP-09A: LTE interface exploit
ap_09a_factors = {
"Elapsed Time": 3, # le_6_months — need 0-day LTE modem exploit
"Specialist Expertise": 4, # expert — cellular firmware exploitation
"Knowledge of Target": 3, # restricted — modem model known from FCC filings
"Window of Opportunity": 1, # easy — vehicle always has LTE active
"Equipment": 0, # standard — laptop + software radio
}
ap_09a_score = sum(ap_09a_factors.values())
print(f"AP-09A (LTE 0-day exploit): AFR score = {ap_09a_score} → {'High' if ap_09a_score <= 13 else 'Medium'}")
# Attack path AP-09B: social engineering + remote portal
ap_09b_factors = {
"Elapsed Time": 0, # le_1_day — phishing works quickly
"Specialist Expertise": 0, # layman — no technical skill needed
"Knowledge of Target": 3, # restricted — OEM portal URL is public
"Window of Opportunity": 1, # easy — portal available 24/7
"Equipment": 0, # standard
}
ap_09b_score = sum(ap_09b_factors.values())
print(f"AP-09B (social engineering): AFR score = {ap_09b_score} → {'High' if ap_09b_score <= 13 else 'Medium'}")
# Overall TS-09: OR gate → worst-case (lowest score = highest feasibility)
import sys
overall = min(ap_09a_score, ap_09b_score)
print(f"TS-09 overall feasibility: score = {overall} → High")
print(f"Risk: S2/F2 × High = UNACCEPTABLE — mandatory countermeasures required")Countermeasure Definition and Residual Risk
#!/usr/bin/env python3
# TS-09 countermeasure definition and residual risk calculation
countermeasures = {
"CM-09.1": {
"description": "Require SecurityAccess seed-key (SID 0x27) with 256-bit random challenge "
"before entering extended session; HMAC-SHA256 with secret known only to OEM tooling",
"impact_on_feasibility": "AP-09B eliminated: portal cannot grant extended session without seed-key "
"exchange requiring secret key"
},
"CM-09.2": {
"description": "Enforce TLS 1.3 mTLS for all remote diagnostic connections; "
"OEM-issued client certificate required from registered diagnostic tool",
"impact_on_feasibility": "AP-09A: attacker must also forge valid mTLS certificate chain — "
"ET > 6 months; SE = multiple experts; EQ = bespoke"
},
}
print("Countermeasures for TS-09:")
for cm_id, cm in countermeasures.items():
print(f" [{cm_id}] {cm['description'][:80]}")
print(f" Feasibility impact: {cm['impact_on_feasibility'][:80]}")
print()
# Residual risk after CM-09.1 + CM-09.2
residual_score = 4 + 6 + 7 + 10 + 7 # ET>6m + multipleExperts + sensitive + difficult + bespoke
print(f"Residual AFR score (after CM-09.1+09.2): {residual_score} → Very Low")
print(f"Residual Risk: S2/F2 × Very Low = ACCEPTABLE")
print(f"Required sign-off: Cybersecurity Manager + Functional Safety Manager")
print(f"Review trigger: New CVE for OEM mTLS library; or new remote diag portal vulnerability")Summary
A full TCU TARA for a connected ECU with 12 assets and multiple external interfaces produces 20+ damage scenarios, 40+ threat scenarios, and 80+ attack paths. The worked TS-09 example shows the complete flow: enumerate attack paths, score each with AFR factors, identify the most feasible path (OR gate selects minimum score), compute risk, define countermeasures that raise residual feasibility to Very Low, and document with management sign-off. This TARA record is the primary evidence submitted to Technical Service for UNECE R155 VTCA review.
🔬 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
- 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'.
- 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.
- 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.
- 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.