Skip to content

Fix: Container Running with Dangerous Root Access Permissions in Dockerfile #1542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kira-offgrid
Copy link

Context and Purpose:

This PR automatically remediates a security vulnerability:

  • Description: By not specifying a USER, a program in the container may run as 'root'. This is a security hazard. If an attacker can control a process running as root, they may have control over the container. Ensure that the last USER in a Dockerfile is a USER other than 'root'.
  • Rule ID: dockerfile.security.missing-user.missing-user
  • Severity: MEDIUM
  • File: Dockerfile
  • Lines Affected: 23 - 23

This change is necessary to protect the application from potential security risks associated with this vulnerability.

Solution Implemented:

The automated remediation process has applied the necessary changes to the affected code in Dockerfile to resolve the identified issue.

Please review the changes to ensure they are correct and integrate as expected.

@RockChinQ RockChinQ requested a review from Copilot June 18, 2025 04:11
Copy link
Contributor

@Copilot 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 adds a non-root user to the Dockerfile to address a security vulnerability where the container would otherwise run as root.

  • Create a system user langbot
  • Switch container runtime to the langbot user
Comments suppressed due to low confidence (1)

Dockerfile:24

  • Ensure that any application files and directories are owned or accessible by the langbot user before switching users. You can add a chown -R langbot:langbot /app (or your working directory) prior to USER langbot to avoid permission issues at runtime.
USER langbot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant