Skip to content

Commit 659015d

Browse files
authored
[wazuh]: fix security context and permissions issues (#88)
1 parent a5525c3 commit 659015d

File tree

3 files changed

+3
-32
lines changed

3 files changed

+3
-32
lines changed

charts/wazuh/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: 2.2.0
18+
version: 2.2.1
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/wazuh/templates/indexer/indexer-sts.yaml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,11 @@ spec:
3939
image: busybox
4040
resources:
4141
{{- toYaml .Values.indexer.initContainers.resources | nindent 12 }}
42-
env:
43-
- name: RUN_AS_USER
44-
value: {{ .Values.indexer.initContainers.securityContext.runAsUser | quote }}
45-
- name: RUN_AS_GROUP
46-
value: {{ .Values.indexer.initContainers.securityContext.runAsGroup | quote }}
4742
command:
4843
- sh
4944
- '-c'
5045
- |
51-
chown -R $RUN_AS_USER:$RUN_AS_GROUP /var/lib/wazuh-indexer
52-
securityContext:
53-
{{- toYaml .Values.indexer.initContainers.securityContext | nindent 12 }}
46+
chown -R 1000:1000 /var/lib/wazuh-indexer
5447
volumeMounts:
5548
- name: wazuh-indexer
5649
mountPath: /var/lib/wazuh-indexer
@@ -61,7 +54,7 @@ spec:
6154
- -w
6255
- vm.max_map_count=262144
6356
securityContext:
64-
{{- toYaml .Values.indexer.initContainers.securityContext | nindent 12 }}
57+
privileged: true
6558
containers:
6659
- name: {{ include "wazuh.fullname" . }}-indexer
6760
securityContext:

charts/wazuh/values.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ indexer:
8888
limits:
8989
cpu: 100m
9090
memory: 256Mi
91-
securityContext:
92-
runAsUser: 1000 # Match Docker image UID (wazuh-indexer user)
93-
runAsGroup: 1000 # Match Docker image GID
9491

9592
config:
9693
sslEnabled: true
@@ -129,15 +126,10 @@ indexer:
129126

130127
podSecurityContext:
131128
fsGroup: 1000 # Match Docker image user group
132-
runAsUser: 1000 # Match Docker image UID (wazuh-indexer user)
133-
runAsGroup: 1000 # Match Docker image GID
134-
runAsNonRoot: true # Docker image runs as non-root user
135129

136130
securityContext:
137131
runAsUser: 1000 # Match Docker image UID (wazuh-indexer user)
138132
runAsGroup: 1000 # Match Docker image GID
139-
runAsNonRoot: true # Docker image runs as non-root user
140-
allowPrivilegeEscalation: false # Security hardening
141133
capabilities:
142134
add: ["SYS_CHROOT"] # Required for OpenSearch/Elasticsearch
143135
# capabilities:
@@ -251,19 +243,12 @@ manager:
251243
master:
252244
podSecurityContext:
253245
fsGroup: 101 # Wazuh group GID (matches Docker image wazuh group)
254-
runAsUser: 0 # Docker image runs as root (no USER directive)
255-
runAsGroup: 0 # Root group
256-
runAsNonRoot: false # Docker image runs as root
257246

258247
podAnnotations: {}
259248

260249
podLabels: {}
261250

262251
securityContext:
263-
runAsUser: 0 # Docker image runs as root (no USER directive)
264-
runAsGroup: 0 # Root group
265-
runAsNonRoot: false # Docker image runs as root
266-
allowPrivilegeEscalation: false # Security hardening
267252
capabilities:
268253
add: ["SYS_CHROOT"] # Required for Wazuh manager
269254
# capabilities:
@@ -328,19 +313,12 @@ manager:
328313

329314
podSecurityContext:
330315
fsGroup: 101 # Wazuh group GID (matches Docker image wazuh group)
331-
runAsUser: 0 # Docker image runs as root (no USER directive)
332-
runAsGroup: 0 # Root group
333-
runAsNonRoot: false # Docker image runs as root
334316

335317
podAnnotations: {}
336318

337319
podLabels: {}
338320

339321
securityContext:
340-
runAsUser: 0 # Docker image runs as root (no USER directive)
341-
runAsGroup: 0 # Root group
342-
runAsNonRoot: false # Docker image runs as root
343-
allowPrivilegeEscalation: false # Security hardening
344322
capabilities:
345323
add: ["SYS_CHROOT"] # Required for Wazuh manager
346324
# capabilities:

0 commit comments

Comments
 (0)