You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add examples/nodejs-secure/: a hardened Node.js Dockerfile that pairs with the existing examples/nodejs-vulnerable/ demo. Together they form a high-impact before/after learning path for DockSec users.
Problem Statement
We have an intentionally weak Node example (nodejs-vulnerable) but no in-repo remediation counterpart. Users cannot easily:
Compare Hadolint warnings side by side
See security score improvement after fixes
Use AI remediation output against a concrete "fixed" reference Dockerfile
This gap reduces the educational value of the examples directory and makes demos harder for contributors and OWASP talks.
Proposed Solution
Add examples/nodejs-secure/ with:
Practice
Implementation
Pinned base image
node:22-bookworm-slim (or current LTS, not latest)
Summary
Add
examples/nodejs-secure/: a hardened Node.js Dockerfile that pairs with the existingexamples/nodejs-vulnerable/demo. Together they form a high-impact before/after learning path for DockSec users.Problem Statement
We have an intentionally weak Node example (
nodejs-vulnerable) but no in-repo remediation counterpart. Users cannot easily:This gap reduces the educational value of the examples directory and makes demos harder for contributors and OWASP talks.
Proposed Solution
Add
examples/nodejs-secure/with:node:22-bookworm-slim(or current LTS, notlatest)deps/build/runtimestagesUSER node(or dedicatedappuser)npm ci --omit=devin build stage.dockerignore(excludenode_modules,.git)ENV API_KEY; document runtime secrets--no-install-recommends, clean apt listsNODE_ENV=production, minimal runtime files copiedInclude:
Dockerfilepackage.json,server.js(can mirror vulnerable app behavior).dockerignoreREADME.mdwith scan commands and expected score higher than vulnerable exampleExample usage:
Update
examples/README.mdwith a "Node.js remediation path" row linking both folders.Why this example is high value
Alternatives considered
Use Case
Acceptance Criteria
examples/nodejs-secure/builds successfully withdocker builddocksec ... --scan-onlyruns on Dockerfile and built imagenodejs-vulnerableexamples/README.mdupdated with remediation pathRelated Issues
.dockerignore(foundation)