Skip to content
Merged
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
2 changes: 1 addition & 1 deletion charts/helm_lib/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
type: library
name: deckhouse_lib_helm
version: 1.72.32
version: 1.72.33
description: "Helm utils template definitions for Deckhouse modules."
16 changes: 16 additions & 0 deletions charts/helm_lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
| [helm_lib_module_container_security_context_privileged_read_only_root_filesystem](#helm_lib_module_container_security_context_privileged_read_only_root_filesystem) |
| [helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all](#helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all) |
| [helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_and_add](#helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_and_add) |
| [helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_and_add_runtime_default](#helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_and_add_runtime_default) |
| [helm_lib_module_container_security_context_capabilities_drop_all_and_add](#helm_lib_module_container_security_context_capabilities_drop_all_and_add) |
| [helm_lib_module_container_security_context_capabilities_drop_all_and_run_as_user_custom](#helm_lib_module_container_security_context_capabilities_drop_all_and_run_as_user_custom) |
| [helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_pss_restricted](#helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_pss_restricted) |
Expand Down Expand Up @@ -1558,6 +1559,21 @@ list:
- List of capabilities


### helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_and_add_runtime_default

returns SecurityContext parameters for Container with read only root filesystem, all dropped and some added capabilities, and the RuntimeDefault seccomp profile

#### Usage

`{{ include "helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_and_add_runtime_default" (list . (list "KILL" "SYS_PTRACE")) }} `

#### Arguments

list:
- Template context with .Values, .Chart, etc
- List of capabilities


### helm_lib_module_container_security_context_capabilities_drop_all_and_add

returns SecurityContext parameters for Container with all dropped and some added capabilities
Expand Down
16 changes: 16 additions & 0 deletions charts/helm_lib/templates/_module_security_context.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,22 @@ securityContext:
add: {{ index . 1 | toJson }}
{{- end }}

{{- /* Usage: {{ include "helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_and_add_runtime_default" (list . (list "KILL" "SYS_PTRACE")) }} */ -}}
{{- /* returns SecurityContext parameters for Container with read only root filesystem, all dropped and some added capabilities, and the RuntimeDefault seccomp profile */ -}}
{{- define "helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_and_add_runtime_default" -}}
{{- /* Template context with .Values, .Chart, etc */ -}}
{{- /* List of capabilities */ -}}
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
add: {{ index . 1 | toJson }}
seccompProfile:
type: RuntimeDefault
{{- end }}

{{- /* Usage: {{ include "helm_lib_module_container_security_context_capabilities_drop_all_and_add" (list . (list "KILL" "SYS_PTRACE")) }} */ -}}
{{- /* returns SecurityContext parameters for Container with all dropped and some added capabilities */ -}}
{{- define "helm_lib_module_container_security_context_capabilities_drop_all_and_add" -}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_and_add_runtime_default" (list . (list "DAC_OVERRIDE" "NET_ADMIN")) }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
suite: helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_and_add_runtime_default
templates:
- helm_lib_module_container_security_context_read_only_root_filesystem_capabilities_drop_all_and_add_runtime_default.yaml
tests:
- it: drops all, adds the given capabilities and sets the RuntimeDefault seccomp profile
asserts:
- equal:
path: securityContext
value:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
add:
- DAC_OVERRIDE
- NET_ADMIN
seccompProfile:
type: RuntimeDefault
Loading