Skip to content

Commit 69c6f1c

Browse files
committed
chore: added comment example for confidence calculation
Signed-off-by: Carl Flottmann <[email protected]>
1 parent 3118f38 commit 69c6f1c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/macaron/slsa_analyzer/checks/detect_malicious_metadata_check.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ def evaluate_heuristic_results(
150150
# in the problog model. Multiplying these probabilities together on several triggers will further decrease the probability
151151
# of the package being benign. This is then negated after calculation to get the probability of the package being malicious.
152152
# If no rules are triggered, this will simply result in 1.0 - 1.0 = 0.0.
153+
# For example, if a LOW rule and MEDIUM rule are triggered, with confidences 0.4 and 0.7 respectively, this would result in
154+
# the following calculation for confidence in package maliciousness:
155+
# 1 - (1.0 * (1 - 0.4) * (1 - 0.7)) = 0.82
153156
confidence: float = 1.0
154157

155158
for heuristic, result in heuristic_results.items():

0 commit comments

Comments
 (0)