forked from danielpenagos/reactjs-shopping-cart
-
Notifications
You must be signed in to change notification settings - Fork 46
/
azure-pipelines-checkov.yml
70 lines (66 loc) · 2.2 KB
/
azure-pipelines-checkov.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
67
68
69
70
# Checkov
# Análisis de archivos Dockerfile
#
trigger: none # Disable CI triggers.
#- master
resources:
- repo: self
variables:
# a regular variable
- name: dockerfilePath
value: '$(Build.SourcesDirectory)/Dockerfile'
- name: tag
value: 'latest'
- name: vmImageName
value: 'ubuntu-latest'
# a variable group
- group: Mis_Variables
stages:
- stage: CodeSecurityScan
displayName: Code Security Scan
jobs:
- job: Checkov
displayName: Checkov
pool:
vmImage: $(vmImageName)
steps:
- task: Bash@3
displayName: 'Install Checkov CLI'
inputs:
targetType: 'inline'
script: |
echo 'Install Checkov'
pip3 install checkov
mkdir checkov-report
- task: Bash@3
displayName: 'Checkov Dockerfile Analysis'
inputs:
targetType: 'inline'
script: |
checkov -d . --soft-fail --framework all --output junitxml > ./checkov-report/TEST-checkov-IaC-report.xml
# - task: Bash@3
# displayName: 'Checkov SCA Analysis'
# inputs:
# targetType: 'inline'
# script: |
# checkov -d . --soft-fail --framework sca_package --bc-api-key $(API) --output junitxml > ./checkov-report/TEST-checkov-SCA-report.xml
- task: PublishTestResults@2
displayName: 'Checkov Dockerfile Report'
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/TEST-checkov-IaC-report.xml'
searchFolder: '$(System.DefaultWorkingDirectory)/checkov-report'
mergeTestResults: false
testRunTitle: 'Checkov Dockerfile Report'
failTaskOnFailedTests: false
publishRunAttachments: true
# - task: PublishTestResults@2
# displayName: 'Checkov SCA Report'
# inputs:
# testResultsFormat: 'JUnit'
# testResultsFiles: '**/TEST-checkov-SCA-report.xml'
# searchFolder: '$(System.DefaultWorkingDirectory)/checkov-report'
# mergeTestResults: false
# testRunTitle: 'Checkov SCA Report'
# failTaskOnFailedTests: false
# publishRunAttachments: true