Skip to content

Commit 2585928

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 f70f88d commit 2585928

File tree

2 files changed

+35
-18
lines changed

2 files changed

+35
-18
lines changed

.ci/matrix_job.yaml

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ job: LIBVMA
33

44
step_allow_single_selector: false
55

6-
registry_host: harbor.mellanox.com
6+
registry_host: nbu-harbor.gtm.nvidia.com
77
registry_auth: swx-infra_harbor_credentials
88
registry_path: /swx-infra/media
99

@@ -17,10 +17,10 @@ kubernetes:
1717
arch_table:
1818
x86_64:
1919
nodeSelector: 'kubernetes.io/arch=amd64'
20-
jnlpImage: 'harbor.mellanox.com/toolbox/c3po-jnlp:latest'
20+
jnlpImage: 'nbu-harbor.gtm.nvidia.com/toolbox/c3po-jnlp:latest'
2121
aarch64:
2222
nodeSelector: 'kubernetes.io/arch=arm64'
23-
jnlpImage: 'harbor.mellanox.com/toolbox/c3po-jnlp:latest'
23+
jnlpImage: 'nbu-harbor.gtm.nvidia.com/toolbox/c3po-jnlp:latest'
2424

2525
volumes:
2626
- {mountPath: /hpc/local/bin, hostPath: /hpc/local/bin}
@@ -42,19 +42,20 @@ env:
4242

4343
runs_on_dockers:
4444
# doca-host
45-
- {name: 'rhel8.6-x86_64', url: 'harbor.mellanox.com/hpcx/x86_64/rhel8.6/base', category: 'base', arch: 'x86_64'}
46-
- {name: 'rhel9.0-x86_64', url: 'harbor.mellanox.com/hpcx/x86_64/rhel9.0/base', category: 'base', arch: 'x86_64'}
45+
- {name: 'rhel8.6-x86_64', url: 'nbu-harbor.gtm.nvidia.com/hpcx/x86_64/rhel8.6/base', category: 'base', arch: 'x86_64'}
46+
- {name: 'rhel9.0-x86_64', url: 'nbu-harbor.gtm.nvidia.com/hpcx/x86_64/rhel9.0/base', category: 'base', arch: 'x86_64'}
4747
- {name: 'rhel9.4-aarch64', file: '.ci/dockerfiles/Dockerfile.rhel9.4', category: 'base', arch: 'aarch64', tag: '20250203', uri: 'vma/$arch/$name/build', build_args: '--build-arg ARCH=aarch64 --no-cache'}
48-
- {name: 'ub24.04-x86_64', url: 'harbor.mellanox.com/hpcx/x86_64/ubuntu24.04/base', category: 'base', arch: 'x86_64'}
49-
- {name: 'ub24.04-aarch64', url: 'harbor.mellanox.com/hpcx/aarch64/ubuntu24.04/base', category: 'base', arch: 'aarch64'}
50-
- {name: 'sl15sp4-x86_64', url: 'harbor.mellanox.com/hpcx/x86_64/sles15sp4/base', category: 'base', arch: 'x86_64'}
51-
- {name: 'rhel8.6-inbox-x86_64', url: 'harbor.mellanox.com/hpcx/x86_64/rhel8.6/builder:inbox', category: 'base', arch: 'x86_64'}
52-
- {name: 'ub22.04-x86_64', url: 'harbor.mellanox.com/hpcx/x86_64/ubuntu22.04/base', category: 'base', arch: 'x86_64'}
53-
- {name: 'ub22.04-aarch64', url: 'harbor.mellanox.com/hpcx/aarch64/ubuntu22.04/base', category: 'base', arch: 'aarch64'}
48+
- {name: 'ub24.04-x86_64', url: 'nbu-harbor.gtm.nvidia.com/hpcx/x86_64/ubuntu24.04/base', category: 'base', arch: 'x86_64'}
49+
- {name: 'ub24.04-aarch64', url: 'nbu-harbor.gtm.nvidia.com/hpcx/aarch64/ubuntu24.04/base', category: 'base', arch: 'aarch64'}
50+
- {name: 'sl15sp4-x86_64', url: 'nbu-harbor.gtm.nvidia.com/hpcx/x86_64/sles15sp4/base', category: 'base', arch: 'x86_64'}
51+
- {name: 'rhel8.6-inbox-x86_64', url: 'nbu-harbor.gtm.nvidia.com/hpcx/x86_64/rhel8.6/builder:inbox', category: 'base', arch: 'x86_64'}
52+
- {name: 'ub22.04-x86_64', url: 'nbu-harbor.gtm.nvidia.com/hpcx/x86_64/ubuntu22.04/base', category: 'base', arch: 'x86_64'}
53+
- {name: 'ub22.04-aarch64', url: 'nbu-harbor.gtm.nvidia.com/hpcx/aarch64/ubuntu22.04/base', category: 'base', arch: 'aarch64'}
5454
# tool
55-
- {name: 'toolbox', url: 'harbor.mellanox.com/hpcx/x86_64/rhel8.6/builder:inbox', category: 'tool', arch: 'x86_64'}
55+
- {name: 'toolbox', url: 'nbu-harbor.gtm.nvidia.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'}
57-
- {name: 'header-check', url: 'harbor.mellanox.com/toolbox/header_check:0.0.58', category: 'tool', arch: 'x86_64', tag: '0.0.58'}
57+
- {name: 'header-check', url: 'nbu-harbor.gtm.nvidia.com/toolbox/header_check:0.0.58', category: 'tool', arch: 'x86_64', tag: '0.0.58'}
58+
- {name: 'secret-scan', url: 'nbu-harbor.gtm.nvidia.com/toolbox/secret_scan:0.0.23', arch: 'x86_64', tag: '0.0.23', category: 'tool'}
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)