fix: fix incorrect skip result evaluation causing false positives in PyPI malware reporting"#1031
Merged
Conversation
8af93d3 to
97bb593
Compare
behnazh-w
reviewed
Mar 27, 2025
362d0b4 to
d46f7ed
Compare
added 7 commits
April 9, 2025 09:43
Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
…ules triggers increase the confidence Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
… improved. Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
d46f7ed to
6d50aaa
Compare
… rule ignorant of wheel absence result Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
behnazh-w
previously approved these changes
Apr 9, 2025
tromai
reviewed
Apr 9, 2025
Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
tromai
reviewed
Apr 9, 2025
tromai
reviewed
Apr 9, 2025
tromai
reviewed
Apr 9, 2025
Signed-off-by: Carl Flottmann <carl.flottmann@oracle.com>
Author
|
I ran the unit test on the old ProbLog model to ensure the unit test is solving the problem, and this is confirmed by the old ProbLog model failing the unit test, with a high confidence rule being triggered: |
behnazh-w
approved these changes
Apr 9, 2025
tromai
approved these changes
Apr 9, 2025
tromai
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Thanks for the fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addressing issue identified in #1027, where skips were being evaluated as false. This PR introduces wrappers
passed()andfailed()into the ProbLog model that usetry_call()statements. Skipped heuristics are no longer defined in the ProbLog model, which is why thistry_call()statement is used. This means that evaluatingfailed(heuristic)will be false if the heuristic passed, or if it was not defined (i.e. was skipped). Similarly, for evaluatingpassed(), this will be false if the heuristic failed, or if it was not defined. This should handle situations where skips should not cause rules they are part of to trigger. This method was the easiest way to keep as much of the ProbLog model in a static string as possible, without having to perform extensive string operations.Rule IDs have also been added for debugging purposes, and a method to extract them, so that it is evident what rule was triggered.