Skip to content

toolkit#8696

Closed
LOve-luST-LOST wants to merge 5 commits intoaws:masterfrom
FLY-firstluveyourself:master
Closed

toolkit#8696
LOve-luST-LOST wants to merge 5 commits intoaws:masterfrom
FLY-firstluveyourself:master

Conversation

@LOve-luST-LOST
Copy link
Copy Markdown

Problem

Solution


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

Semgrep Autofix and others added 4 commits March 29, 2026 03:30
Add a non-root user to the Dockerfile to prevent container processes from running as root.

## Changes
- Create a dedicated `appuser` account with `useradd`
- Set ownership of `/code` directory to the new user
- Add `USER appuser` directive before CMD
- Remove `--unsafe-perm` flag from npm install (no longer needed for non-root user)

## Why
Running containers as root is a security risk. If an attacker gains control of a process running as root, they potentially have full control over the container. By switching to a non-root user, we limit the blast radius of any potential container compromise.

## Semgrep Finding Details
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'.

@230243296 requested Semgrep Assistant generate this pull request to fix [a finding](https://semgrep.dev/orgs/alicefosseneuve_personal_org/findings/735185002) from the detection rule [dockerfile.security.missing-user.missing-user](https://semgrep.dev/r/dockerfile.security.missing-user.missing-user).
fix(docker): Add non-root user to Dockerfile for security
Added a security policy document outlining supported versions and vulnerability reporting.
Create SECURITY.md for security policy and reporting
@LOve-luST-LOST LOve-luST-LOST requested a review from a team as a code owner March 29, 2026 04:45
@amazon-inspector-ohio
Copy link
Copy Markdown

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

@amazon-inspector-ohio
Copy link
Copy Markdown

✅ I finished the code review, and didn't find any security or code quality issues.

Copy link
Copy Markdown
Author

@LOve-luST-LOST LOve-luST-LOST left a comment

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Author

@LOve-luST-LOST LOve-luST-LOST left a comment

Choose a reason for hiding this comment

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

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