Skip to content

Commit

Permalink
Enforce runAsNonRoot
Browse files Browse the repository at this point in the history
BREAKING CHANGE: the controller container is now executed under 65534:65534 (userid:groupid). This change may break deployments that hard-coded the user name 'controller' in their PodSecurityPolicy.

Signed-off-by: Paulo Gomes <paulo.gomes@weave.works>
  • Loading branch information
Paulo Gomes committed Jan 19, 2022
1 parent 7b04b44 commit 9ba76a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ FROM debian:bookworm-slim as controller
# Link repo to the GitHub Container Registry image
LABEL org.opencontainers.image.source="https://github.com/fluxcd/source-controller"

# Configure user
RUN addgroup --gid 65532 controller && \
useradd -u 65532 -s /sbin/nologin -g controller controller

ARG TARGETPLATFORM
RUN apt update && apt install -y ca-certificates

Expand All @@ -102,5 +98,5 @@ COPY --from=build /workspace/source-controller /usr/local/bin/
COPY --from=libgit2-bullseye /libgit2/built-on-glibc-version /
COPY ATTRIBUTIONS.md /

USER controller
USER 65534:65534
ENTRYPOINT [ "source-controller" ]
1 change: 1 addition & 0 deletions config/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ spec:
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
capabilities:
drop: [ "ALL" ]
seccompProfile:
Expand Down

0 comments on commit 9ba76a1

Please sign in to comment.