Skip to content

cs7org/ROSAID-ST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROSAID-ST: Adversarially Robust Intrusion and Anomaly Detection in ROS Networks via Student-Teacher Deep Learning

A proposed flow of an IDS.

Setting Up

  1. Download the dataset:
    • DNP3 Intrusion Detection Dataset from Zenodo.
    • IEC Dataset from Zenodo. After unzipping IEC104340MB and IEC6185040GB.
    • ROSIDS23 Dataset from Zenodo.
  2. Unzip and copy all the CSV files related to CICFlowmeter and paste in a single folder.
  3. These files will be the main data files.
  4. Read all files and combine them into a single CSV file. This file will be used to train models.
  5. Install this project as pip install -e . and all its requirements too.
  6. Install PyTorch with CUDA support: pip install torch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 --index-url https://download.pytorch.org/whl/cu124.

PCAP to Image

A PCAP to Image process with intermediate steps.

Issues with PCAP to Image

CICFlowmeter extracts the timestamp with only support for seconds, and hence, finding the correct start frame would not be possible. As a result, 100% match rate will not be possible.

Extracting images from large PCAP takes huge amount of time. Hence multiprocessing has been implemented to run one process in each of suggested cores. First the PCAP is truncated with timestamp using editcap then filtered with IP addressess using tshark. This final filtered PCAP is read and filtered again before converting to image. However these tools are not available in HPC and has to be installed with spack or Apptainer.

Using Spack

  • Load spack: module load user-spack
  • Check if the wireshark is already available: spack info wireshark
  • Install: spack install wireshark Takes some time.
  • Verify: spack spec wireshark
  • Verify: module avail wireshark
  • Load: module load wireshark/....

Using Apptainer

We use Apptainer here.

apptainer pull cincan_tshark.sif docker://cincan/tshark
apptainer exec docker://cincan/tshark tshark -v
apptainer exec docker://cincan/tshark editcap -V

For DNP3

For IEC104

Main script is data_preparation/iec104_pcap_to_img.py.

For ROSIDS23

Main script is data_preparation/rosids23_pcap_to_img_mp.py. It uses multi processing and only 80% of the data is used. It is filtered by taking only those sessions which have total number of packets below or equal to 80 percentile. Slurm file for this task is: jobs/rosids23_pcap_to_image.slurm

Model Training

  • As MLFlow is being used for logging the parameters, the command mlflow server should be run before training a model. But for the HPC, it is disabled.
  • Dataset: rosaid/data/dataset.py.
  • Trainer: rosaid/trainers/trainer.py. A single trainer to train all models, but this is used by other modules in /trainers/.

Training Attack Detection Model

STFPM Model

Adversarial Generation

Evaluation

Generating Plots

Acknowledgement

The authors gratefully acknowledge the scientific support and HPC resources provided by the Erlangen National High Performance Computing Center (NHR@FAU) of the Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU). The hardware is funded by the German Research Foundation (DFG).

Citation

Coming soon.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors