feat: add non-root user to Docker images for PSA restricted compliance#3356
Open
will-corrigan wants to merge 9 commits into
Open
feat: add non-root user to Docker images for PSA restricted compliance#3356will-corrigan wants to merge 9 commits into
will-corrigan wants to merge 9 commits into
Conversation
|
@will-corrigan is attempting to deploy a commit to the Hatchet Team on Vercel. A member of the Team first needs to authorize it. |
|
📝 Documentation updates detected! New suggestion: Update self-hosting docs for non-root Docker images and PSA compliance Tip: Assign suggestions to team members in the Promptless dashboard to claim work 👥 |
Create a hatchet system user (UID 1000) in all three Dockerfiles so Kubernetes deployments can opt into non-root execution via securityContext. Images continue to run as root by default for backward compatibility. To run as non-root, set runAsUser: 1000 in the pod securityContext or pass --user 1000 to docker run. Signed-off-by: Will Corrigan <will-corrigan@users.noreply.github.com>
f51420e to
a053362
Compare
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.
Description
Adds a
hatchetsystem user (UID 1000) to the servers and frontend Dockerfiles with explicit file ownership viaCOPY --chown, enabling Kubernetes deployments to opt into non-root execution.Images continue to run as root by default — no breaking changes for existing users.
Type of change
What's Changed
Dockerfiles
build/package/servers.dockerfile: Createhatchetuser (UID 1000),COPY --chown=hatchet:hatchetfor binary andatlas-apply.shbuild/package/frontend.dockerfile: Createhatchetuser (UID 1000),COPY --chown=hatchet:hatchetforhatchet-staticfileserverbinarybuild/package/dashboard.dockerfile: No non-root support (nginx requires root for port 80). Added TODO comment for futurenginx-unprivilegedmigration.Documentation
frontend/docs/pages/self-hosting/kubernetes-helm-configuration.mdxWhy
COPY --chown?Makes file ownership explicit rather than relying on Alpine's default umask. When running as UID 1000, binaries owned by
hatchet:hatchetare unambiguously accessible.Usage
After this change, users can run Hatchet as non-root:
No action needed for existing deployments — they continue to run as root.
Companion PR
hatchet-dev/hatchet-charts#45 adds securityContext templating to the Helm charts.
Testing
task fmt— all passtask test— all unit tests passtask test-integration— all integration tests passhatchetexists (UID 1000)hatchet:hatchet--user 1000:1000