CAN BUS PROTECTION SYSTEM AND METHOD
The described system enhances CAN bus security by analyzing message traffic to detect anomalies and malicious code, addressing the vulnerability of unauthorized access and firmware hacking, thereby improving vehicle safety and security.
Patent Information
- Application Number
- JP2022504153
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-07-25
- Filing Date
- 2020-07-22
- Publication Date
- 2024-10-04
- Estimated Expiration
- 2040-07-22
AI Technical Summary
The open architecture of the Controller Area Network (CAN) bus in vehicles allows unauthorized access and malicious activities, including data theft and potentially dangerous control actions, due to the lack of message authentication and the potential for firmware hacking through CAN-TP transmissions.
An electronic device with an electronic processor and storage medium that extracts and analyzes CAN bus message traffic to identify anomalies, infers signal formats, and detects unauthorized firmware updates or malicious code by recognizing machine language instructions, generating alerts for suspicious activity.
Enhances security by detecting and preventing unauthorized actions on the CAN bus, reducing the risk of malicious firmware updates and code execution in ECUs, thereby improving vehicle safety and security.
Smart Images

Figure 0007561825000002 
Figure 0007561825000003 
Figure 0007561825000004
Abstract
Description
[Technical field]
[0001] (CROSS REFERENCE TO RELATED APPLICATIONS) This application claims the benefit of U.S. Provisional Patent Application No. 62 / 878,419, filed July 25, 2019, and entitled “CAN BUS PROTECTION SYSTEMS AND METHODS,” which is incorporated by reference in its entirety herein.
[0002] The following relates to electronic data network security technologies, controller area network (CAN) security technologies, electronic control unit (ECU) security technologies, ground vehicle electronic security technologies, water vehicle electronic security technologies, space vehicle electronic security technologies, and the like. [Background technology]
[0003] (background) Modern vehicles employ modularized electronic components such as anti-brake system (ABS) modules, engine control modules, and modules for controlling steering, throttle, cruise control, climate control systems, and various other vehicle functions. These modules communicate with each other using a CAN bus. Auxiliary systems such as vehicle entertainment systems, navigation systems, and the like also sometimes include ECUs connected to the CAN bus. Communication over the CAN bus at the application layer consists of an arbitration identifier (ARB ID) and up to eight data bytes. The ARB ID indicates the meaning of the data contained in the message. For example, wheel speed may be contained on ARB ID 0x354 with two bytes of data representing the rotational speed of each of the four wheels. All ECUs on the vehicle that have a need to know wheel speed are programmed to associate ARB ID 0x354 with wheel speed. The information carried by the data bytes is referred to as a signal. With a maximum of eight bytes per message, a single message can carry up to eight bytes of any signal. Furthermore, a single message can carry more than one signal (up to eight signals, each consisting of a single byte) if each individual signal is represented by fewer than eight bytes. Conversely, a signal requiring more than eight bytes can be carried by more than one message. An example of such a situation is sending a firmware update to an ECU. A firmware update may be considered a single signal, but may consist of hundreds, thousands, or even more bytes. To address such situations, an application layer CAN protocol known as the CAN-TP protocol ("TP" stands for "Transport Protocol") allows for sending longer signals, such as firmware updates, via multiple messages. The international standard ISO 15765-2 (also known as ISO-TP) is a common implementation of the CAN-TP protocol, however, other protocols exist that achieve the same functionality.
[0004] CAN bus advantageously allows for the ad-hoc addition of new electronic components, which is ideal for automobile manufacturers who sell vehicles in a variety of models with different features, as well as for aftermarket manufacturers supplying aftermarket sound systems (for example).
[0005] However, this open architecture introduces security challenges. Any ECU on the CAN bus (or more generally, any electronic device on the CAN bus) can be connected to the CAN bus (or an ECU already connected to the CAN bus can be compromised) and then transmit messages on the CAN bus that are received by all ECUs or other electronic devices on the CAN bus. The messages do not include authentication to identify the sender in a secure manner. Thus, there is no barrier to a device being added to the CAN bus (or an existing device being compromised to be so programmed) that is programmed to mimic legitimate transmissions by adopting the same ARB ID header and payload format used in legitimate transmissions, thereby performing unauthorized, potentially malicious activities over the CAN bus. Such malicious activities can range from unauthorized collection of data to potentially life-threatening actions such as inducing dangerous throttle or braking actions. With the large payload capacity of CAN-TP transmissions, there is even the potential to transmit malicious code to an ECU, thereby hacking the ECU's firmware and reprogramming it to perform malicious acts.
[0006] No. 9,792,435 to Harris et al., issued on October 17, 2017 and entitled "Anomaly Detection for Vehicular Networks for Intrusion and Malfunction Detection," is incorporated herein by reference in its entirety. No. 10,083,071 to Sonalker et al., issued on September 25, 2018 and entitled "Temporal Anomaly Detection on Automotive Networks," is incorporated herein by reference in its entirety. These patents describe several approaches for detecting anomalous messaging on a CAN bus, thereby providing an alert of potentially malicious activity on the CAN bus. Thus, certain improvements to the security and responsiveness of the CAN architecture are provided herein. [Prior art documents] [Patent documents]
[0007] [Patent Document 1] U.S. Patent No. 9,792,435 [Patent Document 2] U.S. Patent No. 10,083,071 Summary of the Invention [Means for solving the problem]
[0008] (Brief summary) According to certain demonstrative embodiments disclosed herein, an electronic device includes an electronic processor communicatively coupled to a controller area network (CAN) bus and a non-transitory storage medium storing a descriptor file representing a plurality of CAN bus protocols and instructions readable and executable by the electronic processor to implement a CAN bus security method, the method including extracting signals from CAN bus message traffic on the CAN bus, each extracted signal conforming to one of the plurality of CAN bus protocols, detecting anomalies in the extracted signals, and generating an alert indicative of the detected anomaly.
[0009] In some embodiments, the electronic device of the immediately preceding paragraph further comprises electronic equipment configured to perform a CAN bus signal format inference method including: extracting candidate signals from the training CAN bus message traffic, each candidate signal being a repeating time sequence of ordered groups of data bits in the CAN bus message traffic, the ordered groups of data bits being delimited by one or more message headers; defining one or more signals, each signal being a candidate signal that matches structural characteristics of a matching data type, each signal being assigned the matching data type; and generating a descriptor file representing an inferred CAN bus signal format to which the defined one or more signals conform. The multiple CAN bus protocols referred to in the immediately preceding paragraph then include the inferred CAN bus signal format. The electronic device may comprise an electronic processor and the non-transitory storage medium of the immediately preceding paragraph, the storage medium further storing instructions readable and executable by the electronic processor to perform the CAN bus signal format inference method, and / or may comprise a training electronic processor distinct from the electronic processor of the immediately preceding paragraph, and a training non-transitory storage medium distinct from the non-transitory storage medium of the immediately preceding paragraph, the training storage medium storing instructions readable and executable by the training electronic processor to perform the CAN bus signal format inference method.
[0010] According to certain demonstrative embodiments disclosed herein, a non-transitory storage medium stores instructions readable and executable by at least one electronic processor to implement a CAN bus signal format inference method including extracting candidate signals from training CAN bus message traffic, where each candidate signal is a repeating time sequence of ordered groups of data bits in the CAN bus message traffic, where the ordered groups of data bits are delimited by one or more message headers; defining one or more signals, where each signal is a candidate signal that matches structural characteristics of a matching data type, where each signal is assigned a matching data type; and generating an inferred CAN bus signal format to which the defined one or more signals conform.
[0011] According to some illustrative embodiments disclosed herein, an electronic device comprises an electronic processor connectable to a controller area network (CAN) bus, and a non-transitory storage medium storing (i) one or more machine language instruction sets, each machine language instruction set comprising a set of opcodes, and (ii) instructions readable and executable by the electronic processor to implement a CAN bus security method. The method includes extracting transport protocol (TP) signals comprising data bytes of a plurality of messages conforming to the CAN TP protocol from CAN bus message traffic on the CAN bus, determining, for each machine language instruction set of the one or more machine language instruction sets, a percentage of the TP signals that match an opcode of the machine language instruction set, and detecting an anomaly based, at least in part, on at least one of the determined percentages exceeding an opcode anomaly threshold. The present specification also provides, for example, the following items: (Item 1) 1. An electronic device comprising: an electronic processor communicatively coupled to a controller area network (CAN) bus; 1. A non-transitory storage medium storing a descriptor file representing a plurality of CAN bus protocols and instructions readable and executable by the electronic processor for implementing a CAN bus security method, the method comprising: extracting signals from CAN bus message traffic on the CAN bus, each extracted signal conforming to one of the plurality of CAN bus protocols; Detecting anomalies in the extracted signal; and generating an alert indicative of the detected anomaly; and A non-transitory storage medium, An electronic device comprising: (Item 2) extracting candidate signals from training CAN bus message traffic, each candidate signal being a repeating time sequence of ordered groups of data bits in the CAN bus message traffic, the ordered groups of data bits being delimited by one or more message headers; defining one or more signals, each signal being a candidate signal that matches structural characteristics of a matching data type, each signal being assigned said matching data type; generating a descriptor file representing an inferred CAN bus signal format to which the defined one or more signals conform; and an electronic device configured to implement a CAN bus signal format inference method, comprising: the plurality of CAN bus protocols includes the inferred CAN bus signal format; 2. The electronic device of claim 1, wherein the electronic device comprises at least one of: (i) the electronic processor and the non-transitory storage medium further storing instructions readable and executable by the electronic processor to perform the CAN bus signal format inference method; and / or (ii) a training electronic processor distinct from the electronic processor and a training non-transitory storage medium distinct from the non-transitory storage medium and storing instructions readable and executable by the training electronic processor to perform the CAN bus signal format inference method. (Item 3) Defining the one or more signals further comprises: 3. The electronic device of claim 2, further comprising: defining a signal assigned a counter data type as a candidate signal that matches a structural characteristic of the counter data type in which the values of the ordered group of data bits defined by the counter data type are monotonically increasing or monotonically decreasing over a time sequence of the ordered group of data bits. (Item 4) Defining the one or more signals further comprises: The electronic device of any one of claims 2-3, further comprising defining a signal assigned a constant data type as a candidate signal that matches a structural characteristic of the constant data type, in which values of ordered groups of data bits are constant over a time sequence of ordered groups of data bits. (Item 5) Defining the one or more signals further comprises: A signal assigned a floating-point data type with an exponent and a mantissa is an ordered group of said data bits being 16, 32, or 64 bits; a first subset of the ordered groups of data bits representing an exponent of the floating-point data type having lower entropy over the time sequence than a second subset of the ordered groups of data bits representing a mantissa of the floating-point data type; The electronic device of any one of items 2-4, further comprising: defining as a candidate signal that matches structural characteristics of the floating-point data type, the candidate signal including: (Item 6) Defining the one or more signals further comprises: Signals assigned an integer data type can be an ordered group of said data bits being 4, 8, 12, 16, or 32 bits; a first subset of the ordered groups of the data bits representing most significant bits of the integer data type having lower entropy over the time sequence than a second subset of the ordered groups of the data bits representing least significant bits of the integer data type; The electronic device of any one of items 2-5, further comprising: defining as candidate signals that match structural characteristics of the integer data type, the integer data type including: (Item 7) Defining the signal assigned the integer data type comprises: values of the ordered group of data bits defined by the integer data type having continuity across the time sequence satisfying a continuity criterion; the values of the ordered group of data bits defined by the integer data type having continuity across the time sequence that satisfies an entropy criterion; 7. The electronic device of claim 6, further comprising: (Item 8) Defining the one or more signals further comprises: 8. The electronic device of claim 2, further comprising: defining a signal assigned a bit field data type as a candidate signal that matches a structural characteristic of the bit field data type, in which a value of an ordered group of data bits indicates a binary state. (Item 9) The extracting is performed over an initial time interval; 9. The electronic device of claim 1, wherein the detecting includes detecting a deviation of one of the extracted signals from conforming to one of the plurality of CAN bus protocols over subsequent time intervals following the initial time interval. (Item 10) 10. The electronic device of any one of claims 1-9, wherein the descriptor file is a DBC file. (Item 11) The non-transitory storage medium further stores one or more machine language instruction sets, each machine language instruction set having a set of opcodes; The extracting includes extracting a transport protocol (TP) signal comprising data bytes of a plurality of messages conforming to a CAN-TP protocol; The detecting comprises: determining, for each of the one or more instruction sets, a percentage of the TP signals that match an opcode of the instruction set; detecting an anomaly based, at least in part, on at least one of the determined percentages exceeding an opcode anomaly threshold; and 11. The electronic device according to any one of items 1 to 10, comprising: (Item 12) 1. An electronic device comprising: an electronic processor communicatively coupled to a controller area network (CAN) bus; 1. A non-transitory storage medium storing: (i) one or more machine language instruction sets, each machine language instruction set having a set of opcodes; and (ii) instructions readable and executable by the electronic processor for implementing a CAN bus security method, the method comprising: extracting a transport protocol (TP) signal comprising data bytes of a plurality of messages conforming to a CAN-TP protocol from CAN bus message traffic on the CAN bus; determining, for each of the one or more instruction sets, a percentage of the TP signals that match an opcode of the instruction set; detecting an anomaly based, at least in part, on at least one of the determined percentages exceeding an opcode anomaly threshold; and A non-transitory storage medium, An electronic device comprising: (Item 13) The detecting comprises: Item 13. The electronic device of item 12, further comprising: performing endian correction on bytes of the TP signal before matching the TP signal with an opcode of the machine language instruction set. (Item 14) The detecting comprises: 14. The electronic device of claim 12, further comprising: performing a byte rotation on bytes of the TP signal before matching the TP signal with an opcode of the machine language instruction set. (Item 15) The detecting comprises: 15. The electronic device of any one of claims 12-14, further comprising: detecting an anomaly when (I) at least one of the determined percentages exceeds an opcode anomaly threshold; and (II) the TP signal is not identified as an authorized firmware update. (Item 16) 1. A non-transitory storage medium storing instructions readable and executable by at least one electronic processor for implementing a CAN bus signal format inference method, the method comprising: extracting candidate signals from training CAN bus message traffic, each candidate signal being a repeating time sequence of ordered groups of data bits in the CAN bus message traffic, the ordered groups of data bits being delimited by one or more message headers; defining one or more signals, each signal being a candidate signal that matches structural characteristics of a matching data type, each signal being assigned said matching data type; generating an inferred CAN bus protocol to which the defined one or more signals conform; and A non-transitory storage medium, including (Item 17) Defining the one or more signals further comprises: 17. The non-transitory storage medium of claim 16, further comprising: defining a signal assigned a counter data type as a candidate signal that matches a structural characteristic of the counter data type in which the values of the ordered group of data bits defined by the counter data type are monotonically increasing or monotonically decreasing over a time sequence of the ordered group of data bits. (Item 18) Defining the one or more signals further comprises: 18. The non-transitory storage medium of any one of items 16-17, further comprising defining a signal assigned a constant data type as a candidate signal that matches a structural characteristic of the constant data type, in which values of ordered groups of data bits are constant over a time sequence of ordered groups of data bits. (Item 19) Defining the one or more signals further comprises: A signal assigned a floating-point data type with an exponent and a mantissa is an ordered group of said data bits being 16, 32, or 64 bits; a first subset of the ordered groups of data bits representing an exponent of the floating-point data type having lower entropy over the time sequence than a second subset of the ordered groups of data bits representing a mantissa of the floating-point data type; 19. The non-transitory storage medium of any one of items 16-18, further comprising: defining as a candidate signal that matches structural characteristics of the floating-point data type, the candidate signal including: (Item 20) Defining the one or more signals further comprises: Signals assigned an integer data type can be an ordered group of said data bits being 4, 8, 12, 16, or 32 bits; a first subset of the ordered groups of the data bits representing most significant bits of the integer data type having lower entropy over the time sequence than a second subset of the ordered groups of the data bits representing least significant bits of the integer data type; 20. The non-transitory storage medium of any one of items 16-19, further comprising: defining as a candidate signal that matches structural characteristics of the integer data type, the integer data type including: (Item 21) Defining the signal assigned the integer data type comprises: values of the ordered group of data bits defined by the integer data type having continuity across the time sequence satisfying a continuity criterion; the values of the ordered group of data bits defined by the integer data type having continuity across the time sequence that satisfies an entropy criterion; 21. The non-transitory storage medium of claim 20, further comprising: (Item 22) Defining the one or more signals further comprises: 20. The non-transitory storage medium of any one of claims 16-19, further comprising defining a signal assigned a bit field data type as a candidate signal that matches a structural characteristic of the bit field data type, in which values of an ordered group of data bits indicate binary states. (Item 23) extracting a signal from CAN bus message traffic on a CAN bus, the extracted signal conforming to the inferred CAN bus protocol; detecting anomalies in the extracted signal; and generating an alert indicative of the detected anomaly; and 23. The non-transitory storage medium of any one of items 16-22, further storing instructions readable and executable by at least one electronic processor to implement a CAN bus signal format inference method, comprising: [Brief description of the drawings]
[0012] Any quantitative dimensions shown in the drawings are to be understood as non-limiting illustrative examples. Unless otherwise indicated, the drawings are not to scale, and if any aspect of the drawings is shown as being to scale, the depicted scale is to be understood as a non-limiting illustrative example.
[0013] [Figure 1]FIG. 1 presents a schematic representation of a vehicle having a CAN bus and a functional diagram of one ECU on the CAN bus that implements an embodiment of anomaly detection as disclosed herein.
[0014] [Diagram 2] FIG. 2 diagrammatically illustrates an example embodiment of the unique CAN bus signal format inference block of FIG.
[0015] [Diagram 3] FIG. 3 diagrammatically shows an illustrative embodiment of the signal extraction block of FIG.
[0016] [Figure 4] FIG. 4 diagrammatically illustrates an illustrative embodiment of the opcode detector block of FIG.
[0017] [Diagram 5] FIG. 5 diagrammatically illustrates an expanded representation of the opcode detector shown in FIG. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0018] (Detailed Description) The goal of anomaly detection in the context of CAN bus security is to detect anomalous messages on the CAN bus that may be considered suspicious. This approach is adopted because the information content of CAN bus messages is generally unknown from the perspective of a typical security component monitoring traffic on the CAN bus. Thus, detection of unusual, i.e., anomalous, messages serves as a proxy for knowledge-based detection of information content. Additionally, detected anomalies may represent an indication of component failure and be associated with maintenance issues.
[0019] CAN bus provides a physical transport layer that can support a wide range of higher layer signal formats. The signal format of a signal identifies the message header associated with the signal (e.g., a specific ARB ID or part thereof) and defines the structural representation to which the signal conforms. The structural representation typically includes a data type (e.g., counter, constant, integer, floating point) and associated properties such as byte count, endianness, etc. Some of these higher layer signal formats are published protocols where the signal format is publicly available as a DBC file or other signal format storage. Some examples of published CAN bus protocols include SAE J1939, ISO14229, MilCAN, etc. Even in the case of published CAN bus protocols, anomaly detection is difficult because the information content of the messages is not always known, for example when parts of the published protocol are reserved for proprietary data. Nevertheless, knowledge of the published protocol provides information about the signal format of the signal being conveyed. For example, knowledge of a published protocol allows anomaly detection to recognize that a given set of data bytes in a message represents a signal of an integer data type (or a floating point data type, etc.) This knowledge allows for more sophisticated anomaly detection, such as based on unexpected signal values.
[0020] However, some ECUs communicate on the CAN bus using proprietary signals whose signal formats are not publicly known. In this case, not only is the information content unknown, but even the signal format is unknown. This substantially increases the challenges for anomaly detection. Signal-independent anomaly detectors such as those disclosed in U.S. Pat. No. 9,792,435 to Harris et al. and U.S. Pat. No. 10,083,071 to Sonalker et al. can be constructed. However, additional information about the signals and their signal formats would enable more advanced anomaly detection.
[0021] Some anomaly detection approaches disclosed herein leverage the insight made herein that knowledge of how data is generally structured can be used to infer structure within proprietary messages. By inferring structure, the underlying data is treated as structured data, including the identities of the signals carried within the CAN bus message and the data types of the signals. This knowledge of structure can reduce training time and increase the effectiveness of downstream anomaly detection algorithms. The disclosed approach for signal extraction is applicable to proprietary signal formats where the underlying data is structured (i.e., composed of signals of a specified signal format), but whose structure is unknown. The disclosed signal extraction does not extract the information content of the underlying data, but rather extracts signals and their data types. The signal extraction is trained on CAN bus traffic, and this training can be done offline and / or online (e.g., adaptive training to fine-tune the signal extraction in real time). The method can still work if the messages on the CAN bus are encrypted, provided that a decryption key is present and the messages and / or signals are decrypted prior to or during the signal extraction stage.
[0022] A particularly relevant modality of malicious attack is the potential delivery of executable code to the ECU in a manner that causes the ECU to execute the code. This can be done in a variety of ways. In one approach, if the ECU firmware is updatable over the CAN bus, for example using CAN-TP, an attacker can transmit an unauthorized firmware update to the ECU, which follows a design-based protocol for firmware updates over the CAN bus. In another approach, CAN-TP can transmit large blocks of executable code that lead to stack overflows or other memory leaks in a poorly designed ECU processing architecture, and the overflowed or memory-leaked executable code can then be executed by the ECU. These are merely some non-limiting examples of this type of attack.
[0023] Some anomaly detection approaches disclosed herein are designed to detect anomalies that may be certain attempts to transmit illegal executable code to an ECU for the purpose of causing it to execute the illegal code. These approaches include identifying a block of data type transmitted under the CAN-TP protocol and then searching the data bytes for an opcode of a machine language instruction set. The machine language instruction set may be, for example, an instruction set of a central processing unit (CPU) architecture or an instruction set of a virtual machine architecture such as a Java Virtual Machine (JVM), etc. It should be understood that these opcode detector approaches may be usefully combined with the signal extraction approaches also disclosed herein to extend the application of the opcode detector to protocols such as CAN-TP that cause the aggregation of message data in the processor's memory. However, the disclosed opcode detector approaches may also be used without signal extraction and the opcode detector may be limited to published CAN-TP protocols such as ISO 15765-2.
[0024] Referring to FIG. 1, a vehicle 10 includes a controller area network (CAN) bus 12 to which several electronic control units (ECUs) 14 are connected. More generally, the vehicle 10 may be a ground vehicle (e.g., an automobile 10 as shown, or a truck, an off-road vehicle, a motorcycle, a bus, or the like), a water vehicle (e.g., an ocean-going vessel, a submarine, or the like), or a space vehicle (e.g., an orbiting satellite, an interplanetary probe, or the like). More generally, an ECU may be any electronic device that is connected to the CAN bus or other network 12, such as an engine control module, an ABS module, a power steering module, and / or other vehicle operation related electronic devices, a car stereo or other in-vehicle entertainment system, a radio transceiver used for outside-vehicle communication (e.g., a communications satellite transceiver), a vehicle climate control module, etc. The CAN bus 12 is a promiscuous network in that traffic on the CAN bus is received by all electronic devices on the CAN bus and traffic on the CAN bus does not include message authentication. Message authentication in this context is information contained within a message or within the architecture of a network by which a receiving device may verify the source of the message. The CAN bus does not provide message authentication. A message on the CAN bus comprises a payload and a message header. In many cases, the header is the arbitration identifier (ARB ID) itself. However, there are situations where the ARB ID contains additional information that is not considered part of the header for signal extraction and identification purposes, such as the J-1939 ARB ID that contains three priority bits.
[0025] Continuing with reference to FIG. 1, at least one protection ECU 14 prot (or more generally, electronic devices 14 on a CAN bus 12 prot ) includes anomaly detection capabilities as shown diagrammatically in FIG. protThe ECU 14 includes an electronic processor 20 and a non-transitory storage medium 22 that stores instructions readable and executable by the electronic processor 20. The hardware components 20, 22 may be implemented in a variety of ways. For example, in some embodiments, the electronic processor 20 and the non-transitory storage medium 22 may be separate integrated circuit (IC) chips disposed on a printed circuit board (PCB, not shown), with conductive traces of the PCB operatively connecting the processor 20 and the storage medium 22. As some examples, the electronic processor 20 may comprise a microprocessor or microcontroller IC chip, and the non-transitory storage medium 22 may comprise a memory IC chip, such as a flash memory chip, a read-only memory (ROM) IC chip, an electronically programmable read-only memory (EPROM) IC chip, or the like. In other embodiments, the electronic processor 20 and the non-transitory storage medium 22 may be monolithically integrated as a single IC chip. As some examples, the ECU 14 may include a microprocessor or microcontroller IC chip, and the non-transitory storage medium 22 may comprise a memory IC chip, such as a flash memory chip, a read-only memory (ROM) IC chip, an electronically programmable read-only memory (EPROM) IC chip, or the like. In other embodiments, the electronic processor 20 and the non-transitory storage medium 22 may be monolithically integrated as a single IC chip. prot The ECU 14 is implemented as an application specific integrated circuit (ASIC) chip or a field programmable gate array (FPGA) chip, with both the storage device and the digital processor being monolithically fabricated on a single ASIC or FPGA. prot receives CAN traffic 26 from the CAN bus 12.
[0026] Continuing with reference to FIG. 1 , the instructions stored on the non-transitory storage medium 22 are readable and executable by the electronic processor 20 to perform the signal extraction 30 as disclosed herein, to implement one or more anomaly detectors 32 (e.g., a time anomaly detector, a per-message anomaly detector, an illustrative opcode detector 34, etc.), and to implement alerting and / or logging 36 of anomalies detected by the anomaly detectors 32. The signal extraction 30 utilizes a standard DBC file 40, which stores signal formats related to the published CAN bus protocol. (More generally, other file formats besides DBC are contemplated for storing standard protocol signal formats.) In addition, the signal extraction 30 utilizes a proprietary DBC file 42, which stores proprietary CAN bus signal formats inferred from analysis of CAN bus traffic as disclosed herein. The standard and proprietary DBC files 40, 42 are suitably stored on the non-transitory storage medium 22.
[0027] In some embodiments, the instructions stored on the non-transitory storage medium 22 are further readable and executable by the electronic processor 20 to perform a unique CAN bus signal format inference 44 as disclosed herein and to generate a unique DBC file 42. In other embodiments, the disclosed unique CAN bus signal format inference 44 is performed offline, i.e., by some other electronic processor (e.g., a desktop computer, a server computer, etc.), to generate a unique DBC file 42, which is then transmitted to the ECU 14 via the CAN bus 12 or by another transfer mechanism. prot (e.g., prior to its installation on the vehicle 10, prot20) and stored on the non-transitory storage medium 22 for access by the signal extraction 30 executing on the electronic processor 20. In yet other embodiments, a combination of these two approaches may be employed, for example, an instance of a proprietary CAN bus signal format inference may be performed offline to generate an initial proprietary DBC file 42, which is subsequently updated in real time by an instance of a proprietary CAN bus signal format inference 44 executed by the electronic processor 20 during operation of the vehicle 10.
[0028] Additionally, the opcode detector 34 utilizes a database of machine language instruction sets 46, which stores instruction sets for various CPU and / or virtual machine architectures that may reliably be expected to be deployed in ECUs connected to the CAN bus 12. Some typical CPU architectures include (as non-limiting illustrative examples) CPU architectures such as Intel x86, 8051, ARM A32, T32, A64, various RISC and SPARC architectures, etc. The machine language instruction set for a CPU architecture identifies opcodes that are recognized and executable by a CPU conforming to that CPU architecture. Similarly, virtual machines such as the Java Virtual Machine (JVM) employ instructions, sometimes referred to as bytecodes or some other similar name. The machine language instruction set for a CPU or virtual machine architecture identifies opcodes that are recognized and executable by a CPU or virtual machine conforming to that architecture. In general, a machine language instruction executable by a CPU or virtual machine consists of an opcode and an operand. The opcode identifies the operation to be performed, and the operand provides any data required for the execution of the opcode. (Some opcodes may not have any associated operands.) Any given CPU or virtual machine architecture will recognize and be able to execute a finite set of opcodes, which are identified in a database of machine language instruction sets 46, suitably stored on non-transitory storage medium 22.
[0029] In some embodiments, the ECU 14 prot is a dedicated electronic device that performs only anomaly detection. prot is an ECU that performs some other function (e.g., ECU14 prot(eg, the instructions stored on the non-transitory storage medium 22 may be an ABS module for controlling anti-lock braking, a cruise control module, etc.). In such an embodiment, the instructions stored on the non-transitory storage medium 22 are further readable and executable by the electronic processor 20 to perform ECU functional operations 48, such as ABS module functionality for controlling anti-lock braking, etc. As shown diagrammatically in FIG. 1, the ECU functional operations 48 may in some cases generate messages that are transmitted over the CAN bus 12, i.e., the ECU functional operations 48 may inject messages into the CAN traffic 26. Typically, these outgoing messages are not processed by operations 30, 32, 34, 36 (but may alternatively be processed by, e.g., the ECU 14). prot It is also envisioned that the ECU itself may be hacked to modify its performance of the ECU functional operations 48 by processing outgoing messages via operations 30, 32, 34, 36).
[0030] The term "signal" in the context of the CAN bus is a single, self-contained unit of data. A signal can be a sensor measurement of one variable, e.g., engine coolant temperature. It can also be a digital command, e.g., a torque request. Multiple signals can be present in a single message, such as four 8-bit tire pressure signals in a single CAN message. Or a signal can be present in multiple messages, such as when the J-1939 transport protocol is used to transfer a firmware update. A firmware update can be considered as a single signal transmitted over the CAN-TP protocol. More generally, a signal is basic information. A signal does not contain a supporting signal format or headers.
[0031] The signal extraction has two regimes: a training regime corresponding to the unique CAN bus signal format inference 44, and an operational regime corresponding to the signal extraction 30. In one embodiment, the training is performed prior to deployment on a corpus of CAN bus traffic, preferably encompassing the expected operational envelope of the CAN bus on which the signal extraction 30 will subsequently be deployed. In another embodiment, the training is performed online after installation and prior to the security device being activated. A third embodiment combines these two options by performing pre-deployment training followed by ongoing adaptive update training during deployment. The training (i.e., the unique CAN bus signal format inference 44) identifies structures in the CAN bus traffic. The operational regime (i.e., the signal extraction 30) utilizes the trained structures to extract signals in real time from the raw data stream. These two regimes communicate through the non-volatile storage medium 22. The illustrative embodiment uses a descriptor file, a commonly adopted format for the CAN bus protocol, namely the DBC format produced by Vector Informatik GmbH. However, other descriptor file formats, such as JSON or XML, may be employed. During training, the identified signal formats for the unique signals are written to a descriptor file for each signal format. Also, note that unique CAN bus signal format inference 44 is so referred to because typically the unknown CAN bus signal whose signal format needs to be inferred is the unique signal format. However, more generally, unique CAN bus signal format inference 44 can be used to infer the signal format of any CAN bus signal for which the signal format is unavailable, regardless of the reason the signal format is not available.
[0032] 2, an illustrative embodiment of the proprietary CAN bus signal format inference 44 is described. The output of the proprietary CAN bus signal format inference 44 is a descriptor file, shown as a DBC file 42, that provides operational data 50. FIG. 2 also illustrates the handling of protocol-based non-proprietary signals whose signal format does not need to be inferred. These standard DBC files 40 are explicitly programmed from the protocol definition and transcribed (52) into the descriptor file 40, for example, through manual programming, purchasing information in a transcribed format, automated extraction from protocol documentation, etc. In the non-limiting illustrative example of FIG. 2, the standard DBC files 40 include DBC files for standards MICAN 54, J1939 56, and ISO14229 58.
[0033] Continuing with reference to FIG. 2, the illustrative unique CAN bus signal format inference 44 provides automated signal format identification that is trained on training CAN bus data 60, which includes unique signals in the signal format to be inferred. The input training CAN bus data 60 is preferably collected from an instrumented platform or hardware in a loop simulation spanning the expected operating envelope. The training CAN bus data 60 should capture enough of all signal movement to identify the full data width. The training CAN bus data 60 does not need to be complete; for example, if a signal is defined as 16 bits, but the most significant 4 bits are never triggered and are effectively unmeasurable, successful identification only needs to register 12 bits. The unique CAN bus signal format inference 44 takes the raw data 60 and performs a programmatic reverse engineering step to find the signal format. In operation 62, candidate signals are extracted from the training CAN bus message traffic 60. Each candidate signal is a time sequence of repetitions (i.e., repeated broadcasts) of ordered groups of data bits within the CAN bus message traffic 60, where the ordered groups of data bits are delimited by one or more message headers. In operation 64, one or more signals are defined. Each signal is a candidate signal that matches the structural characteristics of a matching data type, and each signal is assigned a matching data type. Below, the processing of operation 64 is described with respect to the non-limiting examples of a counter data type, a constant data type, a floating point data type, an integer data type, and a bit field data type.
[0034] A signal assigned a counter data type is defined as a candidate signal that meets the structural characteristics of the counter data type, where the value of the ordered group of data bits defined by the counter data type is monotonically increasing or monotonically decreasing over the time sequence of the ordered group of data bits (i.e., with successive broadcasts). A counter is a monotonically increasing or decreasing field. Generally, these values are used to ensure active communication by a module and to ensure that a module is not temporarily taken off the network, causing a skip in values, or that a thread does not freeze and send repeated values. Counters are identified by looking for a constant difference between the broadcasts of the signal. Rollovers (i.e., when a value crosses either a maximum or minimum value) can be handled by identifying a monolithic increase or decrease over a subinterval of the time sequence. The width of the counter is inferred by first finding the alternating bits that represent the least significant bits of the counter. The next most significant bits are searched adjacent to the first bit by identifying the bit that changes with every second change of the first bit. Depending on the endianness, this change can be in the leading or trailing bit. The second bit defines the endianness; in the big-endian case, the second bit will precede the first, and in the little-endian case, the second bit will follow the first. After identifying the second bit of the counter, the search continues in either the little-endian or big-endian direction as defined by the second bit, until the pattern of bits no longer changes with all other changes in the preceding bits. Counters can range in size from a single bit to multiple bytes.
[0035] A signal assigned a constant data type is defined as a candidate signal that meets the structural characteristic of a constant data type, where the value of an ordered group of data bits is constant over the time sequence of the ordered group of data bits (i.e., over repeated broadcasts). Finding a signal with a constant data type value involves identifying a candidate signal where the set of bits that make up the ordered group of data bits never changes. The constant value may be an empty placeholder, or it may be a signal that is not triggered under normal conditions. If it is the latter, identifying a change in the constant signal would be an anomaly that is easily detected once the constant signal is recognized. Some examples of constant signals include device serial numbers, software versions, or identification numbers. A signal that may be inferred as a constant may in fact represent a signal with information that changes, however, that is not triggered under normal circumstances. For example, a signal may represent the state of an airbag as deployed (represented by a first signal value) or non-deployed (represented by a second signal value). Under trained normal conditions, the signal would be constant (i.e., the second signal value representing the non-deployed state). In the case of an airbag deployment event, the signal changes to a first value and is therefore marked as an anomaly, which is a correct determination in that the vehicle is experiencing an anomaly in expected behavior at the time of deployment.
[0036] Signals assigned a floating-point data type with an exponent and a mantissa are defined as candidate signals that match structural characteristics of the floating-point data type. These structural characteristics include an ordered group of data bits that is 16, 32, or 64 bits, and a first subset of ordered groups of data bits representing the exponent of the floating-point data type that has lower entropy over a time sequence than a second subset of ordered groups of data bits representing the mantissa of the floating-point data type. Floating-point numbers are defined by the IEEE as 16, 32, and 64 bits. Even larger sizes are available, however, it is unlikely that an ECU will use 64 bits or higher precision. Identifying signals of floating-point data type involves finding a smooth low-entropy output through swapping endianness and performing a search. In general, the exponent is expected to change less frequently than the mantissa. From an entropy perspective, the mantissa is expected to be more disordered (i.e., have higher entropy) than the exponent. To see this, consider a floating point value that ranges from 1 to 999. Using exponential notation of the form 0.MMMEXX, where "MMM" represents the mantissa and "XX" represents the exponent, this range can be written as 0.100E01 to 0.999E03. As can be seen, the mantissa essentially ranges throughout the entire range, while the exponent only ranges from 01 to 03. This embodiment employs base 10, while the floating point signals on the CAN bus are binary, i.e., base 2, but the principle remains the same: the mantissa typically has higher entropy than the exponent, and this structural property of the floating point data type is exploited to detect these signals.
[0037] A signal assigned an integer data type is defined as a candidate signal that matches structural characteristics of the integer data type. These structural characteristics include an ordered group of data bits that is 4, 8, 12, 16, or 32 bits, and a first subset of ordered groups of data bits representing the most significant bits of the integer data type that has lower entropy over a time sequence than a second subset of ordered groups of data bits representing the least significant bits of the integer data type. Because data in a platform generally represents measurements or control parameters, the data represents slowly varying values. These slow variations result in a time series history that is smooth with little change between messages. Thus, from an information theory perspective, the data channel (total bits of the signal) is communicating significantly less information per unit time than it is capable of communicating. This characteristic results in a signal with low entropy. When data is misrepresented, lower bits are placed in higher bit positions, resulting in greater signal variability. The signal then appears to change rapidly, resulting in a greater perceived transfer of information per unit time, and therefore a higher entropy. Integer representations typically include various bit sizes, endianness, and sign attributes. The objective is to find the most consistent representation that is smooth with respect to the test data. Each permutation needs to be verified for smoothness, which is achieved via an entropy measurement. Using the time history of the message, each permutation of size and endianness is tested and the best smoothest fit is identified. The smooth fit is often determined numerically using a time series entropy calculation, often referred to as an approximate entropy technique or sample entropy. Here, the approximate entropy calculation is performed with the same parameters for all permutations, resulting in each permutation having a resulting quantitative entropy value. Bit sizes are typically between 4, 8, 12, 16, and 32 bits. Most ECU data that is in integer format is 16 bits or less, with 32 bits often only being used for the clock.There are two forms of signedness, either unsigned or two's complement. Finally, endianness refers to the byte ordering, i.e., which bytes reflect the most significant bit and how those bytes are packed into a message. Byte ordering is a criterion only for those signals with more than 8 bits.
[0038] Signals assigned a bit-field data type are defined as candidate signals that match the structural characteristics of the bit-field data type. A bit-field data type is where a single bit or grouping of single bits represents a binary state. This binary state can be reflected as a subset of bytes in a CAN message, e.g., 0000 0011 can represent the brakes are active and 0000 0000 can represent the brakes are inactive. Alternatively, the message can be 0000 0010 for active or 0000 0001 for inactive. In these aforementioned representations, the leftmost 6 bits can represent other states. To mitigate single-bit errors in memory or transmission, it is common to use more than 1 bit to represent a state. Bit-field detection is done by searching for adjacent bits that always have the same relationship, e.g., equal or unequal, and the value changes at least once in the training data set.
[0039] In order to identify the most consistent representation, different combinations of the aforementioned integer representations are interpreted as signals and then tested for smoothness. More specifically, the test for smoothness involves analyzing the entropy of the interpreted signal and testing it for reasonable continuity as time progresses. Interpretations of the signal that are either too discontinuous or too entropic are deemed invalid. The largest interpretation (in terms of the number of bits required to represent it) is selected as the most likely representation of the integer. In one preferred formulation of the aforementioned, the structural characteristics of the integer data type may further include values of ordered groups of data bits defined by the integer data type that have continuity over time sequences that satisfy a continuity criterion, and values of ordered groups of data bits defined by the integer data type that have continuity over time sequences that satisfy an entropy criterion. If constant data is present in the higher order bits, it is possible for the above method to infer that those bits belong to a signal rather than its own signal. In this way, no errors in anomaly detection are made since constant bit changes would in fact represent anomalous events.
[0040] 2, the one or more signals defined in operation 64 are output to a DBC builder 66 to describe the signal format of the defined signals in DBC files 42. These DBC files 42 store the trained results of the signal format inference stage 44 so that when a CAN message carrying a signal in the inferred signal format is encountered again, the DBC file 42 can be referenced to quickly and correctly interpret the signal. The DBC file is defined to associate a signal with a header and a structural representation of that signal. Anomaly detection extends the common format to also include other features such as expected frequency of receipt, variability of the frequency of receipt, upper and lower limits, and other metadata that aid in identifying anomalies.
[0041] 3, an illustrative embodiment of signal extraction 30 is shown. All branches of control flow are enumerated (each protocol specifically named) to show that some protocols may be layered on top of others. Without loss of generality, protocol detection operation 70 first attempts to identify the protocol being used using one of the standard DBCs 40, and then parses the message with the DBC of the appropriate protocol. For example, MilCAN parser 72 attempts to identify the protocol as MilCAN. If the MilCAN protocol is recognized at decision 74, MilCAN signal extractor 76 selects MilCAN DBC 40. MilCAN Similarly, a J1939 parser 82 attempts to identify the protocol as J1939. If, at decision 84, the J1939 protocol is recognized, a J1939 signal extractor 86 extracts the J1939 DBC 40 J1939 2. The J1939 protocol supports CAN-TP, so J1939 parser 82 may invoke TP aggregator 88 if a J1939 CAN-TP variant is encountered. Similarly, ISO 14229 parser 92 attempts to identify the protocol as ISO 14229. If, upon determination (not shown due to space constraints), the ISO 14229 protocol is recognized, ISO 14229 signal extractor 96 extracts the J1939 DBC40 J19392 ) is applied to extract the signal. Because the ISO 14229 protocol supports CAN-TP, the ISO 14229 parser 92 may invoke the TP aggregator 98 if an ISO 14229 CAN-TP variant is encountered. It should be understood that these are only illustrative examples and that signals employing additional and / or other standard protocols may be extracted as well. If the parsed message is in a proprietary format (and thus does not have a standard DBC), the signal extractor 100 uses the proprietary DBC 42, generated as part of the training phase (described with reference to FIG. 2 ), to extract any available signals and metadata. All extracted signals 102 and metadata 104 (both standard and proprietary) are collected and output to the next stage in the pipeline.
[0042] Referring again to FIG. 1, the extracted signals as described with reference to FIGS. 2 and 3 can be exploited by the anomaly detector 32 in a variety of ways. As previously mentioned, if a signal is identified as being of a constant data type, any deviation of that signal from its expected constant value can be flagged as an anomaly. More generally, the signal extraction 30 may be performed over an initial time interval to extract signals that conform to a particular CAN bus signal format. Some embodiments of the anomaly detector 32 may then operate by detecting any deviation of one of the extracted signals from the conforming CAN bus signal format over subsequent time intervals following the initial time interval as an anomaly.
[0043] As another example, opcode detector 34 may leverage detection of CAN-TP or similar signals to focus opcode detection on these many byte signals because the large payload of such signals provides an opportunity for cyber attacks where malicious machine code can be delivered to the ECU. It is hypothesized that an opcode-based attack would need to transfer a minimum number of opcodes to be effective. Referring again to FIG. 1, in the following, several embodiments of opcode detector 34 are described.
[0044] 4, the opcode detector 34 is configured to detect binary payloads containing machine code transmitted across the CAN bus 12, thus protecting against opcode execution threats. A typical attack on the CAN bus 12 of a vehicle 10 attempting to cause an ECU to execute code is shown diagrammatically in FIG. 4, in which an attacker 110 compromises an ECU or other electronic device 112 on the CAN bus 12 and injects exploit machine code 114 that is received and executed by another ECU or electronic device 116 also on the CAN bus 12. An intrusion detection system (IDS) 120 on the CAN bus 12 (e.g., ECU 14 of FIG. 1) may be configured to detect an opcode execution threat. prot ) also receives malicious payload attempts 114 intended by an attacker 110 to infect the ECU or other electronic components 116. This is because the CAN bus 12 is a promiscuous network in that all devices on the network receive all messages.
[0045] The likelihood that an attacker would leverage an individual CAN message into a code execution exploit is low. Even if poor coding practices somehow allowed the execution of machine code contained within an individual CAN message, only 8 bytes of data would be available for the opcode containing the exploit, commonly known as shellcode. However, when the CAN-TP protocol is used, multiple messages are aggregated into a single signal. This aggregation provides a much larger amount of data, and thus a much greater potential for triggering a vulnerability. As one non-limiting illustrative example of one possible attack, consider an x509 certificate parser where a new certificate should be uploaded to a control module. The certificate is several kilobytes in size. If the certificate is parsed by poorly designed code, this may allow an attacker to embed shellcode into the certificate and then redirect the program flow to that code. As another example, firmware updates may be transmitted to the ECU via the CAN bus 12; as a promiscuous network, there is no barrier for a malicious actor with sufficient knowledge of the firmware update process to craft a illegitimate firmware update that would then be received and executed by the ECU. In general, once the higher level CAN-TP protocol is used to aggregate multiple messages, the risk of code execution through common software vulnerabilities becomes real.
[0046] Continuing with reference to FIG. 4, the output of the signal extraction 30 identifies signals in the CAN-TP protocol or similar signals that are greater than a predetermined number of bytes, e.g., 32. In operation 122, the payloads of the CAN-TP signals are aggregated and queued in queue 124. The extracted payloads are inspected to detect valid opcodes. As previously mentioned, opcodes are machine language instructions of a CPU or virtual machine instruction set that attackers incorporate into malicious "shellcodes" to perform cyber attacks. The promiscuous nature of the CAN bus 12 also allows the IDS 120 to extract these CAN TP payloads and inspect them for a large number of valid opcodes for the CPU or virtual machine architecture used in the ECU or other electronic device on (or potentially on) the CAN bus 12. Opcodes that belong to the instruction set of a CPU or virtual machine are recognized and executable by that CPU or virtual machine; however, because opcodes are binary sequences, they may also occur accidentally in non-malicious messages.
[0047] Considering this, in one approach, the detection of suspicious machine code in a CAN-TP signal comprising data bytes of a plurality of messages conforming to the CAN TP protocol is performed as follows: For each machine language instruction set of one or more machine language instruction sets 46, a proportion of TP signals that match the opcode of the machine language instruction set is determined. This is repeated for each machine language instruction of the set of machine language instruction sets 46, since the CPU or virtual machine architecture that may be the target of a cyber attack is not known a priori. An anomaly is detected based (at least in part) on at least one of the determined proportions exceeding an opcode anomaly threshold. That is, the proportion of messages representing valid opcodes is taken into account, optionally together with other factors such as the continuity of the opcodes, to determine the level of threat. This information is analyzed to generate a confidence measure that is forwarded to the alert engine 36.
[0048] With continuing reference to FIG. 4 and further to FIG. 5, an exemplary implementation of the opcode detector 34 is described in further detail. In operation 130, the bytes of the payload are matched to the opcodes of the machine language instruction set. To do this, the bytes must be interpreted appropriately. Different protocols may affect the endianness and rotation of the opcodes, and operation 130 tests different combinations of endianness and rotation to determine whether there is a byte endianness and rotation that generates a valid code for one of the known architectures (i.e., matches the opcodes of the machine language instruction set). Once these are known, in operation 132, the identified opcodes are analyzed to determine the percentage of the CAN-TP signals that are composed of opcodes of the given machine language instruction set, and optionally other metrics that may establish whether the payload contains suspicious machine code. For example, specific functional measures indicative of attempts to obtain malicious code execution may include metrics of instruction diversity (in addition to the percentage of payloads that are composed of opcodes), stack effects, the percentage of opcodes that are jumps or calls or otherwise operate to move the program counter (PC) or instruction pointer (IP) (depending on the CPU or virtual machine architecture), the percentage of opcodes that implement return operations, and / or the percentage of opcodes that implement software interrupts. Opcodes that move the PC or IP or that implement return or interrupt operations are particularly important because they can be used to redirect program flow to injected malicious code. In operation 134, the percentage of TP signals that match the opcodes of the machine language instruction set, along with other optional metrics, are analyzed to calculate the likelihood that the CAN-TP signal constitutes a cyber attack. If this likelihood exceeds a certain alert threshold, alerting / logging 36 is invoked to log the anomaly. In the illustrative embodiment of FIG. 5, operation 134 calculates the likelihood of a threat as:
number
[0049] In general, the presence of detected machine language content in the CAN-TP signal is critical. However, there may be some instances where the machine language content in the CAN-TP may be non-malicious. For example, when the ECU receives a firmware update over the CAN bus 12, a legitimate firmware update is a non-malicious message that should be received and executed by the ECU. To accommodate these types of situations, an optional decision operation 136 (shown only in FIG. 5 ) checks whether the CAN-TP signal is an authorized firmware update, and an anomaly is flagged only if the CAN-TP signal is not identified as an authorized firmware update. For example, a certificate or other authentication mechanism may be employed, which may be used by the ECU 14 to authenticate the ECU 14. prot and stored therein. If the CAN-TP signal is then determined to contain machine code, but also contains a certificate or other authentication, decision 136 recognizes the authenticated firmware update and does not flag it as anomalous.
[0050] 1, alerting / logging 36 can take a variety of forms, and the type of alert (or whether no alert is issued at all) and / or the anomaly that is logged may depend on the type of anomaly. protThe alert may be displayed on the dashboard of the vehicle 10 (by the ECU controlling the dashboard), the alert may be transmitted to the vehicle manufacturer over a 3G, 4G, 5G, or other cellular or other wireless communication link (assuming the vehicle 10 is equipped with such wireless communication), the alert may be transmitted to the ECU 14 for later reading using a handheld or auto shop based CAN bus code reader, or the alert may be transmitted to the vehicle manufacturer for later reading using a handheld or auto shop based CAN bus code reader. prot It is also possible that the information may be logged in the memory of the device.
[0051] Preferred embodiments have been illustrated and described. Obviously, modifications and alterations will occur to others upon reading and understanding the foregoing detailed description. It is intended that the invention be construed as including all such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.
[0052] It will be understood that variations of the above-disclosed and other features and functions, or alternatives thereof, may be combined into many other different systems or applications. Various presently unforeseen or unanticipated alternatives, modifications, variations, or improvements therein may continue to be made by those skilled in the art, which are also intended to be encompassed by the following claims.
[0053] In order to assist the Patent Office and any readers of this application and any resulting patent in interpreting the claims appended hereto, Applicants do not intend that any of the appended claims or claim elements invoke 35 U.S.C. § 112(f), unless the words "means for" or "step for" are expressly used in a particular claim.
Claims
1. 1. An electronic device comprising: an electronic processor communicatively coupled to a controller area network (CAN) bus; 1. A non-transitory storage medium storing a descriptor file representing a plurality of CAN bus protocols and instructions readable and executable by the electronic processor for implementing a CAN bus security method, the CAN bus security method comprising: extracting signals from CAN bus message traffic on the CAN bus, each extracted signal conforming to one of the plurality of CAN bus protocols; Detecting anomalies in the extracted signal; and generating an alert indicative of the detected anomaly; and A non-transitory storage medium comprising:
1. An electronic device configured to perform a CAN bus signal format inference method, the CAN bus signal format inference method comprising: extracting candidate signals from training CAN bus message traffic, each candidate signal being a repeating time sequence of ordered groups of data bits in the CAN bus message traffic, the ordered groups of data bits being delimited by one or more message headers; defining one or more signals, each signal being a candidate signal matching a structural characteristic of a matching data type, each signal being assigned the matching data type, defining the one or more signals including defining a signal assigned a bit field data type as a candidate signal matching a structural characteristic of the bit field data type, where the value of an ordered group of data bits indicates a binary state; generating a descriptor file representing an inferred CAN bus signal format to which the defined one or more signals conform; Electronic equipment, including Equipped with the plurality of CAN bus protocols includes the inferred CAN bus signal format; The electronic device comprises at least one of: (i) the electronic processor and the non-transitory storage medium further storing instructions readable and executable by the electronic processor to perform the CAN bus signal format inference method; and / or (ii) a training electronic processor distinct from the electronic processor and a training non-transitory storage medium distinct from the non-transitory storage medium and storing instructions readable and executable by the training electronic processor to perform the CAN bus signal format inference method.
2. Defining the one or more signals comprises:
2. The electronic device of claim 1, further comprising: defining a signal assigned a counter data type as a candidate signal that meets a structural characteristic of the counter data type in which the values of the ordered group of data bits defined by the counter data type are monotonically increasing or monotonically decreasing over a time sequence of the ordered group of data bits.
3. Defining the one or more signals comprises: The electronic device of any one of claims 1-2, further comprising defining a signal assigned a constant data type as a candidate signal that meets a structural characteristic of the constant data type, in which values of ordered groups of data bits are constant over a time sequence of ordered groups of data bits.
4. Defining the one or more signals comprises: A signal assigned a floating-point data type with an exponent and a mantissa is an ordered group of said data bits, said group being 16, 32 or 64 bits; a first subset of the ordered groups of the data bits representing an exponent of the floating-point data type having lower entropy over the time sequence than a second subset of the ordered groups of the data bits representing a mantissa of the floating-point data type; 4. The electronic device of claim 1, further comprising: defining as candidate signals that match structural characteristics of the floating-point data type, the candidate signals including:
5. Defining the one or more signals comprises: Signals assigned an integer data type can be an ordered group of said data bits being 4, 8, 12, 16, or 32 bits; a first subset of the ordered groups of the data bits representing most significant bits of the integer data type having lower entropy over the time sequence than a second subset of the ordered groups of the data bits representing least significant bits of the integer data type; 5. The electronic device of claim 1, further comprising: defining as candidate signals that match structural characteristics of the integer data type, the integer data type including:
6. Defining the signal assigned the integer data type comprises: values of the ordered group of data bits defined by the integer data type having continuity across the time sequence satisfying a continuity criterion; the values of the ordered group of data bits defined by the integer data type having continuity across the time sequence that satisfies an entropy criterion; 6. The electronic device of claim 5, conforming to the structural characteristics of the integer data type further comprising:
7. The extracting is performed over an initial time interval; 7. The electronic device of claim 1, wherein the detecting comprises detecting a deviation of one of the extracted signals from conforming to one of the plurality of CAN bus protocols over subsequent time intervals following the initial time interval.
8. An electronic device according to any one of claims 1 to 7, wherein the descriptor file is a DBC file.
9. The non-transitory storage medium further stores one or more machine language instruction sets, each machine language instruction set having a set of opcodes; The extracting includes extracting a CAN-Transport Protocol (TP) signal comprising data bytes of a plurality of messages conforming to a TP protocol; The detecting comprises: determining, for each of the one or more instruction sets, a percentage of the TP signals that match an opcode of the instruction set; detecting an anomaly based, at least in part, on at least one of the determined percentages exceeding an opcode anomaly threshold; and The electronic device of any one of claims 1 to 8, comprising:
10. 1. An electronic device comprising: an electronic processor communicatively coupled to a controller area network (CAN) bus; 1. A non-transitory storage medium storing: (i) one or more machine language instruction sets, each machine language instruction set comprising a set of opcodes; and (ii) instructions readable and executable by said electronic processor for implementing a CAN bus security method, said CAN bus security method comprising: extracting a CAN-Transport Protocol (TP) signal from CAN bus message traffic on the CAN bus, the TP signal comprising data bytes of a plurality of messages conforming to a CAN-TP protocol; determining, for each of the one or more instruction sets, a percentage of the TP signals that match an opcode of the instruction set; detecting an anomaly based, at least in part, on at least one of the determined percentages exceeding an opcode anomaly threshold; and A non-transitory storage medium, An electronic device comprising:
11. The detecting comprises: The electronic device of claim 10 , further comprising: performing endian correction on bytes of the TP signal before matching the TP signal with an opcode of the machine language instruction set.
12. The detecting comprises: The electronic device of any one of claims 10-11, further comprising performing a byte rotation on bytes of the TP signal before matching the TP signal with an opcode of the machine language instruction set.
13. The detecting comprises: The electronic device of any one of claims 10-12, further comprising: (I) detecting an anomaly when at least one of the determined percentages exceeds an opcode anomaly threshold; and (II) detecting the anomaly when the TP signal is not identified as an authorized firmware update.
14. 1. A non-transitory storage medium storing instructions readable and executable by at least one electronic processor for implementing a CAN bus signal format inference method, the CAN bus signal format inference method comprising: extracting candidate signals from training CAN bus message traffic, each candidate signal being a repeating time sequence of ordered groups of data bits in the CAN bus message traffic, the ordered groups of data bits being delimited by one or more message headers; defining one or more signals, each signal being a candidate signal matching a structural characteristic of a matching data type, each signal being assigned the matching data type, defining the one or more signals including defining a signal assigned a bit field data type as a candidate signal matching a structural characteristic of the bit field data type, where the value of an ordered group of data bits indicates a binary state; generating an inferred CAN bus protocol to which the defined one or more signals conform; and A non-transitory storage medium, including
15. Defining the one or more signals comprises:
15. The non-transitory storage medium of claim 14, further comprising defining a signal assigned a counter data type as a candidate signal that meets a structural characteristic of the counter data type in which the values of the ordered group of data bits defined by the counter data type are monotonically increasing or monotonically decreasing over a time sequence of the ordered group of data bits.
16. Defining the one or more signals comprises: A non-transitory storage medium according to any one of claims 14-15, comprising defining a signal assigned a constant data type as a candidate signal that meets a structural characteristic of the constant data type, in which values of ordered groups of data bits are constant over a time sequence of ordered groups of data bits.
17. Defining the one or more signals comprises: A signal assigned a floating-point data type with an exponent and a mantissa is an ordered group of said data bits, said group being 16, 32 or 64 bits; a first subset of the ordered groups of data bits representing an exponent of the floating-point data type having lower entropy over the time sequence than a second subset of the ordered groups of data bits representing a mantissa of the floating-point data type; The non-transitory storage medium according to any one of claims 14 to 16, further comprising defining as candidate signals that match structural characteristics of the floating-point data type, the structural characteristics including:
18. Defining the one or more signals comprises: Signals assigned an integer data type can be an ordered group of said data bits being 4, 8, 12, 16, or 32 bits; a first subset of the ordered groups of the data bits representing most significant bits of the integer data type having lower entropy over the time sequence than a second subset of the ordered groups of the data bits representing least significant bits of the integer data type; The non-transitory storage medium of any one of claims 14 to 17, further comprising: defining as candidate signals that match structural characteristics of the integer data type, the integer data type including:
19. Defining the signal assigned the integer data type comprises: values of the ordered group of data bits defined by the integer data type having continuity across the time sequence satisfying a continuity criterion; the values of the ordered group of data bits defined by the integer data type having continuity across the time sequence that satisfies an entropy criterion; 20. The non-transitory storage medium of claim 18, conforming to the structural characteristics of the integer data type, further comprising:
20. extracting a signal from CAN bus message traffic on a CAN bus, the extracted signal conforming to the inferred CAN bus protocol; detecting anomalies in the extracted signal; and generating an alert indicative of the detected anomaly; and 20. The non-transitory storage medium of any one of claims 14-19, further storing instructions readable and executable by at least one electronic processor to implement a CAN bus signal format inference method, comprising:
Citation Information
Patent Citations
Method and device for detecting data
CN106250767A
Network device and data transmission reception system
JP2014146868A
US10,083,071
Apparatus and method for detecting network attack
US20080134334A1
Automatic Reverse Engineering of Message Formats From Network Traces
US20090006645A1
