Skip to content

Commit

Permalink
security: Drop capabilities and enable seccomp
Browse files Browse the repository at this point in the history
Further restricts the SecurityContext that the controller runs under, by
enabling the default seccomp profile, dropping all linux capabilities
and enforcing a specific user/group ID.
This was set at container-level to ensure backwards compatibility with
use cases in which sidecars are injected into the source-controller pod
without setting less restrictive settings.

Co-authored-by: Sanskar Jaiswal <[email protected]>
Signed-off-by: Paulo Gomes <[email protected]>
  • Loading branch information
Paulo Gomes and Sanskar Jaiswal committed Jan 5, 2022
1 parent 46642a7 commit 7c971cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ RUN apk add --no-cache ca-certificates tini

COPY --from=builder /workspace/helm-controller /usr/local/bin/

RUN addgroup -S controller && adduser -S controller -G controller

USER controller
USER 65534:65534

ENTRYPOINT [ "/sbin/tini", "--", "helm-controller" ]
5 changes: 5 additions & 0 deletions config/manager/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ spec:
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
capabilities:
drop: ["ALL"]
seccompProfile:
type: RuntimeDefault
ports:
- containerPort: 8080
name: http-prom
Expand Down

0 comments on commit 7c971cd

Please sign in to comment.