Skip to content

Commit

Permalink
patch all
Browse files Browse the repository at this point in the history
  • Loading branch information
Demonsthere committed Dec 12, 2023
1 parent b2c0b0d commit 2ef4af1
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,5 @@ spec:
dnsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
25 changes: 20 additions & 5 deletions helm/charts/kratos-selfservice-ui-node/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,33 @@ ingress:
# hosts:
# - chart-example.local

# -- Deployment level securityContext
# -- Container level security context
securityContext:
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
readOnlyRootFilesystem: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 10000
runAsUser: 65534
runAsGroup: 65534
allowPrivilegeEscalation: false
privileged: false
seccompProfile:
type: RuntimeDefault
seLinuxOptions:
level: "s0:c123,c456"

# -- Pod level security context
podSecurityContext:
fsGroupChangePolicy: "OnRootMismatch"
runAsNonRoot: true
runAsUser: 65534
fsGroup: 65534
runAsGroup: 65534
seccompProfile:
type: RuntimeDefault
sysctls: []
supplementalGroups: []

# -- Deployment configuration
deployment:
Expand Down
2 changes: 1 addition & 1 deletion helm/charts/kratos/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ statefulSet:
securityContext:
capabilities:
drop:
- ALL
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 65534
Expand Down
9 changes: 6 additions & 3 deletions helm/charts/oathkeeper-maester/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,18 @@ spec:
{{- toYaml .Values.deployment.resources | nindent 12 }}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
{{- if .Values.deployment.securityContext }}
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 12 }}
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
serviceAccountName: {{ include "oathkeeper-maester.fullname" . }}-account
automountServiceAccountToken: {{ .Values.deployment.automountServiceAccountToken }}
dnsPolicy: ClusterFirst
restartPolicy: Always
securityContext: {}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: 10
{{- with .Values.priorityClassName }}
priorityClassName: {{ . }}
Expand Down
39 changes: 28 additions & 11 deletions helm/charts/oathkeeper-maester/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,34 @@ image:
# -- Image pull secrets
imagePullSecrets: []

# -- Container level security context
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 65534
runAsGroup: 65534
allowPrivilegeEscalation: false
privileged: false
seccompProfile:
type: RuntimeDefault
seLinuxOptions:
level: "s0:c123,c456"

# -- Pod level security context
podSecurityContext:
fsGroupChangePolicy: "OnRootMismatch"
runAsNonRoot: true
runAsUser: 65534
fsGroup: 65534
runAsGroup: 65534
seccompProfile:
type: RuntimeDefault
sysctls: []
supplementalGroups: []

deployment:
resources:
{}
Expand All @@ -46,17 +74,6 @@ deployment:
# requests:
# cpu: 100m
# memory: 20Mi
securityContext:
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
allowPrivilegeEscalation: false
privileged: false

# -- Pod priority
# https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
Expand Down
8 changes: 6 additions & 2 deletions helm/charts/oathkeeper/templates/deployment-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.deployment.resources | nindent 12 }}
{{- if .Values.deployment.securityContext }}
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 12 }}
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
{{- if .Values.deployment.extraContainers }}
{{- tpl .Values.deployment.extraContainers . | nindent 8 }}
Expand Down Expand Up @@ -187,4 +187,8 @@ spec:
dnsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
16 changes: 10 additions & 6 deletions helm/charts/oathkeeper/templates/deployment-sidecar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ spec:
- |
touch /etc/rules/access-rules.json
chmod 666 /etc/rules/access-rules.json
{{- if .Values.deployment.securityContext }}
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 12 }}
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
{{- if .Values.deployment.extraInitContainers }}
{{- tpl .Values.deployment.extraInitContainers . | nindent 8 }}
Expand Down Expand Up @@ -157,9 +157,9 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.deployment.resources | nindent 12 }}
{{- if .Values.deployment.securityContext }}
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 12 }}
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
- name: {{ .Chart.Name }}-maester
image: "{{ .Values.sidecar.image.repository }}:{{ .Values.sidecar.image.tag }}"
Expand All @@ -183,9 +183,9 @@ spec:
- name: {{ include "oathkeeper.name" . }}-rules-volume
mountPath: /etc/rules
readOnly: false
{{- if .Values.deployment.securityContext }}
{{- if .Values.securityContext }}
securityContext:
{{- toYaml .Values.deployment.securityContext | nindent 12 }}
{{- toYaml .Values.securityContext | nindent 12 }}
{{- end }}
{{- if .Values.deployment.extraContainers }}
{{- tpl .Values.deployment.extraContainers . | nindent 8 }}
Expand All @@ -212,4 +212,8 @@ spec:
dnsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
39 changes: 28 additions & 11 deletions helm/charts/oathkeeper/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,34 @@ nameOverride: ""
# -- Full chart name override
fullnameOverride: ""

# -- Container level security context
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 65534
runAsGroup: 65534
allowPrivilegeEscalation: false
privileged: false
seccompProfile:
type: RuntimeDefault
seLinuxOptions:
level: "s0:c123,c456"

# -- Pod level security context
podSecurityContext:
fsGroupChangePolicy: "OnRootMismatch"
runAsNonRoot: true
runAsUser: 65534
fsGroup: 65534
runAsGroup: 65534
seccompProfile:
type: RuntimeDefault
sysctls: []
supplementalGroups: []

# -- If enabled, a demo deployment with exemplary access rules and JSON Web Key Secrets will be generated.
demo: false

Expand Down Expand Up @@ -217,17 +245,6 @@ deployment:
# requests:
# cpu: 100m
# memory: 128Mi
securityContext:
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
allowPrivilegeEscalation: false
privileged: false

lifecycle: {}
# -- Configure the livenessProbe parameters
Expand Down

0 comments on commit 2ef4af1

Please sign in to comment.