Skip to content

Commit 5347eb4

Browse files
committed
Scope Trivy scan to app manifests and fix pod security context
1 parent 6509076 commit 5347eb4

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

.github/workflows/platform-iac-ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515

1616
permissions:
1717
contents: read
18+
security-events: write
1819

1920
jobs:
2021
quality-gates:
@@ -45,4 +46,22 @@ jobs:
4546
with:
4647
directory: .
4748
framework: cloudformation,terraform,github_actions
49+
soft_fail: false
50+
output_format: cli,sarif
51+
output_file_path: console,results.sarif
4852
quiet: true
53+
54+
- name: Upload Checkov SARIF report
55+
if: always()
56+
uses: github/codeql-action/upload-sarif@v4
57+
with:
58+
sarif_file: results.sarif
59+
60+
- name: Static security scan (Trivy IaC misconfigurations)
61+
uses: aquasecurity/trivy-action@v0.35.0
62+
with:
63+
scan-type: config
64+
scan-ref: applications/gitops/base
65+
hide-progress: true
66+
severity: CRITICAL,HIGH
67+
exit-code: '1'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ It is also curated as a **Platform Engineering consulting profile project** that
1818
- Secure-by-default guardrails and policy checks
1919
- Repository structure for multi-team and multi-environment operation
2020
- Backstage software template example for self-service service creation
21-
- CI pipeline for platform IaC quality gates (fmt/validate/lint/security)
21+
- CI pipeline for platform IaC quality gates (build/test/synth + Checkov + Trivy security scans)
2222
- GitOps-oriented app delivery guardrails
2323
- OPA/Conftest policy bundle for Kubernetes deployment security checks
2424
- Day-2 DX helpers via `Makefile`

applications/gitops/base/sample-service.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ spec:
2222
labels:
2323
app.kubernetes.io/name: sample-service
2424
spec:
25+
securityContext:
26+
runAsNonRoot: true
27+
seccompProfile:
28+
type: RuntimeDefault
2529
containers:
2630
- name: app
2731
image: nginx:1.27.0

0 commit comments

Comments
 (0)