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

Add Guardian SDL pipeline after internal builds #649

Merged
merged 3 commits into from
Jul 27, 2022

Conversation

dagood
Copy link
Member

@dagood dagood commented Jul 22, 2022

Add SDL validation stage to our internal (official) builds, based on Arcade. See https://github.com/dagood/go/blob/dev/dagood/sdl-stage/eng/compliance/Guardian/README.md

My initial implementation was to include SDL validation as a stage in the internal rolling pipeline, but it added 25 minutes (not including queue time) to the completion time--nearly doubling the build's total time. Instead, I changed SDL validation into a new pipeline that triggers automatically after each internal rolling build. This keeps the extra time out of our servicing release critical path, while still running validation on every build so we know as soon as possible when there's some compliance/security issue detected. (I'll configure AzDO to send an email notification when this pipeline fails. I haven't seen any flakiness yet in my test runs, but we'll see how this goes.)

A bonus of moving this build out of the main rolling build pipeline is that if it is flaky, or if it returns a false positive, we can continue the release without having to retry the build or otherwise work around the fail status.

Example run: https://dev.azure.com/dnceng/internal/_build/results?buildId=1898747&view=results

@dagood dagood requested a review from a team as a code owner July 22, 2022 23:27
@dagood dagood requested review from jaredpar, chsienki and qmuntal July 25, 2022 18:06
to disable "BA3001.EnablePositionIndependentExecutable.Options".
-->
<Properties Type="PropertiesDictionary">
<!-- Go doesn't build PIE executables by default: https://github.com/microsoft/go/issues/104 -->
Copy link
Member

Choose a reason for hiding this comment

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

In case it makes a difference, windows defaults to PIE since go1.19: golang/go#35192

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, the commit that closed the issue actually says it's in go1.15, is there something else in go1.19 that ends up enabling it?

But either way, I last touched this file for go1.16 or go1.17, so I'll try a fresh run without this exception and see what happens.

Copy link
Member

Choose a reason for hiding this comment

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

Wops, I meant 1.15.

Copy link
Member Author

@dagood dagood Jul 27, 2022

Choose a reason for hiding this comment

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

BinSkim sees that the Windows binaries are PIE, but it complains about the Linux binaries. (Every arch.) I added a note to #104 and I'll add some more detail to this comment. I think the exception has to stay for now--I haven't been able to find a way to filter a rule for some files and not others.

https://dev.azure.com/dnceng/internal/_build/results?buildId=1905501&view=results

@dagood dagood merged commit ebceed2 into microsoft:microsoft/main Jul 27, 2022
@dagood dagood deleted the dev/dagood/sdl-stage branch July 27, 2022 23:00
dagood added a commit to dagood/go that referenced this pull request Jul 28, 2022
* Add Guardian SDL pipeline after internal builds

* Guardian README.md: note Microsoft internal auth

* Update PIE exception note

(cherry picked from commit ebceed2)
dagood added a commit to dagood/go that referenced this pull request Jul 28, 2022
* Add Guardian SDL pipeline after internal builds

* Guardian README.md: note Microsoft internal auth

* Update PIE exception note

(cherry picked from commit ebceed2)
dagood added a commit that referenced this pull request Jul 29, 2022
* Add Guardian SDL pipeline after internal builds

* Guardian README.md: note Microsoft internal auth

* Update PIE exception note

(cherry picked from commit ebceed2)
microsoft-golang-bot pushed a commit that referenced this pull request Aug 10, 2022
* Add Guardian SDL pipeline after internal builds

* Guardian README.md: note Microsoft internal auth

* Update PIE exception note

(cherry picked from commit ebceed2)
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.

Apply SDL validation task on windows-amd64 outputs
3 participants