feat(lab7): trivy + PSS restricted + conftest gate#7
Open
demonit4028 wants to merge 1 commit into
Open
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
Scan Juice Shop image with Trivy (CVE + misconfig), deploy hardened K8s manifests with PSS restricted profile + NetworkPolicy, and add a Conftest Rego policy to gate non-compliant pods at CI time.
Changes
submissions/lab7.mdβ full submission with severity tables, top-10 CVEs, Grype comparison, hardened manifests, Conftest resultslabs/lab7/k8s/namespace.yamlβ namespace with PSS enforce/warn/audit = restrictedlabs/lab7/k8s/serviceaccount.yamlβ dedicated SA withautomountServiceAccountToken: falselabs/lab7/k8s/deployment.yamlβ full hardened:runAsNonRoot,readOnlyRootFilesystem,drop: ["ALL"], initContainers for writable volumes, pinned by digest, emptyDir at writable pathslabs/lab7/k8s/networkpolicy.yamlβ default-deny ingress/egress, allow port 3000 + DNS + HTTPSlabs/lab7/policies/pod-hardening.regoβ Rego policy checking 4 hardening rulesTesting
# Trivy image scan trivy image bkimminich/juice-shop:v20.0.0 \ --severity HIGH,CRITICAL \ --format json --output labs/lab7/results/trivy-image.jsonResult: 5 Critical, 43 High; 46 of 48 have fixes
# Trivy config scan trivy config /tmp/Dockerfile --severity HIGH,CRITICALResult: 1 failure β DS-0002 (USER root)
Result:
juice-shop-57bbdb5559-52ll4 Running 1/1# Trivy k8s scan trivy k8s --include-namespaces juice-shop --severity HIGH,CRITICAL --report summaryResult: 15 Critical, 129 High, 2 misconfigs, 6 secrets
Result: 5 tests, 5 passed
Result: 4 failures (missing runAsNonRoot, readOnlyRootFilesystem, allowPrivilegeEscalation, capabilities.drop)
Artifacts & Screenshots
submissions/lab7.mdChecklist
feat(labN): <topic>formatsubmissions/lab7.mdexists