Skip to content

Commit cd67f10

Browse files
mmitchemarcpopMSFT
andauthored
Setup binskim globbing to artifacts/bin w/ workaround (#45462)
Co-authored-by: Marc Paine <marcpop@microsoft.com>
1 parent e4f4455 commit cd67f10

File tree

4 files changed

+27
-34
lines changed

4 files changed

+27
-34
lines changed

.config/tsaoptions.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"instanceUrl": "https://devdiv.visualstudio.com/",
3+
"template": "TFSDEVDIV",
4+
"projectName": "DEVDIV",
5+
"areaPath": "DevDiv\\NET Tools\\SDK",
6+
"iterationPath": "DevDiv",
7+
"notificationAliases": [ "dotnetdevexcli@microsoft.com" ],
8+
"repositoryName": "dotnet-sdk",
9+
"codebaseName": "dotnet-sdk"
10+
}

.vsts-ci.yml

+10-23
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ extends:
7878
name: $(DncEngInternalBuildPool)
7979
image: 1es-windows-2022
8080
os: windows
81+
policheck:
82+
enabled: true
83+
tsa:
84+
enabled: true
85+
binskim:
86+
enabled: true
8187
${{ if or(eq(parameters.runTestBuild, true), eq(variables['Build.Reason'], 'PullRequest')) }}:
8288
componentgovernance:
8389
# Refdoc: https://docs.opensource.microsoft.com/tools/cg/component-detection/variables/
@@ -101,6 +107,10 @@ extends:
101107
publishTaskPrefix: 1ES.
102108
runtimeSourceProperties: /p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
103109
locBranch: release/9.0.2xx
110+
# WORKAROUND: BinSkim requires the folder exist prior to scanning.
111+
preSteps:
112+
- powershell: New-Item -ItemType Directory -Path $(Build.SourcesDirectory)/artifacts/bin -Force
113+
displayName: Create artifacts/bin directory
104114
${{ if and(eq(parameters.runTestBuild, false), ne(variables['Build.Reason'], 'PullRequest')) }}:
105115
timeoutInMinutes: 90
106116
windowsJobParameterSets:
@@ -331,26 +341,3 @@ extends:
331341
name: $(DncEngInternalBuildPool)
332342
image: 1es-windows-2022
333343
os: windows
334-
335-
############### POST-BUILD STAGE ###############
336-
- template: /eng/common/templates-official/post-build/post-build.yml@self
337-
parameters:
338-
publishingInfraVersion: 3
339-
enableSymbolValidation: false
340-
enableSigningValidation: false
341-
enableNugetValidation: false
342-
enableSourceLinkValidation: false
343-
publishInstallersAndChecksums: true
344-
publishAssetsImmediately: true
345-
SDLValidationParameters:
346-
enable: false
347-
params: ' -SourceToolsList @("policheck","credscan")
348-
-TsaInstanceURL $(_TsaInstanceURL)
349-
-TsaProjectName $(_TsaProjectName)
350-
-TsaNotificationEmail $(_TsaNotificationEmail)
351-
-TsaCodebaseAdmin $(_TsaCodebaseAdmin)
352-
-TsaBugAreaPath $(_TsaBugAreaPath)
353-
-TsaIterationPath $(_TsaIterationPath)
354-
-TsaRepositoryName "dotnet-sdk"
355-
-TsaCodebaseName "dotnet-sdk"
356-
-TsaPublish $True'

eng/pipelines/templates/jobs/sdk-build.yml

+7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ parameters:
2727
osProperties: ''
2828
runtimeSourceProperties: ''
2929
officialBuildProperties: ''
30+
### ARCADE ###
31+
preSteps: []
3032

3133
jobs:
3234
- template: /eng/common/${{ parameters.oneESCompat.templateFolderName }}/job/job.yml
@@ -49,6 +51,11 @@ jobs:
4951
enableSbom: ${{ parameters.enableSbom }}
5052
variables:
5153
- ${{ insert }}: ${{ parameters.variables }}
54+
preSteps: ${{ parameters.preSteps }}
55+
templateContext:
56+
sdl:
57+
binskim:
58+
analyzeTargetGlob: +:f|eng\**\*.props;+:f|artifacts\bin\**\*.dll;+:f|artifacts\bin\**\*.exe;-:f|artifacts\bin\**\msdia140.dll;
5259

5360
steps:
5461
############## PREP ###############

eng/sdl-tsa-vars.config

-11
This file was deleted.

0 commit comments

Comments
 (0)