forked from fortify/IWA-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-fortify-sast-scancentral.yml
66 lines (62 loc) · 2.37 KB
/
azure-pipelines-fortify-sast-scancentral.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Integrate Fortify ScanCentral Static AppSec Testing (SAST) into your Azure DevOps pipeline
# The following pipeline variables must be defined before using SAST stage
# - $_FCLI_DEFAULT_SC_SAST_CLIENT_AUTH_TOKEN
# - $_FCLI_DEFAULT_SSC_USER
# - $_FCLI_DEFAULT_SSC_PASSWORD
# - $_FCLI_DEFAULT_SSC_CI_TOKEN
# - $_FCLI_DEFAULT_SSC_URL
# - $_SSC_APP_VERSION_ID
trigger:
- none
stages:
- stage: Build
jobs:
- job: Build
displayName: Building IWA Project
pool:
vmImage: ubuntu-latest
steps:
- task: Maven@4
displayName: 'Maven pom.xml'
inputs:
mavenPomFile: 'pom.xml'
mavenOptions: '-Xmx3072m'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.17'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
goals: 'package'
- job: SAST
displayName: Fortify SAST
dependsOn:
- Build
pool:
vmImage: ubuntu-latest
container:
image: fortifydocker/fortify-ci-tools:5.4.1-jdk-17
options: "--add-host=$(_SSC_HOST)"
env:
FCLI_DEFAULT_SC_SAST_CLIENT_AUTH_TOKEN: $(_FCLI_DEFAULT_SC_SAST_CLIENT_AUTH_TOKEN)
FCLI_DEFAULT_SSC_USER: $(_FCLI_DEFAULT_SSC_USER)
FCLI_DEFAULT_SSC_PASSWORD: $(_FCLI_DEFAULT_SSC_PASSWORD)
FCLI_DEFAULT_SSC_CI_TOKEN: $(_FCLI_DEFAULT_SSC_CI_TOKEN)
FCLI_DEFAULT_SSC_URL: $(_FCLI_DEFAULT_SSC_URL)
SSC_APP_VERSION_ID: $(_SSC_APP_VERSION_ID)
SC_SAST_SENSOR_VERSION: 24.2
steps:
- script: |
echo Setting connection with Fortify Platform
echo "$(_SSC_HOST_ENTRY)" >> /etc/hosts
#Use --insecure switch if the SSL certificate is self generated.
fcli ssc session login
fcli sc-sast session login
scancentral package -bt mvn -o package.zip
fcli sc-sast scan start --publish-to=$SSC_APP_VERSION_ID --sensor-version=$SC_SAST_SENSOR_VERSION --package-file=package.zip --store=Id
fcli sc-sast scan wait-for ::Id:: --interval=30s
fcli ssc issue count --appversion=$SSC_APP_VERSION_ID
echo Terminating connection with Fortify Platform
fcli sc-sast session logout
fcli ssc session logout
displayName: Scan Central Scan
continueOnError: false