tudelft-cda-lab/SAGE

Split sage.py into separate files

jzelenjak opened this issue · 0 comments

Description

Currently, SAGE is one file sage.py, which is over 1k lines of code. The largest part of the file consists of the functions, and only at the very end there is the actual main part. A better approach might be to split sage.py into separate files, as it was also done in SECLEDS.

Proposed solution

  1. The following files will be present in the repository:
  • sage.py with the main part, alert parsing and global parameters
  • plotting.py with the functions that are related to plotting (including make_state_groups)
  • episode_sequence_generation.py (from making hyperalert sequences to trace generation, i.e. from aggregate_into_episodes until generate_traces excluding)
  • model_learning.py (from generate_traces until make_state_sequences and group_episodes_per_av including; the code in group_episodes_per_av can go to make_state_sequences function, since it just makes the state sequences on an attacker or victim level)
  • ag_generation.py (converting state sequences into AGs, i.e. make_attack_graphs and the related functions)
  1. Furthermore, the global parameters will become function parameters wherever applicable.
  2. Finally, the docker branch will be updated accordingly to make sure that all the files are copied.