Skip to content

Commit

Permalink
Setup binskim globbing to artifacts/bin w/ workaround (#45462)
Browse files Browse the repository at this point in the history
Co-authored-by: Marc Paine <marcpop@microsoft.com>
  • Loading branch information
mmitche and marcpopMSFT authored Dec 19, 2024
1 parent e4f4455 commit cd67f10
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 34 deletions.
10 changes: 10 additions & 0 deletions .config/tsaoptions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"instanceUrl": "https://devdiv.visualstudio.com/",
"template": "TFSDEVDIV",
"projectName": "DEVDIV",
"areaPath": "DevDiv\\NET Tools\\SDK",
"iterationPath": "DevDiv",
"notificationAliases": [ "dotnetdevexcli@microsoft.com" ],
"repositoryName": "dotnet-sdk",
"codebaseName": "dotnet-sdk"
}
33 changes: 10 additions & 23 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ extends:
name: $(DncEngInternalBuildPool)
image: 1es-windows-2022
os: windows
policheck:
enabled: true
tsa:
enabled: true
binskim:
enabled: true
${{ if or(eq(parameters.runTestBuild, true), eq(variables['Build.Reason'], 'PullRequest')) }}:
componentgovernance:
# Refdoc: https://docs.opensource.microsoft.com/tools/cg/component-detection/variables/
Expand All @@ -101,6 +107,10 @@ extends:
publishTaskPrefix: 1ES.
runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
locBranch: release/9.0.2xx
# WORKAROUND: BinSkim requires the folder exist prior to scanning.
preSteps:
- powershell: New-Item -ItemType Directory -Path $(Build.SourcesDirectory)/artifacts/bin -Force
displayName: Create artifacts/bin directory
${{ if and(eq(parameters.runTestBuild, false), ne(variables['Build.Reason'], 'PullRequest')) }}:
timeoutInMinutes: 90
windowsJobParameterSets:
Expand Down Expand Up @@ -331,26 +341,3 @@ extends:
name: $(DncEngInternalBuildPool)
image: 1es-windows-2022
os: windows

############### POST-BUILD STAGE ###############
- template: /eng/common/templates-official/post-build/post-build.yml@self
parameters:
publishingInfraVersion: 3
enableSymbolValidation: false
enableSigningValidation: false
enableNugetValidation: false
enableSourceLinkValidation: false
publishInstallersAndChecksums: true
publishAssetsImmediately: true
SDLValidationParameters:
enable: false
params: ' -SourceToolsList @("policheck","credscan")
-TsaInstanceURL $(_TsaInstanceURL)
-TsaProjectName $(_TsaProjectName)
-TsaNotificationEmail $(_TsaNotificationEmail)
-TsaCodebaseAdmin $(_TsaCodebaseAdmin)
-TsaBugAreaPath $(_TsaBugAreaPath)
-TsaIterationPath $(_TsaIterationPath)
-TsaRepositoryName "dotnet-sdk"
-TsaCodebaseName "dotnet-sdk"
-TsaPublish $True'
7 changes: 7 additions & 0 deletions eng/pipelines/templates/jobs/sdk-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ parameters:
osProperties: ''
runtimeSourceProperties: ''
officialBuildProperties: ''
### ARCADE ###
preSteps: []

jobs:
- template: /eng/common/${{ parameters.oneESCompat.templateFolderName }}/job/job.yml
Expand All @@ -49,6 +51,11 @@ jobs:
enableSbom: ${{ parameters.enableSbom }}
variables:
- ${{ insert }}: ${{ parameters.variables }}
preSteps: ${{ parameters.preSteps }}
templateContext:
sdl:
binskim:
analyzeTargetGlob: +:f|eng\**\*.props;+:f|artifacts\bin\**\*.dll;+:f|artifacts\bin\**\*.exe;-:f|artifacts\bin\**\msdia140.dll;

steps:
############## PREP ###############
Expand Down
11 changes: 0 additions & 11 deletions eng/sdl-tsa-vars.config

This file was deleted.

0 comments on commit cd67f10

Please sign in to comment.