Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-segning authored Dec 10, 2024
2 parents 2ed747a + fd36ff5 commit 7c4729a
Show file tree
Hide file tree
Showing 22 changed files with 367 additions and 317 deletions.
2 changes: 1 addition & 1 deletion charts/wazuh/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.2.21
version: 0.2.21-rc.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
23 changes: 23 additions & 0 deletions charts/wazuh/files/scripts/backup-indexer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Initialize the backup folder
bkp_folder=/tmp/wazuh_files_backup
mkdir -p $bkp_folder

## Backup the host information
cat /etc/*release* > $bkp_folder/host-info.txt

## Install rsync
yum install -y rsync

## Backup the Wazuh files
rsync -aREz \
--ignore-missing-args \
/etc/wazuh-indexer/certs/ \
/etc/wazuh-indexer/jvm.options \
/etc/wazuh-indexer/jvm.options.d \
/etc/wazuh-indexer/log4j2.properties \
/etc/wazuh-indexer/opensearch.yml \
/etc/wazuh-indexer/opensearch.keystore \
/etc/wazuh-indexer/opensearch-observability/ \
/etc/wazuh-indexer/opensearch-reports-scheduler/ \
/etc/wazuh-indexer/opensearch-security/ \
/usr/lib/sysctl.d/wazuh-indexer.conf $bkp_folder
48 changes: 48 additions & 0 deletions charts/wazuh/files/scripts/backup-manager.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## Initialize the backup folder
bkp_folder=/tmp/wazuh_files_backup
mkdir -p $bkp_folder

## Backup the host information
cat /etc/*release* > $bkp_folder/host-info.txt

## Install rsync
yum install -y rsync

## Backup the Wazuh files
rsync -aREz -v --stats --progress \
--ignore-missing-args \
/etc/filebeat/ \
/etc/postfix/ \
/var/ossec/api/configuration/ \
/var/ossec/etc/client.keys \
/var/ossec/etc/sslmanager* \
/var/ossec/etc/ossec.conf \
/var/ossec/etc/internal_options.conf \
/var/ossec/etc/local_internal_options.conf \
/var/ossec/etc/rules/local_rules.xml \
/var/ossec/etc/decoders/local_decoder.xml \
/var/ossec/etc/shared/ \
/var/ossec/queue/agentless/ \
/var/ossec/queue/agents-timestamp \
/var/ossec/queue/fts/ \
/var/ossec/queue/rids/ \
/var/ossec/stats/ \
/var/ossec/var/multigroups/ \
$bkp_folder

## Backup the Wazuh files
rsync -aREz -v --stats --progress \
/var/ossec/queue/db/ \
$bkp_folder


# Merge the two for loops
for i in {1..20} ; do
if [ $i -lt 10 ]; then
echo "Copying 012.db to 0$i.db"
rsync -aREz -v --stats --progress --ignore-missing-args "/var/ossec/queue/db/00$i.db" $bkp_folder
else
echo "Copying 012.db to $i.db"
rsync -aREz -v --stats --progress --ignore-missing-args "/var/ossec/queue/db/0$i.db" $bkp_folder
fi
done
1 change: 1 addition & 0 deletions charts/wazuh/files/scripts/certs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"root-ca.pem":"-----BEGIN CERTIFICATE-----\nMIIDbTCCAlWgAwIBAgIUexcJCKPqBeep6y/4HwVwvOQOurAwDQYJKoZIhvcNAQEL\nBQAwRjELMAkGA1UEBhMCVVMxEzARBgNVBAcMCkNhbGlmb3JuaWExEDAOBgNVBAoM\nB0NvbXBhbnkxEDAOBgNVBAMMB3Jvb3QtY2EwHhcNMjQxMDAyMDkzMzU3WhcNMzQw\nOTMwMDkzMzU3WjBGMQswCQYDVQQGEwJVUzETMBEGA1UEBwwKQ2FsaWZvcm5pYTEQ\nMA4GA1UECgwHQ29tcGFueTEQMA4GA1UEAwwHcm9vdC1jYTCCASIwDQYJKoZIhvcN\nAQEBBQADggEPADCCAQoCggEBALbN87VhycF2/XFsQdgVtexkUOFunfQ6RXHYmcOS\nVi/JG0gvzTZQvHBoPU+PXhjEtYO7846oK6EtIyq7CAH79HF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uVZP41gSqkEhEBODYkSrmNA0ImB4zN5NU7kU+8iduypXFDo8R4I8yJ4\nelajFqZ7CVuJZT6RwEYKRGG9NaxLyrVGR6teNx0YnKSOtPIVWohv7Djes0SFa0UG\n0mlfXRCIpE78+TavM+GEI4LrJNkLakxAhcC0bfObAoGAeXMvxDXyHUgElzM4aK+M\n91UaDBXcPcRg06ljJdOhh1kgJTd1O4EFSKWBF6uTluCIBeJF+azYZpMVXwdeA0hq\nRMO1Oq57Io9W3qKJ6M9dgHr+chGwKlYLucAK1yizmWXeFeN4yTQw2Akf+0ZDlO0+\nGHpWew24KuI8AWzcVF0UJwI=\n-----END PRIVATE KEY-----"}
34 changes: 34 additions & 0 deletions charts/wazuh/files/scripts/restor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
cp etc/filebeat/filebeat.reference.yml /etc/filebeat/
cp etc/filebeat/fields.yml /etc/filebeat/
cp -r etc/filebeat/modules.d/* /etc/filebeat/modules.d/
cp -r etc/postfix/* /etc/postfix/
cp var/ossec/etc/client.keys /var/ossec/etc/
chown root:wazuh /var/ossec/etc/client.keys
cp -r var/ossec/etc/sslmanager* /var/ossec/etc/
cp var/ossec/etc/ossec.conf /var/ossec/etc/
chown root:wazuh /var/ossec/etc/ossec.conf
cp var/ossec/etc/internal_options.conf /var/ossec/etc/
chown root:wazuh /var/ossec/etc/internal_options.conf
cp var/ossec/etc/local_internal_options.conf /var/ossec/etc/
chown root:wazuh /var/ossec/etc/local_internal_options.conf
cp -r var/ossec/etc/rules/* /var/ossec/etc/rules/
chown -R wazuh:wazuh /var/ossec/etc/rules/
cp -r var/ossec/etc/decoders/* /var/ossec/etc/decoders
chown -R wazuh:wazuh /var/ossec/etc/decoders/
cp -r var/ossec/etc/shared/* /var/ossec/etc/shared/
chown -R wazuh:wazuh /var/ossec/etc/shared/
chown root:wazuh /var/ossec/etc/shared/ar.conf
cp -r var/ossec/logs/* /var/ossec/logs/
chown -R wazuh:wazuh /var/ossec/logs/
cp -r var/ossec/queue/agentless/* /var/ossec/queue/agentless/
chown -R wazuh:wazuh /var/ossec/queue/agentless/
cp var/ossec/queue/agents-timestamp /var/ossec/queue/
chown root:wazuh /var/ossec/queue/agents-timestamp
cp -r var/ossec/queue/fts/* /var/ossec/queue/fts/
chown -R wazuh:wazuh /var/ossec/queue/fts/
cp -r var/ossec/queue/rids/* /var/ossec/queue/rids/
chown -R wazuh:wazuh /var/ossec/queue/rids/
cp -r var/ossec/stats/* /var/ossec/stats/
chown -R wazuh:wazuh /var/ossec/stats/
cp -r var/ossec/var/multigroups/* /var/ossec/var/multigroups/
chown -R wazuh:wazuh /var/ossec/var/multigroups/
56 changes: 56 additions & 0 deletions charts/wazuh/templates/common/svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{{ range $name, $val := .Values.svcs -}}
{{- if $val.enabled -}}
{{- with $val }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "common.tplvalues.render" (dict "value" $name "context" $) }}
namespace: {{ include "common.names.namespace" $ }}
labels:
{{- include "common.labels.standard" ( dict "customLabels" .additionalLabels "context" $ ) | nindent 4 }}
annotations:
{{- include "common.annotations.standard" ( dict "customAnnotations" .annotations "context" $ ) | nindent 4 }}
spec:
{{ with .type }}
type: {{ include "common.tplvalues.render" (dict "value" . "context" $) }}
{{ end }}
{{ if eq .type "LoadBalancer" }}
{{ with .loadBalancerClass }}
loadBalancerClass: {{ include "common.tplvalues.render" (dict "value" . "context" $) }}
{{ end }}
{{ end }}
selector:
{{- include "common.labels.matchLabels" $ | nindent 4 }}
{{- include "common.tplvalues.render" (dict "value" .selector "context" $) | nindent 4 -}}
{{ with .ports }}
ports:
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 4 -}}
{{ end }}
{{ with .loadBalancerIP }}
loadBalancerIP: {{ include "common.tplvalues.render" (dict "value" . "context" $) }}
{{- end }}
{{ with .allocateLoadBalancerNodePorts }}
allocateLoadBalancerNodePorts: {{ include "common.tplvalues.render" (dict "value" . "context" $) }}
{{- end }}
{{ with .clusterIP }}
clusterIP: {{ include "common.tplvalues.render" (dict "value" . "context" $) }}
{{ end }}
{{ with .externalTrafficPolicy }}
externalTrafficPolicy: {{ include "common.tplvalues.render" (dict "value" . "context" $) }}
{{ end }}
{{ with .sessionAffinity }}
sessionAffinity: {{ include "common.tplvalues.render" (dict "value" . "context" $) }}
{{ end }}
{{ with .externalName }}
externalName: {{ include "common.tplvalues.render" (dict "value" . "context" $) }}
{{ end }}
{{ with .healthCheckNodePort }}
healthCheckNodePort: {{ include "common.tplvalues.render" (dict "value" . "context" $) }}
{{ end }}
{{ with .publishNotReadyAddresses }}
publishNotReadyAddresses: {{ include "common.tplvalues.render" (dict "value" . "context" $) }}
{{ end }}
---
{{- end -}}
{{- end -}}
{{- end }}
2 changes: 1 addition & 1 deletion charts/wazuh/templates/dashboard/deploy.dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ spec:
- name: INDEXER_URL
value: 'https://{{ include "common.names.fullname" $ }}-indexer-api:9200'
- name: WAZUH_API_URL
value: 'https://{{ include "common.names.fullname" $ }}-manager'
value: 'https://{{ include "common.names.fullname" $ }}'
- name: SERVER_SSL_ENABLED
value: "true"
- name: SERVER_SSL_CERTIFICATE
Expand Down
6 changes: 3 additions & 3 deletions charts/wazuh/templates/dashboard/ing.dashboard.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and (.Values.dashboard.ingress.enabled) (eq .Values.dashboard.service.type "ClusterIP") }}
{{- if .Values.dashboard.ingress.enabled }}
{{ with .Values.dashboard.ingress -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand All @@ -11,7 +11,7 @@ metadata:
{{- include "common.labels.standard" ( dict "customLabels" .additionalLabels "context" $ ) | nindent 4 }}
spec:
{{ with .className -}}
ingressClassName: {{ . }}
ingressClassName: {{ include "common.tplvalues.render" (dict "value" . "context" $) }}
{{- end }}
rules:
- host: {{ include "common.tplvalues.render" (dict "value" .host "context" $) }}
Expand All @@ -23,7 +23,7 @@ spec:
service:
name: {{ include "common.names.fullname" $ }}-dashboard
port:
number: {{ include "common.tplvalues.render" (dict "value" $.Values.dashboard.service.port "context" $) }}
number: {{ include "common.tplvalues.render" (dict "value" .port "context" $) }}
tls:
- hosts:
- {{ include "common.tplvalues.render" (dict "value" .host "context" $) }}
Expand Down
30 changes: 0 additions & 30 deletions charts/wazuh/templates/dashboard/svc.dashboard.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion charts/wazuh/templates/helpers/_cert_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ generate_cert "indexer" \
"{{ include "common.names.fullname" $ }}-indexer-api,*.{{ include "common.names.fullname" $ }}-indexer"

generate_cert "server" \
"{{ include "common.names.fullname" $ }}-manager,*.{{ include "common.names.fullname" $ }}-cluster,{{ include "common.names.fullname" $ }}-master,{{ include "common.names.fullname" $ }},*.{{ include "common.names.fullname" $ }}"
"{{ include "common.names.fullname" $ }}-manager,*.{{ include "common.names.fullname" $ }}-cluster,{{ include "common.names.fullname" $ }}-cluster,{{ include "common.names.fullname" $ }},*.{{ include "common.names.fullname" $ }}"

generate_cert "dashboard" \
"{{ include "common.names.fullname" $ }}-dashboard,*.{{ include "common.names.fullname" $ }}-dashboard"
Expand Down
1 change: 0 additions & 1 deletion charts/wazuh/templates/indexer/svc.indexer-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ metadata:
namespace: {{ include "common.names.namespace" $ }}
labels:
{{- include "common.labels.standard" ( dict "customLabels" .additionalLabels "context" $ ) | nindent 4 }}
app: {{ include "common.names.fullname" $ }}-indexer
annotations:
{{- include "common.annotations.standard" ( dict "customAnnotations" .annotations "context" $ ) | nindent 4 }}
spec:
Expand Down
1 change: 0 additions & 1 deletion charts/wazuh/templates/indexer/svc.indexer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ metadata:
{{- include "common.annotations.standard" ( dict "customAnnotations" .annotations "context" $ ) | nindent 4 }}
labels:
{{- include "common.labels.standard" ( dict "customLabels" .additionalLabels "context" $ ) | nindent 4 }}
app: {{ include "common.names.fullname" $ }}-indexer
spec:
selector:
{{- include "common.labels.matchLabels" ( dict "customLabels" .additionalLabels "context" $ ) | nindent 4 }}
Expand Down
33 changes: 0 additions & 33 deletions charts/wazuh/templates/manager/ing.wazuh-master.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions charts/wazuh/templates/manager/svc.wazuh-cluster.yaml

This file was deleted.

34 changes: 0 additions & 34 deletions charts/wazuh/templates/manager/svc.wazuh-manager.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions charts/wazuh/templates/manager/svc.wazuh-master.yaml

This file was deleted.

Loading

0 comments on commit 7c4729a

Please sign in to comment.