(detection: Detection)
| 153 | |
| 154 | |
| 155 | def get_severity(detection: Detection) -> str: |
| 156 | if detection._severity is not None: |
| 157 | return detection._severity |
| 158 | |
| 159 | for category, catdef in config.CFG["severities"].items(): |
| 160 | if "score" in catdef and detection.score >= catdef["score"]: |
| 161 | return category |
| 162 | if detection.name in catdef.get("detections", []): |
| 163 | return category |
| 164 | if set(catdef.get("tags", [])).intersection(detection.tags): |
| 165 | return category |
| 166 | |
| 167 | return "unknown" |
no test coverage detected