INF-1650: run agentql-mcp container as non-root user#50
Merged
Conversation
Add `USER node` before CMD so the MCP server no longer runs as root, clearing the Semgrep finding dockerfile.security.missing-user. The node base image ships a non-privileged `node` user (uid 1000); build artifacts under /app are world-readable so no chown is needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR modifies the Dockerfile to run the container as the non-root 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
paveldudka
approved these changes
Jun 9, 2026
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.
What
Clears the Semgrep finding
dockerfile.security.missing-user.missing-user(ERROR) atDockerfile:21from the fresh org-wide SAST scan (INF-1650). The container had noUSERinstruction, so the MCP server ran as root.How
Add
USER nodebeforeCMD. Thenode:20-alpinebase image ships a non-privilegednodeuser (uid 1000); the build artifacts under/appare world-readable, so the runtime needs only read access — nochownrequired.Verification
semgrep --config p/dockerfile→ 1 finding (missing-user)npm run build/npm run lint(the repo CI) are unaffected — the change only adds a runtimeUSER.Closes INF-1650.
🤖 Generated with Claude Code