Skip to content

Commit e84031a

Browse files
authored
Merge pull request #521 from pjbgf/main
security: Drop capabilities, set userid and enable seccomp
2 parents 3ca05e1 + 9ba76a1 commit e84031a

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

Dockerfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,6 @@ FROM debian:bookworm-slim as controller
9090
# Link repo to the GitHub Container Registry image
9191
LABEL org.opencontainers.image.source="https://github.com/fluxcd/source-controller"
9292

93-
# Configure user
94-
RUN groupadd controller && \
95-
useradd --gid controller --shell /bin/sh --create-home controller
96-
9793
ARG TARGETPLATFORM
9894
RUN apt update && apt install -y ca-certificates
9995

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

105-
USER controller
101+
USER 65534:65534
106102
ENTRYPOINT [ "source-controller" ]

config/manager/deployment.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ spec:
2020
prometheus.io/port: "8080"
2121
spec:
2222
terminationGracePeriodSeconds: 10
23-
# Required for AWS IAM Role bindings
24-
# https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html
2523
securityContext:
24+
# Required for AWS IAM Role bindings
25+
# https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html
2626
fsGroup: 1337
2727
containers:
2828
- name: manager
@@ -31,6 +31,11 @@ spec:
3131
securityContext:
3232
allowPrivilegeEscalation: false
3333
readOnlyRootFilesystem: true
34+
runAsNonRoot: true
35+
capabilities:
36+
drop: [ "ALL" ]
37+
seccompProfile:
38+
type: RuntimeDefault
3439
ports:
3540
- containerPort: 9090
3641
name: http

0 commit comments

Comments
 (0)