Skip to content

Commit 3be8e04

Browse files
committed
run as nonroot
1 parent 01bb6a8 commit 3be8e04

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/modules/kubectl.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,9 @@ export class Kubectl {
574574
},
575575
spec: {
576576
restartPolicy: 'Never',
577+
securityContext: {
578+
runAsUser: 1000
579+
},
577580
containers: [
578581
{
579582
name: 'trivy-repo-scan',
@@ -589,6 +592,8 @@ export class Kubectl {
589592
"json",
590593
"--scanners",
591594
"vuln,secret,config",
595+
"--cache-dir",
596+
"/tmp/trivy",
592597
"--exit-code",
593598
"0"
594599
],
@@ -627,6 +632,9 @@ export class Kubectl {
627632
},
628633
spec: {
629634
restartPolicy: 'Never',
635+
securityContext: {
636+
runAsUser: 1000
637+
},
630638
containers: [
631639
{
632640
name: 'trivy-repo-scan',
@@ -640,6 +648,8 @@ export class Kubectl {
640648
"json",
641649
"--scanners",
642650
"vuln",
651+
"--cache-dir",
652+
"/tmp/trivy",
643653
"--exit-code",
644654
"0"
645655
],

0 commit comments

Comments
 (0)