Skip to content

Commit 759f657

Browse files
authored
Merge branch 'ITISFoundation:main' into main
2 parents 4100b87 + c06f569 commit 759f657

File tree

11 files changed

+96
-17
lines changed

11 files changed

+96
-17
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,10 @@ repos:
122122
always_run: true
123123
language: script
124124
files: '^(.*\/Makefile.*)|(.*\.deploy_everything_locally.bash)|(.*\/services/.*\/.*\.((sh)|(bash)))$'
125+
- id: helm-update-dependencies
126+
name: Helm Dependency Update
127+
description: Make sure all Chart.lock files are up-to-date
128+
entry: bash -c 'find . -name Chart.yaml -exec dirname {} \; | xargs -t -I% helm dependency update %'
129+
language: system
130+
files: ^charts/
131+
pass_filenames: false

charts/SECURITY.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Security
2+
3+
This file documents security measures and their configuration in current code base
4+
5+
## Application developer
6+
7+
Full list: https://kubernetes.io/docs/concepts/security/application-security-checklist/
8+
9+
#### Pod-level securityContext recommendations
10+
11+
Enable pod security standard on namespace level:
12+
* create namespace with labels (examples and explanations https://aro-labs.com/pod-security-standards/)
13+
* configure pod and container security context to satisfy security standards (read more https://medium.com/dynatrace-engineering/kubernetes-security-part-3-security-context-7d44862c4cfa)
14+
15+
## Cluster / OPS developers
16+
17+
Full list: https://kubernetes.io/docs/concepts/security/security-checklist/

charts/simcore-charts/common-helpers/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.0.1
18+
version: 0.0.2
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/simcore-charts/common-helpers/templates/_helpers.tpl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,36 @@ data:
7272
{{- end }}
7373
{{- end }}
7474
{{- end -}}
75+
76+
{{/*
77+
78+
Usage:
79+
{{- include "common-helpers.defaultPodSecurityContext" . | nindent 0 }}
80+
81+
Defines a common pod security context to ensure minimal privileges for containers.
82+
83+
Values inspired from https://medium.com/dynatrace-engineering/kubernetes-security-part-3-security-context-7d44862c4cfa
84+
*/}}
85+
{{- define "common-helpers.defaultPodSecurityContext" -}}
86+
runAsNonRoot: true
87+
seccompProfile:
88+
type: RuntimeDefault
89+
{{- end -}}
90+
91+
{{/*
92+
93+
Usage:
94+
{{- include "common-helpers.defaultContainerSecurityContext" . | nindent 0 }}
95+
96+
Defines a common container security context to ensure minimal privileges for containers.
97+
98+
Values inspired from https://medium.com/dynatrace-engineering/kubernetes-security-part-3-security-context-7d44862c4cfa
99+
*/}}
100+
{{- define "common-helpers.defaultContainerSecurityContext" -}}
101+
privileged: false
102+
readOnlyRootFilesystem: true
103+
allowPrivilegeEscalation: false
104+
capabilities:
105+
drop:
106+
- ALL
107+
{{- end -}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# namespace with defined pod security standard
2+
# inspired from https://aro-labs.com/pod-security-standards/
3+
# official doc: https://kubernetes.io/docs/concepts/security/pod-security-standards/
4+
#
5+
# Warning: if pod / container does not meet enforced standards, it will not be deployed (silently)
6+
# execute `kubectl -n <namespace> events` to see errors (e.g.)
7+
# Error creating: pods "xyz" is forbidden: violates PodSecurity "baseline:latest": privileged
8+
# container "xyz" must not set securityContext.privileged to true
9+
#
10+
apiVersion: v1
11+
kind: Namespace
12+
metadata:
13+
name: simcore
14+
labels:
15+
pod-security.kubernetes.io/enforce: baseline
16+
pod-security.kubernetes.io/warn: restricted
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dependencies:
22
- name: common-helpers
33
repository: file://../common-helpers
4-
version: 0.0.1
5-
digest: sha256:5dad45e33a2acd921f5f907f9cabb434bb60f14bb799df95897661e95b302a26
6-
generated: "2024-08-29T11:15:50.206549321+02:00"
4+
version: 0.0.2
5+
digest: sha256:d6893dfacee6738bea269ee1ef0cec150d742d229541cde753b35f45fc1fa48a
6+
generated: "2025-07-21T13:47:47.456513024+02:00"

charts/simcore-charts/resource-usage-tracker/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: A Helm chart for Kubernetes
44

55
dependencies:
66
- name: common-helpers
7-
version: 0.0.1
7+
version: 0.0.2
88
repository: "file://../common-helpers"
99

1010
# A chart can be either an 'application' or a 'library' chart.
@@ -20,7 +20,7 @@ type: application
2020
# This is the chart version. This version number should be incremented each time you make changes
2121
# to the chart and its templates, including the app version.
2222
# Versions are expected to follow Semantic Versioning (https://semver.org/)
23-
version: 0.0.1
23+
version: 0.0.2
2424

2525
# This is the version number of the application being deployed. This version number should be
2626
# incremented each time you make changes to the application. Versions are not expected to

charts/simcore-charts/resource-usage-tracker/templates/deployment.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,19 @@ spec:
2929
{{- end }}
3030
serviceAccountName: {{ include "resource-usage-tracker.serviceAccountName" . }}
3131
securityContext:
32+
{{- if .Values.podSecurityContext }}
3233
{{- toYaml .Values.podSecurityContext | nindent 8 }}
34+
{{- else }}
35+
{{- include "common-helpers.defaultPodSecurityContext" . | nindent 8 }}
36+
{{- end }}
3337
containers:
3438
- name: {{ .Chart.Name }}
3539
securityContext:
40+
{{- if .Values.securityContext }}
3641
{{- toYaml .Values.securityContext | nindent 12 }}
42+
{{- else }}
43+
{{- include "common-helpers.defaultContainerSecurityContext" . | nindent 12 }}
44+
{{- end }}
3745
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
3846
imagePullPolicy: {{ .Values.image.pullPolicy }}
3947
env:

charts/simcore-charts/resource-usage-tracker/values.yaml.gotmpl

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,12 @@ serviceAccount:
2828
podAnnotations: {}
2929
podLabels: {}
3030

31-
podSecurityContext: {}
32-
# fsGroup: 2000
33-
34-
securityContext: {}
35-
# capabilities:
36-
# drop:
37-
# - ALL
38-
# readOnlyRootFilesystem: true
39-
# runAsNonRoot: true
40-
# runAsUser: 1000
31+
podSecurityContext:
32+
seccompProfile:
33+
type: RuntimeDefault
34+
35+
securityContext:
36+
privileged: false
4137

4238
service:
4339
type: ClusterIP

charts/topolvm/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ Source: https://github.com/topolvm/topolvm/blob/topolvm-chart-v15.5.5/docs/getti
1616

1717
## Deleting PV(C)s with `retain` reclaim policy
1818
1. Delete release (e.g. helm uninstall -n test test)
19-
2. Find LogicalVolume CR (`kubectl get logicalvolumes.topolvm.io`
19+
2. Find LogicalVolume CR (`kubectl get logicalvolumes.topolvm.io`)
2020
3. Delete LogicalVolume CR (`kubectl delete logicalvolumes.topolvm.io <lv-name>`)
2121
4. Delete PV (`kubectl delete PV <pv-name>`)
22+
5. Remove PV's finalizers (`kubectl patch pv <pv-name> -p '{"metadata":{"finalizers":null}}'`)
2223

2324
## Backup / Snapshotting
2425
1. Only possible while using thin provisioning

0 commit comments

Comments
 (0)