Skip to content

Conversation

@tim48-robot
Copy link
Contributor

fixes Medium: Docker COPY . . (possible sensitive file inclusion).
fixes Medium: container running as root.
Addresses “copied resources should not be writable by non‑root.

image

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

⚠️ PR Description Issues Detected

Please update the PR description to address these issues.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens Docker images for security by implementing least privilege principles across three Dockerfiles. It addresses security scanner findings related to sensitive file inclusion and running containers as root.

Key changes:

  • Creates and switches to non-root users in all containers to prevent running as root
  • Replaces COPY . . with explicit selective file copying to avoid including sensitive files
  • Changes npm install to npm ci for more secure, deterministic builds
  • Adds cleanup of apt cache to reduce image size and attack surface

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
firebase-emulator/Dockerfile Adds non-root 'firebase' user, explicit file copying, apt cache cleanup, and creates firebase-debug.log with proper ownership
Dockerfile-playwright Creates non-root 'app' user, replaces wildcards with explicit file copying in both build and production stages, sets up Playwright cache with proper permissions
Dockerfile Implements non-root 'app' user in production stage, removes .env file from build stage, uses explicit file copying instead of wildcards, switches from npm install to npm ci

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

tim48-robot and others added 3 commits January 5, 2026 20:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… execution

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@tim48-robot
Copy link
Contributor Author

wait before merged letme check the hotspot problem

Add chmod -R 555 after COPY to remove write permissions.
Fixes SonarCloud security hotspot docker:S6504
@tim48-robot
Copy link
Contributor Author

tim48-robot commented Jan 5, 2026

should be ready to merge, and somehow sonarcloud always does false positive :/

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 5, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant