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.

Files changed (338) hide show
  1. pidsmaker/__init__.py +22 -0
  2. pidsmaker/cli.py +32 -0
  3. pidsmaker/config/__init__.py +2 -0
  4. pidsmaker/config/config.py +2100 -0
  5. pidsmaker/config/pipeline.py +1768 -0
  6. pidsmaker/config/schemas.py +1032 -0
  7. pidsmaker/datasets.py +222 -0
  8. pidsmaker/debug_tests.py +30 -0
  9. pidsmaker/decoders/__init__.py +5 -0
  10. pidsmaker/decoders/custom_edge_mlp_decoder.py +17 -0
  11. pidsmaker/decoders/custom_mlp_decoder.py +10 -0
  12. pidsmaker/decoders/edge_linear_decoder.py +16 -0
  13. pidsmaker/decoders/inner_product_decoder.py +18 -0
  14. pidsmaker/decoders/nodlink_decoder.py +56 -0
  15. pidsmaker/detection/__init__.py +0 -0
  16. pidsmaker/detection/evaluation_methods/__init__.py +9 -0
  17. pidsmaker/detection/evaluation_methods/edge_evaluation.py +259 -0
  18. pidsmaker/detection/evaluation_methods/evaluation_utils.py +1730 -0
  19. pidsmaker/detection/evaluation_methods/host_two_stage_evaluation.py +115 -0
  20. pidsmaker/detection/evaluation_methods/node_evaluation.py +463 -0
  21. pidsmaker/detection/evaluation_methods/node_tw_evaluation.py +196 -0
  22. pidsmaker/detection/evaluation_methods/plot.py +192 -0
  23. pidsmaker/detection/evaluation_methods/queue_evaluation.py +451 -0
  24. pidsmaker/detection/evaluation_methods/tw_evaluation.py +95 -0
  25. pidsmaker/detection/flash_detection.py +162 -0
  26. pidsmaker/detection/magic_knn.py +190 -0
  27. pidsmaker/detection/node_scoring.py +52 -0
  28. pidsmaker/detection/threatrace_detection.py +65 -0
  29. pidsmaker/detection/training_methods/__init__.py +1 -0
  30. pidsmaker/detection/training_methods/inference_loop.py +293 -0
  31. pidsmaker/detection/training_methods/ocrapt_early_stop.py +165 -0
  32. pidsmaker/detection/training_methods/threatrace_training.py +169 -0
  33. pidsmaker/detection/training_methods/training_loop.py +377 -0
  34. pidsmaker/encoders/__init__.py +22 -0
  35. pidsmaker/encoders/argus_encoder.py +69 -0
  36. pidsmaker/encoders/custom_mlp.py +75 -0
  37. pidsmaker/encoders/custom_mlp_encoder.py +10 -0
  38. pidsmaker/encoders/egraphsage_encoder.py +56 -0
  39. pidsmaker/encoders/gat.py +67 -0
  40. pidsmaker/encoders/gcn.py +27 -0
  41. pidsmaker/encoders/gin.py +48 -0
  42. pidsmaker/encoders/glstm.py +298 -0
  43. pidsmaker/encoders/graph_attention.py +63 -0
  44. pidsmaker/encoders/gru.py +29 -0
  45. pidsmaker/encoders/hetero/__init__.py +4 -0
  46. pidsmaker/encoders/hetero/ancestor_encoder.py +98 -0
  47. pidsmaker/encoders/hetero/entity_encoder.py +33 -0
  48. pidsmaker/encoders/hetero/event_encoder.py +81 -0
  49. pidsmaker/encoders/hetero/hetero_graph_transformer.py +40 -0
  50. pidsmaker/encoders/lares_encoder.py +68 -0
  51. pidsmaker/encoders/linear_encoder.py +16 -0
  52. pidsmaker/encoders/magic_encoder.py +161 -0
  53. pidsmaker/encoders/rcaid_encoder.py +81 -0
  54. pidsmaker/encoders/rgcn.py +75 -0
  55. pidsmaker/encoders/sage.py +51 -0
  56. pidsmaker/encoders/shadewatcher_encoder.py +149 -0
  57. pidsmaker/encoders/sum_aggregation.py +20 -0
  58. pidsmaker/encoders/temporal_wrappers.py +80 -0
  59. pidsmaker/encoders/textrcnn.py +82 -0
  60. pidsmaker/encoders/tgn_encoder.py +193 -0
  61. pidsmaker/experiments/tuning.py +102 -0
  62. pidsmaker/experiments/uncertainty.py +261 -0
  63. pidsmaker/factory.py +1456 -0
  64. pidsmaker/featurization/__init__.py +0 -0
  65. pidsmaker/featurization/feat_inference_methods/__init__.py +7 -0
  66. pidsmaker/featurization/feat_inference_methods/feat_inference_HFH.py +31 -0
  67. pidsmaker/featurization/feat_inference_methods/feat_inference_TRW.py +67 -0
  68. pidsmaker/featurization/feat_inference_methods/feat_inference_alacarte.py +16 -0
  69. pidsmaker/featurization/feat_inference_methods/feat_inference_doc2vec.py +54 -0
  70. pidsmaker/featurization/feat_inference_methods/feat_inference_fasttext.py +38 -0
  71. pidsmaker/featurization/feat_inference_methods/feat_inference_flash.py +70 -0
  72. pidsmaker/featurization/feat_inference_methods/feat_inference_graph2vec.py +85 -0
  73. pidsmaker/featurization/feat_inference_methods/feat_inference_ocrapt_features.py +95 -0
  74. pidsmaker/featurization/feat_inference_methods/feat_inference_pretrained.py +1729 -0
  75. pidsmaker/featurization/feat_inference_methods/feat_inference_word2vec.py +56 -0
  76. pidsmaker/featurization/featurization_methods/__init__.py +0 -0
  77. pidsmaker/featurization/featurization_methods/build_trw.py +67 -0
  78. pidsmaker/featurization/featurization_methods/featurization_alacarte.py +748 -0
  79. pidsmaker/featurization/featurization_methods/featurization_doc2vec.py +99 -0
  80. pidsmaker/featurization/featurization_methods/featurization_fasttext.py +75 -0
  81. pidsmaker/featurization/featurization_methods/featurization_flash.py +203 -0
  82. pidsmaker/featurization/featurization_methods/featurization_graph2vec.py +243 -0
  83. pidsmaker/featurization/featurization_methods/featurization_trw.py +115 -0
  84. pidsmaker/featurization/featurization_methods/featurization_word2vec.py +87 -0
  85. pidsmaker/featurization/featurization_utils.py +275 -0
  86. pidsmaker/featurization/utils/build_random_walks.py +68 -0
  87. pidsmaker/featurization/utils/trw.py +203 -0
  88. pidsmaker/hetero.py +81 -0
  89. pidsmaker/losses.py +170 -0
  90. pidsmaker/main.py +377 -0
  91. pidsmaker/mimicry.py +284 -0
  92. pidsmaker/model.py +382 -0
  93. pidsmaker/objectives/__init__.py +16 -0
  94. pidsmaker/objectives/autoencode_edge_emb.py +43 -0
  95. pidsmaker/objectives/deep_graph_infomax.py +94 -0
  96. pidsmaker/objectives/detect_few_shot.py +21 -0
  97. pidsmaker/objectives/one_class.py +75 -0
  98. pidsmaker/objectives/predict_edge_contrastive.py +165 -0
  99. pidsmaker/objectives/predict_edge_supervised.py +77 -0
  100. pidsmaker/objectives/predict_edge_type.py +28 -0
  101. pidsmaker/objectives/predict_masked_struct.py +49 -0
  102. pidsmaker/objectives/predict_node_type.py +36 -0
  103. pidsmaker/objectives/predict_process_tag.py +169 -0
  104. pidsmaker/objectives/predict_snapshot_embedding.py +97 -0
  105. pidsmaker/objectives/reconstruct_edge_emb.py +16 -0
  106. pidsmaker/objectives/reconstruct_masked_feat.py +51 -0
  107. pidsmaker/objectives/reconstruct_node_emb.py +13 -0
  108. pidsmaker/objectives/reconstruct_node_feat.py +13 -0
  109. pidsmaker/objectives/validation_wrapper.py +55 -0
  110. pidsmaker/preprocessing/__init__.py +0 -0
  111. pidsmaker/preprocessing/build_graph_methods/__init__.py +1 -0
  112. pidsmaker/preprocessing/build_graph_methods/build_default_graphs.py +830 -0
  113. pidsmaker/preprocessing/build_graph_methods/build_magic_graphs.py +220 -0
  114. pidsmaker/preprocessing/cleaning.py +258 -0
  115. pidsmaker/preprocessing/transformation_methods/__init__.py +2 -0
  116. pidsmaker/preprocessing/transformation_methods/attack_generation/synthetic_attack_naive.py +194 -0
  117. pidsmaker/preprocessing/transformation_methods/transformation_dag.py +28 -0
  118. pidsmaker/preprocessing/transformation_methods/transformation_merge_edges.py +136 -0
  119. pidsmaker/preprocessing/transformation_methods/transformation_rcaid_pseudo_graph.py +510 -0
  120. pidsmaker/preprocessing/transformation_methods/transformation_undirected.py +24 -0
  121. pidsmaker/preprocessing/transformation_methods/transformation_utils.py +36 -0
  122. pidsmaker/pretrained/__init__.py +5 -0
  123. pidsmaker/pretrained/data/__init__.py +4 -0
  124. pidsmaker/pretrained/data/behavior_signatures.py +548 -0
  125. pidsmaker/pretrained/data/canonical_tokens.py +1035 -0
  126. pidsmaker/pretrained/data/edge_filter.py +381 -0
  127. pidsmaker/pretrained/data/entity_classes.py +476 -0
  128. pidsmaker/pretrained/data/sampler.py +926 -0
  129. pidsmaker/pretrained/data/tokenizer_bpe.py +1659 -0
  130. pidsmaker/pretrained/detect.py +1432 -0
  131. pidsmaker/pretrained/embedding_generator.py +252 -0
  132. pidsmaker/pretrained/finetune.py +1437 -0
  133. pidsmaker/pretrained/models/__init__.py +20 -0
  134. pidsmaker/pretrained/models/behavior.py +348 -0
  135. pidsmaker/pretrained/models/bert.py +286 -0
  136. pidsmaker/pretrained/models/deepwalk.py +128 -0
  137. pidsmaker/pretrained/models/dgi.py +120 -0
  138. pidsmaker/pretrained/models/gae.py +114 -0
  139. pidsmaker/pretrained/models/gnn_distill.py +475 -0
  140. pidsmaker/pretrained/models/graphmae.py +373 -0
  141. pidsmaker/pretrained/models/hf_pretrained.py +213 -0
  142. pidsmaker/pretrained/models/llama.py +110 -0
  143. pidsmaker/pretrained/models/modernbert.py +567 -0
  144. pidsmaker/pretrained/models/roberta.py +147 -0
  145. pidsmaker/pretrained/models/rope_utils.py +99 -0
  146. pidsmaker/pretrained/models/ropebert.py +322 -0
  147. pidsmaker/pretrained/models/spider.py +204 -0
  148. pidsmaker/pretrained/models/tgn.py +770 -0
  149. pidsmaker/pretrained/pretrain/__init__.py +3 -0
  150. pidsmaker/pretrained/pretrain/pretrain_behavior_cluster.py +513 -0
  151. pidsmaker/pretrained/pretrain/pretrain_common.py +585 -0
  152. pidsmaker/pretrained/pretrain/pretrain_deepwalk.py +31 -0
  153. pidsmaker/pretrained/pretrain/pretrain_dgi.py +143 -0
  154. pidsmaker/pretrained/pretrain/pretrain_gae.py +143 -0
  155. pidsmaker/pretrained/pretrain/pretrain_gnn_distill.py +438 -0
  156. pidsmaker/pretrained/pretrain/pretrain_graphmae.py +151 -0
  157. pidsmaker/pretrained/pretrain/pretrain_hf.py +169 -0
  158. pidsmaker/pretrained/pretrain/pretrain_main.py +276 -0
  159. pidsmaker/pretrained/pretrain/pretrain_mlm.py +491 -0
  160. pidsmaker/pretrained/pretrain/pretrain_spider.py +502 -0
  161. pidsmaker/pretrained/training_utils.py +157 -0
  162. pidsmaker/process_reapr_gt.py +101 -0
  163. pidsmaker/resources/Ground_Truth/orthrus/E3-CADETS/node_Nginx_Backdoor_06.csv +8 -0
  164. pidsmaker/resources/Ground_Truth/orthrus/E3-CADETS/node_Nginx_Backdoor_11.csv +4 -0
  165. pidsmaker/resources/Ground_Truth/orthrus/E3-CADETS/node_Nginx_Backdoor_12.csv +43 -0
  166. pidsmaker/resources/Ground_Truth/orthrus/E3-CADETS/node_Nginx_Backdoor_13.csv +24 -0
  167. pidsmaker/resources/Ground_Truth/orthrus/E3-CLEARSCOPE/node_clearscope_e3_firefox_0411.csv +41 -0
  168. pidsmaker/resources/Ground_Truth/orthrus/E3-CLEARSCOPE/node_clearscope_e3_firefox_0412.csv +0 -0
  169. pidsmaker/resources/Ground_Truth/orthrus/E3-FIVEDIRECTIONS/node_fivedirections_e3_browser_0412.csv +1 -0
  170. pidsmaker/resources/Ground_Truth/orthrus/E3-FIVEDIRECTIONS/node_fivedirections_e3_excel_0409.csv +63 -0
  171. pidsmaker/resources/Ground_Truth/orthrus/E3-FIVEDIRECTIONS/node_fivedirections_e3_firefox_0411.csv +56 -0
  172. pidsmaker/resources/Ground_Truth/orthrus/E3-THEIA/node_Browser_Extension_Drakon_Dropper.csv +61 -0
  173. pidsmaker/resources/Ground_Truth/orthrus/E3-THEIA/node_Firefox_Backdoor_Drakon_In_Memory.csv +58 -0
  174. pidsmaker/resources/Ground_Truth/orthrus/E3-TRACE/node_trace_e3_firefox_0410.csv +11 -0
  175. pidsmaker/resources/Ground_Truth/orthrus/E3-TRACE/node_trace_e3_phishing_executable_0413.csv +11 -0
  176. pidsmaker/resources/Ground_Truth/orthrus/E3-TRACE/node_trace_e3_pine_0413.csv +14 -0
  177. pidsmaker/resources/Ground_Truth/orthrus/E5-CADETS/node_Nginx_Drakon_APT.csv +19 -0
  178. pidsmaker/resources/Ground_Truth/orthrus/E5-CADETS/node_Nginx_Drakon_APT_17.csv +107 -0
  179. pidsmaker/resources/Ground_Truth/orthrus/E5-CLEARSCOPE/node_clearscope_e5_appstarter_0515.csv +26 -0
  180. pidsmaker/resources/Ground_Truth/orthrus/E5-CLEARSCOPE/node_clearscope_e5_firefox_0517.csv +1 -0
  181. pidsmaker/resources/Ground_Truth/orthrus/E5-CLEARSCOPE/node_clearscope_e5_lockwatch_0517.csv +17 -0
  182. pidsmaker/resources/Ground_Truth/orthrus/E5-CLEARSCOPE/node_clearscope_e5_tester_0517.csv +8 -0
  183. pidsmaker/resources/Ground_Truth/orthrus/E5-FIVEDIRECTIONS/node_fivedirections_e5_bits_0515.csv +54 -0
  184. pidsmaker/resources/Ground_Truth/orthrus/E5-FIVEDIRECTIONS/node_fivedirections_e5_copykatz_0509.csv +87 -0
  185. pidsmaker/resources/Ground_Truth/orthrus/E5-FIVEDIRECTIONS/node_fivedirections_e5_dns_0517.csv +11 -0
  186. pidsmaker/resources/Ground_Truth/orthrus/E5-FIVEDIRECTIONS/node_fivedirections_e5_drakon_0517.csv +6 -0
  187. pidsmaker/resources/Ground_Truth/orthrus/E5-THEIA/node_THEIA_1_Firefox_Drakon_APT_BinFmt_Elevate_Inject.csv +70 -0
  188. pidsmaker/resources/Ground_Truth/orthrus/E5-TRACE/node_Trace_Firefox_Drakon.csv +71 -0
  189. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_m1.csv +1 -0
  190. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_m2.csv +1 -0
  191. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_m3.csv +1 -0
  192. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_m4.csv +5 -0
  193. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_m5.csv +23 -0
  194. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_m6.csv +18 -0
  195. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_s1.csv +1 -0
  196. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_s2.csv +1 -0
  197. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_s3.csv +16 -0
  198. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_edr/atlasv2_edr_s4.csv +22 -0
  199. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_m1.csv +126 -0
  200. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_m2.csv +105 -0
  201. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_m3.csv +94 -0
  202. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_m4.csv +139 -0
  203. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_m5.csv +228 -0
  204. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_m6.csv +131 -0
  205. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_s1.csv +118 -0
  206. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_s2.csv +89 -0
  207. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_s3.csv +133 -0
  208. pidsmaker/resources/Ground_Truth/orthrus/atlasv2_h1/node_h1_s4.csv +135 -0
  209. pidsmaker/resources/Ground_Truth/orthrus/carbanakv2_edr/carbanakv2_edr.csv +2453 -0
  210. pidsmaker/resources/Ground_Truth/orthrus/h051/node_h051_0925.csv +114 -0
  211. pidsmaker/resources/Ground_Truth/orthrus/h201/node_h201_0923.csv +2905 -0
  212. pidsmaker/resources/Ground_Truth/orthrus/h501/node_h501_0924.csv +749 -0
  213. pidsmaker/resources/Ground_Truth/orthrus/readme.md +98 -0
  214. pidsmaker/resources/Ground_Truth/reapr/E3-CADETS/node_Nginx_Backdoor_06.csv +3 -0
  215. pidsmaker/resources/Ground_Truth/reapr/E3-CADETS/node_Nginx_Backdoor_12.csv +655 -0
  216. pidsmaker/resources/Ground_Truth/reapr/E3-CADETS/node_Nginx_Backdoor_13.csv +770 -0
  217. pidsmaker/resources/Ground_Truth/reapr/E3-FIVEDIRECTIONS/node_fivedirections_e3_excel_0409.csv +0 -0
  218. pidsmaker/resources/Ground_Truth/reapr/E3-FIVEDIRECTIONS/node_fivedirections_e3_firefox_0411.csv +18 -0
  219. pidsmaker/resources/Ground_Truth/reapr/E3-THEIA/node_Browser_Extension_Drakon_Dropper.csv +42 -0
  220. pidsmaker/resources/Ground_Truth/reapr/E3-THEIA/node_Firefox_Backdoor_Drakon_In_Memory.csv +81 -0
  221. pidsmaker/resources/Ground_Truth/reapr/E3-TRACE/node_trace_e3_firefox_0410.csv +37 -0
  222. pidsmaker/resources/Ground_Truth/reapr/E3-TRACE/node_trace_e3_phishing_executable_0413.csv +9 -0
  223. pidsmaker/resources/Ground_Truth/reapr/E3-TRACE/node_trace_e3_pine_0413.csv +40 -0
  224. pidsmaker/resources/Ground_Truth/threatrace/E3-CADETS/ground_truth.txt +12858 -0
  225. pidsmaker/resources/Ground_Truth/threatrace/E3-FIVEDIRECTIONS/ground_truth.txt +18420 -0
  226. pidsmaker/resources/Ground_Truth/threatrace/E3-THEIA/ground_truth.txt +25363 -0
  227. pidsmaker/resources/Ground_Truth/threatrace/E3-TRACE/ground_truth.txt +68265 -0
  228. pidsmaker/resources/Ground_Truth/threatrace/README.md +123 -0
  229. pidsmaker/resources/config/anomal_e.yml +25 -0
  230. pidsmaker/resources/config/argus.yml +56 -0
  231. pidsmaker/resources/config/attack_edges/cadets_e3.yml +435 -0
  232. pidsmaker/resources/config/attack_edges/cadets_e5.yml +407 -0
  233. pidsmaker/resources/config/attack_edges/theia_e3.yml +382 -0
  234. pidsmaker/resources/config/attack_edges/theia_e5.yml +387 -0
  235. pidsmaker/resources/config/attack_edges/trace_e3.yml +415 -0
  236. pidsmaker/resources/config/attack_edges/trace_e5.yml +417 -0
  237. pidsmaker/resources/config/default.yml +315 -0
  238. pidsmaker/resources/config/egraphsage.yml +95 -0
  239. pidsmaker/resources/config/euler.yml +104 -0
  240. pidsmaker/resources/config/eval/eval_set_clustering.json +3170 -0
  241. pidsmaker/resources/config/experiments/tuning/components/tuning_featurization_methods.yml +29 -0
  242. pidsmaker/resources/config/experiments/tuning/systems/clearscope_e5/tuning_orthrus.yml +14 -0
  243. pidsmaker/resources/config/experiments/tuning/systems/default/tuning_default_baselines.yml +13 -0
  244. pidsmaker/resources/config/experiments/tuning/systems/default/tuning_orthrus_fixed.yml +16 -0
  245. pidsmaker/resources/config/experiments/uncertainty/none.yml +5 -0
  246. pidsmaker/resources/config/experiments/uncertainty/run_n_times.yml +12 -0
  247. pidsmaker/resources/config/experiments/uncertainty/run_n_times_hyperparameters.yml +12 -0
  248. pidsmaker/resources/config/experiments/uncertainty/uncertainty.yml +22 -0
  249. pidsmaker/resources/config/flash.yml +79 -0
  250. pidsmaker/resources/config/jbeil.yml +65 -0
  251. pidsmaker/resources/config/kairos.yml +121 -0
  252. pidsmaker/resources/config/lares.yml +115 -0
  253. pidsmaker/resources/config/magic.yml +86 -0
  254. pidsmaker/resources/config/nodlink.yml +79 -0
  255. pidsmaker/resources/config/ocrapt.yml +91 -0
  256. pidsmaker/resources/config/orthrus.yml +120 -0
  257. pidsmaker/resources/config/orthrus_fixed.yml +17 -0
  258. pidsmaker/resources/config/orthrus_non_snooped.yml +17 -0
  259. pidsmaker/resources/config/pretrained/README.md +101 -0
  260. pidsmaker/resources/config/pretrained/cybergfm/cybergfm.yml +49 -0
  261. pidsmaker/resources/config/pretrained/pretrained.yml +190 -0
  262. pidsmaker/resources/config/pretrained/pretrained_flash.yml +9 -0
  263. pidsmaker/resources/config/pretrained/pretrained_kairos.yml +12 -0
  264. pidsmaker/resources/config/pretrained/pretrained_magic.yml +1 -0
  265. pidsmaker/resources/config/pretrained/pretrained_nodlink.yml +1 -0
  266. pidsmaker/resources/config/pretrained/pretrained_orthrus.yml +1 -0
  267. pidsmaker/resources/config/pretrained/pretrained_supervised.yml +13 -0
  268. pidsmaker/resources/config/pretrained/pretrained_threatrace.yml +8 -0
  269. pidsmaker/resources/config/pretrained/pretrained_velox.yml +14 -0
  270. pidsmaker/resources/config/prographer.yml +136 -0
  271. pidsmaker/resources/config/rcaid.yml +88 -0
  272. pidsmaker/resources/config/shadewatcher.yml +146 -0
  273. pidsmaker/resources/config/tests.yml +10 -0
  274. pidsmaker/resources/config/threatrace.yml +73 -0
  275. pidsmaker/resources/config/tuned_baselines/optc_net/tuned_argus.yml +4 -0
  276. pidsmaker/resources/config/tuned_baselines/optc_net/tuned_lares.yml +13 -0
  277. pidsmaker/resources/config/velox.yml +10 -0
  278. pidsmaker/resources/config/viz_config.yml +10 -0
  279. pidsmaker/tasks/__init__.py +10 -0
  280. pidsmaker/tasks/batching.py +49 -0
  281. pidsmaker/tasks/construction.py +31 -0
  282. pidsmaker/tasks/evaluation.py +232 -0
  283. pidsmaker/tasks/feat_inference.py +413 -0
  284. pidsmaker/tasks/featurization.py +43 -0
  285. pidsmaker/tasks/training.py +19 -0
  286. pidsmaker/tasks/transformation.py +308 -0
  287. pidsmaker/tasks/triage.py +143 -0
  288. pidsmaker/tgn.py +635 -0
  289. pidsmaker/tokenization/__init__.py +112 -0
  290. pidsmaker/tokenization/base.py +58 -0
  291. pidsmaker/tokenization/bpe_tokenizer.py +83 -0
  292. pidsmaker/tokenization/hf_tokenizer.py +61 -0
  293. pidsmaker/tokenization/hierarchical_tokenizer.py +44 -0
  294. pidsmaker/tokenization/label_tokenizer.py +24 -0
  295. pidsmaker/tokenization/nltk_tokenizer.py +84 -0
  296. pidsmaker/tokenization/substitution.py +295 -0
  297. pidsmaker/triage/__init__.py +0 -0
  298. pidsmaker/triage/tracing_methods/__init__.py +1 -0
  299. pidsmaker/triage/tracing_methods/depimpact.py +213 -0
  300. pidsmaker/triage/tracing_methods/depimpact_utils.py +537 -0
  301. pidsmaker/triage/tracing_methods/ocrapt_subgraph.py +267 -0
  302. pidsmaker/utils/__init__.py +0 -0
  303. pidsmaker/utils/cache_utils.py +256 -0
  304. pidsmaker/utils/data_utils.py +1742 -0
  305. pidsmaker/utils/database.py +204 -0
  306. pidsmaker/utils/dataset_utils.py +413 -0
  307. pidsmaker/utils/dataset_writer.py +1057 -0
  308. pidsmaker/utils/graph_store.py +634 -0
  309. pidsmaker/utils/labelling.py +447 -0
  310. pidsmaker/utils/loss_files.py +193 -0
  311. pidsmaker/utils/process_tags.py +44 -0
  312. pidsmaker/utils/utils.py +730 -0
  313. pidsmaker/vizgen/__init__.py +1 -0
  314. pidsmaker/vizgen/dimensionality_reduction.py +249 -0
  315. pidsmaker/vizgen/embed_exporter.py +467 -0
  316. pidsmaker/vizgen/exporter.py +493 -0
  317. pidsmaker/vizgen/html_builder.py +936 -0
  318. pidsmaker/vizgen/web/__init__.py +1 -0
  319. pidsmaker/vizgen/web/export.py +62 -0
  320. pidsmaker/vizgen/web/static/css/app.css +250 -0
  321. pidsmaker/vizgen/web/static/index.html +182 -0
  322. pidsmaker/vizgen/web/static/js/app.js +627 -0
  323. pidsmaker/vizgen/web/static/js/campaign.js +123 -0
  324. pidsmaker/vizgen/web/static/js/data.js +119 -0
  325. pidsmaker/vizgen/web/static/js/dialogs.js +240 -0
  326. pidsmaker/vizgen/web/static/js/jobs.js +75 -0
  327. pidsmaker/vizgen/web/static/js/scene.js +651 -0
  328. pidsmaker/vizgen/web/static/js/ui.js +370 -0
  329. pidsmaker/vizgen/web/static/vendor/OrbitControls.js +1045 -0
  330. pidsmaker/vizgen/web/static/vendor/d3.v4.min.js +2 -0
  331. pidsmaker/vizgen/web/static/vendor/three.min.js +6 -0
  332. pidsmaker/vizgen/web/viz_server.py +2176 -0
  333. pidsmaker-4.0.0.dist-info/METADATA +596 -0
  334. pidsmaker-4.0.0.dist-info/RECORD +338 -0
  335. pidsmaker-4.0.0.dist-info/WHEEL +5 -0
  336. pidsmaker-4.0.0.dist-info/entry_points.txt +2 -0
  337. pidsmaker-4.0.0.dist-info/licenses/LICENSE +201 -0
  338. pidsmaker-4.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1 @@
