I've got an error "oauth2-proxy in the Deployment oauth2-proxy is running as root" while i use :
runAsNonRoot: true
runAsUser: 2000
the yaml :
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: oauth2-proxy
labels:
app: oauth2-proxy
spec:
replicas: 1
selector:
matchLabels:
app: oauth2-proxy
template:
metadata:
labels:
app: oauth2-proxy
spec:
containers:
- args:
- --http-address=0.0.0.0:4180
- --config=/etc/oauth2-proxy/oauth2-proxy.toml
- --upstream=file:///dev/null
- --pass-host-header=true
- --pass-user-headers=true
- --set-xauthrequest=true
- --pass-basic-auth=true
image: quay.io/oauth2-proxy/oauth2-proxy:v6.1.1
livenessProbe:
httpGet:
path: /ping
port: http
name: oauth2-proxy
ports:
- containerPort: 4180
name: http
readinessProbe:
httpGet:
path: /ping
port: http
resources:
limits:
cpu: 50m
memory: 50Mi
requests:
cpu: 10m
memory: 20Mi
volumeMounts:
- name: config
mountPath: /etc/oauth2-proxy
readOnly: true
securityContext:
fsGroup: 2000
runAsNonRoot: true
runAsUser: 2000
serviceAccountName: oauth2-proxy
volumes:
- name: config
configMap:
name: oauth2-proxy
❯ conftest test resources/identity/oauth2-proxy/base/deployment.yaml -p addons/policies/instrumenta/policy/
FAIL - resources/identity/oauth2-proxy/base/deployment.yaml - oauth2-proxy in the Deployment oauth2-proxy doesn't drop all capabilities
FAIL - resources/identity/oauth2-proxy/base/deployment.yaml - oauth2-proxy in the Deployment oauth2-proxy is not using a read only root filesystem
FAIL - resources/identity/oauth2-proxy/base/deployment.yaml - oauth2-proxy in the Deployment oauth2-proxy allows priviledge escalation
FAIL - resources/identity/oauth2-proxy/base/deployment.yaml - oauth2-proxy in the Deployment oauth2-proxy is running as root
30 tests, 26 passed, 0 warnings, 4 failures, 0 exceptions
I've got an error "oauth2-proxy in the Deployment oauth2-proxy is running as root" while i use :
the yaml :