Intrusion Detection System#
The Intrusion Detection System (IDS) is a proprietary feature which allows the Car Anchor to monitor anomalous events related to the traffic and conditions generated during the operation of the Bluetooth LE software stack. These events are detected at Host and Controller level. The application registers a callback where it receives and handles reports.
The IDS feature is supported on the following platforms:
KW45B41Z-EVK
KW47-EVK
To enable IDS, modify the Digital Key Car Anchor as per the steps listed below:
In
app_preinclude.hfile, setgIntrusionDetectionSystem_dtoTRUE.
Intrusion Detection System Test Mode#
The IDS Test Mode is a development and testing feature that allows developers to simulate and validate IDS security event detection without requiring actual attack scenarios or malicious devices.
Enabling Test Mode#
To enable IDS Test Mode, set gIntrusionDetectionSystemTestMode_d to TRUE in app_preinclude.h.
This enables:
Shell command
idstestfor triggering security eventsPairing message interception hooks
Test packet generation utilities
Supported Security Events#
IDS Test Mode supports triggering the following security events:
Bit |
Event Macro |
Description |
Category |
Trigger Method |
|---|---|---|---|---|
0 |
|
Max Encryption Key Size (Sweyntooth) |
Pairing |
Hook |
1 |
|
DH Key Check Zero |
Pairing |
Hook |
2 |
|
Unexpected SMP Message |
Pairing |
Hook |
5 |
|
MIC Failure Disconnect |
Connection |
Packet |
6 |
|
Non-Bonded Device |
Connection |
Packet |
7 |
|
Malformed L2CAP Packet |
Connection |
Packet |
8 |
|
Malformed ATT Packet |
Connection |
Packet |
13 |
|
Forced Re-pairing |
Pairing |
Hook |
14 |
|
L2CAP Fragments Exceed MTU (Blue Frag) |
Connection |
Packet |
16 |
|
Key Negotiation over Bluetooth (KNOB) |
Pairing |
Hook |
18 |
|
Invalid Public Key |
Pairing |
Hook |
19 |
|
Wrong Confirm Value |
Pairing |
Hook |
20 |
|
DH Key Check Failed |
Pairing |
Hook |
Event Categories#
Connection Events (Immediate Trigger)#
These events are triggered immediately when the idstest command is executed:
BIT5: MIC Failure Disconnect
BIT7: Malformed L2CAP Packet
BIT8: Malformed ATT Packet
BIT14: L2CAP Fragments Exceed MTU
BIT6: Encryption Request from Non-Bonded Device#
Natural Scenario:
Connect device to anchor with bonding enabled
Complete pairing and bonding successfully
Disconnect device
On anchor: Run
factoryresetcommandOn device: Reconnect without clearing bonds
IDS event triggers when device sends encryption request
Pairing Events (Hook-based Trigger)#
These events activate a message interception hook and trigger during the next pairing procedure:
BIT0: Sweyntooth Max Encryption Key Size
BIT1: DH Key Check Zero
BIT2: Unexpected SMP Message
BIT13: Forced Re-pairing
BIT16: KNOB (Key Negotiation)
BIT18: Invalid Public Key
BIT19: Wrong Confirm Value
BIT20: DH Key Check Failed
Using the idstest Command#
idstest <event_bit> [device_id]
Examples#
Trigger Connection Event (Immediate):
Anchor> idstest 5 0
[IDS TEST] Event BIT5 (mask 0x20000000) triggered for device 0.
Anchor> Received IDS event 32 triggered by peer 25008F195173
Trigger Pairing Event (During Next Pairing):
Anchor> idstest 0 0
[IDS TEST] Pairing event BIT0 (mask 0x00000001) will be triggered on next pairing.
[IDS TEST] Hook activated. Now run 'sd op' to start Owner Pairing.
Anchor> sd op
Advertising started - Legacy.
Connected!
Received IDS event 65536 triggered by peer 1BE0914D955A