Skip to content

fix: run container as non-root user#951

Merged
TomerFi merged 1 commit intodevfrom
fix/dockerfile-non-root-user
Feb 16, 2026
Merged

fix: run container as non-root user#951
TomerFi merged 1 commit intodevfrom
fix/dockerfile-non-root-user

Conversation

@TomerFi
Copy link
Owner

@TomerFi TomerFi commented Feb 16, 2026

Summary

  • Fix potential RCE privilege escalation by running the container as a non-root user, as recommended by Sourcery AI.
  • Add a dedicated appuser system user and chown the workdir to it.
  • Set USER appuser before EXPOSE/CMD so the application runs unprivileged.
  • Port 8000 is unprivileged, so no capability adjustments are needed.

Validation

  • actionlint passes (no workflow changes).
  • Dockerfile change is minimal — CI will validate the multi-platform build.

Create a dedicated unprivileged system user and switch to it
before CMD to prevent RCE from granting full root privileges
inside the container.

Signed-off-by: Tomer Figenblat <tomer@figenblat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@auto-me-bot auto-me-bot bot added the status: needs review Pull request needs a review label Feb 16, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

Warning

Rate limit exceeded

@TomerFi has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 40 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/dockerfile-non-root-user

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@TomerFi
Copy link
Owner Author

TomerFi commented Feb 16, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions
Copy link
Contributor

Test Results

66 tests   66 ✅  1s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 2f8e195.

@TomerFi TomerFi merged commit 9cc8700 into dev Feb 16, 2026
11 checks passed
@TomerFi TomerFi deleted the fix/dockerfile-non-root-user branch February 16, 2026 21:14
@auto-me-bot auto-me-bot bot added status: merged Pull request merged and removed status: needs review Pull request needs a review labels Feb 16, 2026
@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.02%. Comparing base (4e48df1) to head (2f8e195).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #951   +/-   ##
=======================================
  Coverage   96.02%   96.02%           
=======================================
  Files           1        1           
  Lines         327      327           
=======================================
  Hits          314      314           
  Misses         13       13           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

TomerFi added a commit that referenced this pull request Feb 20, 2026
The Dockerfile already runs as non-root (USER appuser) since #951.
Replace ambiguous "(pending fix)" with a firm "must" rule in ci-cd.mdc
and code-reviewer agent.

Signed-off-by: Tomer Figenblat <tomer@figenblat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
TomerFi added a commit that referenced this pull request Feb 20, 2026
* chore: split cursor rules into focused files and add tooling index

Replace monolithic project-rules.mdc with focused rule files:
- project-overview.mdc (alwaysApply) — tech stack summary
- python-conventions.mdc (globs: **/*.py) — coding standards
- testing.mdc (globs: app/tests/**) — test conventions
- ci-cd.mdc (globs: .github/workflows/**) — CI/CD rules
- git-workflow.mdc (intelligent) — git/PR conventions
- architecture.mdc (intelligent) — handler patterns
- cursor-tooling.mdc (alwaysApply) — agents, commands, skills index

Signed-off-by: Tomer Figenblat <tomer@figenblat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: update non-root Dockerfile rule to reflect current state

The Dockerfile already runs as non-root (USER appuser) since #951.
Replace ambiguous "(pending fix)" with a firm "must" rule in ci-cd.mdc
and code-reviewer agent.

Signed-off-by: Tomer Figenblat <tomer@figenblat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Signed-off-by: Tomer Figenblat <tomer@figenblat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: merged Pull request merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant