pidsmaker 4.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pidsmaker might be problematic. Click here for more details.
- pidsmaker/__init__.py +22 -0
- pidsmaker/cli.py +32 -0
- pidsmaker/config/__init__.py +2 -0
- pidsmaker/config/config.py +2100 -0
- pidsmaker/config/pipeline.py +1768 -0
- pidsmaker/config/schemas.py +1032 -0
- pidsmaker/datasets.py +222 -0
- pidsmaker/debug_tests.py +30 -0
- pidsmaker/decoders/__init__.py +5 -0
- pidsmaker/decoders/custom_edge_mlp_decoder.py +17 -0
- pidsmaker/decoders/custom_mlp_decoder.py +10 -0
- pidsmaker/decoders/edge_linear_decoder.py +16 -0
- pidsmaker/decoders/inner_product_decoder.py +18 -0
- pidsmaker/decoders/nodlink_decoder.py +56 -0
- pidsmaker/detection/__init__.py +0 -0
- pidsmaker/detection/evaluation_methods/__init__.py +9 -0
- pidsmaker/detection/evaluation_methods/edge_evaluation.py +259 -0
- pidsmaker/detection/evaluation_methods/evaluation_utils.py +1730 -0
- pidsmaker/detection/evaluation_methods/host_two_stage_evaluation.py +115 -0
- pidsmaker/detection/evaluation_methods/node_evaluation.py +463 -0
- pidsmaker/detection/evaluation_methods/node_tw_evaluation.py +196 -0
- pidsmaker/detection/evaluation_methods/plot.py +192 -0
- pidsmaker/detection/evaluation_methods/queue_evaluation.py +451 -0
- pidsmaker/detection/evaluation_methods/tw_evaluation.py +95 -0
- pidsmaker/detection/flash_detection.py +162 -0
- pidsmaker/detection/magic_knn.py +190 -0
- pidsmaker/detection/node_scoring.py +52 -0
- pidsmaker/detection/threatrace_detection.py +65 -0
- pidsmaker/detection/training_methods/__init__.py +1 -0
- pidsmaker/detection/training_methods/inference_loop.py +293 -0
- pidsmaker/detection/training_methods/ocrapt_early_stop.py +165 -0
- pidsmaker/detection/training_methods/threatrace_training.py +169 -0
- pidsmaker/detection/training_methods/training_loop.py +377 -0
- pidsmaker/encoders/__init__.py +22 -0
- pidsmaker/encoders/argus_encoder.py +69 -0
- pidsmaker/encoders/custom_mlp.py +75 -0
- pidsmaker/encoders/custom_mlp_encoder.py +10 -0
- pidsmaker/encoders/egraphsage_encoder.py +56 -0
- pidsmaker/encoders/gat.py +67 -0
- pidsmaker/encoders/gcn.py +27 -0
- pidsmaker/encoders/gin.py +48 -0
- pidsmaker/encoders/glstm.py +298 -0
- pidsmaker/encoders/graph_attention.py +63 -0
- pidsmaker/encoders/gru.py +29 -0
- pidsmaker/encoders/hetero/__init__.py +4 -0
- pidsmaker/encoders/hetero/ancestor_encoder.py +98 -0
- pidsmaker/encoders/hetero/entity_encoder.py +33 -0
- pidsmaker/encoders/hetero/event_encoder.py +81 -0
- pidsmaker/encoders/hetero/hetero_graph_transformer.py +40 -0
- pidsmaker/encoders/lares_encoder.py +68 -0
- pidsmaker/encoders/linear_encoder.py +16 -0
- pidsmaker/encoders/magic_encoder.py +161 -0
- pidsmaker/encoders/rcaid_encoder.py +81 -0
- pidsmaker/encoders/rgcn.py +75 -0
- pidsmaker/encoders/sage.py +51 -0
- pidsmaker/encoders/shadewatcher_encoder.py +149 -0
- pidsmaker/encoders/sum_aggregation.py +20 -0
- pidsmaker/encoders/temporal_wrappers.py +80 -0
- pidsmaker/encoders/textrcnn.py +82 -0
- pidsmaker/encoders/tgn_encoder.py +193 -0
- pidsmaker/experiments/tuning.py +102 -0
- pidsmaker/experiments/uncertainty.py +261 -0
- pidsmaker/factory.py +1456 -0
- pidsmaker/featurization/__init__.py +0 -0
- pidsmaker/featurization/feat_inference_methods/__init__.py +7 -0
- pidsmaker/featurization/feat_inference_methods/feat_inference_HFH.py +31 -0
- pidsmaker/featurization/feat_inference_methods/feat_inference_TRW.py +67 -0
- pidsmaker/featurization/feat_inference_methods/feat_inference_alacarte.py +16 -0
- pidsmaker/featurization/feat_inference_methods/feat_inference_doc2vec.py +54 -0
- pidsmaker/featurization/feat_inference_methods/feat_inference_fasttext.py +38 -0
- pidsmaker/featurization/feat_inference_methods/feat_inference_flash.py +70 -0
- pidsmaker/featurization/feat_inference_methods/feat_inference_graph2vec.py +85 -0
- pidsmaker/featurization/feat_inference_methods/feat_inference_ocrapt_features.py +95 -0
- pidsmaker/featurization/feat_inference_methods/feat_inference_pretrained.py +1729 -0
- pidsmaker/featurization/feat_inference_methods/feat_inference_word2vec.py +56 -0
- pidsmaker/featurization/featurization_methods/__init__.py +0 -0
- pidsmaker/featurization/featurization_methods/build_trw.py +67 -0
- pidsmaker/featurization/featurization_methods/featurization_alacarte.py +748 -0
- pidsmaker/featurization/featurization_methods/featurization_doc2vec.py +99 -0
- pidsmaker/featurization/featurization_methods/featurization_fasttext.py +75 -0
- pidsmaker/featurization/featurization_methods/featurization_flash.py +203 -0
- pidsmaker/featurization/featurization_methods/featurization_graph2vec.py +243 -0
- pidsmaker/featurization/featurization_methods/featurization_trw.py +115 -0
- pidsmaker/featurization/featurization_methods/featurization_word2vec.py +87 -0
- pidsmaker/featurization/featurization_utils.py +275 -0
- pidsmaker/featurization/utils/build_random_walks.py +68 -0
- pidsmaker/featurization/utils/trw.py +203 -0
- pidsmaker/hetero.py +81 -0
- pidsmaker/losses.py +170 -0
- pidsmaker/main.py +377 -0
- pidsmaker/mimicry.py +284 -0
- pidsmaker/model.py +382 -0
- pidsmaker/objectives/__init__.py +16 -0
- pidsmaker/objectives/autoencode_edge_emb.py +43 -0
- pidsmaker/objectives/deep_graph_infomax.py +94 -0
- pidsmaker/objectives/detect_few_shot.py +21 -0
- pidsmaker/objectives/one_class.py +75 -0
- pidsmaker/objectives/predict_edge_contrastive.py +165 -0
- pidsmaker/objectives/predict_edge_supervised.py +77 -0
- pidsmaker/objectives/predict_edge_type.py +28 -0
- pidsmaker/objectives/predict_masked_struct.py +49 -0
- pidsmaker/objectives/predict_node_type.py +36 -0
- pidsmaker/objectives/predict_process_tag.py +169 -0
- pidsmaker/objectives/predict_snapshot_embedding.py +97 -0
- pidsmaker/objectives/reconstruct_edge_emb.py +16 -0
- pidsmaker/objectives/reconstruct_masked_feat.py +51 -0
- pidsmaker/objectives/reconstruct_node_emb.py +13 -0
- pidsmaker/objectives/reconstruct_node_feat.py +13 -0
- pidsmaker/objectives/validation_wrapper.py +55 -0
- pidsmaker/preprocessing/__init__.py +0 -0
- pidsmaker/preprocessing/build_graph_methods/__init__.py +1 -0
- pidsmaker/preprocessing/build_graph_methods/build_default_graphs.py +830 -0
- pidsmaker/preprocessing/build_graph_methods/build_magic_graphs.py +220 -0
- pidsmaker/preprocessing/cleaning.py +258 -0
- pidsmaker/preprocessing/transformation_methods/__init__.py +2 -0
- pidsmaker/preprocessing/transformation_methods/attack_generation/synthetic_attack_naive.py +194 -0
- pidsmaker/preprocessing/transformation_methods/transformation_dag.py +28 -0
- pidsmaker/preprocessing/transformation_methods/transformation_merge_edges.py +136 -0
- pidsmaker/preprocessing/transformation_methods/transformation_rcaid_pseudo_graph.py +510 -0
- pidsmaker/preprocessing/transformation_methods/transformation_undirected.py +24 -0
- pidsmaker/preprocessing/transformation_methods/transformation_utils.py +36 -0
- pidsmaker/pretrained/__init__.py +5 -0
- pidsmaker/pretrained/data/__init__.py +4 -0
- pidsmaker/pretrained/data/behavior_signatures.py +548 -0
- pidsmaker/pretrained/data/canonical_tokens.py +1035 -0
- pidsmaker/pretrained/data/edge_filter.py +381 -0
- pidsmaker/pretrained/data/entity_classes.py +476 -0
- pidsmaker/pretrained/data/sampler.py +926 -0
- pidsmaker/pretrained/data/tokenizer_bpe.py +1659 -0
- pidsmaker/pretrained/detect.py +1432 -0
- pidsmaker/pretrained/embedding_generator.py +252 -0
- pidsmaker/pretrained/finetune.py +1437 -0
- pidsmaker/pretrained/models/__init__.py +20 -0
- pidsmaker/pretrained/models/behavior.py +348 -0
- pidsmaker/pretrained/models/bert.py +286 -0
- pidsmaker/pretrained/models/deepwalk.py +128 -0
- pidsmaker/pretrained/models/dgi.py +120 -0
- pidsmaker/pretrained/models/gae.py +114 -0
- pidsmaker/pretrained/models/gnn_distill.py +475 -0
- pidsmaker/pretrained/models/graphmae.py +373 -0
- pidsmaker/pretrained/models/hf_pretrained.py +213 -0
- pidsmaker/pretrained/models/llama.py +110 -0
- pidsmaker/pretrained/models/modernbert.py +567 -0
- pidsmaker/pretrained/models/roberta.py +147 -0
- pidsmaker/pretrained/models/rope_utils.py +99 -0
- pidsmaker/pretrained/models/ropebert.py +322 -0
- pidsmaker/pretrained/models/spider.py +204 -0
- pidsmaker/pretrained/models/tgn.py +770 -0
- pidsmaker/pretrained/pretrain/__init__.py +3 -0
- pidsmaker/pretrained/pretrain/pretrain_behavior_cluster.py +513 -0
- pidsmaker/pretrained/pretrain/pretrain_common.py +585 -0
- pidsmaker/pretrained/pretrain/pretrain_deepwalk.py +31 -0
- pidsmaker/pretrained/pretrain/pretrain_dgi.py +143 -0
- pidsmaker/pretrained/pretrain/pretrain_gae.py +143 -0
- pidsmaker/pretrained/pretrain/pretrain_gnn_distill.py +438 -0
- pidsmaker/pretrained/pretrain/pretrain_graphmae.py +151 -0
- pidsmaker/pretrained/pretrain/pretrain_hf.py +169 -0
- pidsmaker/pretrained/pretrain/pretrain_main.py +276 -0
- pidsmaker/pretrained/pretrain/pretrain_mlm.py +491 -0
- pidsmaker/pretrained/pretrain/pretrain_spider.py +502 -0
- pidsmaker/pretrained/training_utils.py +157 -0
- pidsmaker/process_reapr_gt.py +101 -0
- pidsmaker/resources/Ground_Truth/orthrus/E3-CADETS/node_Nginx_Backdoor_06.csv +8 -0
- pidsmaker/resources/Ground_Truth/orthrus/E3-CADETS/node_Nginx_Backdoor_11.csv +4 -0
- pidsmaker/resources/Ground_Truth/orthrus/E3-CADETS/node_Nginx_Backdoor_12.csv +43 -0
- pidsmaker/resources/Ground_Truth/orthrus/E3-CADETS/node_Nginx_Backdoor_13.csv +24 -0
- pidsmaker/resources/Ground_Truth/orthrus/E3-CLEARSCOPE/node_clearscope_e3_firefox_0411.csv +41 -0
- pidsmaker/resources/Ground_Truth/orthrus/E3-CLEARSCOPE/node_clearscope_e3_firefox_0412.csv +0 -0
- pidsmaker/resources/Ground_Truth/orthrus/E3-FIVEDIRECTIONS/node_fivedirections_e3_browser_0412.csv +1 -0
- pidsmaker/resources/Ground_Truth/orthrus/E3-FIVEDIRECTIONS/node_fivedirections_e3_excel_0409.csv +63 -0
- pidsmaker/resources/Ground_Truth/orthrus/E3-FIVEDIRECTIONS/node_fivedirections_e3_firefox_0411.csv +56 -0
- pidsmaker/resources/Ground_Truth/orthrus/E3-THEIA/node_Browser_Extension_Drakon_Dropper.csv +61 -0
- pidsmaker/resources/Ground_Truth/orthrus/E3-THEIA/node_Firefox_Backdoor_Drakon_In_Memory.csv +58 -0
- pidsmaker/resources/Ground_Truth/orthrus/E3-TRACE/node_trace_e3_firefox_0410.csv +11 -0
- pidsmaker/resources/Ground_Truth/orthrus/E3-TRACE/node_trace_e3_phishing_executable_0413.csv +11 -0
- pidsmaker/resources/Ground_Truth/orthrus/E3-TRACE/node_trace_e3_pine_0413.csv +14 -0
- pidsmaker/resources/Ground_Truth/orthrus/E5-CADETS/node_Nginx_Drakon_APT.csv +19 -0
- pidsmaker/resources/Ground_Truth/orthrus/E5-CADETS/node_Nginx_Drakon_APT_17.csv +107 -0
- pidsmaker/resources/Ground_Truth/orthrus/E5-CLEARSCOPE/node_clearscope_e5_appstarter_0515.csv +26 -0
- pidsmaker/resources/Ground_Truth/orthrus/E5-CLEARSCOPE/node_clearscope_e5_firefox_0517.csv +1 -0
- pidsmaker/resources/Ground_Truth/orthrus/E5-CLEARSCOPE/node_clearscope_e5_lockwatch_0517.csv +17 -0
- pidsmaker/resources/Ground_Truth/orthrus/E5-CLEARSCOPE/node_clearscope_e5_tester_0517.csv +8 -0
- pidsmaker/resources/Ground_Truth/orthrus/E5-FIVEDIRECTIONS/node_fivedirections_e5_bits_0515.csv +54 -0
- pidsmaker/resources/Ground_Truth/orthrus/E5-FIVEDIRECTIONS/node_fivedirections_e5_copykatz_0509.csv +87 -0
- pidsmaker/resources/Ground_Truth/orthrus/E5-FIVEDIRECTIONS/node_fivedirections_e5_dns_0517.csv +11 -0
- pidsmaker/resources/Ground_Truth/orthrus/E5-FIVEDIRECTIONS/node_fivedirections_e5_drakon_0517.csv +6 -0
- pidsmaker/resources/Ground_Truth/orthrus/E5-THEIA/node_THEIA_1_Firefox_Drakon_APT_BinFmt_Elevate_Inject.csv +70 -0
- pidsmaker/resources/Ground_Truth/orthrus/E5-TRACE/node_Trace_Firefox_Drakon.csv +71 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_m1.csv +1 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_m2.csv +1 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_m3.csv +1 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_m4.csv +5 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_m5.csv +23 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_m6.csv +18 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_s1.csv +1 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_s2.csv +1 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_s3.csv +16 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_s4.csv +22 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_m1.csv +126 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_m2.csv +105 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_m3.csv +94 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_m4.csv +139 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_m5.csv +228 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_m6.csv +131 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_s1.csv +118 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_s2.csv +89 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_s3.csv +133 -0
- pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_s4.csv +135 -0
- pidsmaker/resources/Ground_Truth/orthrus/carbanakv2_edr/carbanakv2_edr.csv +2453 -0
- pidsmaker/resources/Ground_Truth/orthrus/h051/node_h051_0925.csv +114 -0
- pidsmaker/resources/Ground_Truth/orthrus/h201/node_h201_0923.csv +2905 -0
- pidsmaker/resources/Ground_Truth/orthrus/h501/node_h501_0924.csv +749 -0
- pidsmaker/resources/Ground_Truth/orthrus/readme.md +98 -0
- pidsmaker/resources/Ground_Truth/reapr/E3-CADETS/node_Nginx_Backdoor_06.csv +3 -0
- pidsmaker/resources/Ground_Truth/reapr/E3-CADETS/node_Nginx_Backdoor_12.csv +655 -0
- pidsmaker/resources/Ground_Truth/reapr/E3-CADETS/node_Nginx_Backdoor_13.csv +770 -0
- pidsmaker/resources/Ground_Truth/reapr/E3-FIVEDIRECTIONS/node_fivedirections_e3_excel_0409.csv +0 -0
- pidsmaker/resources/Ground_Truth/reapr/E3-FIVEDIRECTIONS/node_fivedirections_e3_firefox_0411.csv +18 -0
- pidsmaker/resources/Ground_Truth/reapr/E3-THEIA/node_Browser_Extension_Drakon_Dropper.csv +42 -0
- pidsmaker/resources/Ground_Truth/reapr/E3-THEIA/node_Firefox_Backdoor_Drakon_In_Memory.csv +81 -0
- pidsmaker/resources/Ground_Truth/reapr/E3-TRACE/node_trace_e3_firefox_0410.csv +37 -0
- pidsmaker/resources/Ground_Truth/reapr/E3-TRACE/node_trace_e3_phishing_executable_0413.csv +9 -0
- pidsmaker/resources/Ground_Truth/reapr/E3-TRACE/node_trace_e3_pine_0413.csv +40 -0
- pidsmaker/resources/Ground_Truth/threatrace/E3-CADETS/ground_truth.txt +12858 -0
- pidsmaker/resources/Ground_Truth/threatrace/E3-FIVEDIRECTIONS/ground_truth.txt +18420 -0
- pidsmaker/resources/Ground_Truth/threatrace/E3-THEIA/ground_truth.txt +25363 -0
- pidsmaker/resources/Ground_Truth/threatrace/E3-TRACE/ground_truth.txt +68265 -0
- pidsmaker/resources/Ground_Truth/threatrace/README.md +123 -0
- pidsmaker/resources/config/anomal_e.yml +25 -0
- pidsmaker/resources/config/argus.yml +56 -0
- pidsmaker/resources/config/attack_edges/cadets_e3.yml +435 -0
- pidsmaker/resources/config/attack_edges/cadets_e5.yml +407 -0
- pidsmaker/resources/config/attack_edges/theia_e3.yml +382 -0
- pidsmaker/resources/config/attack_edges/theia_e5.yml +387 -0
- pidsmaker/resources/config/attack_edges/trace_e3.yml +415 -0
- pidsmaker/resources/config/attack_edges/trace_e5.yml +417 -0
- pidsmaker/resources/config/default.yml +315 -0
- pidsmaker/resources/config/egraphsage.yml +95 -0
- pidsmaker/resources/config/euler.yml +104 -0
- pidsmaker/resources/config/eval/eval_set_clustering.json +3170 -0
- pidsmaker/resources/config/experiments/tuning/components/tuning_featurization_methods.yml +29 -0
- pidsmaker/resources/config/experiments/tuning/systems/clearscope_e5/tuning_orthrus.yml +14 -0
- pidsmaker/resources/config/experiments/tuning/systems/default/tuning_default_baselines.yml +13 -0
- pidsmaker/resources/config/experiments/tuning/systems/default/tuning_orthrus_fixed.yml +16 -0
- pidsmaker/resources/config/experiments/uncertainty/none.yml +5 -0
- pidsmaker/resources/config/experiments/uncertainty/run_n_times.yml +12 -0
- pidsmaker/resources/config/experiments/uncertainty/run_n_times_hyperparameters.yml +12 -0
- pidsmaker/resources/config/experiments/uncertainty/uncertainty.yml +22 -0
- pidsmaker/resources/config/flash.yml +79 -0
- pidsmaker/resources/config/jbeil.yml +65 -0
- pidsmaker/resources/config/kairos.yml +121 -0
- pidsmaker/resources/config/lares.yml +115 -0
- pidsmaker/resources/config/magic.yml +86 -0
- pidsmaker/resources/config/nodlink.yml +79 -0
- pidsmaker/resources/config/ocrapt.yml +91 -0
- pidsmaker/resources/config/orthrus.yml +120 -0
- pidsmaker/resources/config/orthrus_fixed.yml +17 -0
- pidsmaker/resources/config/orthrus_non_snooped.yml +17 -0
- pidsmaker/resources/config/pretrained/README.md +101 -0
- pidsmaker/resources/config/pretrained/cybergfm/cybergfm.yml +49 -0
- pidsmaker/resources/config/pretrained/pretrained.yml +190 -0
- pidsmaker/resources/config/pretrained/pretrained_flash.yml +9 -0
- pidsmaker/resources/config/pretrained/pretrained_kairos.yml +12 -0
- pidsmaker/resources/config/pretrained/pretrained_magic.yml +1 -0
- pidsmaker/resources/config/pretrained/pretrained_nodlink.yml +1 -0
- pidsmaker/resources/config/pretrained/pretrained_orthrus.yml +1 -0
- pidsmaker/resources/config/pretrained/pretrained_supervised.yml +13 -0
- pidsmaker/resources/config/pretrained/pretrained_threatrace.yml +8 -0
- pidsmaker/resources/config/pretrained/pretrained_velox.yml +14 -0
- pidsmaker/resources/config/prographer.yml +136 -0
- pidsmaker/resources/config/rcaid.yml +88 -0
- pidsmaker/resources/config/shadewatcher.yml +146 -0
- pidsmaker/resources/config/tests.yml +10 -0
- pidsmaker/resources/config/threatrace.yml +73 -0
- pidsmaker/resources/config/tuned_baselines/optc_net/tuned_argus.yml +4 -0
- pidsmaker/resources/config/tuned_baselines/optc_net/tuned_lares.yml +13 -0
- pidsmaker/resources/config/velox.yml +10 -0
- pidsmaker/resources/config/viz_config.yml +10 -0
- pidsmaker/tasks/__init__.py +10 -0
- pidsmaker/tasks/batching.py +49 -0
- pidsmaker/tasks/construction.py +31 -0
- pidsmaker/tasks/evaluation.py +232 -0
- pidsmaker/tasks/feat_inference.py +413 -0
- pidsmaker/tasks/featurization.py +43 -0
- pidsmaker/tasks/training.py +19 -0
- pidsmaker/tasks/transformation.py +308 -0
- pidsmaker/tasks/triage.py +143 -0
- pidsmaker/tgn.py +635 -0
- pidsmaker/tokenization/__init__.py +112 -0
- pidsmaker/tokenization/base.py +58 -0
- pidsmaker/tokenization/bpe_tokenizer.py +83 -0
- pidsmaker/tokenization/hf_tokenizer.py +61 -0
- pidsmaker/tokenization/hierarchical_tokenizer.py +44 -0
- pidsmaker/tokenization/label_tokenizer.py +24 -0
- pidsmaker/tokenization/nltk_tokenizer.py +84 -0
- pidsmaker/tokenization/substitution.py +295 -0
- pidsmaker/triage/__init__.py +0 -0
- pidsmaker/triage/tracing_methods/__init__.py +1 -0
- pidsmaker/triage/tracing_methods/depimpact.py +213 -0
- pidsmaker/triage/tracing_methods/depimpact_utils.py +537 -0
- pidsmaker/triage/tracing_methods/ocrapt_subgraph.py +267 -0
- pidsmaker/utils/__init__.py +0 -0
- pidsmaker/utils/cache_utils.py +256 -0
- pidsmaker/utils/data_utils.py +1742 -0
- pidsmaker/utils/database.py +204 -0
- pidsmaker/utils/dataset_utils.py +413 -0
- pidsmaker/utils/dataset_writer.py +1057 -0
- pidsmaker/utils/graph_store.py +634 -0
- pidsmaker/utils/labelling.py +447 -0
- pidsmaker/utils/loss_files.py +193 -0
- pidsmaker/utils/process_tags.py +44 -0
- pidsmaker/utils/utils.py +730 -0
- pidsmaker/vizgen/__init__.py +1 -0
- pidsmaker/vizgen/dimensionality_reduction.py +249 -0
- pidsmaker/vizgen/embed_exporter.py +467 -0
- pidsmaker/vizgen/exporter.py +493 -0
- pidsmaker/vizgen/html_builder.py +936 -0
- pidsmaker/vizgen/web/__init__.py +1 -0
- pidsmaker/vizgen/web/export.py +62 -0
- pidsmaker/vizgen/web/static/css/app.css +250 -0
- pidsmaker/vizgen/web/static/index.html +182 -0
- pidsmaker/vizgen/web/static/js/app.js +627 -0
- pidsmaker/vizgen/web/static/js/campaign.js +123 -0
- pidsmaker/vizgen/web/static/js/data.js +119 -0
- pidsmaker/vizgen/web/static/js/dialogs.js +240 -0
- pidsmaker/vizgen/web/static/js/jobs.js +75 -0
- pidsmaker/vizgen/web/static/js/scene.js +651 -0
- pidsmaker/vizgen/web/static/js/ui.js +370 -0
- pidsmaker/vizgen/web/static/vendor/OrbitControls.js +1045 -0
- pidsmaker/vizgen/web/static/vendor/d3.v4.min.js +2 -0
- pidsmaker/vizgen/web/static/vendor/three.min.js +6 -0
- pidsmaker/vizgen/web/viz_server.py +2176 -0
- pidsmaker-4.0.0.dist-info/METADATA +596 -0
- pidsmaker-4.0.0.dist-info/RECORD +338 -0
- pidsmaker-4.0.0.dist-info/WHEEL +5 -0
- pidsmaker-4.0.0.dist-info/entry_points.txt +2 -0
- pidsmaker-4.0.0.dist-info/licenses/LICENSE +201 -0
- pidsmaker-4.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
method: grid
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
parameters:
|
|
5
|
+
embedding_techniques:
|
|
6
|
+
values: [
|
|
7
|
+
tuned_word2vec_train,
|
|
8
|
+
tuned_word2vec_all,
|
|
9
|
+
|
|
10
|
+
tuned_alacarte_train,
|
|
11
|
+
tuned_alacarte_all,
|
|
12
|
+
|
|
13
|
+
tuned_flash_train,
|
|
14
|
+
tuned_flash_all,
|
|
15
|
+
|
|
16
|
+
tuned_doc2vec_train,
|
|
17
|
+
tuned_doc2vec_all,
|
|
18
|
+
|
|
19
|
+
tuned_fasttext_train,
|
|
20
|
+
tuned_fasttext_all,
|
|
21
|
+
|
|
22
|
+
tuned_hfh_train,
|
|
23
|
+
tuned_hfh_all,
|
|
24
|
+
|
|
25
|
+
no_featurization,
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
featurization.emb_dim:
|
|
29
|
+
values: [32, 128, 256]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
method: grid
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
parameters:
|
|
5
|
+
construction.time_window_size:
|
|
6
|
+
values: [1.0, 5.0, 10.0]
|
|
7
|
+
training.lr:
|
|
8
|
+
values: [0.0001, 0.00001]
|
|
9
|
+
training.encoder.dropout:
|
|
10
|
+
values: [0.4]
|
|
11
|
+
training.node_hid_dim:
|
|
12
|
+
values: [128, 256]
|
|
13
|
+
training.node_out_dim:
|
|
14
|
+
values: [-1]
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
method: grid
|
|
2
|
+
|
|
3
|
+
parameters:
|
|
4
|
+
construction.time_window_size:
|
|
5
|
+
values: [5.0, 15.0]
|
|
6
|
+
training.lr:
|
|
7
|
+
values: [0.001, 0.0001]
|
|
8
|
+
training.node_hid_dim:
|
|
9
|
+
values: [64, 128]
|
|
10
|
+
training.node_out_dim:
|
|
11
|
+
values: [-1]
|
|
12
|
+
training.encoder.dropout:
|
|
13
|
+
values: [0.3]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
method: grid
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
parameters:
|
|
5
|
+
training.lr:
|
|
6
|
+
values: [0.001, 0.0001]
|
|
7
|
+
training.node_hid_dim:
|
|
8
|
+
values: [64, 128, 256]
|
|
9
|
+
training.node_out_dim:
|
|
10
|
+
values: [-1]
|
|
11
|
+
training.num_epochs:
|
|
12
|
+
values: [20]
|
|
13
|
+
training.encoder.tgn.tgn_memory_dim:
|
|
14
|
+
values: [-1]
|
|
15
|
+
training.encoder.tgn.tgn_time_dim:
|
|
16
|
+
values: [-1]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Simply runs an experiment N times and return the mean of metrics + std
|
|
2
|
+
|
|
3
|
+
training_loop:
|
|
4
|
+
run_evaluation: each_epoch
|
|
5
|
+
|
|
6
|
+
experiment:
|
|
7
|
+
used_method: uncertainty
|
|
8
|
+
uncertainty:
|
|
9
|
+
deep_ensemble:
|
|
10
|
+
method: increasing_seed
|
|
11
|
+
iterations: 5
|
|
12
|
+
restart_from: featurization
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Simply runs an experiment N times with Hyperparameter ensemble uncertainty
|
|
2
|
+
|
|
3
|
+
training_loop:
|
|
4
|
+
run_evaluation: each_epoch
|
|
5
|
+
|
|
6
|
+
experiment:
|
|
7
|
+
used_method: uncertainty
|
|
8
|
+
uncertainty:
|
|
9
|
+
hyperparameter:
|
|
10
|
+
hyperparameters: lr, gnn_h_dim
|
|
11
|
+
iterations: 5
|
|
12
|
+
delta: 0.2
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Runs a same experiment multiple times with different uncertainty experiments + return a file with all metrics
|
|
2
|
+
|
|
3
|
+
training_loop:
|
|
4
|
+
run_evaluation: each_epoch
|
|
5
|
+
|
|
6
|
+
experiment:
|
|
7
|
+
used_method: uncertainty
|
|
8
|
+
uncertainty:
|
|
9
|
+
hyperparameter:
|
|
10
|
+
hyperparameters: lr, text_h_dim, gnn_h_dim
|
|
11
|
+
iterations: 5
|
|
12
|
+
delta: 0.2
|
|
13
|
+
mc_dropout:
|
|
14
|
+
iterations: 5
|
|
15
|
+
dropout: 0.4
|
|
16
|
+
deep_ensemble:
|
|
17
|
+
method: increasing_seed
|
|
18
|
+
iterations: 5
|
|
19
|
+
restart_from: training
|
|
20
|
+
bagged_ensemble:
|
|
21
|
+
iterations: 5
|
|
22
|
+
min_num_days: 3
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
construction:
|
|
2
|
+
used_method: default
|
|
3
|
+
use_all_files: True
|
|
4
|
+
mimicry_edge_num: 0
|
|
5
|
+
time_window_size: 15.0
|
|
6
|
+
use_hashed_label: False
|
|
7
|
+
fuse_edge: True
|
|
8
|
+
node_label_features:
|
|
9
|
+
subject: path, cmd_line
|
|
10
|
+
file: path
|
|
11
|
+
netflow: remote_ip, remote_port
|
|
12
|
+
multi_dataset: none
|
|
13
|
+
cleaning:
|
|
14
|
+
used_methods: none
|
|
15
|
+
transformation:
|
|
16
|
+
used_methods: none
|
|
17
|
+
|
|
18
|
+
featurization:
|
|
19
|
+
emb_dim: 30
|
|
20
|
+
epochs: 10 # 300
|
|
21
|
+
training_split: train
|
|
22
|
+
used_method: flash
|
|
23
|
+
tokenization:
|
|
24
|
+
used_method: nltk
|
|
25
|
+
nltk:
|
|
26
|
+
type_aware: False
|
|
27
|
+
substitutions: none
|
|
28
|
+
seed: 0
|
|
29
|
+
flash:
|
|
30
|
+
min_count: 1
|
|
31
|
+
workers: 1 # several workers make word2vec training non-deterministic
|
|
32
|
+
feat_inference:
|
|
33
|
+
to_remove: True
|
|
34
|
+
|
|
35
|
+
batching:
|
|
36
|
+
save_on_disk: False
|
|
37
|
+
node_features: node_emb
|
|
38
|
+
edge_features: none
|
|
39
|
+
fix_buggy_graph_reindexer: False
|
|
40
|
+
global_batching:
|
|
41
|
+
used_method: none
|
|
42
|
+
intra_graph_batching:
|
|
43
|
+
used_methods: none
|
|
44
|
+
inter_graph_batching:
|
|
45
|
+
used_method: none
|
|
46
|
+
training:
|
|
47
|
+
used_method: default
|
|
48
|
+
seed: 0
|
|
49
|
+
deterministic: False
|
|
50
|
+
num_epochs: 12
|
|
51
|
+
patience: 3
|
|
52
|
+
lr: 0.01
|
|
53
|
+
weight_decay: 0.0005
|
|
54
|
+
node_hid_dim: 30
|
|
55
|
+
node_out_dim: 3
|
|
56
|
+
grad_accumulation: 1
|
|
57
|
+
encoder:
|
|
58
|
+
dropout: 0.5
|
|
59
|
+
used_methods: sage
|
|
60
|
+
sage:
|
|
61
|
+
activation: relu
|
|
62
|
+
num_layers: 2
|
|
63
|
+
decoder:
|
|
64
|
+
used_methods: predict_node_type
|
|
65
|
+
predict_node_type:
|
|
66
|
+
decoder: none
|
|
67
|
+
balanced_loss: True
|
|
68
|
+
flash_snapshots: True
|
|
69
|
+
flash_drop_conf: 0.9
|
|
70
|
+
|
|
71
|
+
evaluation:
|
|
72
|
+
viz_malicious_nodes: False
|
|
73
|
+
ground_truth_version: orthrus
|
|
74
|
+
best_model_selection: best_adp
|
|
75
|
+
used_method: node_evaluation
|
|
76
|
+
node_evaluation:
|
|
77
|
+
threshold_method: flash
|
|
78
|
+
use_dst_node_loss: True
|
|
79
|
+
use_kmeans: False
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Jbeil (Khoury et al., IEEE S&P 2024): "Jbeil: Temporal Graph-Based Inductive Learning to Infer
|
|
2
|
+
# Lateral Movement in Evolving Enterprise Networks". A TGN (node memory + graph attention over
|
|
3
|
+
# temporal neighbors) trained by self-supervised link prediction against random negative edges.
|
|
4
|
+
# Edges with a low probability are anomalous.
|
|
5
|
+
#
|
|
6
|
+
# As in TGN and Jbeil, each edge is contrasted with a negative edge from its source to a random
|
|
7
|
+
# destination of the dataset, embedded by the TGN with the edges of the batch
|
|
8
|
+
# (`negative_destinations`, `neg_sampling: tgn`), and the best epoch is selected by link
|
|
9
|
+
# prediction on the validation set.
|
|
10
|
+
#
|
|
11
|
+
# Differences with the original implementation (https://github.com/surender08/Jbeil, a mirror of
|
|
12
|
+
# the original repository):
|
|
13
|
+
# - Jbeil's edges carry 9 unique-neighbor counts computed on the whole log (test days included)
|
|
14
|
+
# as features, which are not used (node features are the node type, zeros in Jbeil);
|
|
15
|
+
# - the paper's results are link prediction metrics of all test edges (malicious ones included)
|
|
16
|
+
# against random negatives, binarized per batch; here, malicious edges are detected among the
|
|
17
|
+
# test edges by their score, and the data is split by days instead of 70/15/15 quantiles;
|
|
18
|
+
# - Jbeil also trains on synthetic lateral movement events (not released), which are not used.
|
|
19
|
+
|
|
20
|
+
_include_yml: kairos
|
|
21
|
+
|
|
22
|
+
featurization:
|
|
23
|
+
used_method: only_type
|
|
24
|
+
tokenization:
|
|
25
|
+
used_method: none
|
|
26
|
+
|
|
27
|
+
batching:
|
|
28
|
+
node_features: node_type
|
|
29
|
+
edge_features: msg,time_encoding
|
|
30
|
+
intra_graph_batching:
|
|
31
|
+
used_methods: edges, tgn_last_neighbor
|
|
32
|
+
edges:
|
|
33
|
+
intra_graph_batch_size: 200
|
|
34
|
+
tgn_last_neighbor:
|
|
35
|
+
tgn_neighbor_size: 10
|
|
36
|
+
negative_destinations: True
|
|
37
|
+
# Kept continuous across days (Kairos resets them every day)
|
|
38
|
+
reset_state_every_day: False
|
|
39
|
+
|
|
40
|
+
training:
|
|
41
|
+
encoder:
|
|
42
|
+
# Not Kairos' 8 heads and final ReLU
|
|
43
|
+
graph_attention:
|
|
44
|
+
num_heads: 4
|
|
45
|
+
final_activation: False
|
|
46
|
+
num_epochs: 10
|
|
47
|
+
patience: 5
|
|
48
|
+
lr: 0.0001
|
|
49
|
+
decoder:
|
|
50
|
+
used_methods: predict_edge_contrastive
|
|
51
|
+
predict_edge_contrastive:
|
|
52
|
+
neg_sampling: tgn
|
|
53
|
+
decoder: edge_mlp
|
|
54
|
+
edge_mlp:
|
|
55
|
+
architecture_str: linear(0.5) | relu
|
|
56
|
+
src_dst_projection_coef: 1
|
|
57
|
+
|
|
58
|
+
evaluation:
|
|
59
|
+
# Disabled until the NIDS reach their published performance (one point per edge is slow)
|
|
60
|
+
save_figures: False
|
|
61
|
+
best_model_selection: best_val_score
|
|
62
|
+
used_method: edge_evaluation
|
|
63
|
+
edge_evaluation:
|
|
64
|
+
malicious_edge_selection: both_nodes
|
|
65
|
+
threshold_method: max_val_loss
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Kairos (Cheng et al., IEEE S&P 2024): "KAIROS: Practical Intrusion Detection and Investigation
|
|
2
|
+
# using Whole-system Provenance". A TGN (node memory + graph attention over the last neighbors) on
|
|
3
|
+
# hierarchically hashed node labels, trained to predict the type of each edge; edges whose type is
|
|
4
|
+
# badly predicted are anomalous.
|
|
5
|
+
#
|
|
6
|
+
# As in the original implementation (https://github.com/ProvenanceAnalytics/kairos): messages are
|
|
7
|
+
# (src, edge type, dst), TransformerConv with 8 heads then 1 head, both followed by a ReLU, a decoder
|
|
8
|
+
# with dropout 0.5, and the memory and neighbors are reset every day.
|
|
9
|
+
#
|
|
10
|
+
# Differences with the original implementation:
|
|
11
|
+
# - nodes are scored by their largest edge loss and evaluated at node level, instead of time windows
|
|
12
|
+
# whose anomalous edges (above mean + 1.5 std of the window) are grouped into IDF queues;
|
|
13
|
+
# - 12 epochs and the best evaluated epoch, instead of 50 (E3) or 30 (E5) epochs;
|
|
14
|
+
# - consecutive identical events between two nodes are fused (`fuse_edge`), and all the edge types
|
|
15
|
+
# of the dataset are kept (7 in the code of CADETS_E3);
|
|
16
|
+
# - each level of a path or IP is a hashed token, as in the paper (the code hashes the characters of
|
|
17
|
+
# the concatenated levels), the vectors are L2-normalized, and the node type is a one-hot feature.
|
|
18
|
+
|
|
19
|
+
construction:
|
|
20
|
+
used_method: default
|
|
21
|
+
use_all_files: True
|
|
22
|
+
mimicry_edge_num: 0
|
|
23
|
+
time_window_size: 15.0
|
|
24
|
+
use_hashed_label: False
|
|
25
|
+
fuse_edge: True
|
|
26
|
+
node_label_features:
|
|
27
|
+
subject: path
|
|
28
|
+
file: path
|
|
29
|
+
netflow: remote_ip, remote_port
|
|
30
|
+
multi_dataset: none
|
|
31
|
+
cleaning:
|
|
32
|
+
used_methods: none
|
|
33
|
+
transformation:
|
|
34
|
+
used_methods: none
|
|
35
|
+
|
|
36
|
+
featurization:
|
|
37
|
+
emb_dim: 16
|
|
38
|
+
training_split: all
|
|
39
|
+
used_method: hierarchical_hashing
|
|
40
|
+
tokenization:
|
|
41
|
+
used_method: hierarchical
|
|
42
|
+
hierarchical:
|
|
43
|
+
substitutions: none
|
|
44
|
+
feat_inference:
|
|
45
|
+
to_remove: True
|
|
46
|
+
|
|
47
|
+
batching:
|
|
48
|
+
compact_node_ids: True
|
|
49
|
+
save_on_disk: False
|
|
50
|
+
node_features: node_emb,node_type
|
|
51
|
+
edge_features: msg,time_encoding
|
|
52
|
+
fix_buggy_graph_reindexer: False
|
|
53
|
+
global_batching:
|
|
54
|
+
used_method: none
|
|
55
|
+
intra_graph_batching:
|
|
56
|
+
used_methods: edges, tgn_last_neighbor
|
|
57
|
+
edges:
|
|
58
|
+
intra_graph_batch_size: 1024
|
|
59
|
+
tgn_last_neighbor:
|
|
60
|
+
tgn_neighbor_size: 20
|
|
61
|
+
tgn_neighbor_n_hop: 1
|
|
62
|
+
fix_buggy_orthrus_TGN: False
|
|
63
|
+
fix_tgn_neighbor_loader: False
|
|
64
|
+
directed: False
|
|
65
|
+
insert_neighbors_before: False
|
|
66
|
+
reset_state_every_day: True
|
|
67
|
+
inter_graph_batching:
|
|
68
|
+
used_method: none
|
|
69
|
+
training:
|
|
70
|
+
used_method: default
|
|
71
|
+
seed: 0
|
|
72
|
+
deterministic: False
|
|
73
|
+
num_epochs: 12
|
|
74
|
+
patience: 3
|
|
75
|
+
lr: 0.00005
|
|
76
|
+
weight_decay: 0.01
|
|
77
|
+
node_hid_dim: 100
|
|
78
|
+
node_out_dim: 100
|
|
79
|
+
grad_accumulation: 1
|
|
80
|
+
encoder:
|
|
81
|
+
dropout: 0.0
|
|
82
|
+
used_methods: graph_attention,tgn
|
|
83
|
+
graph_attention:
|
|
84
|
+
activation: relu
|
|
85
|
+
num_heads: 8
|
|
86
|
+
concat: True
|
|
87
|
+
flow: source_to_target
|
|
88
|
+
num_layers: 2
|
|
89
|
+
final_activation: True
|
|
90
|
+
tgn:
|
|
91
|
+
tgn_memory_dim: 100
|
|
92
|
+
tgn_time_dim: 100
|
|
93
|
+
use_node_feats_in_gnn: False
|
|
94
|
+
use_memory: True
|
|
95
|
+
use_time_order_encoding: False
|
|
96
|
+
project_src_dst: True
|
|
97
|
+
decoder:
|
|
98
|
+
used_methods: predict_edge_type
|
|
99
|
+
predict_edge_type:
|
|
100
|
+
balanced_loss: False
|
|
101
|
+
use_triplet_types: False
|
|
102
|
+
edge_type_in_msg: True
|
|
103
|
+
decoder: edge_mlp
|
|
104
|
+
edge_mlp:
|
|
105
|
+
architecture_str: linear(2) | dropout(0.5) | tanh | linear(0.25) | dropout(0.5) | tanh | linear(0.25) | dropout(0.5) | tanh
|
|
106
|
+
src_dst_projection_coef: 2
|
|
107
|
+
|
|
108
|
+
evaluation:
|
|
109
|
+
viz_malicious_nodes: False
|
|
110
|
+
ground_truth_version: orthrus
|
|
111
|
+
best_model_selection: best_adp
|
|
112
|
+
used_method: node_evaluation
|
|
113
|
+
node_evaluation:
|
|
114
|
+
threshold_method: max_val_loss
|
|
115
|
+
use_dst_node_loss: True
|
|
116
|
+
use_kmeans: False
|
|
117
|
+
queue_evaluation:
|
|
118
|
+
queue_threshold: 20
|
|
119
|
+
used_method: kairos_idf_queue
|
|
120
|
+
kairos_idf_queue:
|
|
121
|
+
include_test_set_in_IDF: True
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# LARES (Bilot et al., ACSAC 2026): "LARES: Host-centered Lateral Movement Detection via
|
|
2
|
+
# Inductive Graph Reasoning". Repeated edges of each snapshot are merged, a single
|
|
3
|
+
# sum-aggregation layer embeds hosts from their identity and from the features of their edges,
|
|
4
|
+
# and an autoencoder reconstructs the embeddings of edges. A host is scored by the maximum
|
|
5
|
+
# reconstruction error of its outgoing edges, and the top-scored hosts are clustered (K-means)
|
|
6
|
+
# to keep the most anomalous ones.
|
|
7
|
+
#
|
|
8
|
+
# As in LARES, edge features are the number of events of each merged edge and their counts per
|
|
9
|
+
# attribute value (e.g. successful/failed logons, kinds of users), standardized per snapshot
|
|
10
|
+
# (`merge_edges.aggregate_attributes`); hosts are embedded from their ID only, and edge
|
|
11
|
+
# embeddings combine the embeddings of their endpoints with their own features through a gated
|
|
12
|
+
# skip connection before being reconstructed (`autoencode_edge_embeddings`).
|
|
13
|
+
#
|
|
14
|
+
# The evaluation is LARES' two-stage host-centered evaluation (`host_two_stage_evaluation`):
|
|
15
|
+
# hosts are scored by the maximum loss of their outgoing edges over the test period, the top
|
|
16
|
+
# cluster of the α=3 highest scores is selected (K-means), and the β=350 top outgoing edges of
|
|
17
|
+
# each selected host are predicted malicious; positives are the malicious edges of the root
|
|
18
|
+
# source of the attacks (`root_attack_nodes` of the dataset). As the original code, the best
|
|
19
|
+
# epoch is selected on the MCC of the test set (`best_mcc`).
|
|
20
|
+
#
|
|
21
|
+
# Differences with the original implementation:
|
|
22
|
+
# - hosts aggregate the messages of their incoming edges (`source_to_target`), whereas the code
|
|
23
|
+
# of LARES defaults to their outgoing edges (`target_to_source`): on LANL, the latter ranks
|
|
24
|
+
# the root attacker much lower in our experiments;
|
|
25
|
+
# - LARES evaluates LANL on its first 14 days only (set
|
|
26
|
+
# `evaluation.host_two_stage_evaluation.test_end="2015-01-15 06:05:15"` to do the same).
|
|
27
|
+
#
|
|
28
|
+
# On LANL with the 14-day test period, the best epoch reaches MCC 0.56-0.64 on 2 of 3 seeds
|
|
29
|
+
# (paper: 0.65); as in the original, whether the first stage selects the root attacker depends
|
|
30
|
+
# on the seed and the epoch, while edge-level AUC is ~0.99 across seeds.
|
|
31
|
+
|
|
32
|
+
_include_yml: default
|
|
33
|
+
|
|
34
|
+
construction:
|
|
35
|
+
used_method: default
|
|
36
|
+
use_all_files: True
|
|
37
|
+
mimicry_edge_num: 0
|
|
38
|
+
time_window_size: 60.0
|
|
39
|
+
use_hashed_label: False
|
|
40
|
+
fuse_edge: False
|
|
41
|
+
multi_dataset: none
|
|
42
|
+
cleaning:
|
|
43
|
+
used_methods: remove_self_loops
|
|
44
|
+
transformation:
|
|
45
|
+
used_methods: merge_edges
|
|
46
|
+
merge_edges:
|
|
47
|
+
per_edge_type: False
|
|
48
|
+
aggregate_attributes: True
|
|
49
|
+
|
|
50
|
+
featurization:
|
|
51
|
+
emb_dim: 16
|
|
52
|
+
training_split: train
|
|
53
|
+
used_method: only_type
|
|
54
|
+
tokenization:
|
|
55
|
+
used_method: none
|
|
56
|
+
feat_inference:
|
|
57
|
+
to_remove: True
|
|
58
|
+
# Edge features of LARES: numbers of successful and failed logons (LANL), of each protocol and
|
|
59
|
+
# port (OpTC), along with the number of events of each merged edge
|
|
60
|
+
edge_attributes: LANL:success;OPTC_NET:src_port,dst_port,protocol
|
|
61
|
+
|
|
62
|
+
batching:
|
|
63
|
+
node_features: node_type
|
|
64
|
+
edge_features: edge_attrs
|
|
65
|
+
fix_buggy_graph_reindexer: True
|
|
66
|
+
global_batching:
|
|
67
|
+
used_method: none
|
|
68
|
+
intra_graph_batching:
|
|
69
|
+
used_methods: none
|
|
70
|
+
inter_graph_batching:
|
|
71
|
+
used_method: none
|
|
72
|
+
|
|
73
|
+
training:
|
|
74
|
+
used_method: default
|
|
75
|
+
seed: 0
|
|
76
|
+
deterministic: False
|
|
77
|
+
num_epochs: 10
|
|
78
|
+
patience: 3
|
|
79
|
+
lr: 0.0001
|
|
80
|
+
weight_decay: 0.0
|
|
81
|
+
node_hid_dim: 64
|
|
82
|
+
node_out_dim: 32
|
|
83
|
+
grad_accumulation: 1
|
|
84
|
+
encoder:
|
|
85
|
+
dropout: 0.25
|
|
86
|
+
used_methods: lares
|
|
87
|
+
lares:
|
|
88
|
+
# Hosts aggregate the messages of the sources of their incoming edges (more stable on LANL
|
|
89
|
+
# than LARES' default target_to_source, see the header)
|
|
90
|
+
flow: source_to_target
|
|
91
|
+
use_node_features: False
|
|
92
|
+
decoder:
|
|
93
|
+
used_methods: autoencode_edge_embeddings
|
|
94
|
+
autoencode_edge_embeddings:
|
|
95
|
+
decoder: none
|
|
96
|
+
use_edge_feats: True
|
|
97
|
+
|
|
98
|
+
evaluation:
|
|
99
|
+
# Disabled until the NIDS reach their published performance (one point per edge is slow)
|
|
100
|
+
save_figures: False
|
|
101
|
+
viz_malicious_nodes: False
|
|
102
|
+
ground_truth_version: orthrus
|
|
103
|
+
best_model_selection: best_mcc
|
|
104
|
+
used_method: host_two_stage_evaluation
|
|
105
|
+
host_two_stage_evaluation:
|
|
106
|
+
alpha: 3
|
|
107
|
+
beta: 350
|
|
108
|
+
root_attack_nodes: dataset
|
|
109
|
+
node_evaluation:
|
|
110
|
+
threshold_method: max_val_loss
|
|
111
|
+
max_val_loss:
|
|
112
|
+
alpha: 1.0
|
|
113
|
+
use_dst_node_loss: False
|
|
114
|
+
use_kmeans: True
|
|
115
|
+
kmeans_top_K: 5
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
construction:
|
|
2
|
+
used_method: default
|
|
3
|
+
use_all_files: True
|
|
4
|
+
mimicry_edge_num: 0
|
|
5
|
+
time_window_size: 15.0
|
|
6
|
+
use_hashed_label: False
|
|
7
|
+
fuse_edge: True
|
|
8
|
+
node_label_features:
|
|
9
|
+
subject: path, cmd_line
|
|
10
|
+
file: path
|
|
11
|
+
netflow: remote_ip
|
|
12
|
+
multi_dataset: none
|
|
13
|
+
cleaning:
|
|
14
|
+
# MAGIC keeps one edge per (source, destination, edge type) in a graph (paper, Sec. 4.1)
|
|
15
|
+
used_methods: dedup_window_edges
|
|
16
|
+
transformation:
|
|
17
|
+
used_methods: none
|
|
18
|
+
|
|
19
|
+
featurization:
|
|
20
|
+
used_method: only_type
|
|
21
|
+
tokenization:
|
|
22
|
+
used_method: none
|
|
23
|
+
feat_inference:
|
|
24
|
+
to_remove: True
|
|
25
|
+
|
|
26
|
+
batching:
|
|
27
|
+
save_on_disk: False
|
|
28
|
+
node_features: node_type
|
|
29
|
+
edge_features: edge_type # MAGIC attends over the one-hot edge type
|
|
30
|
+
fix_buggy_graph_reindexer: False
|
|
31
|
+
global_batching:
|
|
32
|
+
used_method: none
|
|
33
|
+
intra_graph_batching:
|
|
34
|
+
used_methods: none
|
|
35
|
+
inter_graph_batching:
|
|
36
|
+
used_method: none
|
|
37
|
+
training:
|
|
38
|
+
used_method: default
|
|
39
|
+
seed: 0
|
|
40
|
+
deterministic: False
|
|
41
|
+
num_epochs: 12
|
|
42
|
+
patience: 3
|
|
43
|
+
lr: 0.001
|
|
44
|
+
weight_decay: 0.0005
|
|
45
|
+
node_hid_dim: 64
|
|
46
|
+
node_out_dim: 64
|
|
47
|
+
grad_accumulation: 1
|
|
48
|
+
encoder:
|
|
49
|
+
dropout: 0.0
|
|
50
|
+
used_methods: magic_gat
|
|
51
|
+
magic_gat:
|
|
52
|
+
num_layers: 3
|
|
53
|
+
num_heads: 4
|
|
54
|
+
negative_slope: 0.2
|
|
55
|
+
alpha_l: 3.0
|
|
56
|
+
activation: prelu
|
|
57
|
+
decoder:
|
|
58
|
+
used_methods: reconstruct_masked_features,predict_masked_struct
|
|
59
|
+
reconstruct_masked_features:
|
|
60
|
+
loss: SCE
|
|
61
|
+
mask_rate: 0.5
|
|
62
|
+
decoder: magic_gat
|
|
63
|
+
magic_gat:
|
|
64
|
+
num_layers: 1
|
|
65
|
+
num_heads: 1
|
|
66
|
+
negative_slope: 0.2
|
|
67
|
+
predict_masked_struct:
|
|
68
|
+
loss: BCE
|
|
69
|
+
decoder: node_mlp
|
|
70
|
+
node_mlp:
|
|
71
|
+
# MAGIC: 2 x 192 (3 concatenated encoder layers) -> 64 -> 1
|
|
72
|
+
architecture_str: linear(0.16666667) | leaky_relu
|
|
73
|
+
balanced_loss: False
|
|
74
|
+
max_samples: 10000 # MAGIC samples min(10000, #nodes) edges and as many non-edges
|
|
75
|
+
|
|
76
|
+
evaluation:
|
|
77
|
+
viz_malicious_nodes: False
|
|
78
|
+
ground_truth_version: orthrus
|
|
79
|
+
best_model_selection: best_adp
|
|
80
|
+
used_method: node_evaluation
|
|
81
|
+
node_evaluation:
|
|
82
|
+
threshold_method: magic # can't use anything else here
|
|
83
|
+
use_dst_node_loss: True
|
|
84
|
+
magic_knn_k: 10 # k-NN on the benign training embeddings, as in MAGIC
|
|
85
|
+
magic_max_reference_size: 0 # 0: all the training node embeddings
|
|
86
|
+
magic_embedding: concat # all encoder layers, as in the paper (the code scores the last one)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
construction:
|
|
2
|
+
used_method: default
|
|
3
|
+
use_all_files: True
|
|
4
|
+
mimicry_edge_num: 0
|
|
5
|
+
time_window_size: 15.0
|
|
6
|
+
use_hashed_label: False
|
|
7
|
+
fuse_edge: True
|
|
8
|
+
node_label_features:
|
|
9
|
+
subject: cmd_line
|
|
10
|
+
file: path
|
|
11
|
+
netflow: remote_ip, remote_port
|
|
12
|
+
multi_dataset: none
|
|
13
|
+
cleaning:
|
|
14
|
+
used_methods: none
|
|
15
|
+
transformation:
|
|
16
|
+
used_methods: undirected
|
|
17
|
+
|
|
18
|
+
featurization:
|
|
19
|
+
epochs: 100
|
|
20
|
+
emb_dim: 256
|
|
21
|
+
seed: 0
|
|
22
|
+
training_split: train
|
|
23
|
+
used_method: fasttext
|
|
24
|
+
tokenization:
|
|
25
|
+
used_method: nltk
|
|
26
|
+
nltk:
|
|
27
|
+
type_aware: True
|
|
28
|
+
substitutions: none
|
|
29
|
+
fasttext:
|
|
30
|
+
min_count: 2
|
|
31
|
+
alpha: 0.01
|
|
32
|
+
window_size: 3
|
|
33
|
+
negative: 3
|
|
34
|
+
num_workers: 1
|
|
35
|
+
use_pretrained_fb_model: False
|
|
36
|
+
feat_inference:
|
|
37
|
+
to_remove: True
|
|
38
|
+
|
|
39
|
+
batching:
|
|
40
|
+
save_on_disk: False
|
|
41
|
+
node_features: node_emb
|
|
42
|
+
edge_features: none
|
|
43
|
+
fix_buggy_graph_reindexer: False
|
|
44
|
+
global_batching:
|
|
45
|
+
used_method: none
|
|
46
|
+
intra_graph_batching:
|
|
47
|
+
used_methods: none
|
|
48
|
+
inter_graph_batching:
|
|
49
|
+
used_method: none
|
|
50
|
+
training:
|
|
51
|
+
used_method: default
|
|
52
|
+
seed: 0
|
|
53
|
+
deterministic: False
|
|
54
|
+
num_epochs: 12
|
|
55
|
+
patience: 3
|
|
56
|
+
lr: 0.001
|
|
57
|
+
weight_decay: 0.00001
|
|
58
|
+
node_hid_dim: 256
|
|
59
|
+
node_out_dim: 256
|
|
60
|
+
grad_accumulation: 1
|
|
61
|
+
encoder:
|
|
62
|
+
dropout: 0.0
|
|
63
|
+
used_methods: sum_aggregation
|
|
64
|
+
decoder:
|
|
65
|
+
used_methods: reconstruct_node_features
|
|
66
|
+
reconstruct_node_features:
|
|
67
|
+
loss: MSE # MSE_sum originally but too large loss
|
|
68
|
+
decoder: nodlink
|
|
69
|
+
node_mlp:
|
|
70
|
+
architecture_str: linear(0.5) | relu
|
|
71
|
+
|
|
72
|
+
evaluation:
|
|
73
|
+
viz_malicious_nodes: False
|
|
74
|
+
ground_truth_version: orthrus
|
|
75
|
+
best_model_selection: best_adp
|
|
76
|
+
used_method: node_evaluation
|
|
77
|
+
node_evaluation:
|
|
78
|
+
threshold_method: nodlink
|
|
79
|
+
use_kmeans: False
|