Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SARIF Multitool] match-results-forward command generates invalid SARIF when results contain SubRuleId #2486

Open
eddynaka opened this issue Jun 15, 2022 · 4 comments

Comments

@eddynaka
Copy link
Collaborator

How to simulate:

Use the attached example.zip and execute the command: sarif match-results-forward .\original.sarif --previous .\previous.sarif -o baselined.sarif --force

Current behavior:

The rules are duplicated after executing the command, generating an invalid SARIF.

Expected behavior:

After executing the command, the SARIF must have the baselined data and be a valid SARIF.

@eddynaka
Copy link
Collaborator Author

@marmegh this is one of the issues that I saw when running the E2E pipeline.

@eddynaka eddynaka changed the title [SARIF Multitool] match-results-forward generates invalid SARIF when results contain SubRuleId [SARIF Multitool] match-results-forward command generates invalid SARIF when results contain SubRuleId Jun 15, 2022
@michaelcfanning
Copy link
Member

@marmegh @EasyRhinoMSFT these issues filed by Eddy are important for working scenarios and it would be good to make them a priority. do we have a result matching expert blessed? this area is going to get some attention moving forward, for sure.

@marmegh
Copy link
Contributor

marmegh commented Jul 5, 2022

@yongyan-gh, this is one of the issues discussed today.
cc: @EasyRhinoMSFT, @shaopeng-gh

@yongyan-gh
Copy link
Collaborator

The issue of invalid Sarif produced by match-results-forward command is that the Sarif contains duplicated rule definitions in rules array, if the Sarif to be merged contain results which use a sub ruleId.

E.g. if there are 2 results' ruleId is "TESTRULE/001/SUB001", both reference to parent rule "TESTRULE/001", the command will produce a Sarif which rules array contains 2 duplicated rules of "TESTRULE/001".

Have a fix in #2505 pls review

This was referenced Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants