Skip to content

Add byte-level CANShield IDS module#3

Open
shubham-899 wants to merge 1 commit into
spring-iitd:mainfrom
shubham-899:byte-canshield-v2
Open

Add byte-level CANShield IDS module#3
shubham-899 wants to merge 1 commit into
spring-iitd:mainfrom
shubham-899:byte-canshield-v2

Conversation

@shubham-899

Copy link
Copy Markdown

Extends CANShield to operate on raw CAN payload bytes without DBC files. Adds per-CAN-ID anomaly scoring. Implements ids.base.IDS interface. Auto-discovered via ids/init.py.

Extends CANShield to operate on raw CAN payload bytes without DBC files.
Adds per-CAN-ID anomaly scoring. Implements ids.base.IDS interface.
Auto-discovered via ids/__init__.py.
@shubham-899

Copy link
Copy Markdown
Author

Summary
Adds a byte-level extension of CANShield as a CAN-Rakshak IDS module.

CANShield operates on DBC-decoded signals, requiring proprietary decoding
files unavailable for most vehicles. This module extends it to operate
directly on raw CAN payload bytes, removing the DBC dependency, and adds
per-CAN-ID anomaly scoring to overcome feature dilution on single-byte attacks.

Implementation

  • New file: ids/canshield_byte.py
  • Implements the ids.base.IDS interface (train/test/predict/save/load)
  • Reads the framework-standard CSV (timestamp, can_id, dlc, b1..b8, label)
  • Auto-discovered via ids/__init__.py (no manual registration)
  • Use by setting MODEL_NAME = "CANShieldByte_demo" in src/config.py

Method

  • Forward-filled byte matrix over top-N CAN IDs (no DBC decoding)
  • Correlation-based column clustering
  • Multi-period (T=1,5,10) CNN autoencoder, trained on normal traffic only
  • Per-CAN-ID scoring: max over IDs of fraction-flagged bytes

Unsupervised — trains on normal data only, no attack labels needed.
No new dependencies beyond the framework's existing ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants