A vehicle security incident leaves evidence in places a conventional
SOC rarely looks, CAN logs with no sender authentication, telematics
records held by a backend, infotainment storage, and diagnostic
trouble codes that may be symptoms or may be noise. The vehicle
clock, the backend clock, and the analyst clock rarely agree, and
volatile vehicle state disappears when the vehicle powers down. This
sub-skill covers triage and forensic handling for vehicles you own
or are authorized to examine, with preservation before analysis and
a timeline that accounts for every clock involved.
Quick Workflow
- Preserve first, volatile vehicle state, diagnostic logs, and
backend records are captured before any analysis changes them.
- Record the vehicle identity, software versions, and power state
at the time of acquisition, plus who handled the vehicle.
- Inventory the log sources available, vehicle, telematics backend,
charger or fleet system, and mobile app, with their retention.
- Build a timeline in one reference timezone, noting each source
clock offset explicitly.
- Correlate vehicle events with backend events, looking for the
same session, command, or message ID on both sides.
- Test each hypothesis against the evidence, and record which
evidence supports or contradicts it.
- Separate attack artefacts from faults, a failing sensor and a
spoofed signal can look alike in a single log.
- Write the incident record with the chain of custody, the
evidence hashes, and the gaps where a source was unavailable.
1. Evidence preservation and hashing
Acquisition order matters, volatile before non-volatile, and every
acquired file is hashed immediately so later analysis can prove
the copy matches the original. Work on copies, never on original
vehicle storage.
# Acquire a vehicle log export to a working copy, then hash it
cp /mnt/vehicle_logs/diagnostic_export.log ./evidence/diag_export.log
sha256sum ./evidence/diag_export.log > ./evidence/diag_export.sha256
cat ./evidence/diag_export.sha256
# Acquire a CAN recording the same way, with its own hash file
cp /mnt/vehicle_logs/can_capture.log ./evidence/can_capture.log
sha256sum ./evidence/can_capture.log > ./evidence/can_capture.sha256
# Verify every evidence file still matches its recorded hash
import hashlib
import pathlib
for hash_file in sorted(pathlib.Path("evidence").glob("*.sha256")):
recorded = hash_file.read_text().split()[0]
target = hash_file.with_suffix("").with_suffix(".log")
if not target.exists():
# Hash files are named <name>.sha256 for <name>.log
target = pathlib.Path(str(hash_file).replace(".sha256", ".log"))
digest = hashlib.sha256(target.read_bytes()).hexdigest()
status = "OK" if digest == recorded else "MISMATCH - stop and investigate"
print(f"{target}: {status}")
2. Timeline reconstruction across vehicle and backend logs
Normalize timestamps before correlating anything. A vehicle event
that appears to precede its backend cause by minutes is usually a
clock offset, not time travel, and the offset is measured from
events visible in both logs, such as a remote command and its
vehicle execution.
# Normalize timestamps from two sources to one reference timezone
from datetime import datetime, timezone, timedelta
# Offsets measured from an event visible in both logs.
# Vehicle clock runs 4 minutes behind the backend clock in this example.
vehicle_offset = timedelta(minutes=4)
def normalize_vehicle_time(raw):
parsed = datetime.fromisoformat(raw)
return (parsed + vehicle_offset).astimezone(timezone.utc)
events = [
("vehicle", "2026-10-27T08:12:00+00:00", "remote unlock executed"),
("backend", "2026-10-27T08:16:05+00:00", "remote unlock requested"),
]
for source, raw, description in sorted(events, key=lambda e: e[1]):
print(f"{source}: {raw} - {description}")
# After normalization the vehicle execution follows the backend
# request by seconds, which matches the expected command flow.
# Build a combined timeline with a simple merge of normalized logs
# Each source log is first converted to UTC, then merged and sorted.
sort -m vehicle_timeline_utc.log backend_timeline_utc.log \
> combined_timeline.log
head -20 combined_timeline.log
3. Detection use cases and triage checklist
Detection use cases trace back to the threat model, so each use case
names the attack it detects, the log source it needs, and the false
positive it is most likely to produce. Triage starts with the
highest fidelity source and works outward, rather than starting
from the noisiest alert.
# Vehicle SOC use case catalogue, one entry per detection
use_cases = [
{
"attack": "CAN injection from a compromised ECU",
"source": "CAN IDS alerts plus gateway logs",
"false_positive": "diagnostic session traffic",
},
{
"attack": "unauthorized remote command",
"source": "telematics backend command log",
"false_positive": "owner command from a new device",
},
{
"attack": "keyless relay unlock",
"source": "passive entry logs plus key presence data",
"false_positive": "owner unlock with key nearby",
},
]
for case in use_cases:
print(f"{case['attack']} - source: {case['source']} - "
f"watch for: {case['false_positive']}")
Edge cases
- Volatile evidence loss: powering down a vehicle can clear
diagnostic trouble codes and volatile logs, so the power state
decision is made before any other handling, and the reasoning is
recorded.
- Clock drift and timezone: vehicle clocks drift and may use local
time without a timezone marker, so offsets are measured, never
assumed, and unmarked timestamps are flagged as uncertain.
- Missing backend retention: telematics backends may retain
detailed logs only briefly, so a preservation request to the
backend is sent as early as the vehicle acquisition starts.
- Privacy limits: vehicle logs contain location and personal data,
so acquisition is scoped to the incident window and the
authorization that covers it, and unrelated data is excluded.
- Fault versus attack ambiguity: a single anomalous signal proves
neither, so conclusions require corroboration from a second
source, such as a backend record or a second vehicle bus.
- Chain of custody gaps: any period where the vehicle was handled
without a record weakens the evidence, so gaps are stated in the
incident record rather than smoothed over.
Key references
- ISO 21434, road vehicles cybersecurity engineering, for incident
response, vulnerability handling, and the threat analysis that
detection use cases trace back to.
- ISO 27037, guidelines for identification, collection, acquisition
and preservation of digital evidence, for handling and chain of
custody practice applied to vehicle evidence.
- The parent skill automotive-threat-model, for the attack paths and
risk ranking that prioritize which alerts get triaged first.
- Vehicle manufacturer diagnostic documentation for the specific
vehicle under examination, used to interpret trouble codes and
log formats before drawing conclusions.
1---2name: vehicle-soc-forensics3parent: automotive-threat-model4description: Use when triaging vehicle security alerts in a SOC or performing forensic acquisition on a vehicle you own or are authorized to examine. Covers vehicle log sources and their limits, CAN and Ethernet evidence preservation, telematics and infotainment artefacts, timeline reconstruction across vehicle and backend logs, and chain of custody for vehicle evidence. Also use when an incident response plan needs vehicle-specific detection use cases and evidence handling.5version: 1.0.06domain: automotive7lifecycle: stable8last_verified: '2026-10-27'9requires: [automotive-threat-model]10extends: []11relates: [can-bus-security, telematics-security, automotive-ethernet]12tools:13 - name: Python14 version: '3.12'15 - name: Wireshark16 version: '4.4'17metadata:18 source: https://skillmd.com/skills/mizazhaider-ceh/vehicle-soc-forensics19---2021A vehicle security incident leaves evidence in places a conventional22SOC rarely looks, CAN logs with no sender authentication, telematics23records held by a backend, infotainment storage, and diagnostic24trouble codes that may be symptoms or may be noise. The vehicle25clock, the backend clock, and the analyst clock rarely agree, and26volatile vehicle state disappears when the vehicle powers down. This27sub-skill covers triage and forensic handling for vehicles you own28or are authorized to examine, with preservation before analysis and29a timeline that accounts for every clock involved.3031## Quick Workflow32331. Preserve first, volatile vehicle state, diagnostic logs, and34 backend records are captured before any analysis changes them.352. Record the vehicle identity, software versions, and power state36 at the time of acquisition, plus who handled the vehicle.373. Inventory the log sources available, vehicle, telematics backend,38 charger or fleet system, and mobile app, with their retention.394. Build a timeline in one reference timezone, noting each source40 clock offset explicitly.415. Correlate vehicle events with backend events, looking for the42 same session, command, or message ID on both sides.436. Test each hypothesis against the evidence, and record which44 evidence supports or contradicts it.457. Separate attack artefacts from faults, a failing sensor and a46 spoofed signal can look alike in a single log.478. Write the incident record with the chain of custody, the48 evidence hashes, and the gaps where a source was unavailable.4950## 1. Evidence preservation and hashing5152Acquisition order matters, volatile before non-volatile, and every53acquired file is hashed immediately so later analysis can prove54the copy matches the original. Work on copies, never on original55vehicle storage.5657```bash58# Acquire a vehicle log export to a working copy, then hash it59cp /mnt/vehicle_logs/diagnostic_export.log ./evidence/diag_export.log60sha256sum ./evidence/diag_export.log > ./evidence/diag_export.sha25661cat ./evidence/diag_export.sha25662# Acquire a CAN recording the same way, with its own hash file63cp /mnt/vehicle_logs/can_capture.log ./evidence/can_capture.log64sha256sum ./evidence/can_capture.log > ./evidence/can_capture.sha25665```6667```python68# Verify every evidence file still matches its recorded hash69import hashlib70import pathlib7172for hash_file in sorted(pathlib.Path("evidence").glob("*.sha256")):73 recorded = hash_file.read_text().split()[0]74 target = hash_file.with_suffix("").with_suffix(".log")75 if not target.exists():76 # Hash files are named <name>.sha256 for <name>.log77 target = pathlib.Path(str(hash_file).replace(".sha256", ".log"))78 digest = hashlib.sha256(target.read_bytes()).hexdigest()79 status = "OK" if digest == recorded else "MISMATCH - stop and investigate"80 print(f"{target}: {status}")81```8283## 2. Timeline reconstruction across vehicle and backend logs8485Normalize timestamps before correlating anything. A vehicle event86that appears to precede its backend cause by minutes is usually a87clock offset, not time travel, and the offset is measured from88events visible in both logs, such as a remote command and its89vehicle execution.9091```python92# Normalize timestamps from two sources to one reference timezone93from datetime import datetime, timezone, timedelta9495# Offsets measured from an event visible in both logs.96# Vehicle clock runs 4 minutes behind the backend clock in this example.97vehicle_offset = timedelta(minutes=4)9899def normalize_vehicle_time(raw):100 parsed = datetime.fromisoformat(raw)101 return (parsed + vehicle_offset).astimezone(timezone.utc)102103events = [104 ("vehicle", "2026-10-27T08:12:00+00:00", "remote unlock executed"),105 ("backend", "2026-10-27T08:16:05+00:00", "remote unlock requested"),106]107for source, raw, description in sorted(events, key=lambda e: e[1]):108 print(f"{source}: {raw} - {description}")109# After normalization the vehicle execution follows the backend110# request by seconds, which matches the expected command flow.111```112113```bash114# Build a combined timeline with a simple merge of normalized logs115# Each source log is first converted to UTC, then merged and sorted.116sort -m vehicle_timeline_utc.log backend_timeline_utc.log \117 > combined_timeline.log118head -20 combined_timeline.log119```120121## 3. Detection use cases and triage checklist122123Detection use cases trace back to the threat model, so each use case124names the attack it detects, the log source it needs, and the false125positive it is most likely to produce. Triage starts with the126highest fidelity source and works outward, rather than starting127from the noisiest alert.128129```python130# Vehicle SOC use case catalogue, one entry per detection131use_cases = [132 {133 "attack": "CAN injection from a compromised ECU",134 "source": "CAN IDS alerts plus gateway logs",135 "false_positive": "diagnostic session traffic",136 },137 {138 "attack": "unauthorized remote command",139 "source": "telematics backend command log",140 "false_positive": "owner command from a new device",141 },142 {143 "attack": "keyless relay unlock",144 "source": "passive entry logs plus key presence data",145 "false_positive": "owner unlock with key nearby",146 },147]148for case in use_cases:149 print(f"{case['attack']} - source: {case['source']} - "150 f"watch for: {case['false_positive']}")151```152153## Edge cases154155- Volatile evidence loss: powering down a vehicle can clear156 diagnostic trouble codes and volatile logs, so the power state157 decision is made before any other handling, and the reasoning is158 recorded.159- Clock drift and timezone: vehicle clocks drift and may use local160 time without a timezone marker, so offsets are measured, never161 assumed, and unmarked timestamps are flagged as uncertain.162- Missing backend retention: telematics backends may retain163 detailed logs only briefly, so a preservation request to the164 backend is sent as early as the vehicle acquisition starts.165- Privacy limits: vehicle logs contain location and personal data,166 so acquisition is scoped to the incident window and the167 authorization that covers it, and unrelated data is excluded.168- Fault versus attack ambiguity: a single anomalous signal proves169 neither, so conclusions require corroboration from a second170 source, such as a backend record or a second vehicle bus.171- Chain of custody gaps: any period where the vehicle was handled172 without a record weakens the evidence, so gaps are stated in the173 incident record rather than smoothed over.174175## Key references176177- ISO 21434, road vehicles cybersecurity engineering, for incident178 response, vulnerability handling, and the threat analysis that179 detection use cases trace back to.180- ISO 27037, guidelines for identification, collection, acquisition181 and preservation of digital evidence, for handling and chain of182 custody practice applied to vehicle evidence.183- The parent skill automotive-threat-model, for the attack paths and184 risk ranking that prioritize which alerts get triaged first.185- Vehicle manufacturer diagnostic documentation for the specific186 vehicle under examination, used to interpret trouble codes and187 log formats before drawing conclusions.