diff --git a/Dockerfile b/Dockerfile index 1f2090a2..fb2ab9f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,10 +69,6 @@ FROM prepare-${BASE_VARIANT} as build FROM debian:${BASE_VARIANT}-slim as controller -# Configure user -RUN groupadd controller && \ - useradd --gid controller --shell /bin/sh --create-home controller - # Copy libgit2 COPY --from=build /libgit2/lib/ /usr/local/lib/ RUN ldconfig @@ -90,5 +86,6 @@ RUN echo "deb http://deb.debian.org/debian sid main" >> /etc/apt/sources.list \ # Copy over binary from build COPY --from=build /workspace/image-automation-controller /usr/local/bin/ -USER controller +USER 65534:65534 + ENTRYPOINT [ "image-automation-controller" ] diff --git a/config/manager/deployment.yaml b/config/manager/deployment.yaml index 29591c61..fa5b49af 100644 --- a/config/manager/deployment.yaml +++ b/config/manager/deployment.yaml @@ -29,6 +29,11 @@ spec: securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true + runAsNonRoot: true + capabilities: + drop: [ "ALL" ] + seccompProfile: + type: RuntimeDefault ports: - containerPort: 8080 name: http-prom