Skip to content

Commit 749dd7f

Browse files
authored
Migrate security-tools pipeline from UI based to yaml (#19412)
* Migrate security-tools pipeline from UI based to yaml * Migrate security-tools pipeline from UI based to yaml * Update security-tools.yml Co-authored-by: wyunchi-ms <[email protected]>
1 parent e970e0b commit 749dd7f

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

.azure-pipelines/security-tools.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Variable 'IsGenerateBased' was defined in the Variables tab
2+
# Variable 'NugetSecurityAnalysisWarningLevel' was defined in the Variables tab
3+
# Variable 'OCTOKITPAT' was defined in the Variables tab
4+
# Cron Schedules have been converted using UTC Time Zone and may need to be updated for your location
5+
schedules:
6+
- cron: 0 4 * * 1,2,3,4,5
7+
branches:
8+
include:
9+
- main
10+
resources:
11+
repositories:
12+
- repository: self
13+
type: git
14+
ref: refs/heads/main
15+
jobs:
16+
- job: Job_1
17+
displayName: Main
18+
timeoutInMinutes: 120
19+
pool:
20+
name: pool-windows-2019
21+
steps:
22+
- checkout: self
23+
fetchTags: false
24+
- task: PowerShell@2
25+
displayName: Install platyPS
26+
inputs:
27+
targetType: inline
28+
script: Install-Module platyPS -Force -Confirm:$false -Scope CurrentUser
29+
pwsh: true
30+
- task: NodeTool@0
31+
displayName: Install Node 14.17.1
32+
condition: eq(variables.IsGenerateBased, true)
33+
inputs:
34+
versionSpec: 14.17.1
35+
- task: PowerShell@2
36+
displayName: Install autorest
37+
condition: eq(variables.IsGenerateBased, true)
38+
inputs:
39+
targetType: inline
40+
script: npm install autorest@latest;$env:NODE_OPTIONS="--max-old-space-size=65536"
41+
- task: PowerShell@2
42+
displayName: Build
43+
inputs:
44+
targetType: inline
45+
script: dotnet msbuilc build.proj /t:"Build;GenerateHelp" /p:"PullRequestNumber=$(System.PullRequest.PullRequestNumber);IsSecurityCheck=true"
46+
env:
47+
OCTOKITPAT: $(OCTOKITPAT)
48+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
49+
displayName: Run CredScan
50+
condition: in(variables['system.pullRequest.targetBranch'], 'generation', 'main')
51+
inputs:
52+
toolMajorVersion: V2
53+
outputFormat: sarif
54+
scanFolder: SecurityTmp
55+
suppressionsFile: tools/SecurityTools/CredScanSuppressions.json
56+
debugMode: false
57+
folderSuppression: false
58+
- task: PowerShell@2
59+
displayName: Cleanup Build
60+
inputs:
61+
targetType: inline
62+
script: ./tools/CleanupBuild.ps1
63+
pwsh: true
64+
- task: PoliCheck@1
65+
displayName: Run PoliCheck
66+
inputs:
67+
targetArgument: $(Build.SourcesDirectory)/artifacts/Debug
68+
result: $(Build.SourcesDirectory)/artifacts/result/PoliCheck.xml
69+
optionsFTPATH: tools/SecurityTools/PoliCheckFileExtensions.xml
70+
- task: PublishPipelineArtifact@0
71+
displayName: Save artifacts
72+
condition: succeededOrFailed()
73+
inputs:
74+
artifactName: artifacts
75+
targetPath: artifacts
76+
...

0 commit comments

Comments
 (0)