feat(lab7): trivy + PSS restricted + conftest gate - #7
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Harden the Juice Shop Kubernetes deployment to Pod Security Standards
restricted(securityContext, NetworkPolicy, dedicated ServiceAccount), run Trivy image/config/k8s scans, and add a Conftest/Rego policy gate that fails CI on non-compliant pods.Changes
labs/lab7/k8s/namespace.yamlβ namespace with PSS labels (enforce/warn/audit: restricted)labs/lab7/k8s/serviceaccount.yamlβ dedicated ServiceAccount withautomountServiceAccountToken: falselabs/lab7/k8s/deployment.yamlβ hardened Deployment (pod + containersecurityContext,readOnlyRootFilesystem: truewithemptyDirmounts, resource limits/requests, image pinned by digest)labs/lab7/k8s/networkpolicy.yamlβ default-deny NetworkPolicy with explicit ingress (localhost/ingress controller) and egress (DNS + HTTPS) ruleslabs/lab7/policies/pod-hardening.regoβ Conftest/Rego policy gatingrunAsNonRoot,readOnlyRootFilesystem,allowPrivilegeEscalation, andcapabilities.drop: ["ALL"]submissions/lab7.mdβ full write-up: Trivy image scan results, top-10 fixable CVEs, Grype comparison, K8s hardening docs, Trivy k8s scan, readOnlyRootFilesystem debugging story, Conftest bonus resultsTesting
Artifacts & Screenshots
submissions/lab7.mdlabs/lab7/k8s/namespace.yamllabs/lab7/k8s/serviceaccount.yamllabs/lab7/k8s/deployment.yamllabs/lab7/k8s/networkpolicy.yamllabs/lab7/policies/pod-hardening.regoChecklist
feat(labN): <topic>stylesubmissions/lab7.md