Security: tighten Docker build contexts and .dockerignore rules#280
Merged
Conversation
6 tasks
- Fix apps/marketing-site/Dockerfile line 6: replace glob `COPY package.json package-lock.json* ./` with explicit `COPY package.json package-lock.json ./` (resolves docker:S6470) - Expand apps/marketing-site/.dockerignore to exclude secrets, private keys, .sops.yaml, .git, test tooling, dev config files, and OS artefacts. Existing entries reorganised with comments. - Expand services/core-api/.dockerignore to exclude secrets, private keys, .sops.yaml, .git, test projects, test results, coverage outputs, solution metadata, and OS artefacts. Build contexts confirmed from docker-compose.yml: marketing-site → ./apps/marketing-site core-api → ./services/core-api Both .dockerignore files sit at their effective build context roots. Agent-Logs-Url: https://github.com/NickLetts2/Curvit/sessions/b1673847-1861-4418-8ff7-da30504ff961 Co-authored-by: NickLetts2 <90337962+NickLetts2@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix security hotspots in Docker build contexts and .dockerignore rules
Security: tighten Docker build contexts and .dockerignore rules
May 15, 2026
NickLetts2
added a commit
that referenced
this pull request
Jun 1, 2026
…contexts Security: tighten Docker build contexts and .dockerignore rules
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.
SonarCloud flagged
docker:S6470hotspots in the marketing-site and core-api Dockerfiles where glob patterns and broadCOPY . .instructions could pull secrets, keys, test artefacts, or.gitmetadata into intermediate build layers.Changes
apps/marketing-site/DockerfileCOPY package.json package-lock.json* ./→COPY package.json package-lock.json ./(explicit, no glob;npm cirequires the lockfile anyway)apps/marketing-site/.dockerignoreReorganised with section comments; added missing exclusions:
.env,.env.*,*.pem,*.key,*.p12,*.pfx,*.crt,*.csr,*.agekey,secrets/,.sops.yaml.git/,.gitignoretests/,playwright.config.ts,vitest.config.ts,eslint.config.js,.prettierrc,.trivyignore,nginx.confbuild/,coverage/.DS_Store,*.suo,*.user,Thumbs.dbservices/core-api/.dockerignoreExpanded from 2 entries (
**/bin/,**/obj/) to full coverage:.git/,.gitignoretests/,**/TestResults/,**/coverage/*.md,*.slnx.DS_Store,*.suo,*.user,*.DotSettings.user,Thumbs.dbBoth
.dockerignorefiles are at their effective build context roots (./apps/marketing-siteand./services/core-apirespectively, as defined indocker-compose.yml).