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

Adding SARIF V1 read capability to compiler telemetry #613

Merged
merged 6 commits into from
Mar 12, 2022

Conversation

marmegh
Copy link
Contributor

@marmegh marmegh commented Mar 11, 2022

Many customers have a strong dependency on SARIF V1 and are therefore unable to utilize the full compiler telemetry functionality. This change addresses this by adding capacity to distinguish SARIF version and convert before logging telemetry summary if needed. Additionally, test coverage was added to verify the reading and telemetry logging in this situation.


fileSystem.Verify(fileSystem => fileSystem.FileOpenRead(sarifLogPath), Times.Once);
sendItems.Count.Should().Be(1);
}
Copy link
Contributor Author

@marmegh marmegh Mar 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the added test.
Used the Native_x86_VS2019_SDL_Enabled.exe to generate a SARIF v1 output (in addition to the SARIF V2 used in the baseline tests).
Mocked the fileSystem to return this sarif output and verified that the fileSystem was called exactly one time as expected.
Finally, verified that we generated the single telemetry event as expected when calling CompilerDataLogger.Disepose(). #Resolved

}

return sarifLog;
}
Copy link
Contributor Author

@marmegh marmegh Mar 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the bulk of the code change, loading based on SARIF version. #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add test for SARIF V2, as well.

@@ -5,6 +5,7 @@
* FEATURE: Add new PE `CV_CFL_LANG` language code for `ALIASOBJ` and `Rust`. [530](https://github.com/microsoft/binskim/pull/530)
* BUGFIX: Fix `BA2014.DoNotDisableStackProtectionForFunctions` to eliminate false positive reports that `GsDriverEntry` has disabled the stack protector. [551](https://github.com/microsoft/binskim/pull/551)
* BREAKING: Rename `BA2026.EnableAdditionalSdlSecurityChecks` to `BA2026.EnableMicrosoftCompilerSdlSwitch` to clarify rule purpose. [#586](https://github.com/microsoft/binskim/pull/586)
* BUGFIX: Fix inability to emit `SummaryEvent` when SARIF V1. [613](https://github.com/microsoft/binskim/pull/613)
Copy link
Member

@michaelcfanning michaelcfanning Mar 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix

Make this release note searchable based on what customers see when this crashes.
#Resolved

Copy link
Member

@michaelcfanning michaelcfanning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@michaelcfanning michaelcfanning merged commit 3ff2786 into main Mar 12, 2022
@michaelcfanning michaelcfanning deleted the users/marmegh/binSkimIcM branch March 12, 2022 01:09
@marmegh marmegh mentioned this pull request Mar 14, 2022
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

Successfully merging this pull request may close these issues.

2 participants