Outline chart: security hardening, configurable probes, flexible ingress
- Pod and container securityContext are now values-configurable (outline.securityContext.pod/container) with hardened defaults: runAsNonRoot (uid/gid 1001, the upstream image's nodejs user), readOnlyRootFilesystem, allowPrivilegeEscalation false, all capabilities dropped. /tmp is mounted as an emptyDir for Outline's import/export scratch files. - Probes moved to values (outline.livenessProbe/readinessProbe/ startupProbe); defaults are exactly the previously hardcoded ones. - Ingress raised to the repo standard: ingress.className (default nginx), ingress.annotations merged with the always-set annotations, ingress.enabled flag; domain/clusterIssuer stay required and the TLS secret name was already conform. - Additive outline.env block rendered through tpl with value/ secretKeyRef/configMapKeyRef forms; chart-managed env stays in the template. Major bump 3.1.1+up1.9.2 -> 4.0.0+up1.9.2 (runtime behavior changes through hardening). Part of #32
This commit is contained in:
4 files changed
+95
-30
No files matched your search
+1
-1
@@ -5,7 +5,7 @@ icon: https://raw.githubusercontent.com/outline/outline/main/public/images/icon-
|
|||||||
|
|
||||||
type: application
|
type: application
|
||||||
|
|
||||||
version: 3.1.1+up1.9.2
|
version: 4.0.0+up1.9.2
|
||||||
appVersion: 1.9.2
|
appVersion: 1.9.2
|
||||||
|
|
||||||
maintainers:
|
maintainers:
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
|
{{- if .Values.ingress.enabled }}
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress
|
name: {{ .Release.Name }}-{{ .Chart.Name }}-ingress
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/cluster-issuer: {{ required "A Cluster-Issuer must be provided" .Values.ingress.clusterIssuer}}
|
cert-manager.io/cluster-issuer: {{ required "A Cluster-Issuer must be provided" .Values.ingress.clusterIssuer }}
|
||||||
nginx.ingress.kubernetes.io/proxy-body-size: {{ .Values.ingress.maxUploadFileSize }}
|
nginx.ingress.kubernetes.io/proxy-body-size: {{ .Values.ingress.maxUploadFileSize }}
|
||||||
nginx.org/client-max-body-size: {{ .Values.ingress.maxUploadFileSize }}
|
nginx.org/client-max-body-size: {{ .Values.ingress.maxUploadFileSize }}
|
||||||
|
{{- with .Values.ingress.annotations }}
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: nginx
|
ingressClassName: {{ .Values.ingress.className }}
|
||||||
rules:
|
rules:
|
||||||
- host: {{ required "A Domain/Host must be provided" .Values.ingress.domain }}
|
- host: {{ required "A Domain/Host must be provided" .Values.ingress.domain }}
|
||||||
http:
|
http:
|
||||||
@@ -23,3 +27,4 @@ spec:
|
|||||||
- hosts:
|
- hosts:
|
||||||
- {{ required "A Domain/Host must be provided" .Values.ingress.domain }}
|
- {{ required "A Domain/Host must be provided" .Values.ingress.domain }}
|
||||||
secretName: tls-{{ .Release.Name }}-{{ .Chart.Name }}-ingress
|
secretName: tls-{{ .Release.Name }}-{{ .Chart.Name }}-ingress
|
||||||
|
{{- end }}
|
||||||
@@ -18,8 +18,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
automountServiceAccountToken: false
|
automountServiceAccountToken: false
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 1001
|
{{- toYaml .Values.outline.securityContext.pod | nindent 8 }}
|
||||||
fsGroupChangePolicy: Always
|
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
|
- name: {{ .Release.Name }}-{{ .Chart.Name }}-sfs
|
||||||
image: "outlinewiki/outline:{{ .Chart.AppVersion }}"
|
image: "outlinewiki/outline:{{ .Chart.AppVersion }}"
|
||||||
@@ -76,45 +75,52 @@ spec:
|
|||||||
value: "{{ .Values.outline.maxUploadSize }}"
|
value: "{{ .Values.outline.maxUploadSize }}"
|
||||||
- name: FORCE_HTTPS
|
- name: FORCE_HTTPS
|
||||||
value: "{{ .Values.outline.forceHttps }}"
|
value: "{{ .Values.outline.forceHttps }}"
|
||||||
|
{{- range $value := .Values.outline.env }}
|
||||||
|
{{- if $value.value }}
|
||||||
|
- name: {{ $value.name | quote }}
|
||||||
|
value: {{ tpl $value.value $ | quote }}
|
||||||
|
{{- else if $value.valueFrom }}
|
||||||
|
{{- if $value.valueFrom.secretKeyRef }}
|
||||||
|
- name: {{ $value.name }}
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ tpl $value.valueFrom.secretKeyRef.name $ | quote }}
|
||||||
|
key: {{ tpl $value.valueFrom.secretKeyRef.key $ | quote }}
|
||||||
|
{{- else if $value.valueFrom.configMapKeyRef }}
|
||||||
|
- name: {{ $value.name }}
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: {{ tpl $value.valueFrom.configMapKeyRef.name $ | quote }}
|
||||||
|
key: {{ tpl $value.valueFrom.configMapKeyRef.key $ | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 3000
|
- containerPort: 3000
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
name: http
|
name: http
|
||||||
# Outline exposes a dedicated health endpoint at /_health (also used
|
|
||||||
# by the upstream Docker HEALTHCHECK). It checks Postgres and Redis;
|
|
||||||
# there is no dependency-free HTTP endpoint ("/" returns 500 too when
|
|
||||||
# the database is down), so all three probes use /_health.
|
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
{{- toYaml .Values.outline.livenessProbe | nindent 12 }}
|
||||||
path: /_health
|
|
||||||
port: 3000
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 3
|
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
{{- toYaml .Values.outline.readinessProbe | nindent 12 }}
|
||||||
path: /_health
|
|
||||||
port: 3000
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 3
|
|
||||||
# The startup probe gates liveness/readiness. Outline runs database
|
|
||||||
# migrations on startup: budget 10s * 30 = 300s.
|
|
||||||
startupProbe:
|
startupProbe:
|
||||||
httpGet:
|
{{- toYaml .Values.outline.startupProbe | nindent 12 }}
|
||||||
path: /_health
|
|
||||||
port: 3000
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 30
|
|
||||||
resources:
|
resources:
|
||||||
{{- include "outline.resources" .Values.outline.resources | nindent 12 }}
|
{{- include "outline.resources" .Values.outline.resources | nindent 12 }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml .Values.outline.securityContext.container | nindent 12 }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: "/outline-data/data"
|
- mountPath: "/outline-data/data"
|
||||||
name: outline-data
|
name: outline-data
|
||||||
subPath: data
|
subPath: data
|
||||||
|
# Writable emptyDir so the root filesystem can stay read-only:
|
||||||
|
# Outline writes import/export scratch files to /tmp.
|
||||||
|
- mountPath: /tmp
|
||||||
|
name: tmp
|
||||||
restartPolicy: Always
|
restartPolicy: Always
|
||||||
volumes:
|
volumes:
|
||||||
- name: outline-data
|
- name: outline-data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: {{ .Release.Name }}-{{ .Chart.Name }}-pvc
|
claimName: {{ .Release.Name }}-{{ .Chart.Name }}-pvc
|
||||||
|
- name: tmp
|
||||||
|
emptyDir: {}
|
||||||
@@ -19,6 +19,55 @@ outline:
|
|||||||
storage:
|
storage:
|
||||||
size: 10Gi
|
size: 10Gi
|
||||||
storageClass: null
|
storageClass: null
|
||||||
|
# The upstream image (outlinewiki/outline) runs as its nodejs user
|
||||||
|
# (uid/gid 1001). Outline only writes to the upload storage (PVC) and to
|
||||||
|
# /tmp (import/export scratch files), which the chart mounts as an
|
||||||
|
# emptyDir, so the root filesystem stays read-only.
|
||||||
|
securityContext:
|
||||||
|
pod:
|
||||||
|
runAsNonRoot: true
|
||||||
|
runAsUser: 1001
|
||||||
|
runAsGroup: 1001
|
||||||
|
fsGroup: 1001
|
||||||
|
fsGroupChangePolicy: Always
|
||||||
|
container:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
runAsNonRoot: true
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- ALL
|
||||||
|
# Outline exposes a dedicated health endpoint at /_health (also used
|
||||||
|
# by the upstream Docker HEALTHCHECK). It checks Postgres and Redis;
|
||||||
|
# there is no dependency-free HTTP endpoint ("/" returns 500 too when
|
||||||
|
# the database is down), so all three probes use /_health.
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /_health
|
||||||
|
port: 3000
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /_health
|
||||||
|
port: 3000
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
# The startup probe gates liveness/readiness. Outline runs database
|
||||||
|
# migrations on startup: budget 10s * 30 = 300s.
|
||||||
|
startupProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /_health
|
||||||
|
port: 3000
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 30
|
||||||
|
# Extra environment variables, appended to the ones the chart always sets.
|
||||||
|
# Values are rendered through tpl; value, secretKeyRef and configMapKeyRef
|
||||||
|
# forms are supported.
|
||||||
|
env: []
|
||||||
resources:
|
resources:
|
||||||
# Limits are optional: memory and ephemeral-storage limits default to
|
# Limits are optional: memory and ephemeral-storage limits default to
|
||||||
# limitFactor x the request, an explicitly set limit always wins, and a
|
# limitFactor x the request, an explicitly set limit always wins, and a
|
||||||
@@ -30,6 +79,11 @@ outline:
|
|||||||
ephemeralStorage: 10Mi
|
ephemeralStorage: 10Mi
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
|
enabled: true
|
||||||
maxUploadFileSize: 25m
|
maxUploadFileSize: 25m
|
||||||
clusterIssuer: letsencrypt
|
clusterIssuer: letsencrypt
|
||||||
domain: null
|
domain: null
|
||||||
|
className: nginx
|
||||||
|
# Extra annotations for the Ingress; merged with the cert-manager
|
||||||
|
# cluster-issuer and proxy-body-size annotations the chart always sets.
|
||||||
|
annotations: {}
|
||||||
Reference in new issue
Block a user