-
Notifications
You must be signed in to change notification settings - Fork 0
/
Checkmarx.gitlab-ci-debug.yml
182 lines (177 loc) · 5.7 KB
/
Checkmarx.gitlab-ci-debug.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#
# Include this file in your .gitlab-ci.yml file to automate & integrate Checkmarx security scans.
#
# These variables can be overridden in your .gitlab-ci.yml file or as envionrment variables.
#
# Please refer to https://checkmarx.com/gitlab for detailed instructions.
#
variables:
GITLAB_URL: "${CI_SERVER_URL}"
GITLAB_API_URL: "${CI_API_V4_URL}"
CHECKMARX_DOCKER_IMAGE: "cx-flow"
CX_FLOW_BUG_TRACKER: "GitLab"
CX_FLOW_BUG_TRACKER_IMPL: ${CX_FLOW_BUG_TRACKER}
CX_FLOW_EXE: "java -jar /app/cx-flow.jar"
#CX_FLOW_EXE: "java -Dhttp.proxySet=true -Dhttp.proxyHost=ericfriese.com -Dhttp.proxyPort=3128 -XshowSettings:all -jar /app/cx-flow.jar"
CX_PROJECT: "$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME"
CHECKMARX_VERSION: "9.0"
CHECKMARX_SETTINGS_OVERRIDE: "false"
CHECKMARX_EXCLUDE_FILES: ""
CHECKMARX_EXCLUDE_FOLDERS: ""
CHECKMARX_CONFIGURATION: "Default Configuration"
CHECKMARX_SCAN_PRESET: "Checkmarx Default"
CX_FLOW_FILTER_SEVERITY: "High"
CX_FLOW_FILTER_CATEGORY: ""
CX_FLOW_FILTER_CWE: ""
CX_FLOW_FILTER_STATUS: ""
CX_FLOW_FILTER_STATE: ""
CX_FLOW_ENABLED_VULNERABILITY_SCANNERS: sast
CX_FLOW_ZIP_EXCLUDE: ".jar"
CX_TEAM: "/CxServer/"
CX_FLOW_BREAK_BUILD: "false"
SCA_FILTER_SEVERITY: ""
SCA_FILTER_SCORE: ""
SCA_THRESHOLDS_SCORE: ""
SCA_TEAM: ""
GITLAB_BLOCK_MERGE: "false"
GITLAB_ERROR_MERGE: "false"
SECURITY_DASHBOARD_ON_MR: "false"
PARAMS: ""
checkmarx-scan-security-dashboard:
stage: test
rules:
- if: '$CX_FLOW_BUG_TRACKER == "GitLabDashboard" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
image:
name: checkmarx/${CHECKMARX_DOCKER_IMAGE}
entrypoint: ['']
variables:
CHECKMARX_INCREMENTAL: "false"
script:
- ${CX_FLOW_EXE}
--scan
--app="${CI_PROJECT_NAME}"
--namespace="${CI_PROJECT_NAMESPACE}"
--repo-name="${CI_PROJECT_NAME}"
--repo-url="${CI_REPOSITORY_URL}"
--cx-team="${CX_TEAM}"
--cx-project="${CX_PROJECT}"
--branch="${CI_COMMIT_BRANCH}"
--spring.profiles.active="${CX_FLOW_ENABLED_VULNERABILITY_SCANNERS}"
--f=.
${PARAMS}
artifacts:
reports:
sast: gl-sast-report.json
dependency_scanning: gl-dependency-scanning-report.json
checkmarx-scan:
stage: test
rules:
- if: '$CX_FLOW_BUG_TRACKER != "GitLabDashboard" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
image:
name: checkmarx/${CHECKMARX_DOCKER_IMAGE}
entrypoint: ['']
variables:
CHECKMARX_INCREMENTAL: "false"
before_script:
- echo ${CX_FLOW_EXE}
- ls /builds/CxFriese/flowgoat
script:
- ${CX_FLOW_EXE}
--scan
--app="${CI_PROJECT_NAME}"
--namespace="${CI_PROJECT_NAMESPACE}"
--repo-name="${CI_PROJECT_NAME}"
--branch="${CI_COMMIT_BRANCH}"
--cx-team="${CX_TEAM}"
--cx-project="${CX_PROJECT}"
--spring.profiles.active="${CX_FLOW_ENABLED_VULNERABILITY_SCANNERS}"
--f=/builds/CxFriese/flowgoat/.
${PARAMS}
after_script:
- wget https://download.checkmarx.com/9.4.0_GA/Plugins/CxConsolePlugin-1.1.11.zip
- apk add py3-pip
- unzip CxConsolePlugin-1.1.11.zip
- ./runCxConsole.sh
OsaScan
-v
-Projectname
"${CX_TEAM}"/"${CX_PROJECT}"
-CxServer
"${CHECKMARX_BASE_URL}"
-cxuser
"${CHECKMARX_USERNAME}"
-cxpassword
"${CHECKMARX_PASSWORD}"
-OsaLocationPath
"${CI_PROJECT_DIR}"
- apk add git
- apk add file
- git clone https://${GITHUB_TOKEN}@github.com/CxFriese/cxsbom-demo.git
- chmod +x cxsbom-demo/cxsbom
- ./cxsbom-demo/cxsbom
--project
"${CX_PROJECT}"
--server
"${CHECKMARX_SBOM_URL}"
--username
"${CHECKMARX_USERNAME}"
--password
"${CHECKMARX_PASSWORD}"
--scan-id
"4a847d9e-ea9d-437e-ba25-104a6b65cd9f"
artifacts:
paths:
- sbom.json
checkmarx-scan-mr:
stage: test
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
image:
name: checkmarx/${CHECKMARX_DOCKER_IMAGE}
entrypoint: ['']
variables:
CHECKMARX_INCREMENTAL: "true"
script:
- ${CX_FLOW_EXE}
--scan
--bug-tracker="GITLABMERGE"
--app="${CI_PROJECT_NAME}"
--namespace="${CI_PROJECT_NAMESPACE}"
--repo-name="${CI_PROJECT_NAME}"
--repo-url="${CI_REPOSITORY_URL}"
--cx-team="${CX_TEAM}"
--cx-project="${CX_PROJECT}"
--branch="${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
--project-id="${CI_PROJECT_ID}"
--merge-id="${CI_MERGE_REQUEST_IID}"
--spring.profiles.active="${CX_FLOW_ENABLED_VULNERABILITY_SCANNERS}"
--f=.
${PARAMS}
checkmarx-scan-security-dashboard-on-mr:
stage: .post
needs: ["checkmarx-scan-mr"]
rules:
- if: '$SECURITY_DASHBOARD_ON_MR == "true" && $CI_PIPELINE_SOURCE == "merge_request_event"'
image:
name: checkmarx/${CHECKMARX_DOCKER_IMAGE}
entrypoint: ['']
variables:
CX_FLOW_BUG_TRACKER: "GitLabDashboard"
CX_FLOW_BUG_TRACKER_IMPL: ${CX_FLOW_BUG_TRACKER}
script:
- ${CX_FLOW_EXE}
--project
--app="${CI_PROJECT_NAME}"
--namespace="${CI_PROJECT_NAMESPACE}"
--repo-name="${CI_PROJECT_NAME}"
--repo-url="${CI_REPOSITORY_URL}"
--cx-team="${CX_TEAM}"
--cx-project="${CX_PROJECT}"
--branch="${CI_COMMIT_BRANCH}"
--spring.profiles.active="${CX_FLOW_ENABLED_VULNERABILITY_SCANNERS}"
--f=.
${PARAMS}
artifacts:
reports:
sast: gl-sast-report.json
dependency_scanning: gl-dependency-scanning-report.json