Skip to content

Commit 5184b44

Browse files
authored
Merge pull request #506 from rojkov/validation-plan
operator: run as non-root
2 parents 7cc07be + 1657b6e commit 5184b44

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

build/docker/intel-deviceplugin-operator.Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ RUN chmod a+x /go/bin/operator \
3535

3636
FROM scratch as final
3737
COPY --from=builder /install_root /
38+
RUN groupadd -g 3210 operator && useradd operator -u 3210 -g 3210
3839
ENTRYPOINT ["/usr/local/bin/intel_deviceplugin_operator"]

deployments/operator/default/manager_auth_proxy_patch.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ spec:
1919
ports:
2020
- containerPort: 8443
2121
name: https
22+
securityContext:
23+
runAsNonRoot: true
24+
runAsUser: 1000
25+
runAsGroup: 1000
26+
readOnlyRootFilesystem: true
2227
- name: manager
2328
args:
2429
- "--metrics-addr=127.0.0.1:8080"

deployments/operator/manager/manager.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,9 @@ spec:
3333
requests:
3434
cpu: 100m
3535
memory: 20Mi
36+
securityContext:
37+
runAsNonRoot: true
38+
runAsUser: 3210
39+
runAsGroup: 3210
40+
readOnlyRootFilesystem: true
3641
terminationGracePeriodSeconds: 10

0 commit comments

Comments
 (0)