Skip to content

Commit 648b0ed

Browse files
committed
[CI] issue: 4705805 Add secret scan step
Make Secrets Scanner run as a step in CI Signed-off-by: Noam Tsemah <[email protected]>
1 parent 0dc96e0 commit 648b0ed

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

.ci/matrix_job.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ runs_on_dockers:
5555
- {name: 'toolbox', url: 'harbor.mellanox.com/hpcx/x86_64/rhel8.6/builder:inbox', category: 'tool', arch: 'x86_64'}
5656
- {name: 'blackduck', file: '.ci/dockerfiles/Dockerfile.rhel8.6', category: 'tool', arch: 'x86_64', tag: '20250630', uri: 'vma/$arch/$name/bduck', build_args: '--no-cache --target bduck'}
5757
- {name: 'header-check', url: 'harbor.mellanox.com/toolbox/header_check:0.0.58', category: 'tool', arch: 'x86_64', tag: '0.0.58'}
58+
- {name: 'secret-scan', url: 'harbor.mellanox.com/toolbox/secret_scan:0.0.23', arch: 'x86_64', tag: '0.0.23', category: 'tool', build_args: '--no-cache'}
5859

5960
runs_on_agents:
6061
- {nodeLabel: 'beni09', category: 'base'}
@@ -99,19 +100,31 @@ steps:
99100
archiveArtifacts: '*.log,*.tar.gz'
100101
parallel: false
101102

103+
- name: Secret Scan
104+
credentialsId: 'mellanox_github_credentials'
105+
enable: ${do_secretscan}
106+
containerSelector:
107+
- "{name: 'secret-scan', category: 'tool'}"
108+
agentSelector:
109+
- "{nodeLabel: 'skip-agent'}"
110+
run: |
111+
env GITHUB_TOKEN=$MELLANOX_GH_TOKEN /opt/nvidia/secret_scan.py --path $WORKSPACE --git-repo $WORKSPACE --report-file secret_scan.html
112+
archiveArtifacts: '*.html'
113+
parallel: false
114+
102115
- name: Install Doca-host
103116
containerSelector:
104117
- "{category: 'base'}"
105118
agentSelector:
106119
- "{nodeLabel: 'skip-agent'}"
107120
run: |
108121
echo "Installing DOCA: ${DOCA_VERSION} ..."
109-
.ci/scripts/doca_install.sh
122+
.ci/scripts/doca_install.sh
110123
111124
- name: Install Doca-host on Tools
112125
run: |
113126
echo "Installing DOCA: ${DOCA_VERSION} ..."
114-
.ci/scripts/doca_install.sh
127+
.ci/scripts/doca_install.sh
115128
containerSelector:
116129
- "{name: 'style', category: 'tool'}"
117130
agentSelector:
@@ -126,7 +139,7 @@ steps:
126139
enable: ${do_build}
127140
run: |
128141
[ "x${do_build}" == "xtrue" ] && action=yes || action=no
129-
env WORKSPACE=$PWD TARGET=${flags} jenkins_test_build=${action} ./contrib/test_jenkins.sh
142+
env WORKSPACE=$PWD TARGET=${flags} jenkins_test_build=${action} ./contrib/test_jenkins.sh
130143
parallel: false
131144
onfail: |
132145
./.ci/artifacts.sh
@@ -321,7 +334,7 @@ steps:
321334
.ci/blackduck_source.sh
322335
fi
323336
archiveArtifacts: 'logs/'
324-
credentialsId:
337+
credentialsId:
325338
- "swx-jenkins2-svc-gerrit-ssh-key"
326339
- "blackduck_api_token"
327340

.ci/proj_jjb.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,16 @@
100100
description: "Collect artifacts."
101101
- bool:
102102
name: "do_blackduck"
103-
default: false
103+
default: false
104104
description: "Run BlackDuck."
105105
- bool:
106106
name: "do_copyrights"
107107
default: true
108108
description: "Check copyrights in source headers"
109+
- bool:
110+
name: "do_secretscan"
111+
default: true
112+
description: "Check for secrets in source code"
109113
triggers:
110114
- github-pull-request:
111115
cron: 'H/5 * * * *'

0 commit comments

Comments
 (0)