Skip to content

feat(lab7): trivy + PSS restricted + conftest gate#1330

Open
Philip-78 wants to merge 1 commit into
inno-devops-labs:mainfrom
Philip-78:feature/lab7
Open

feat(lab7): trivy + PSS restricted + conftest gate#1330
Philip-78 wants to merge 1 commit into
inno-devops-labs:mainfrom
Philip-78:feature/lab7

Conversation

@Philip-78

Copy link
Copy Markdown

Goal

Scan Juice Shop with Trivy (image + Dockerfile misconfig), deploy to K8s with PSS restricted hardening, and write a Conftest policy to gate non-compliant pods.

Changes

  • labs/lab7/k8s/ β€” namespace (PSS restricted), serviceaccount, hardened deployment, networkpolicy
  • labs/lab7/policies/pod-hardening.rego β€” Conftest policy gating runAsNonRoot, readOnlyRootFilesystem, allowPrivilegeEscalation, capabilities
  • submissions/lab7.md β€” Trivy scan results, K8s hardening proof, Conftest output

Testing

  • Trivy image: 5 Critical, 43 High (46 with fixes available)
  • Dockerfile misconfig: 4 findings including HIGH (USER root)
  • Pod running 1/1 in juice-shop namespace with PSS restricted enforced
  • Trivy K8s: 5C/43H vulns (image-level), 0 misconfigs on hardened manifest
  • Conftest PASS on hardened deployment, FAIL on bad manifest (2 deny messages)

Artifacts

  • submissions/lab7.md β€” full analysis

  • Task 1 β€” Trivy image + config scans + Grype comparison
  • Task 2 β€” Hardened K8s deployment with PSS restricted + NetworkPolicy
  • Bonus β€” Conftest policy passing on hardened + failing on bad manifest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant