Signal-Based Intrusion Detection For
Signal-Based Intrusion Detection For
2
Oak Ridge National Laboratory, TN, USA
moriano@[Link]
Abstract. Modern vehicles rely on a fleet of electronic control units
(ECUs) connected through controller area network (CAN) buses for crit-
ical vehicular control. However, with the expansion of advanced connec-
tivity features in automobiles and the elevated risks of internal system
exposure, the CAN bus is increasingly prone to intrusions and injec-
tion attacks. The ordinary injection attacks disrupt the typical timing
properties of the CAN data stream, and the rule-based intrusion detec-
tion systems (IDS) can easily detect them. However, advanced attack-
ers can inject false data to the time series sensory data (signal), while
looking innocuous by the pattern/frequency of the CAN messages. Such
attacks can bypass the rule-based IDS or any anomaly-based IDS built
on binary payload data. To make the vehicles robust against such intelli-
gent attacks, we propose CANShield, a signal-based intrusion detection
framework for the CAN bus. CANShield consists of three modules: a
data preprocessing module that handles the high-dimensional CAN data
stream at the signal level and makes them suitable for a deep learning
model; a data analyzer module consisting of multiple deep autoencoder
(AE) networks, each analyzing the time-series data from a different tem-
poral perspective; and finally an attack detection module that uses an
ensemble method to make the final decision. Evaluation results on two
high-fidelity signal-based CAN attack datasets show the high accuracy
and responsiveness of CANShield in detecting wide-range of advanced
intrusion attacks.
1 Introduction
Modern vehicles are becoming fully computerized to ensure the driver’s safety
and convenience. The majority of the cars’ critical functionalities involve dedi-
cated microcontroller modules, known as electronic control units (ECUs), which
A version of this paper is accepted by escar USA 2022.
?
This manuscript has been co-authored by UT-Battelle, LLC, under contract DE- AC05-
00OR22725 with the US Department of Energy (DOE). The US government retains and the
publisher, by accepting the article for publication, acknowledges that the US government retains
a nonexclusive, paid-up, irrevocable, worldwide license to publish or reproduce the published form
of this manuscript, or allow others to do so, for US government purposes. DOE will provide public
access to these results of federally sponsored research in accordance with the DOE Public Access
Plan ([Link]
2 Shahriar et al.
2 Preliminaries
2.1 Controller Area Network
Robert Bosch GmbH introduced CAN as an automotive communication bus with
the latest version (2.0) released in 1991.
CAN Data Frame Format. Among different types of frames, data frame
is the default mode for CAN data transmission, as shown in the top portion
of Fig. 1. CAN data frame supports up to 8 bytes of payloads with 11 bits
of arbitration ID (CAN ID), which can be extended to 29 bits. Every con-
nected ECU broadcasts its message to the CAN bus. However, only one ECU can
transmit at a time and the rest stay synchronized to receive the data correctly.
The message arbitration mechanism de-
CAN ID Binary Payload tects and resolves collisions of messages. A
SOF
EOF
RTD
IDE
IFS
R0
CRC ACK
(11- bits) (0-8 bytes) message with a higher priority contains a
lower binary-encoded CAN ID. Due to dif-
EngineRPM ferent priorities, different CAN IDs usu-
Battery Voltage Current Gear ally appear in the CAN bus at different
GPS LatitudeABSEnabled frequencies.
Vehicular Speed Signal-level Representation of
Decoded signals of four consecutive payloads CAN Data. The binary payload can
be decoded to the signal level using the
Fig. 1: (Top) CAN data frame syn- specific car’s database for CAN (DBC)
tax. (Bottom) Decoded signals. file. The DBC file is a proprietary format,
4 Shahriar et al.
Aggregator
Critical
Signals
DBC
...... ...... ...... ......
Fig. 2: CANShield workflow. The tasks with AEs and thresholds differ during
the “training” and “deployment” phases.
analyzer module that employs multiple CNN-based AEs for generating anomaly
scores for the data views, and iii) attack detection module that makes the final
detection decision. CANShield has two phases of operation: training and deploy-
ment. Some of the modules play additional/slightly different roles during each
of the two phases. During the training phase, the data analyzer module needs
to train deep learning models. However, as the onboard devices are typically
lightweight and not suitable for effective training of deep learning models, we
consider two potential solutions for that. CANShield can have a secure connec-
tion to the cloud with model training capabilities or train the models on a local
computer with CANShield running on that. Hence, during the training phase,
the normal CAN traces are stored on the local memory first and then periodi-
cally sent to the cloud or local computer for model training. Once the model(s)
are adequately trained, CANShield loads the trained model(s) into the onboard
device and begins the deployment phase, which goes through the three modules
in a feedforward fashion and output the detection result in near real time.
– Masquerade attacks are the most advanced, stealthiest, and destructive at-
tacks. This is the combination of fabrication and suspension attack, where
the attacker silences a legitimate ECU, spoofs it in the continuing operation
while injecting malicious messages.
In evaluation, we will use a well-known CAN attack dataset and an emergent
realistic CAN dataset covering specific forms of the above attacks to test the
efficacy of CANShield.
stronger spatial (correlations) patterns of the signals in the resulting image will
enable more effective learning. To facilitate the learning of the inter-sensor corre-
lations, CANShield calculates the Pearson correlation matrix of the time-series
signal dataset. Interpreting the correlation coefficient as the distance between
a pair of signals, CANShield utilizes hierarchical agglomerative clustering algo-
rithm to find the clusters of highly correlated signals. The goal is to place the
highly correlated signals together while building the 2D image so that learning
the signal-to-signal correlation becomes effective for the small filters of the con-
volutional layers. Notably, the two tasks, signal selection and correlation-based
clustering, are done only once during the initialization of the training process
(i.e., off-line with recorded data) and are not parts of the deployment pipeline.
result, the AE models become more complex. This challenge boils down to how
to effectively learn the temporal patterns of all the signals, especially of the ones
with long reporting periods, while still using a small time window during image
generation. We achieve these two conflicting goals by creating different views
of Q with different sampling periods (seeing more with a less complex models).
Thus, we select the first w columns from Q at every T1 , T2 , ...., Tn time steps,
respectively. Here, T1 , T2 , ...., Tn are the sampling periods to create the views D1 ,
D2 , ...., Dn , respectively of the same Q. With loss of generality, here we assume
T1 < T2 < ... < Tn . Fig. 4 illustrates the sampling process on Q at time step t.
Data Queue at (t)
Therefore, D1 has a more detailed .....
.....
view but contains a very limited his- .....
.....
torical trend, capturing short-term or .....
view Dx ∈ Rm×w as an input image and learns to reconstruct almost the same
D̂x ∈ Rm×w image, ∀x ∈ [n]. Once the training is done, the deployment phase
is initiated, and the trained models are loaded in CANShield. At the end of
the training phase and during the deployment phase, the AEs are tested on
the corresponding data stream and try to reconstruct the same image. For AE
AEx , the difference between the original image and the reconstructed image is
the reconstruction loss Lx ∈ Rm×w . Each row contains the corresponding signal’s
reconstruction losses and columns for the time steps.
T ime th
j=1
of thresholds for attack detection at
∀i ∈ [m] : Ri ← q % ∀∈training Vi (4)
each AE:
T ime
∀i ∈ [m] : Si ← 1 if Vi > Ri (5) – Signal-wise reconstruction loss
m
Px ←
1 X
Si (6) thresholds RLoss ∈ Rm
m i=1
/* Step 2 */
– Signal-wise time step violation
Pens = (P1 + P2 + .... + Pn )/n (7) thresholds RT ime ∈ Rm
Signal th
– A number of total compromised
Rens ←r % ∀∈training Pens (8)
signals threshold RSignal ∈ R
/* Step 3 (deployment phase only) */
attack ← 1 if Pens > Rens We summarize a three-step analysis
Signal
(9)
on Lx to facilitate selection of these
thresholds and attack detection, as
is shown in Table 1 and skip the detailed explanation for brevity. For convenience,
in step 1, we have obviated the AE index x for L, intermediate variables, and
thresholds as this approach will be applied independently to each AE.
Step 1 repeats for every AEs and assigns anomaly score on each of the re-
construction losses on the data views, i.e., P1 , P2 ,...., Pn and step 2 ensembles
the scores in a single score Pens . We configure the training phase of CANShield
to run the steps 1 & 2 from Eq. (1)–(8) and stores RLoss and RT ime for each
Signal
of the AEs, and Rens for the ensemble model, optimally tuning three system
hyper-parameters p, q, r as confidence percentiles for these thresholds. During
10 Shahriar et al.
the deployment phase, these thresholds are pre-loaded from the memory, thus,
skipping (1), (4), and (8). While steps 1 & 2 are common in both training and
deployment, CANShield runs one additional task (step 3) in the deployment
phase to check for potential threats (Eq. 9)) and raises the alarm in the system.
5 Implementation
5.1 Datasets and Attacks
We implement CANShield on both SynCAN dataset and ROAD dataset. Syn-
CAN dataset [7] (Synthetic CAN Bus Data) is a widely used CAN attack dataset
released by ETAS (a subsidiary of Robert Bosch Gmbh) covering stealthy signal-
level CAN attacks. ROAD dataset [6] was released by Oak Ridge National Lab-
oratory and is the most realistic CAN attack dataset to date3 Next we introduce
the details of each dataset and the attacks covered.
SynCAN SynCAN dataset is built on actual CAN traces, emulating the char-
acteristics of the real CAN traffic, with hundreds of advanced attack scenarios.
It contains a total of 20 signals. There are 24 hours of logged data, of which 16.5
hours are for training and 7.5 hours are for testing with five types of advanced
attacks, which resemble the three stealthy forms of attack models mentioned in
§3.2. The attacks in SynCAN datasets are summarized in Table 2. A flooding
attack creates delays the legitimate ECUs’ transmission (similar as DoS attack)
and a suppress attack turns off the corresponding ECU of the targeted signal(s).
Based on time-series nature of the injected data there are three types of mas-
querade attacks. Whereas a plateau attack broadcasts the same constant value
of any signal over a long period of time, the continuous attack and playback
attack overwrites the signals with continuously changing values and previously
recorded data, respectively, that shift naturally from the actual ones.
ROAD Dataset ROAD dataset provides the highest-fidelity CAN traces with
physically verified most realistic CAN attacks. It contains a significant amount
of training data covering different context of driving. We obtained raw ROAD
dataset and extracted signals from the CAN messages using CAN-D. There
are 3.5 hours of logged data, of which 3 hours are for training and 30 minutes
are for testing with five types of advanced masquerade attacks targeting the
3
To the best of our knowledge, SynCAN dataset is the only publicly available signal-
level CAN dataset at the time of writing this paper. ROAD dataset was obfuscated
and did not have signal-level interpretation in its initial release in early 2021. We
obtained the raw ROAD dataset through directly contacting ORNL. Partially mo-
tivated by our work, ORNL has a plan to release signal-level ROAD dataset soon.
CANShield 11
engine coolant temperature, engine RPM, brake light, and wheel speeds sensors.
The injected message manipulates only the specific portion of the data fields
containing the targeted signals.
Whereas the attacks in the SynCAN dataset are created by post-processing
(replacing original ones) on the normal driving data, the attack traces in the
ROAD traces were collected from a real car under the real injection attacks.
Such attack traces provide not only the injected messages but also the response
from the vehicle under such attacks, which makes the ROAD dataset the most
realistic one. The attacks in ROAD dataset are summarized in Table 3. In light
of the model’s complexity, one single IDS is not a feasible option to track all
the hundreds of decoded signals within the ROAD dataset. Thus, considering
individual IDS on a different critical subsystem of the vehicle is be a viable
solution. In the implementation of CANShield on ROAD dataset, we consider
the attacked signals in Table 3 to be of primary importance and add two highly
correlated signals for each to make the IDS more robust, as detailed in §4.1.
Attack visualization and ROC Curve In this part, we visualize the anomaly
scores for all the individual and ensemble detectors along with the ROC curves.
SynCAN Dataset. Fig. 5a shows the anomaly scores and the ROC curves
for five different attacks on the SynCAN dataset. Different AEs show different
performances on each of the attacks. However, the ensemble model yields more
stable and consistent performance, leading to higher AUC scores in all the at-
tacks than the individual AEs. For instance, higher sampling periods (i.e., 10)
perform better in detecting the flooding (fabrication) and suppress (suspension)
attacks, as they are more detectable looking at the long-term sequential pattern.
However, the lower sampling periods (i.e., 1) offer better performance in detect-
ing the masquerade attacks, where short-term views of the data queue provide
a detailed look at the time-series violations. Moreover, in the case of contin-
uous and playback attacks, the signals start to deviate gradually, which takes
some time to create the recognizable deviation for the IDS. Hence, a lower AUC
score is not unexpected, especially against continuous attacks. However, CAN-
Shield can detect the violations instantly for the rest of the attacks (AUC scores
of 0.95 ∼ 1.00). Whereas the individual AEs are attack-specific, the ensemble
model takes the best out of every model, generalizes the process, and detects
most attacks with the highest AUC scores.
CANShield 13
1 5 10 Ens
Flooding Suppress Plateau Continuous Playback
Latency (sec) 10 4 5.0 1
2.5
2
2.5
0 0.0 0
0.1 0.5 1.0 0.1 0.5 1.0 0.1 0.5 1.0 0.1 0.5 1.0 0.1 0.5 1.0
Max FPR (%) Max FPR (%) Max FPR (%) Max FPR (%) Max FPR (%)
(a) SynCAN Dataset
Speedometer Reverse light on Reverse light off Correlated signals Engine coolant
Latency (ms)
forms slightly better on the masquerade attacks, CANShield shows decent per-
formance as well. Table 4: Comparison with baseline.
7 Related Work Area Under the Curve (AUC)
Flooding Suppress Plateau Continous Playback
There have been a good amount Ours 0.997 0.985 0.960 0.870 0.948
CANet 0.979 0.882 0.983 0.936 0.974
of works on CAN IDS, which
can be divided into a few different categories in general. Based on the collected
data during the regular operation of the vehicle, rule-based IDS creates secu-
rity rules for CAN communication and ECU behaviors, e.g., message frequency,
no overlapping with the original flow, no disruption of the regular sequence of
CAN IDs, etc. Such properties are considered as the baseline in developing CAN
IDS [5, 10, 11]. A few works utilized the physical layer attributes of the ECUs,
such as clock skews [12], voltage profile [13], electrical CAN signal characteris-
tics [14], etc. to fingerprint the transmitter ECUs.
There are a few machine learning-based IDS working on binary payloads of
CAN messages. Readers are referred to [5] as a good survey for such IDSs. The
payload-based models are trained on obfuscated binary data; thus, they work as
a black-box and lacks explainability [6]. Most of them only look at the sequence of
IDs, which will not suffice to detect advanced attacks. Additionally, these types
of IDSs cannot detect attacks from an intelligent adversary who has control over
the message generation in CAN bus and can launch stealthy signal-level attacks.
There are only a limited amount of works on the signal-level IDS for CAN
bus [15–17]. CANet [7] is the first IDS working on such a high-dimensional struc-
ture. Indra [15] and LATTE [16] are few other attempts in the same direction.
However, all of them utilizes LSTM-based networks, which are very costly to
train and one LSTM for each IDS will make it impractical on the actual car
with a high number of CAN IDs. Moreover, due to their architectural limita-
tions, the existing IDSs show low detection performance on different advanced
attacks and lack scalability.
8 Conclusion
As modern vehicles become more connected to external networks, we propose
a CAN bus intrusion detection framework, CANShield, working at the signal
level to secure the bus from the advanced attacks. Along with the capability of
handling high-dimensional CAN data stream, CANShield trains multiple CNN-
based autoencoder models to work on different views of the data stream across
different temporal scales. With the aid of the individual models, an ensembled
model is used to detect a wide range of attacks and events with very low latency
and high accuracy. Evaluation on both the SynCAN and ROAD datasets shows
CANShield’s robustness and responsiveness against different advanced attacks.
Acknowledgements This work was supported in part by the US National
Science Foundation (NSF) and the Department of Homeland Security (DHS)
under NSF grant CNS-1837519, the Virginia Commonwealth Cyber Initiative
(CCI), and the Laboratory Directed Research and Development Program of
Oak Ridge National Laboratory (ORNL), managed by UT-Battelle, LLC, for
the U.S. Department of Energy. We are also thankful to Robert A. Bridges from
ORNL for his insightful comments on the manuscript.
CANShield 15
References
1. Andy Greenberg. Jeep hacks. [Link]
hackers-remotely-kill-jeep-highway. Accessed: 2021-06-21.
2. Charlie Miller. Lessons learned from hacking a car. IEEE Design & Test, 2019.
3. Wufei Wu, Renfa Li, Guoqi Xie, Jiyao An, Yang Bai, Jia Zhou, and Keqin Li.
A survey of intrusion detection for in-vehicle networks. IEEE Transactions on
Intelligent Transportation Systems, 21(3):919–933, 2019.
4. Umar Khalid, Ashkan Esmaeili, Nazmul Karim, and Nazanin Rahnavard. Rodd:
A self-supervised approach for robust out-of-distribution detection. arXiv preprint
arXiv:2204.02553, 2022.
5. Siti-Farhana Lokman, Abu Othman, and Muhammad-Husaini Abu-Bakar. Intru-
sion detection system for automotive controller area network (can) bus system: a
review. EURASIP Journal on Wireless Communications and Networking, 2019.
6. Miki E. Verma, Michael D. Iannacone, Robert A. Bridges, Samuel C. Hollifield,
Pablo Moriano, Bill Kay, and Frank L. Combs. Addressing the lack of comparability
& testing in can intrusion detection research: A comprehensive guide to can ids
data & introduction of the road dataset, 2022.
7. Markus Hanselmann, Thilo Strauss, Katharina Dormann, and Holger Ulmer.
Canet: An unsupervised intrusion detection system for high dimensional can bus
data. IEEE Access, 8:58194–58205, 2020.
8. Miki E. Verma, Robert A. Bridges, Jordan J. Sosnowski, Samuel C. Hollifield, and
Michael D. Iannacone. Can-d: A modular four-step pipeline for comprehensively
decoding controller area network data. IEEE Transactions on Vehicular Technol-
ogy, 70(10):9685–9700, 2021.
9. Kyong-Tak Cho and Kang G Shin. Error handling of in-vehicle networks makes
them vulnerable. In Proceedings of the 2016 ACM SIGSAC Conference on Com-
puter and Communications Security, pages 1044–1055, 2016.
10. Ulf E Larson, Dennis K Nilsson, and Erland Jonsson. An approach to specification-
based attack detection for in-vehicle networks. In 2008 IEEE Intelligent Vehicles
Symposium, pages 220–225. IEEE, 2008.
11. Hyunsung Lee, Seong Hoon Jeong, and Huy Kang Kim. Otids: A novel intrusion
detection system for in-vehicle network by using remote frame. In 2017 15th Annual
Conference on Privacy, Security and Trust (PST), pages 57–5709. IEEE, 2017.
12. Kyong-Tak Cho and Kang G Shin. Fingerprinting electronic control units for
vehicle intrusion detection. In 25th {USENIX} Security Symposium Security 16).
13. Wonsuk Choi, Kyungho Joo, Hyo Jin Jo, Moon Chan Park, and Dong Hoon Lee.
Voltageids: Low-level communication characteristics for automotive intrusion de-
tection system. IEEE Transactions on Information Forensics and Security, 2018.
14. Marcel Kneib and Christopher Huth. Scission: Signal characteristic-based sender
identification and intrusion detection in automotive networks. In Proceedings of
the 2018 ACM SIGSAC Conference on Computer and Communications Security.
15. Vipin Kukkala, Sooryaa Vignesh Thiruloga, and Sudeep Pasricha. Indra: Intrusion
detection using recurrent autoencoders in automotive embedded systems. IEEE
Transactions on Computer-Aided Design of Integrated Circuits and Systems, 2020.
16. Vipin Kumar Kukkala, Sooryaa Vignesh Thiruloga, and Sudeep Pasricha. Latte: L
stm self-att ention based anomaly detection in e mbedded automotive platforms.
ACM Transactions on Embedded Computing Systems (TECS), 20(5s):1–23, 2021.
17. Pablo Moriano, Robert A Bridges, and Michael D Iannacone. Detecting can mas-
querade attacks with signal clustering similarity. In Workshop on Automotive and
Autonomous Vehicle Security (AutoSec), 2022.