Skip to content

Commit ef5c226

Browse files
authored
Update release build with compliance tasks (#1260)
1 parent fd13554 commit ef5c226

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed

.vsts-ci/releaseBuild.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
- job: build_windows
2020
pool: Package ES Lab A
2121

22+
# APIScan can take a long time
23+
timeoutInMinutes: 200
24+
2225
steps:
2326

2427
- checkout: self
@@ -41,6 +44,14 @@ jobs:
4144
- pwsh: |
4245
$(Build.SourcesDirectory)\build.ps1 -Bootstrap
4346
$(Build.SourcesDirectory)\build.ps1 -Configuration Release -Framework net461
47+
# Get module version
48+
$psd1Data = Import-PowerShellDataFile -Path $(Build.SourcesDirectory)\bin\Release\PSReadLine\PSReadLine.psd1
49+
$moduleVersion = $psd1Data.ModuleVersion
50+
$prerelease = $psd1Data.PrivateData.PSData.Prerelease
51+
if ($prerelease) { $moduleVersion = "$moduleVersion-$prerelease" }
52+
$vstsCommandString = "vso[task.setvariable variable=ModuleVersion]$moduleVersion"
53+
Write-Host "sending " + $vstsCommandString
54+
Write-Host "##$vstsCommandString"
4455
# Set target folder paths
4556
$vstsCommandString = "vso[task.setvariable variable=PSReadLine]$(Build.SourcesDirectory)\bin\Release\PSReadLine"
4657
Write-Host "sending " + $vstsCommandString
@@ -124,3 +135,8 @@ jobs:
124135
Get-ChildItem -Path $(PSReadLine)
125136
Write-Host "##vso[artifact.upload containerfolder=PSReadLine;artifactname=PSReadLine]$(PSReadLine)"
126137
displayName: 'Upload module artifacts'
138+
139+
- template: templates/compliance.yml
140+
parameters:
141+
configuration: Release
142+
framework: net461

.vsts-ci/templates/compliance.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
parameters:
2+
configuration: ""
3+
framework: ""
4+
5+
steps:
6+
7+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-antimalware.AntiMalware@3
8+
displayName: 'Run Defender Scan'
9+
10+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
11+
displayName: 'Run CredScan'
12+
inputs:
13+
debugMode: false
14+
continueOnError: true
15+
16+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3
17+
displayName: 'Run BinSkim '
18+
inputs:
19+
InputType: Basic
20+
AnalyzeTarget: '$(Build.SourcesDirectory)\bin\${{ parameters.configuration }}\PSReadLine\*.dll'
21+
AnalyzeSymPath: 'SRV*'
22+
AnalyzeVerbose: true
23+
AnalyzeHashes: true
24+
AnalyzeStatistics: true
25+
continueOnError: true
26+
27+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@1
28+
displayName: 'Run PoliCheck'
29+
inputs:
30+
targetType: F
31+
optionsFC: 0
32+
optionsXS: 0
33+
optionsPE: '1|2|3|4'
34+
optionsHMENABLE: 0
35+
# optionsRulesDBPath: '$(Build.SourcesDirectory)\tools\terms\PowerShell-Terms-Rules.mdb'
36+
# optionsFTPATH: '$(Build.SourcesDirectory)\tools\terms\FileTypeSet.xml'
37+
toolVersion: 5.8.2.1
38+
continueOnError: true
39+
40+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-apiscan.APIScan@1
41+
displayName: 'Run APIScan'
42+
inputs:
43+
softwareFolder: '$(Build.SourcesDirectory)'
44+
softwareName: PSReadLine
45+
softwareVersionNum: '$(ModuleVersion)'
46+
isLargeApp: false
47+
preserveTempFiles: true
48+
continueOnError: true
49+
50+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@2
51+
displayName: 'Publish Security Analysis Logs to Build Artifacts'
52+
continueOnError: true
53+
54+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-uploadtotsa.TSAUpload@1
55+
displayName: 'TSA upload to Codebase: PSReadLine_201912 Stamp: Azure'
56+
inputs:
57+
tsaStamp: Azure
58+
codeBaseName: PSReadLine_201912
59+
tsaVersion: TsaV2
60+
uploadFortifySCA: false
61+
uploadFxCop: false
62+
uploadModernCop: false
63+
uploadPREfast: false
64+
uploadRoslyn: false
65+
uploadTSLint: false
66+
uploadAPIScan: true
67+
68+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-report.SdtReport@1
69+
displayName: 'Create Security Analysis Report'
70+
inputs:
71+
TsvFile: false
72+
APIScan: true
73+
BinSkim: true
74+
CredScan: true
75+
PoliCheck: true
76+
PoliCheckBreakOn: Severity2Above
77+
78+
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
79+
displayName: 'Component Detection'
80+
inputs:
81+
sourceScanPath: '$(Build.SourcesDirectory)'
82+
snapshotForceEnabled: true

0 commit comments

Comments
 (0)