@@ -299,6 +299,11 @@ steps:
299
299
args :
300
300
- ' -c'
301
301
- |
302
+ mkdir -p security_test/scan_target/ && find . -mindepth 1 -maxdepth 1 -type d ! -name "security_test" -exec cp -r {} security_test/scan_target/ \;
303
+ mkdir -p /workspace/security_test/scan_target
304
+ # Exclude /workspace/security_test from the copy to avoid recursive issue
305
+ find . -mindepth 1 -maxdepth 1 ! -path "./security_test" -exec cp -r {} /workspace/security_test/scan_target/ \;
306
+ chown -R 65532:65532 /workspace/security_test/scan_target
302
307
mkdir -p /workspace/security_test/allowlist
303
308
cp security_test/config.yaml /workspace/security_test/config.yaml
304
309
cp -r security_test/allowlist/* /workspace/security_test/allowlist/ || echo "Allowlist folder is empty or not found"
@@ -308,7 +313,7 @@ steps:
308
313
# gcr.io/cloud-builders/docker is a special image: This image provided by Google Cloud contains the docker command-line tool, which is essential for executing Docker commands like docker build and docker run within your Cloud Build steps.
309
314
# gcr.io/${_PROJECT_ID}/check_violations:latest is your application image: This image contains your security check tool and its dependencies. It's designed to be run, not to build or run other Docker images.
310
315
- name : ' gcr.io/cloud-builders/docker'
311
- id : ' run shipshape'
316
+ id : ' Run shipshape on cluster '
312
317
args :
313
318
- ' run'
314
319
- ' --network=cloudbuild'
@@ -322,16 +327,32 @@ steps:
322
327
- ' ${_SHIPSHAPE_IMAGE}'
323
328
- ' --mode=cluster'
324
329
- ' --allowlist_folder=/workspace/security_test/allowlist'
325
- - ' --cluster_name=ml-${SHORT_SHA}-${_PR_NUMBER}-${_BUILD_ID}-cluster'
326
- - ' --project_id=$PROJECT_ID'
327
- - ' --location=${_REGION}'
328
330
- ' --kube_config_path=/root/.kube/config'
329
331
- ' --max_wait_duration=3000'
330
332
- ' --max_parallel=100'
331
333
- ' --cluster_scan_config_path=/workspace/security_test/config.yaml'
332
334
allowFailure : true
333
335
waitFor : ['Copy metadata']
334
336
337
+
338
+ - id : ' Run Shipshape on helm'
339
+ name : ' gcr.io/cloud-builders/docker'
340
+ args :
341
+ - ' run'
342
+ - ' --network=cloudbuild'
343
+ - ' --rm'
344
+ - ' -v'
345
+ - ' /workspace/security_test/allowlist:/workspace/security_test/allowlist'
346
+ - ' -v'
347
+ - ' /workspace/security_test/scan_target:/workspace/security_test/scan_target'
348
+ - ' ${_SHIPSHAPE_IMAGE}'
349
+ - ' --mode=helm'
350
+ - ' --allowlist_folder=/workspace/security_test/allowlist'
351
+ - ' --scan_path=/workspace/security_test/scan_target'
352
+ - ' --max_wait_duration=60'
353
+ allowFailure : true
354
+ waitFor : ['Copy metadata']
355
+
335
356
- id : ' cleanup rag'
336
357
name : ' gcr.io/$PROJECT_ID/terraform'
337
358
entrypoint : ' bash'
@@ -358,7 +379,7 @@ steps:
358
379
-var=cloudsql_instance=pgvector-instance-$SHORT_SHA-$_BUILD_ID \
359
380
-auto-approve -no-color
360
381
allowFailure : true
361
- waitFor : ['run shipshape']
382
+ waitFor : ['Run shipshape on cluster', 'Run Shipshape on helm ']
362
383
363
384
- id : ' cleanup gke cluster'
364
385
name : ' gcr.io/$PROJECT_ID/terraform'
@@ -441,7 +462,7 @@ substitutions:
441
462
_USER_NAME : github
442
463
_AUTOPILOT_CLUSTER : " false"
443
464
_BUILD_ID : ${BUILD_ID:0:8}
444
- _SHIPSHAPE_IMAGE : us-docker.pkg.dev/k8ssecurityvalidation-agent/k8ssecurityvalidation-agent/k8ssecurityvalidation-agent@sha256:1f80ae746014330a3a83b5ee2fabeacf90fa488c4f0922072b628b95144f25c8
465
+ _SHIPSHAPE_IMAGE : us-docker.pkg.dev/k8ssecurityvalidation-agent/k8ssecurityvalidation-agent/k8ssecurityvalidation-agent@sha256:cd45e6cd84e9a45462ddbca18c4731fd4e264d517ee98131eb5be4eb57691f44
445
466
logsBucket : gs://ai-on-gke-build-logs
446
467
options :
447
468
substitutionOption : " ALLOW_LOOSE"
0 commit comments