Commit 5d38aae
committed
fix(scanmalware): map the
Two mapping bugs found by running the analyzer against the live archive
rather than against fixtures.
RISK_LEVELS_MEANING_MALICIOUS was ("high", "critical"). Sampling the live
API gives low 74, malicious 14, high 9, medium 2, and no critical at all,
so a page the scanner calls outright Malicious at 95% confidence set no
evaluation, while the value being checked for is one the API has not been
observed to emit. The vocabulary had been taken from the SMQL `verdict`
filter enum (LOW_RISK/MODERATE_RISK/HIGH_RISK), which is a different field
from security_verdict.risk_level.
Tags were derived from risk_factors alone. A live verdict of "High Risk
(Credential Phishing on disposable hosting)" carrying
threat_categories: ["Credential Phishing"] was tagged with nothing, because
its only risk factor named the flagged IPs. threat_categories is the
structured field and is now read first, with the verdict string and the
risk factors kept as prose fallbacks.
Three tests added, each failing against the previous code.malicious risk level, tag from threat_categories1 parent 491467d commit 5d38aae
2 files changed
Lines changed: 75 additions & 9 deletions
File tree
- api_app/analyzers_manager/observable_analyzers
- tests/api_app/analyzers_manager/unit_tests/observable_analyzers
Lines changed: 26 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
66 | 72 | | |
| |||
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
78 | | - | |
79 | | - | |
| 84 | + | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
| |||
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
93 | 111 | | |
94 | | - | |
95 | | - | |
| 112 | + | |
96 | 113 | | |
97 | 114 | | |
98 | 115 | | |
| |||
Lines changed: 49 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
248 | 297 | | |
249 | 298 | | |
250 | 299 | | |
| |||
0 commit comments