Skip to content

Ensure we set sticky bit on mounted tmp folders #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/four-drinks-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@openproject/helm-charts": minor
---

Ensure we set sticky bit on mounted tmp folders
13 changes: 13 additions & 0 deletions charts/openproject/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,19 @@ securityContext:
{{- end }}
{{- end -}}

{{- define "openproject.tmpVolumeInitContainer" -}}
{{- if eq (include "openproject.useTmpVolumes" .) "true" }}
- name: fix-tmp-perms
image: busybox
command: ["sh", "-c", "chmod 1777 /tmp && chmod 1777 /app/tmp"]
volumeMounts:
{{- include "openproject.tmpVolumeMounts" . | indent 4 }}
securityContext:
runAsNonRoot: false
readOnlyRootFilesystem: false
{{- end }}
{{- end -}}

{{- define "openproject.envFrom" -}}
- secretRef:
name: {{ include "common.names.fullname" . }}-core
Expand Down
1 change: 1 addition & 0 deletions charts/openproject/templates/seeder-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ spec:
{{- end }}
{{- include "openproject.extraVolumes" . | indent 8 }}
initContainers:
{{- include "openproject.tmpVolumeInitContainer" . | indent 8 }}
- name: check-db-ready
image: "{{ .Values.dbInit.image.registry }}/{{ .Values.dbInit.image.repository }}:{{ .Values.dbInit.image.tag }}"
imagePullPolicy: {{ .Values.dbInit.image.imagePullPolicy }}
Expand Down
1 change: 1 addition & 0 deletions charts/openproject/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ spec:
{{- end }}
{{- include "openproject.extraVolumes" . | indent 8 }}
initContainers:
{{- include "openproject.tmpVolumeInitContainer" . | indent 8 }}
- name: wait-for-db
{{- include "openproject.containerSecurityContext" . | indent 10 }}
image: {{ include "openproject.image" . }}
Expand Down
1 change: 1 addition & 0 deletions charts/openproject/templates/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ spec:
{{- end }}
{{- include "openproject.extraVolumes" . | indent 8 }}
initContainers:
{{- include "openproject.tmpVolumeInitContainer" . | indent 8 }}
- name: wait-for-db
{{- include "openproject.containerSecurityContext" . | indent 10 }}
image: {{ include "openproject.image" . }}
Expand Down
Loading