3 个版本 (破坏性)
0.3.0 | 2021 年 4 月 16 日 |
---|---|
0.2.0 | 2021 年 4 月 16 日 |
0.1.0 | 2021 年 4 月 14 日 |
#1158 in 数学
3.5MB
1K SLoC
attck
用于在 Rust 中处理 MITRE ATT&CK 矩阵的包。
此包包含每个 MITRE ATT&CK 矩阵的模式和数据。
用法
// initialize the matrix once; this parses JSON so it can be expensive.
let enterprise = attck::enterprise();
let threat = enterprise
.intrusion_sets()
.find(|int_set| int_set.name() == "BRONZE BUTLER")
.unwrap();
// For the example only look at the attack patterns whose IDs resolve in the collection.
// STIX data will not always be so clean, so the extra call to `resolve` enables graph
// traversal without panicking in those cases.
for pat in threat.uses_attack_patterns().filter_map(|r| r.resolve()) {
println!("{}", pat.name());
// Every SRO relationship is expressed as a pair of methods for forward and backward
// traversal, making typesafe navigation easy.
for mitigation in pat
.mitigated_by_courses_of_action()
.filter_map(|r| r.resolve())
{
println!(" - {}", mitigation.name());
}
}
依赖项
~7.5MB
~153K SLoC