feat(lab11): hardened nginx + ModSec WAF sidecar + OWASP CRS blocking SQL injection#1555
Open
Meliman1000-7 wants to merge 32 commits into
Open
feat(lab11): hardened nginx + ModSec WAF sidecar + OWASP CRS blocking SQL injection#1555Meliman1000-7 wants to merge 32 commits into
Meliman1000-7 wants to merge 32 commits into
Conversation
feat(lab1): juice shop deploy + PR template + triage report
feat(lab2): Threagile threat model + secure variant + auth flow bonus
feat(lab3): SSH commit signing + gitleaks pre-commit + history rewrite
feat(lab4): SBOM generation + SCA with Syft/Grype + Trivy comparison + sign-ready attestation
feat(lab5): ZAP baseline + authenticated DAST + Semgrep SAST + SQL injection correlation
feat(lab6): Checkov + KICS comparison across Terraform/Ansible/Pulumi + custom policy
feat(lab7): add Trivy security scanning and Kubernetes hardening
feat(lab8): cosign image signing, sbom, provenance and blob verification
feat(lab9): falco custom rules + conftest hardening policies + cryptominer detection
feat(lab10): DefectDojo capstone — 390 findings, SLA matrix, governance report + interview walkthrough
pulling fixes from main to fork
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
Configure a production-grade Nginx reverse proxy in front of Juice Shop: TLS 1.3 only, full security-header set, rate limiting, cipher hardening, cert-rotation runbook, and (bonus) ModSecurity v3 + OWASP CRS WAF sidecar that blocks SQL injection payloads Nginx alone passes.
Changes
Testing
Stack startup:
docker compose up -d
→ lab11-juice-1 Up, lab11-nginx-1 Up (80/443)
HTTP → HTTPS redirect:
curl -sI http://localhost
→ 308 Permanent Redirect → https://localhost/
TLS 1.3 + cipher:
openssl s_client -connect localhost:443 -tls1_3
→ Cipher: AEAD-CHACHA20-POLY1305-SHA256, Server Temp Key: X25519 253 bits
Security headers (all 6):
curl -skI https://localhost
→ strict-transport-security: max-age=63072000; includeSubDomains; preload
→ x-frame-options: DENY
→ x-content-type-options: nosniff
→ referrer-policy: strict-origin-when-cross-origin
→ permissions-policy: camera=(), geolocation=(), microphone=()
→ content-security-policy-report-only: default-src 'self'; ...
Rate limit:
seq 1 60 | xargs -n1 -P 30 curl -sk -o /dev/null -w "%{http_code}\n" https://localhost/rest/user/login | sort | uniq -c
→ 54 × 429, 6 × 500
WAF sidecar:
docker compose -f docker-compose.yml -f waf/docker-compose.override.yml up -d
→ lab11-waf-1 Up (healthy) on 8080/8443
SQL injection through Nginx alone:
curl -sk "https://localhost/rest/products/search?q=%27%20OR%201%3D1--"
→ HTTP 500 (passed through, Juice Shop error)
SQL injection through WAF:
curl -sk "http://localhost:8080/rest/products/search?q=%27%20OR%201%3D1--"
→ HTTP 403 (blocked by rule 942100 — SQL Injection via libinjection, anomaly score 5/5)
Artifacts & Screenshots
Checklist