You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: fix incorrect skip result evaluation causing false positives in PyPI malware reporting (#1031)
Resolved issue in ProbLog model where skip results were evaluated as false, causing many false positives. Rule IDs have also been added.
Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
Copy file name to clipboardExpand all lines: src/macaron/malware_analyzer/README.md
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -61,8 +61,9 @@ When contributing an analyzer, it must meet the following requirements:
61
61
- The analyzer name must be added to [heuristics.py](./pypi_heuristics/heuristics.py) file so it can be used for rule combinations in [detect_malicious_metadata_check.py](../slsa_analyzer/checks/detect_malicious_metadata_check.py)
62
62
- Update the `malware_rules_problog_model` in [detect_malicious_metadata_check.py](../slsa_analyzer/checks/detect_malicious_metadata_check.py) with logical statements where the heuristic should be included. When adding new rules, please follow the following guidelines:
63
63
- Provide a [confidence value](../slsa_analyzer/checks/check_result.py) using the `Confidence` enum.
64
-
- Provide a name based on this confidence value (i.e. `high`, `medium`, or `low`)
65
-
- If it does not already exist, make sure to assign this to the result variable (`problog_result_access`)
64
+
- Ensure it is assigned to the `problog_result_access` string variable, otherwise it will not be queried and evaluated.
65
+
- Assign a rule ID to the rule. This will be used to backtrack to determine if it was triggered.
66
+
- Make sure to wrap pass/fail statements in `passed()` and `failed()`. Not doing so may result in undesirable behaviour, see the comments in the model for more details.
66
67
- If there are commonly used combinations introduced by adding the heuristic, combine and justify them at the top of the static model (see `quickUndetailed` and `forceSetup` as current examples).
0 commit comments