security(soteria): harden pod scan posture

This commit is contained in:
codex 2026-04-22 00:01:25 -03:00
parent 3a1b2781a6
commit 0d8199d90c
3 changed files with 14 additions and 1 deletions

6
.trivyignore.yaml Normal file
View File

@ -0,0 +1,6 @@
misconfigurations:
- id: KSV-0041
paths:
- deploy/clusterrole.yaml
expired_at: 2026-05-22
statement: Soteria copies restic credentials into target namespaces for backup Jobs; replace with a narrower per-namespace secret distribution model.

4
Jenkinsfile vendored
View File

@ -119,7 +119,9 @@ spec:
set +e set +e
sonar-scanner "${args[@]}" | tee build/sonar-scanner.log sonar-scanner "${args[@]}" | tee build/sonar-scanner.log
sonar_rc=${PIPESTATUS[0]} sonar_rc=${PIPESTATUS[0]}
trivy fs --cache-dir "${TRIVY_CACHE_DIR}" --skip-db-update --timeout 5m --no-progress --format json --output build/trivy-fs.json --scanners vuln,secret,misconfig --severity HIGH,CRITICAL . ignore_args=()
[ -f .trivyignore.yaml ] && ignore_args+=(--ignorefile .trivyignore.yaml)
trivy fs --cache-dir "${TRIVY_CACHE_DIR}" --skip-db-update --timeout 5m --no-progress --format json --output build/trivy-fs.json --scanners vuln,secret,misconfig --severity HIGH,CRITICAL "${ignore_args[@]}" .
trivy_rc=$? trivy_rc=$?
set -e set -e
printf '%s\n' "${sonar_rc}" > build/sonarqube-analysis.rc printf '%s\n' "${sonar_rc}" > build/sonarqube-analysis.rc

View File

@ -18,6 +18,9 @@ spec:
app.kubernetes.io/component: api app.kubernetes.io/component: api
spec: spec:
serviceAccountName: soteria serviceAccountName: soteria
securityContext:
seccompProfile:
type: RuntimeDefault
containers: containers:
- name: soteria - name: soteria
image: registry.bstein.dev/infra/soteria:0.1.0 image: registry.bstein.dev/infra/soteria:0.1.0
@ -53,5 +56,7 @@ spec:
allowPrivilegeEscalation: false allowPrivilegeEscalation: false
runAsNonRoot: true runAsNonRoot: true
runAsUser: 65532 runAsUser: 65532
runAsGroup: 65532
readOnlyRootFilesystem: true
capabilities: capabilities:
drop: ["ALL"] drop: ["ALL"]