1
+ """PIDSMaker web visualizer (Flask + Three.js)."""
@@ -0,0 +1,62 @@
1
+ """Standalone embedding-viz data exporter (independent of the pipeline).
2
+
3
+ Generates the ``embedding_viz_<dataset>_<suffix>_points.json`` /
4
+ ``*_adj.json`` files that the web viewer reads, for a chosen run in the
5
+ artifacts folder — without running the PIDSMaker pipeline. The web server
6
+ (``pidsmaker.vizgen.web.viz_server``) then serves whatever exists in
7
+ artifacts; this is how new data gets produced when you don't want viz wired
8
+ into a pipeline run.
9
+
10
+ Usage::
11
+
12
+ # latest evaluated run for the dataset
13
+ python -m pidsmaker.vizgen.web.export <model> <dataset> --embeddings both
14
+
15
+ # a specific run from the artifacts folder
16
+ python -m pidsmaker.vizgen.web.export <model> <dataset> \
17
+ --run /home/artifacts/evaluation/evaluation/<hash>/CADETS_E3
18
+
19
+ Requires that run's artifacts (trained model, scores, preprocessed graphs)
20
+ to be present — the exporter loads the model to compute encoder embeddings.
21
+ """
22
+
23
+ # Print a line BEFORE importing the heavy GPU libraries (torch/cuML). Loading and
24
+ # initialising them can take several seconds, and if the GPU is busy the CUDA init
25
+ # can stall — so this first line reassures the live console that generation has
26
+ # actually started instead of leaving it blank.
27
+ print("[export] starting up — loading libraries (torch / cuML) and the GPU…", flush=True)
28
+
29
+ # ``pidsmaker.utils.utils`` runs ``nltk.download("punkt")`` at import time. Even when
30
+ # punkt is already installed, that call hits NLTK's server to refresh its package
31
+ # index — and on a host with slow/blocked outbound HTTPS the SSL handshake hangs
32
+ # indefinitely, so generation stalls at import with no further logs (looks like the
33
+ # regenerate button "does nothing"). We only need punkt for tokenisation and it ships
34
+ # in the environment, so cap that one download to a few seconds and swallow failures;
35
+ # the timeout is restored immediately after so DB/network I/O in generation is
36
+ # unaffected. (utils.py is upstream/original code we don't modify — we harden the
37
+ # call from the viz entry point that triggers it.)
38
+ import socket as _socket # noqa: E402
39
+
40
+ import nltk as _nltk # noqa: E402
41
+
42
+ _orig_nltk_download = _nltk.download
43
+
44
+
45
+ def _nltk_download_with_timeout(*args, **kwargs):
46
+ prev = _socket.getdefaulttimeout()
47
+ _socket.setdefaulttimeout(8)
48
+ try:
49
+ return _orig_nltk_download(*args, **kwargs)
50
+ except Exception as exc: # network unreachable / handshake timeout / etc.
51
+ print(f"[export] skipping nltk.download (using local data): {exc}", flush=True)
52
+ return False
53
+ finally:
54
+ _socket.setdefaulttimeout(prev)
55
+
56
+
57
+ _nltk.download = _nltk_download_with_timeout
58
+
59
+ from pidsmaker.vizgen.exporter import main # noqa: E402 (after the startup print)
60
+
61
+ if __name__ == "__main__":
62
+ main()
@@ -0,0 +1,250 @@
1
+ /* PIDSMaker web visualizer — dark theme (parity with native viewer) */
2
+ :root {
3
+ --bg-app: #111116;
4
+ --bg-canvas: #050508;
5
+ --bg-panel: #1a1a24;
6
+ --bg-raised: #2a2a35;
7
+ --bg-hover: #3a3a45;
8
+ --border: #333344;
9
+ --border2: #3f3f4e;
10
+ --text: #e0e0e8;
11
+ --muted: #a0a0b0;
12
+ --muted2: #9ca3af;
13
+ --accent: #3b82f6;
14
+ --accent2: #60a5fa;
15
+ --green: #10b981;
16
+ --red: #ef4444;
17
+ --orange: #f59e0b;
18
+ --gold: #fca636;
19
+ --indigo: #818cf8;
20
+ --yellowgreen: #a3e635;
21
+ }
22
+
23
+ * { box-sizing: border-box; }
24
+ html, body {
25
+ margin: 0; padding: 0; height: 100%; overflow: hidden;
26
+ background: var(--bg-app); color: var(--text);
27
+ font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
28
+ font-size: 13px;
29
+ }
30
+ #app { display: flex; height: 100vh; width: 100vw; }
31
+
32
+ /* ---------- Left panel ---------- */
33
+ #leftPanel {
34
+ width: 380px; min-width: 380px; height: 100%;
35
+ background: var(--bg-app); border-right: 1px solid var(--bg-raised);
36
+ overflow-y: auto; overflow-x: hidden; padding: 20px 15px;
37
+ }
38
+ #leftPanel h2 { margin: 0 0 6px; color: #fff; font-size: 18px; }
39
+ .group {
40
+ border: 1px solid var(--border); border-radius: 6px;
41
+ margin: 15px 0 0; padding: 12px 10px 10px; position: relative;
42
+ }
43
+ .group > .title {
44
+ position: absolute; top: -8px; left: 10px; padding: 0 6px;
45
+ background: var(--bg-app); color: var(--muted);
46
+ font-weight: bold; font-size: 12px; text-transform: none;
47
+ }
48
+ .group.dc > .title { color: var(--indigo); }
49
+ .row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
50
+ .row label.lbl { color: var(--muted); min-width: 60px; font-size: 12px; }
51
+ input[type=range] { flex: 1; accent-color: var(--accent); }
52
+ input[type=text] {
53
+ background: var(--bg-panel); border: 1px solid var(--border2);
54
+ color: var(--text); border-radius: 4px; padding: 6px 8px; width: 100%;
55
+ }
56
+ button {
57
+ background: var(--bg-raised); border: 1px solid #444; color: var(--text);
58
+ border-radius: 4px; padding: 6px 10px; cursor: pointer; font-size: 12px;
59
+ }
60
+ button:hover { background: var(--bg-hover); }
61
+ button:disabled { opacity: .5; cursor: default; }
62
+ select {
63
+ background: #2b2b36; border: 1px solid var(--border2); color: var(--text);
64
+ border-radius: 4px; padding: 5px 6px; width: 100%;
65
+ }
66
+ .chk { display: flex; align-items: center; gap: 8px; margin: 5px 0; cursor: pointer; }
67
+ .chk input { width: 15px; height: 15px; accent-color: var(--accent); }
68
+ .btn-row { display: flex; gap: 8px; }
69
+ .btn-row button { flex: 1; }
70
+ /* the entry point of the whole UI: solid accent, full width, at the top of the
71
+ left panel — everything else is secondary to picking a run */
72
+ .btn-primary {
73
+ width: 100%; margin-top: 4px; padding: 10px; font-size: 13px; font-weight: bold;
74
+ background: var(--accent); border: none; color: #fff;
75
+ box-shadow: 0 2px 10px rgba(59,130,246,.35);
76
+ }
77
+ .btn-primary:hover { background: #2563eb; }
78
+ .btn-blue { background: rgba(100,180,255,.2); color: var(--accent2); border-color: var(--accent); }
79
+ .btn-red { background: rgba(255,100,100,.2); color: var(--red); border-color: var(--red); }
80
+ .btn-indigo { background: rgba(129,140,248,.2); color: var(--indigo); border-color: var(--indigo); }
81
+
82
+ /* stats / detection forms */
83
+ .kv { display: flex; justify-content: space-between; margin: 3px 0; font-size: 12px; }
84
+ .kv .k { color: var(--muted2); }
85
+ .kv .v { font-weight: bold; }
86
+ .desc { color: var(--muted); font-size: 11px; margin: 0 0 6px; }
87
+ #info_lbl {
88
+ font-family: monospace; font-size: 12px; color: #fff;
89
+ white-space: pre-wrap; word-break: break-word; line-height: 1.4;
90
+ }
91
+ #txt_config {
92
+ font-family: monospace; font-size: 11px; color: var(--yellowgreen);
93
+ background: #111115; border: 1px solid var(--border2); border-radius: 4px;
94
+ padding: 8px; height: 160px; overflow: auto; white-space: pre; margin-top: 6px;
95
+ }
96
+
97
+ /* ---------- Canvas + overlays ---------- */
98
+ #viewport { flex: 1; position: relative; background: var(--bg-canvas); }
99
+ #glcanvas { display: block; width: 100%; height: 100%; }
100
+ .overlay {
101
+ position: absolute; background: rgba(15,15,20,.8);
102
+ border: 1px solid rgba(100,180,255,.2); border-radius: 8px; padding: 10px 12px;
103
+ color: #fff; backdrop-filter: blur(2px);
104
+ }
105
+ #overlay_br { right: 14px; bottom: 14px; max-width: 300px; }
106
+ #overlay_bc {
107
+ left: 50%; transform: translateX(-50%); bottom: 14px;
108
+ display: flex; align-items: center; gap: 10px;
109
+ }
110
+ /* right column stacks legend + selected node; the column itself is
111
+ click-through so canvas picking works in the gap between panels */
112
+ #rightCol {
113
+ position: absolute; top: 14px; right: 14px; width: 290px;
114
+ display: flex; flex-direction: column; gap: 10px;
115
+ max-height: calc(100vh - 28px); pointer-events: none;
116
+ }
117
+ #rightCol .overlay { position: static; width: 100%; max-width: none; pointer-events: auto; }
118
+ #overlay_sel { overflow-y: auto; }
119
+ #overlay_sel #info_lbl { margin-top: 6px; }
120
+ #overlay_br button { background: rgba(59,130,246,.8); border: none; color: #fff; }
121
+ #overlay_br button:hover { background: rgba(37,99,235,1); }
122
+ .emb-lbl { color: var(--muted2); font-size: 11px; font-weight: bold; margin-bottom: 4px; }
123
+ #lbl_status { color: var(--accent2); font-style: italic; font-size: 12px; }
124
+ #overlay_bc input[type=range] { width: 250px; }
125
+ .legend-head { display: flex; justify-content: space-between; align-items: center; }
126
+ .legend-head .t { font-weight: bold; letter-spacing: .5px; }
127
+ #btn_collapse_leg { width: 24px; height: 24px; padding: 0; background: transparent; border: none; }
128
+ #legend table { border-collapse: collapse; font-size: 11px; }
129
+ #legend th { text-align: left; font-size: 12px; color: #fff; padding: 2px 8px 2px 0; }
130
+ #legend td { padding: 2px 8px 2px 0; }
131
+ #legend .sw { font-size: 14px; }
132
+ #legend .edges { color: var(--text); font-size: 11px; margin-top: 8px; line-height: 1.5; }
133
+
134
+ /* ---------- Run browser modal ---------- */
135
+ .modal-bg {
136
+ position: fixed; inset: 0; background: rgba(0,0,0,.7);
137
+ display: flex; align-items: center; justify-content: center; z-index: 100;
138
+ }
139
+ .modal {
140
+ background: #111115; border: 1px solid var(--border2); border-radius: 8px;
141
+ width: 80%; max-width: 1100px; max-height: 80vh; display: flex; flex-direction: column;
142
+ }
143
+ .modal h2 { margin: 0; padding: 16px 20px; border-bottom: 1px solid var(--border); }
144
+ .modal .body { padding: 12px 20px; overflow: auto; }
145
+ .modal .foot { padding: 12px 20px; border-top: 1px solid var(--border); text-align: right; }
146
+ table.runs { width: 100%; border-collapse: collapse; }
147
+ table.runs th, table.runs td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); font-size: 12px; }
148
+ table.runs th { color: var(--muted); }
149
+ table.runs tr { cursor: pointer; }
150
+ table.runs tr:hover td { background: var(--bg-panel); }
151
+ table.runs tr.sel td { background: rgba(59,130,246,.25); }
152
+
153
+ /* generic data table (causal / neighbors) */
154
+ table.data { width: 100%; min-width: 100%; border-collapse: collapse; }
155
+ table.data th, table.data td { padding: 5px 8px; border-bottom: 1px solid var(--border); font-size: 12px; text-align: left; white-space: nowrap; }
156
+ /* the last column (Path / Cmd) absorbs the leftover width so the row fills
157
+ evenly instead of leaving a big empty gap on the right */
158
+ table.data th:last-child, table.data td:last-child { width: 100%; white-space: normal; word-break: break-all; }
159
+ table.data th { color: #fff; position: sticky; top: 0; background: #1a1a24; }
160
+ table.data tr.origin td { background: #453b1b; }
161
+ .tabbar { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
162
+ .tabbar .tab { padding: 8px 24px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
163
+ .tabbar .tab.active { color: var(--accent2); border-bottom-color: var(--accent2); }
164
+
165
+ #loading {
166
+ position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
167
+ background: rgba(5,5,8,.6); color: var(--accent2); font-size: 16px; z-index: 50;
168
+ pointer-events: none;
169
+ }
170
+ #loading .loadbox { text-align: center; }
171
+
172
+ #load_msg { animation: loadPulse 1.4s ease-in-out infinite; }
173
+ @keyframes loadPulse { 0%,100% { opacity: .65; } 50% { opacity: 1; } }
174
+
175
+ #load_bar {
176
+ position: relative; width: 320px; height: 8px; margin: 14px auto 6px;
177
+ background: rgba(255,255,255,.12); border-radius: 5px; overflow: hidden;
178
+ }
179
+ /* activity sheen — a translateX transform, so it runs on the compositor and
180
+ keeps sweeping even while the main thread is busy appending a chunk. */
181
+ #load_bar::after {
182
+ content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; border-radius: 5px;
183
+ background: linear-gradient(90deg, transparent, rgba(150,195,255,.55), transparent);
184
+ animation: loadSweep 1.15s linear infinite;
185
+ will-change: transform;
186
+ }
187
+ @keyframes loadSweep { from { transform: translateX(-110%); } to { transform: translateX(320%); } }
188
+ /* fill via scaleX (compositor) instead of width (layout) so progress stays smooth */
189
+ #load_fill {
190
+ position: absolute; left: 0; top: 0; bottom: 0; width: 100%;
191
+ transform-origin: left; transform: scaleX(0);
192
+ background: linear-gradient(90deg, var(--accent), var(--accent2));
193
+ box-shadow: 0 0 10px rgba(96,165,250,.7); border-radius: 5px;
194
+ transition: transform .2s ease-out; will-change: transform;
195
+ }
196
+ #load_pct { color: var(--muted); font-size: 12px; letter-spacing: .3px; }
197
+ .hidden { display: none !important; }
198
+ .mono { font-family: monospace; }
199
+ .muted { color: var(--muted); }
200
+
201
+ /* run-browser status badges + actions */
202
+ .badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: bold; white-space: nowrap; }
203
+ .badge.ready { background: rgba(16,185,129,.2); color: var(--green); }
204
+ .badge.partial { background: rgba(245,158,11,.2); color: var(--orange); }
205
+ .badge.needs { background: rgba(120,120,140,.25); color: var(--muted); }
206
+ .badge.open { background: rgba(250,204,21,.22); color: #facc15; }
207
+ /* the run currently open in the viewer, highlighted in a golden hue */
208
+ table.runs tr.current td { background: rgba(250,204,21,.13); }
209
+ table.runs tr.current td:first-child { box-shadow: inset 3px 0 0 #facc15; color: #facc15; }
210
+ td.actions { white-space: nowrap; }
211
+ button.mini { padding: 3px 8px; font-size: 11px; }
212
+ .copy { cursor: pointer; opacity: .5; }
213
+ .copy:hover { opacity: 1; }
214
+ table.runs tr:hover td { background: transparent; } /* row no longer whole-click */
215
+
216
+ /* generate modal form */
217
+ .gen-summary { margin-bottom: 12px; font-size: 13px; }
218
+ .gen-form { display: flex; flex-direction: column; gap: 8px; }
219
+ .gen-form > label { color: var(--muted); font-size: 12px; margin-top: 4px; }
220
+ .gen-form .r { margin-right: 14px; font-size: 13px; color: var(--text); cursor: pointer; }
221
+ .gen-form input.small { width: 80px; margin-left: 6px; }
222
+ .gen-form .chk2 { color: var(--text); font-size: 13px; }
223
+
224
+ /* live console */
225
+ .phasebar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; font-size: 12px; }
226
+ .phasebar .step { padding: 3px 8px; border-radius: 4px; background: var(--bg-raised); color: var(--muted); }
227
+ .phasebar .step.past { background: rgba(16,185,129,.25); color: var(--green); }
228
+ .phasebar .step.cur { background: var(--accent); color: #fff; }
229
+ .phasebar .sep { color: var(--muted); }
230
+ .console {
231
+ background: #0b0b0d; border: 1px solid var(--border2); border-radius: 4px;
232
+ color: #cdd6e0; font-family: monospace; font-size: 11px; line-height: 1.45;
233
+ height: 46vh; overflow: auto; padding: 8px; margin: 8px 0 0; white-space: pre-wrap; word-break: break-word;
234
+ }
235
+
236
+ /* persistent status pill */
237
+ #job_pill {
238
+ position: fixed; left: 396px; top: 14px; z-index: 90; cursor: pointer;
239
+ background: rgba(15,15,20,.92); border: 1px solid var(--accent); border-radius: 16px;
240
+ padding: 6px 12px; color: var(--text); font-size: 12px; display: flex; align-items: center; gap: 8px;
241
+ box-shadow: 0 2px 10px rgba(0,0,0,.5); max-width: 320px;
242
+ }
243
+ #job_pill .pill-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
244
+ #job_pill.done { border-color: var(--green); }
245
+ #job_pill.failed { border-color: var(--red); }
246
+ #job_pill .spin {
247
+ width: 11px; height: 11px; border: 2px solid var(--muted); border-top-color: var(--accent2);
248
+ border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block;
249
+ }
250
+ @keyframes spin { to { transform: rotate(360deg); } }
@@ -0,0 +1,182 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>PIDSMaker Web Visualizer</title>
7
+ <link rel="stylesheet" href="/static/css/app.css">
8
+ </head>
9
+ <body>
10
+ <div id="app">
11
+ <!-- ===================== LEFT PANEL ===================== -->
12
+ <div id="leftPanel">
13
+ <h2>Node Inspector</h2>
14
+ <button id="btn_open_browser" class="btn-primary">Open Run Browser</button>
15
+
16
+ <div class="group">
17
+ <span class="title">CONTROLS</span>
18
+ <div class="row"><label class="lbl">Pan X:</label><input type="range" id="pan_x" min="-100" max="100" value="0"></div>
19
+ <div class="row"><label class="lbl">Pan Y:</label><input type="range" id="pan_y" min="-100" max="100" value="0"></div>
20
+ <div class="row"><label class="lbl">Pan Z:</label><input type="range" id="pan_z" min="-100" max="100" value="0"></div>
21
+ <div class="row" id="row_hops"><label class="lbl" id="lbl_hops">Hops (0):</label><input type="range" id="hops" min="0" max="0" value="0"></div>
22
+ <div class="btn-row">
23
+ <button id="btn_reset_cam">Reset Camera</button>
24
+ <button id="btn_reset_home">Reset Home</button>
25
+ </div>
26
+ <div id="epoch_wrap" class="hidden" style="margin-top:8px">
27
+ <div id="lbl_epoch" style="color:var(--muted2);font-size:12px;font-weight:bold;margin-bottom:4px"></div>
28
+ <select id="cmb_epoch"></select>
29
+ </div>
30
+ <label class="chk" style="margin-top:8px"><input type="checkbox" id="chk_temporal" checked>3D Temporal Mode</label>
31
+ </div>
32
+
33
+ <div class="group">
34
+ <span class="title">FILTER</span>
35
+ <label class="chk"><input type="checkbox" id="chk_benign" checked>Benign</label>
36
+ <label class="chk"><input type="checkbox" id="chk_det" checked>Detected</label>
37
+ <label class="chk"><input type="checkbox" id="chk_undet" checked>Undetected</label>
38
+ </div>
39
+
40
+ <div class="group">
41
+ <span class="title">SEARCH</span>
42
+ <input type="text" id="search_box" placeholder="Node ID or path...">
43
+ <div class="btn-row" style="margin-top:8px">
44
+ <button id="btn_load_csv">Load CSV...</button>
45
+ <button id="btn_clear_csv" class="hidden">Clear CSV</button>
46
+ </div>
47
+ <input type="file" id="csv_input" accept=".csv" class="hidden">
48
+ <div id="lbl_csv_status" class="hidden" style="color:var(--muted);font-size:11px;margin-top:4px"></div>
49
+ <div id="lbl_csv_terms" class="hidden" style="color:var(--accent2);font-size:11px;background:var(--bg-panel);border:1px solid var(--border);padding:4px;margin-top:4px;word-break:break-word"></div>
50
+ </div>
51
+
52
+ <div class="group">
53
+ <span class="title">GLOBAL STATISTICS</span>
54
+ <p class="desc">Overall unique nodes present across all time windows in this dataset projection.</p>
55
+ <div class="kv"><span class="k">Dataset:</span><span class="v" id="st_ds">Unknown</span></div>
56
+ <div class="kv"><span class="k">Performance:</span><span class="v" id="st_perf">N/A</span></div>
57
+ <div class="kv hidden" id="st_attack_row"><span class="k">Attack Start:</span><span class="v" id="st_attack"></span></div>
58
+ <div class="kv"><span class="k">Total Nodes:</span><span class="v" id="st_total">0</span></div>
59
+ <div class="kv"><span class="k">Benign Nodes:</span><span class="v" id="st_benign" style="color:var(--green)">0</span></div>
60
+ <div class="kv"><span class="k">Malicious Nodes:</span><span class="v" id="st_mal" style="color:var(--red)">0</span></div>
61
+ <div class="kv"><span class="k" style="padding-left:12px">Processes:</span><span class="v" id="st_mproc" style="color:var(--red)">0</span></div>
62
+ <div class="kv"><span class="k" style="padding-left:12px">Netflows:</span><span class="v" id="st_mnet" style="color:var(--red)">0</span></div>
63
+ <div class="kv"><span class="k" style="padding-left:12px">Files:</span><span class="v" id="st_mfile" style="color:var(--red)">0</span></div>
64
+ </div>
65
+
66
+ <div class="group dc">
67
+ <span class="title">DETECTION</span>
68
+ <div class="kv"><span class="k">GT Attack Nodes:</span><span class="v" id="dc_gt">—</span></div>
69
+ <div class="kv"><span class="k" style="color:var(--green)">Detected:</span><span class="v" id="dc_det" style="color:var(--green)">—</span></div>
70
+ <div class="kv"><span class="k" style="color:var(--red)">Current FP:</span><span class="v" id="dc_fp" style="color:var(--red)">—</span></div>
71
+ <div class="kv"><span class="k" style="color:var(--green)">Campaign Coverage:</span><span class="v" id="dc_camp" style="color:var(--green)">—</span></div>
72
+ <div class="kv"><span class="k" style="color:var(--red)">FP for 100% Recall:</span><span class="v" id="dc_recall" style="color:var(--red)">—</span></div>
73
+ <div class="kv"><span class="k" style="color:var(--red)">FP for 100% Campaign:</span><span class="v" id="dc_fcamp" style="color:var(--red)">—</span></div>
74
+ <button id="btn_plot_dist" class="btn-indigo" style="margin-top:8px;width:100%">Plot Score Distribution</button>
75
+ </div>
76
+
77
+ <div class="group">
78
+ <span class="title">OVERLAYS</span>
79
+ <label class="chk"><input type="checkbox" id="chk_traj" checked>Show Temporal Trajectories</label>
80
+ <label class="chk"><input type="checkbox" id="chk_attack">Show Attack Graph</label>
81
+ <label class="chk"><input type="checkbox" id="chk_heat">Discrimination Heatmap</label>
82
+ <label class="chk"><input type="checkbox" id="chk_fp_campaign">Highlight FP (Full Campaign)</label>
83
+ <label class="chk"><input type="checkbox" id="chk_fp_recall">Highlight FP (Full Recall)</label>
84
+ <button id="btn_campaign_graph" class="btn-red" style="margin-top:8px;width:100%">Campaign Attack Graph</button>
85
+ </div>
86
+
87
+ <div class="group">
88
+ <span class="title">RUN CONFIGURATION</span>
89
+ <div id="txt_config"># No run loaded.</div>
90
+ </div>
91
+ </div>
92
+
93
+ <!-- ===================== VIEWPORT ===================== -->
94
+ <div id="viewport">
95
+ <canvas id="glcanvas"></canvas>
96
+ <div id="loading">
97
+ <div class="loadbox">
98
+ <div id="load_msg">Loading…</div>
99
+ <div id="load_bar"><div id="load_fill"></div></div>
100
+ <div id="load_pct"></div>
101
+ </div>
102
+ </div>
103
+
104
+ <!-- bottom-right: model/stats + embedding space -->
105
+ <div class="overlay" id="overlay_br">
106
+ <div id="lbl_model" style="font-weight:bold">Model: —</div>
107
+ <div id="lbl_total" style="margin:4px 0">Total Nodes: 0</div>
108
+ <div id="lbl_metrics" style="color:var(--green);font-size:12px">—</div>
109
+ <div id="emb_wrap" class="hidden" style="margin-top:8px">
110
+ <div class="emb-lbl">Embedding space</div>
111
+ <select id="cmb_emb">
112
+ <option value="feat">Featurization</option>
113
+ <option value="enc">GNN Encoder</option>
114
+ </select>
115
+ </div>
116
+ <div id="lbl_status"></div>
117
+ </div>
118
+
119
+ <!-- bottom-center: playback -->
120
+ <div class="overlay" id="overlay_bc">
121
+ <button id="btn_play">▶ Play</button>
122
+ <select id="combo_speed" style="width:70px">
123
+ <option>20x</option><option>40x</option><option>60x</option><option>80x</option><option>100x</option>
124
+ </select>
125
+ <button id="btn_reset_tw">↺ Reset</button>
126
+ <span>Time:</span>
127
+ <input type="range" id="slider_tw" min="-100" max="100" value="-100">
128
+ <span id="lbl_tw" style="width:40px;display:inline-block">All</span>
129
+ </div>
130
+
131
+ <!-- right column: legend + selected node (stacked) -->
132
+ <div id="rightCol">
133
+ <div class="overlay" id="overlay_tr">
134
+ <div class="legend-head">
135
+ <span class="t">LEGEND</span>
136
+ <button id="btn_collapse_leg">▲</button>
137
+ </div>
138
+ <div id="legend">
139
+ <table>
140
+ <tr><th></th><th>Process</th><th>File</th><th>Netflow</th></tr>
141
+ <tr><th>Benign</th>
142
+ <td><span class="sw" style="color:rgb(204,127,255)">■</span></td>
143
+ <td><span class="sw" style="color:rgb(76,255,178)">■</span></td>
144
+ <td><span class="sw" style="color:rgb(127,204,255)">■</span></td></tr>
145
+ <tr><th>Detected&nbsp;Malicious</th>
146
+ <td colspan="3"><span class="sw" style="color:rgb(255,51,51)">■</span> <span style="color:var(--muted)">any type</span></td></tr>
147
+ <tr><th>Undetected&nbsp;Malicious</th>
148
+ <td colspan="3"><span class="sw" style="color:rgb(255,153,51)">■</span> <span style="color:var(--muted)">any type</span></td></tr>
149
+ </table>
150
+ <div class="edges">
151
+ <b>Temporal Trajectories:</b> <span style="color:#60a5fa">Blue (Start)</span> → <span style="color:#ef4444">Red (End)</span><br>
152
+ <b>Selection:</b> <span style="color:#fff">■ White square (larger)</span><br>
153
+ <b>Attack Graph:</b> <span style="color:#eab308">■ Unactivated</span> / <span style="color:#ef4444">■ Activated</span>
154
+ </div>
155
+ </div>
156
+ </div>
157
+ <!-- right column: selected node (under legend) -->
158
+ <div class="overlay" id="overlay_sel">
159
+ <div class="legend-head"><span class="t">SELECTED NODE</span></div>
160
+ <div id="info_lbl">Click a point to inspect...</div>
161
+ <button id="btn_causal" class="btn-blue" style="margin-top:8px;width:100%">Extract Causal Subgraph</button>
162
+ <button id="btn_neighbors" class="btn-red" style="margin-top:6px;width:100%">See Edges</button>
163
+ </div>
164
+ </div>
165
+ </div>
166
+ </div>
167
+
168
+ <!-- run browser + dialog mount -->
169
+ <div id="modal_mount"></div>
170
+
171
+ <script src="/static/vendor/three.min.js"></script>
172
+ <script src="/static/vendor/OrbitControls.js"></script>
173
+ <script src="/static/vendor/d3.v4.min.js"></script>
174
+ <script src="/static/js/data.js"></script>
175
+ <script src="/static/js/scene.js"></script>
176
+ <script src="/static/js/dialogs.js"></script>
177
+ <script src="/static/js/campaign.js"></script>
178
+ <script src="/static/js/jobs.js"></script>
179
+ <script src="/static/js/ui.js"></script>
180
+ <script src="/static/js/app.js"></script>
181
+ </body>
182
+ </html>