Skip to content

Commit

Permalink
Fix kube-linter issues
Browse files Browse the repository at this point in the history
* run containers as non root
* run containers with read only root file system

The 'mc' init container is using the /tmp folder so for that container,
mount an empty dir volume to /tmp to be able to set root file system
readonly while being able to write to /tmp.

PLNSRVCE-1476

Signed-off-by: Hugo Arès <[email protected]>
  • Loading branch information
hugares authored and Roming22 committed Oct 16, 2023
1 parent e6c4eb7 commit b707aab
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,11 @@ spec:
- name: ca-s3
mountPath: /etc/ssl/certs/s3-cert.crt
subPath: s3-cert.crt
- name: tmp-mc-volume
mountPath: /tmp
securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
volumes:
- name: tmp-mc-volume
emptyDir: {}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ spec:
limits:
memory: "512Mi"
cpu: "500m"
securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
restartPolicy: Always
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ spec:
)" \
--dry-run=client \
-o yaml | kubectl apply -f -
securityContext:
readOnlyRootFilesystem: true
runAsNonRoot: true
dnsPolicy: ClusterFirst
restartPolicy: OnFailure
terminationGracePeriodSeconds: 30
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ spec:
- "--v=6"
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
capabilities:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ spec:
secretKeyRef:
name: tekton-results-database
key: db.name
securityContext:
readOnlyRootFilesystem: true
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ spec:
secretKeyRef:
key: endpoint
name: tekton-results-s3
securityContext:
readOnlyRootFilesystem: true
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ spec:
"-auth_mode",
"token",
]
securityContext:
readOnlyRootFilesystem: true
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ spec:
- "--v=6"
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
capabilities:
Expand Down

0 comments on commit b707aab

Please sign in to comment.