Compare commits

...

86 Commits

Author SHA1 Message Date
Carlos Bordon
ce8dd29425 Merge pull request #879 from wazuh/4.4.5-bump-revision
Bump revision
2023-07-10 09:00:24 -03:00
vcerenu
a433989865 bump revision 2023-07-10 08:42:14 -03:00
Gonzalo Acuña
ff1e5f991a Merge pull request #878 from wazuh/bump-4.4.5
Bump to 4.4.5
2023-07-07 08:48:54 -03:00
Gonzalo Acuña
55ee49aff5 Bumped to 4.4.5 2023-07-07 08:39:57 -03:00
Gonzalo Acuña
75f92308a1 Merge pull request #877 from wazuh/merge-4.4.4-into-4.4
Merge `4.4.4` into `4.4`
2023-07-07 08:32:11 -03:00
Gonzalo Acuña
d278782134 Merge pull request #858 from wazuh/merge-4-4-4-to-4-4
Bump `4.4` to `4.4.4`
2023-06-13 15:58:51 -03:00
Gonzalo Acuña
77725b7eb2 Revision bump 2023-06-13 13:19:35 -03:00
Gonzalo Acuña
4e7c2cf72a Revision bump 2023-06-12 09:38:35 -03:00
Gonzalo Acuña
8ce1f36f10 Revision update 2023-06-05 11:42:10 -03:00
Gonzalo Acuña
e2e95a5c57 Bump to 4.4.4 2023-06-05 11:38:58 -03:00
Raul Del Pozo Moreno
b259665fc6 Merge pull request #851 from wazuh/bump-4.4.3
Bump `4.4` to `4.4.3`
2023-05-26 14:13:58 +02:00
Raul Del Pozo Moreno
820079f1d0 Bump to 4.4.3 2023-05-25 20:03:26 +02:00
Gonzalo Acuña
028b5f6034 Revision update 2023-05-18 21:05:42 +02:00
vcerenu
cd7dc4c7cf bump 4.4.2 version 2023-05-18 21:05:41 +02:00
Jesse Roland
40faad148d Add DASHBOARD_USERNAME and DASHBOARD_PASSWORD environment variables to
the dashboard container.

Resolves https://github.com/wazuh/wazuh-docker/issues/823
2023-05-18 21:04:33 +02:00
vcerenu
02aaf45e9d change revision number 2023-05-18 21:04:32 +02:00
vcerenu
cd9f211eb3 bump 4.3.11 version 2023-05-18 21:04:31 +02:00
vcerenu
20c8000fec change revision 2023-05-18 21:02:52 +02:00
vcerenu
8ada4445b0 bump 4.4.1 version 2023-04-10 10:20:48 -03:00
Gonzalo Acuña
1c69a38bd8 Merge pull request #813 from wazuh/807-docker-update-from-4310-to-440
Disable cluster option
2023-04-05 14:52:28 -03:00
vcerenu
615d6df29c disable cluster option 2023-04-05 13:55:24 -03:00
Gonzalo Acuña
949a465855 Merge pull request #811 from wazuh/revert-799-bump-4-4-1
Revert "Bump `4.4` to `4.4.1`"
2023-04-05 13:49:23 -03:00
Gonzalo Acuña
f7bbac5a08 Revert "Bump 4.4 to 4.4.1" 2023-04-05 13:46:20 -03:00
Gonzalo Acuña
11820b01e9 Merge pull request #799 from wazuh/bump-4-4-1
Bump `4.4` to `4.4.1`
2023-03-31 11:02:25 -03:00
vcerenu
a8de452002 bump 4.4.1 version 2023-03-31 10:27:58 -03:00
Victor Ereñú
c76681b3b9 Merge pull request #794 from wazuh/modify-base-dashboard
Change dashboard and indexer base repository
2023-03-28 17:09:15 -03:00
vcerenu
e25635cb25 change dashboard and indexer base repository 2023-03-28 16:59:49 -03:00
Gonzalo Acuña
304eedcb51 Merge pull request #793 from wazuh/bump_4-4
Change revision number
2023-03-28 10:03:41 -03:00
vcerenu
6123ab994c change revision number 2023-03-28 09:07:24 -03:00
Gonzalo Acuña
2f58da59de Merge pull request #776 from wazuh/change_password
Update indexer password
2023-02-01 10:59:11 -03:00
vcerenu
3279931813 update docs count 2023-02-01 10:33:26 -03:00
vcerenu
b039567e1c update indexer password 2023-02-01 10:02:35 -03:00
Gonzalo Acuña
3190c4246e Merge pull request #766 from wazuh/765-change-wazuh-dashboard-and-indexer-base-path
Modify base path
2022-12-27 08:11:21 -03:00
vcerenu
271f421cd4 modify base path 2022-12-26 11:12:16 -03:00
Alberto Rodríguez
910e28956b Merge pull request #760 from wazuh/merge-4.4
Version check fix
2022-12-02 17:19:02 +01:00
vcerenu
dcf8bb8060 fix index alerts test 2022-12-02 12:42:01 -03:00
vcerenu
be9f3d1b90 fix index alerts test 2022-12-02 11:36:35 -03:00
vcerenu
91625f412c change indexer and manager configuration for 4.4 version 2022-12-01 19:35:35 -03:00
vcerenu
4c7dcb2ebf add revision into versions parameter 2022-12-01 13:32:43 -03:00
vcerenu
8febf33d58 add 4.4 version 2022-12-01 13:02:13 -03:00
Alberto Rodríguez
3d19774d7e Merge pull request #758 from wazuh/merge-4.4
Merge 4.3 in 4.4 branch
2022-12-01 16:23:05 +01:00
vcerenu
e11e7a10b8 add 4.4 version 2022-12-01 11:58:21 -03:00
vcerenu
7f73635651 add 4.4 version 2022-11-30 15:35:16 -03:00
vcerenu
e9a0be25ce resolving conflicts in 4.3 merge 2022-11-30 15:27:48 -03:00
Alberto Rodríguez
c87580cfb5 Merge pull request #754 from wazuh/753-opensearch_java_opts-duplicate-parameters
Remove Xms and Xmx parameter into jvm.options
2022-11-29 15:45:36 +01:00
Alberto Rodríguez
e0cd80c105 Update build-docker-images/wazuh-indexer/config/config.sh 2022-11-29 15:44:36 +01:00
vcerenu
796751aec9 remove Xms and Xmx parameter into jvm.options 2022-11-28 17:24:13 -03:00
Alberto Rodríguez
15205ada03 Merge pull request #742 from wazuh/bump-4-3-10
Bump 4.3 to 4.3.10
2022-11-11 16:20:58 +01:00
vcerenu
c1bfc450ba bump 4.3.10 version 2022-11-11 11:34:09 -03:00
Gonzalo Acuña
b08fd3e384 Merge pull request #726 from wazuh/bump-4-3-9
Bump 4.3 to 4.3.9
2022-10-11 09:47:12 -03:00
vcerenu
fd08279f32 bump 4.3.9 version 2022-10-06 14:25:56 -03:00
Gonzalo Acuña
f42b30b71d Merge pull request #720 from wazuh/bump-4-3-8
Bump 4.3 to 4.3.8
2022-09-14 12:15:09 -03:00
vcerenu
7555453d55 bump 4.3.8 version 2022-09-14 10:39:31 -03:00
vcerenu
22b77749fa bump 4.3.8 version 2022-09-12 15:37:47 -03:00
José Fernández Aguilera
6c094d07a6 Merge pull request #719 from wazuh/4.4-add-double-quote
Add Double Quote on password
2022-09-12 17:04:35 +02:00
vcerenu
b6959c8b15 doble quote for password 2022-09-09 15:29:07 -03:00
José Fernández Aguilera
28e21b0282 Merge pull request #717 from wazuh/714-modify-password
Add Double Quote on password
2022-09-09 08:52:18 +02:00
vcerenu
b83dcc087e doble quote for password 2022-09-08 12:17:45 -03:00
vcerenu
19c23456ec readme 2022-08-24 11:45:55 -03:00
José Fernández Aguilera
f99721e98b Merge pull request #708 from wazuh/bump-4-3-7
Bump 4.3 to 4.3.7
2022-08-17 08:23:32 +02:00
vcerenu
38271d7797 bump 4.3.7 version 2022-08-12 12:44:20 -03:00
vcerenu
c278f6a503 bump 4.3.7 version 2022-08-12 12:02:04 -03:00
vcerenu
d6ba8c3661 Merge pull request #707 from wazuh/695-change-indexer-username
Filebeat parameters
2022-08-12 10:39:19 -03:00
vcerenu
1db718ffc8 fix replace filebeat parameters 2022-08-10 16:15:17 -03:00
vcerenu
cf137c6703 Merge pull request #706 from wazuh/MigrationTo43-WazuhManagerNew
Fix permissions/ownership issue for Wazuh manager migration (4.2 -> 4.3)
2022-08-09 11:41:16 -03:00
Elwali karkoub
6f966cb01a Update 0-wazuh-init 2022-08-09 07:42:12 +02:00
José Fernández Aguilera
8bc11c48d9 Merge pull request #698 from wazuh/change-readme
Update Readme
2022-07-27 12:39:00 +02:00
vcerenu
be1bc64e0f update api and dashboard user 2022-07-26 09:27:01 -03:00
José Fernández Aguilera
b98d32d4ca Merge pull request #691 from wazuh/1665-Fix-filebeat-crash-due-to-glibc-to4.4
Add fix to avoid GLIBC crash
2022-07-07 09:00:19 +02:00
fcaffieri
4c710e6c20 Add fix to avoid GLIBC crash, fix identation 2022-07-06 18:01:53 -03:00
fcaffieri
f97a719304 Add fix to avoid GLIBC crash 2022-07-06 17:35:20 -03:00
José Fernández Aguilera
bf534b4143 Merge pull request #687 from wazuh/1667-disable-filebeat-metrics-to4.4
Disable filebeat metrics
2022-07-04 16:02:24 +02:00
fcaffieri
a82cc9ec39 disable filebeat metrics 2022-07-04 09:18:11 -03:00
fcaffieri
8d9ad6152a disable filebeat metrics 2022-07-01 17:45:23 -03:00
José Fernández Aguilera
5555c1dd06 Merge pull request #666 from wazuh/merge_4_4
Merge 4.3.3 into 4.4
2022-06-01 18:40:02 +02:00
vcerenu
0dd044de68 Merge 4.3.3 into 4.4 2022-06-01 12:29:05 -03:00
Alberto Rodríguez
5d88983066 Merge pull request #651 from wazuh/fix_whitelist_4_4
Fix whitelist in 4.4
2022-05-23 16:09:43 +02:00
vcerenu
95565df2f5 fix whitelist 2022-05-23 10:58:04 -03:00
Alberto Rodríguez
ed5c5d70ba Merge pull request #649 from wazuh/master
Merge master into 4.4
2022-05-23 14:21:52 +02:00
Alberto Rodríguez
97f5a6bf04 Merge pull request #648 from wazuh/merge_master
Merge 4.3 into master
2022-05-23 14:15:22 +02:00
vcerenu
b21c3769d3 Merge 4.3 into master 2022-05-20 15:57:34 -03:00
Alberto Rodríguez
9cd399c2df Merge pull request #598 from wazuh/4.2-merge_master
Merge 4.2 into master
2022-03-28 16:58:01 +02:00
Gonzalo Acuña
3e54eeb62f Merge branch 'master' into 4.2-merge_master 2022-03-28 11:34:55 -03:00
Alberto Rodríguez
a4be008028 Merge pull request #596 from wazuh/595-bump_426
Bump to 4.2.6
2022-03-28 15:49:25 +02:00
Gonzalo Acuña
85e62cfd0e Bump to 4.2.6 2022-03-25 10:28:14 -03:00
Alberto R
84fe19e868 Bumped to 4.4.0 2021-11-24 17:01:09 +01:00
30 changed files with 286 additions and 128 deletions

4
.env
View File

@@ -1,3 +1,3 @@
WAZUH_VERSION=4.3.6 WAZUH_VERSION=4.4.5
WAZUH_IMAGE_VERSION=4.3.6 WAZUH_IMAGE_VERSION=4.4.5
WAZUH_TAG_REVISION=1 WAZUH_TAG_REVISION=1

2
.github/.goss.yaml vendored
View File

@@ -56,7 +56,7 @@ package:
wazuh-manager: wazuh-manager:
installed: true installed: true
versions: versions:
- 4.3.6-1 - 4.4.5-1
port: port:
tcp:1514: tcp:1514:
listening: true listening: true

View File

@@ -126,7 +126,7 @@ jobs:
- name: Check documents into wazuh-alerts index - name: Check documents into wazuh-alerts index
run: | run: |
docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_doc/_search" -u admin:SecretPassword -k -s | jq -r ".hits.total.value"`" docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_count" -u admin:SecretPassword -k -s | jq -r ".count"`"
if [[ $docs -gt 100 ]]; then if [[ $docs -gt 100 ]]; then
echo "wazuh-alerts index documents: ${docs}" echo "wazuh-alerts index documents: ${docs}"
else else
@@ -250,8 +250,8 @@ jobs:
- name: Check documents into wazuh-alerts index - name: Check documents into wazuh-alerts index
run: | run: |
docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_doc/_search" -u admin:SecretPassword -k -s | jq -r ".hits.total.value"`" docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_count" -u admin:SecretPassword -k -s | jq -r ".count"`"
if [[ $docs -gt 200 ]]; then if [[ $docs -gt 100 ]]; then
echo "wazuh-alerts index documents: ${docs}" echo "wazuh-alerts index documents: ${docs}"
else else
echo "wazuh-alerts index documents: ${docs}" echo "wazuh-alerts index documents: ${docs}"

View File

@@ -1,6 +1,63 @@
# Change Log # Change Log
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## Wazuh Docker v4.4.5
### Added
- Update Wazuh to version [4.4.5](https://github.com/wazuh/wazuh/blob/v4.4.5/CHANGELOG.md#v445)
## Wazuh Docker v4.4.4
### Added
- Update Wazuh to version [4.4.4](https://github.com/wazuh/wazuh/blob/v4.4.4/CHANGELOG.md#v444)
## Wazuh Docker v4.4.3
### Added
- Update Wazuh to version [4.4.3](https://github.com/wazuh/wazuh/blob/v4.4.3/CHANGELOG.md#v443)
## Wazuh Docker v4.4.2
### Added
- Update Wazuh to version [4.4.2](https://github.com/wazuh/wazuh/blob/v4.4.2/CHANGELOG.md#v442)
## Wazuh Docker v4.4.1
### Added
- Update Wazuh to version [4.4.1](https://github.com/wazuh/wazuh/blob/v4.4.1/CHANGELOG.md#v441)
## Wazuh Docker v4.4.0
### Added
- Update Wazuh to version [4.4.0](https://github.com/wazuh/wazuh/blob/v4.4.0/CHANGELOG.md#v440)
## Wazuh Docker v4.3.11
### Added
- Update Wazuh to version [4.3.11](https://github.com/wazuh/wazuh/blob/v4.3.11/CHANGELOG.md#v4311)
## Wazuh Docker v4.3.10
### Added
- Update Wazuh to version [4.3.10](https://github.com/wazuh/wazuh/blob/v4.3.10/CHANGELOG.md#v4310)
## Wazuh Docker v4.3.9
### Added
- Update Wazuh to version [4.3.9](https://github.com/wazuh/wazuh/blob/v4.3.9/CHANGELOG.md#v439)
## Wazuh Docker v4.3.8
### Added
- Update Wazuh to version [4.3.8](https://github.com/wazuh/wazuh/blob/v4.3.8/CHANGELOG.md#v438)
## Wazuh Docker v4.3.7
### Added
- Update Wazuh to version [4.3.7](https://github.com/wazuh/wazuh/blob/v4.3.7/CHANGELOG.md#v437)
## Wazuh Docker v4.3.6 ## Wazuh Docker v4.3.6
### Added ### Added

View File

@@ -36,13 +36,13 @@ Default values are included when available.
### Wazuh ### Wazuh
``` ```
API_USERNAME="wazuh" # Wazuh API username API_USERNAME="wazuh-wui" # Wazuh API username
API_PASSWORD="wazuh" # Wazuh API password - Must comply with requirements API_PASSWORD="MyS3cr37P450r.*-" # Wazuh API password - Must comply with requirements
# (8+ length, uppercase, lowercase, specials chars) # (8+ length, uppercase, lowercase, specials chars)
INDEXER_URL=https://wazuh.indexer:9200 # Wazuh indexer URL INDEXER_URL=https://wazuh.indexer:9200 # Wazuh indexer URL
INDEXER_USERNAME=admin # Wazuh indexer Username INDEXER_USERNAME=admin # Wazuh indexer Username
INDEXER_PASSWORD=admin # Wazuh indexer Password INDEXER_PASSWORD=SecretPassword # Wazuh indexer Password
FILEBEAT_SSL_VERIFICATION_MODE=full # Filebeat SSL Verification mode (full or none) FILEBEAT_SSL_VERIFICATION_MODE=full # Filebeat SSL Verification mode (full or none)
SSL_CERTIFICATE_AUTHORITIES="" # Path of Filebeat SSL CA SSL_CERTIFICATE_AUTHORITIES="" # Path of Filebeat SSL CA
SSL_CERTIFICATE="" # Path of Filebeat SSL Certificate SSL_CERTIFICATE="" # Path of Filebeat SSL Certificate
@@ -78,10 +78,12 @@ API_SELECTOR=true Defines if the user is allowed to change the sel
IP_SELECTOR=true # Defines if the user is allowed to change the selected index pattern directly from the Wazuh app top menu IP_SELECTOR=true # Defines if the user is allowed to change the selected index pattern directly from the Wazuh app top menu
IP_IGNORE="[]" # List of index patterns to be ignored IP_IGNORE="[]" # List of index patterns to be ignored
DASHBOARD_USERNAME=kibanaserver # Custom user saved in the dashboard keystore
DASHBOARD_PASSWORD=kibanaserver # Custom password saved in the dashboard keystore
WAZUH_MONITORING_ENABLED=true # Custom settings to enable/disable wazuh-monitoring indices WAZUH_MONITORING_ENABLED=true # Custom settings to enable/disable wazuh-monitoring indices
WAZUH_MONITORING_FREQUENCY=900 # Custom setting to set the frequency for wazuh-monitoring indices cron task WAZUH_MONITORING_FREQUENCY=900 # Custom setting to set the frequency for wazuh-monitoring indices cron task
WAZUH_MONITORING_SHARDS=2 # Configure wazuh-monitoring-* indices shards and replicas WAZUH_MONITORING_SHARDS=2 # Configure wazuh-monitoring-* indices shards and replicas
WAZUH_MONITORING_REPLICAS=0 # WAZUH_MONITORING_REPLICAS=0 ##
``` ```
## Directory structure ## Directory structure
@@ -193,6 +195,17 @@ WAZUH_MONITORING_REPLICAS=0 #
| Wazuh version | ODFE | XPACK | | Wazuh version | ODFE | XPACK |
|---------------|---------|--------| |---------------|---------|--------|
| v4.4.5 | | |
| v4.4.4 | | |
| v4.4.3 | | |
| v4.4.2 | | |
| v4.4.1 | | |
| v4.4.0 | | |
| v4.3.11 | | |
| v4.3.10 | | |
| v4.3.9 | | |
| v4.3.8 | | |
| v4.3.7 | | |
| v4.3.6 | | | | v4.3.6 | | |
| v4.3.5 | | | | v4.3.5 | | |
| v4.3.4 | | | | v4.3.4 | | |

View File

@@ -1,2 +1,2 @@
WAZUH-DOCKER_VERSION="4.3.6" WAZUH-DOCKER_VERSION="4.4.5"
REVISION="40318" REVISION="40413"

View File

@@ -1,4 +1,4 @@
WAZUH_IMAGE_VERSION=4.3.6 WAZUH_IMAGE_VERSION=4.4.5
WAZUH_VERSION=$(echo $WAZUH_IMAGE_VERSION | sed -e 's/\.//g') WAZUH_VERSION=$(echo $WAZUH_IMAGE_VERSION | sed -e 's/\.//g')
WAZUH_TAG_REVISION=1 WAZUH_TAG_REVISION=1
WAZUH_CURRENT_VERSION=$(curl --silent https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 2- | sed -e 's/\.//g') WAZUH_CURRENT_VERSION=$(curl --silent https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 2- | sed -e 's/\.//g')

View File

@@ -9,8 +9,8 @@ export CONFIG_DIR=${INSTALLATION_DIR}/config
## Variables ## Variables
CERT_TOOL=wazuh-certs-tool.sh CERT_TOOL=wazuh-certs-tool.sh
PACKAGES_URL=https://packages.wazuh.com/4.3/ PACKAGES_URL=https://packages.wazuh.com/4.4/
PACKAGES_DEV_URL=https://packages-dev.wazuh.com/4.3/ PACKAGES_DEV_URL=https://packages-dev.wazuh.com/4.4/
## Check if the cert tool exists in S3 buckets ## Check if the cert tool exists in S3 buckets
CERT_TOOL_PACKAGES=$(curl --silent -I $PACKAGES_URL$CERT_TOOL | grep -E "^HTTP" | awk '{print $2}') CERT_TOOL_PACKAGES=$(curl --silent -I $PACKAGES_URL$CERT_TOOL | grep -E "^HTTP" | awk '{print $2}')

View File

@@ -1,12 +1,25 @@
WAZUH_CURRENT_VERSION=$(curl --silent https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 2- | sed -e 's/\.//g') && \ REPOSITORY="packages.wazuh.com/4.x"
WAZUH_IMAGE_VERSION=$(echo $WAZUH_VERSION | sed -e 's/\.//g') && \ WAZUH_CURRENT_VERSION=$(curl --silent https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 2-)
MAJOR_BUILD=$(echo $WAZUH_VERSION | cut -d. -f1)
MID_BUILD=$(echo $WAZUH_VERSION | cut -d. -f2)
MINOR_BUILD=$(echo $WAZUH_VERSION | cut -d. -f3)
MAJOR_CURRENT=$(echo $WAZUH_CURRENT_VERSION | cut -d. -f1)
MID_CURRENT=$(echo $WAZUH_CURRENT_VERSION | cut -d. -f2)
MINOR_CURRENT=$(echo $WAZUH_CURRENT_VERSION | cut -d. -f3)
## check version to use the correct repository
if [ "$WAZUH_IMAGE_VERSION" -le "$WAZUH_CURRENT_VERSION" ]; then if [ "$MAJOR_BUILD" -gt "$MAJOR_CURRENT" ]; then
REPOSITORY="packages.wazuh.com" REPOSITORY="packages-dev.wazuh.com/pre-release"
else elif [ "$MAJOR_BUILD" -eq "$MAJOR_CURRENT" ]; then
REPOSITORY="packages-dev.wazuh.com" if [ "$MID_BUILD" -gt "$MID_CURRENT" ]; then
REPOSITORY="packages-dev.wazuh.com/pre-release"
elif [ "$MID_BUILD" -eq "$MID_CURRENT" ]; then
if [ "$MINOR_BUILD" -gt "$MINOR_CURRENT" ]; then
REPOSITORY="packages-dev.wazuh.com/pre-release"
fi
fi
fi fi
curl -o wazuh-dashboard-base.tar.xz https://${REPOSITORY}/stack/dashboard/base/wazuh-dashboard-base-${WAZUH_VERSION}-${WAZUH_TAG_REVISION}-linux-x64.tar.xz
curl -o wazuh-dashboard-base.tar.xz https://${REPOSITORY}/stack/dashboard/wazuh-dashboard-base-${WAZUH_VERSION}-${WAZUH_TAG_REVISION}-linux-x64.tar.xz
tar -xf wazuh-dashboard-base.tar.xz --directory $INSTALL_DIR --strip-components=1 tar -xf wazuh-dashboard-base.tar.xz --directory $INSTALL_DIR --strip-components=1

View File

@@ -1,11 +1,24 @@
## Variables ## variables
WAZUH_IMAGE_VERSION=$(echo $WAZUH_VERSION | sed -e 's/\.//g') WAZUH_APP=https://packages.wazuh.com/4.x/ui/dashboard/wazuh-${WAZUH_VERSION}-${WAZUH_UI_REVISION}.zip
WAZUH_CURRENT_VERSION=$(curl --silent https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 2- | sed -e 's/\.//g') WAZUH_CURRENT_VERSION=$(curl --silent https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 2-)
## If wazuh manager exists in apt dev repository, change variables, if not exit 1 MAJOR_BUILD=$(echo $WAZUH_VERSION | cut -d. -f1)
if [ "$WAZUH_IMAGE_VERSION" -le "$WAZUH_CURRENT_VERSION" ]; then MID_BUILD=$(echo $WAZUH_VERSION | cut -d. -f2)
WAZUH_APP=https://packages.wazuh.com/4.x/ui/dashboard/wazuh-${WAZUH_VERSION}-${WAZUH_UI_REVISION}.zip MINOR_BUILD=$(echo $WAZUH_VERSION | cut -d. -f3)
else MAJOR_CURRENT=$(echo $WAZUH_CURRENT_VERSION | cut -d. -f1)
MID_CURRENT=$(echo $WAZUH_CURRENT_VERSION | cut -d. -f2)
MINOR_CURRENT=$(echo $WAZUH_CURRENT_VERSION | cut -d. -f3)
## check version to use the correct repository
if [ "$MAJOR_BUILD" -gt "$MAJOR_CURRENT" ]; then
WAZUH_APP=https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-${WAZUH_VERSION}-${WAZUH_UI_REVISION}.zip WAZUH_APP=https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-${WAZUH_VERSION}-${WAZUH_UI_REVISION}.zip
elif [ "$MAJOR_BUILD" -eq "$MAJOR_CURRENT" ]; then
if [ "$MID_BUILD" -gt "$MID_CURRENT" ]; then
WAZUH_APP=https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-${WAZUH_VERSION}-${WAZUH_UI_REVISION}.zip
elif [ "$MID_BUILD" -eq "$MID_CURRENT" ]; then
if [ "$MINOR_BUILD" -gt "$MINOR_CURRENT" ]; then
WAZUH_APP=https://packages-dev.wazuh.com/pre-release/ui/dashboard/wazuh-${WAZUH_VERSION}-${WAZUH_UI_REVISION}.zip
fi
fi
fi fi
# Install Wazuh App # Install Wazuh App

View File

@@ -59,14 +59,15 @@ COPY --from=builder --chown=0:0 /debian/wazuh-indexer/usr/lib/systemd /usr/lib/s
COPY --from=builder --chown=0:0 /debian/wazuh-indexer/usr/lib/sysctl.d /usr/lib/sysctl.d COPY --from=builder --chown=0:0 /debian/wazuh-indexer/usr/lib/sysctl.d /usr/lib/sysctl.d
COPY --from=builder --chown=0:0 /debian/wazuh-indexer/usr/lib/tmpfiles.d /usr/lib/tmpfiles.d COPY --from=builder --chown=0:0 /debian/wazuh-indexer/usr/lib/tmpfiles.d /usr/lib/tmpfiles.d
RUN chown -R 1000:1000 /usr/share/wazuh-indexer
RUN mkdir -p /var/lib/wazuh-indexer && chown 1000:1000 /var/lib/wazuh-indexer && \ RUN mkdir -p /var/lib/wazuh-indexer && chown 1000:1000 /var/lib/wazuh-indexer && \
mkdir -p /usr/share/wazuh-indexer/logs && chown 1000:1000 /usr/share/wazuh-indexer/logs && \ mkdir -p /usr/share/wazuh-indexer/logs && chown 1000:1000 /usr/share/wazuh-indexer/logs && \
mkdir -p /run/wazuh-indexer && chown 1000:1000 /run/wazuh-indexer && \ mkdir -p /run/wazuh-indexer && chown 1000:1000 /run/wazuh-indexer && \
mkdir -p /var/log/wazuh-indexer && chown 1000:1000 /var/log/wazuh-indexer && \ mkdir -p /var/log/wazuh-indexer && chown 1000:1000 /var/log/wazuh-indexer && \
chmod 700 /usr/share/wazuh-indexer/config && \ chmod 700 /usr/share/wazuh-indexer && \
chmod 600 /usr/share/wazuh-indexer/config/jvm.options && \ chmod 600 /usr/share/wazuh-indexer/jvm.options && \
chmod 600 /usr/share/wazuh-indexer/config/opensearch.yml chmod 600 /usr/share/wazuh-indexer/opensearch.yml
USER wazuh-indexer USER wazuh-indexer

View File

@@ -4,8 +4,6 @@ export DH_OPTIONS
export NAME=wazuh-indexer export NAME=wazuh-indexer
export TARGET_DIR=${CURDIR}/debian/${NAME} export TARGET_DIR=${CURDIR}/debian/${NAME}
export WAZUH_CURRENT_VERSION=$(curl --silent https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 2- | sed -e 's/\.//g')
export WAZUH_IMAGE_VERSION=$(echo $WAZUH_VERSION | sed -e 's/\.//g')
# Package build options # Package build options
export USER=${NAME} export USER=${NAME}
@@ -15,7 +13,7 @@ export LOG_DIR=/var/log/${NAME}
export LIB_DIR=/var/lib/${NAME} export LIB_DIR=/var/lib/${NAME}
export PID_DIR=/run/${NAME} export PID_DIR=/run/${NAME}
export INSTALLATION_DIR=/usr/share/${NAME} export INSTALLATION_DIR=/usr/share/${NAME}
export CONFIG_DIR=${INSTALLATION_DIR}/config export CONFIG_DIR=${INSTALLATION_DIR}
export BASE_DIR=${NAME}-* export BASE_DIR=${NAME}-*
export INDEXER_FILE=wazuh-indexer-base.tar.xz export INDEXER_FILE=wazuh-indexer-base.tar.xz
export BASE_FILE=wazuh-indexer-base-${VERSION}-linux-x64.tar.xz export BASE_FILE=wazuh-indexer-base-${VERSION}-linux-x64.tar.xz
@@ -23,13 +21,31 @@ export REPO_DIR=/unattended_installer
rm -rf ${INSTALLATION_DIR}/ rm -rf ${INSTALLATION_DIR}/
if [ "$WAZUH_IMAGE_VERSION" -le "$WAZUH_CURRENT_VERSION" ]; then ## variables
REPOSITORY="packages.wazuh.com" REPOSITORY="packages.wazuh.com/4.x"
else WAZUH_CURRENT_VERSION=$(curl --silent https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 2-)
REPOSITORY="packages-dev.wazuh.com" MAJOR_BUILD=$(echo $WAZUH_VERSION | cut -d. -f1)
MID_BUILD=$(echo $WAZUH_VERSION | cut -d. -f2)
MINOR_BUILD=$(echo $WAZUH_VERSION | cut -d. -f3)
MAJOR_CURRENT=$(echo $WAZUH_CURRENT_VERSION | cut -d. -f1)
MID_CURRENT=$(echo $WAZUH_CURRENT_VERSION | cut -d. -f2)
MINOR_CURRENT=$(echo $WAZUH_CURRENT_VERSION | cut -d. -f3)
## check version to use the correct repository
if [ "$MAJOR_BUILD" -gt "$MAJOR_CURRENT" ]; then
REPOSITORY="packages-dev.wazuh.com/pre-release"
elif [ "$MAJOR_BUILD" -eq "$MAJOR_CURRENT" ]; then
if [ "$MID_BUILD" -gt "$MID_CURRENT" ]; then
REPOSITORY="packages-dev.wazuh.com/pre-release"
elif [ "$MID_BUILD" -eq "$MID_CURRENT" ]; then
if [ "$MINOR_BUILD" -gt "$MINOR_CURRENT" ]; then
REPOSITORY="packages-dev.wazuh.com/pre-release"
fi
fi
fi fi
curl -o ${INDEXER_FILE} https://${REPOSITORY}/stack/indexer/base/${BASE_FILE}
curl -o ${INDEXER_FILE} https://${REPOSITORY}/stack/indexer/${BASE_FILE}
tar -xf ${INDEXER_FILE} tar -xf ${INDEXER_FILE}
## TOOLS ## TOOLS
@@ -37,8 +53,8 @@ tar -xf ${INDEXER_FILE}
## Variables ## Variables
CERT_TOOL=wazuh-certs-tool.sh CERT_TOOL=wazuh-certs-tool.sh
PASSWORD_TOOL=wazuh-passwords-tool.sh PASSWORD_TOOL=wazuh-passwords-tool.sh
PACKAGES_URL=https://packages.wazuh.com/4.3/ PACKAGES_URL=https://packages.wazuh.com/4.4/
PACKAGES_DEV_URL=https://packages-dev.wazuh.com/4.3/ PACKAGES_DEV_URL=https://packages-dev.wazuh.com/4.4/
## Check if the cert tool exists in S3 buckets ## Check if the cert tool exists in S3 buckets
CERT_TOOL_PACKAGES=$(curl --silent -I $PACKAGES_URL$CERT_TOOL | grep -E "^HTTP" | awk '{print $2}') CERT_TOOL_PACKAGES=$(curl --silent -I $PACKAGES_URL$CERT_TOOL | grep -E "^HTTP" | awk '{print $2}')
@@ -77,6 +93,7 @@ chmod 755 $CERT_TOOL && bash /$CERT_TOOL -A
# copy to target # copy to target
mkdir -p ${TARGET_DIR}${INSTALLATION_DIR} mkdir -p ${TARGET_DIR}${INSTALLATION_DIR}
mkdir -p ${TARGET_DIR}${INSTALLATION_DIR}/opensearch-security/
mkdir -p ${TARGET_DIR}${CONFIG_DIR} mkdir -p ${TARGET_DIR}${CONFIG_DIR}
mkdir -p ${TARGET_DIR}${LIB_DIR} mkdir -p ${TARGET_DIR}${LIB_DIR}
mkdir -p ${TARGET_DIR}${LOG_DIR} mkdir -p ${TARGET_DIR}${LOG_DIR}
@@ -101,9 +118,9 @@ cp -pr ${BASE_DIR}/* ${TARGET_DIR}${INSTALLATION_DIR}
cp /$CERT_TOOL ${TARGET_DIR}${INSTALLATION_DIR}/plugins/opensearch-security/tools/ cp /$CERT_TOOL ${TARGET_DIR}${INSTALLATION_DIR}/plugins/opensearch-security/tools/
cp /$PASSWORD_TOOL ${TARGET_DIR}${INSTALLATION_DIR}/plugins/opensearch-security/tools/ cp /$PASSWORD_TOOL ${TARGET_DIR}${INSTALLATION_DIR}/plugins/opensearch-security/tools/
# Copy Wazuh's config files for the security plugin # Copy Wazuh's config files for the security plugin
cp -pr /roles_mapping.yml ${TARGET_DIR}${INSTALLATION_DIR}/plugins/opensearch-security/securityconfig/ cp -pr /roles_mapping.yml ${TARGET_DIR}${INSTALLATION_DIR}/opensearch-security/
cp -pr /roles.yml ${TARGET_DIR}${INSTALLATION_DIR}/plugins/opensearch-security/securityconfig/ cp -pr /roles.yml ${TARGET_DIR}${INSTALLATION_DIR}/opensearch-security/
cp -pr /internal_users.yml ${TARGET_DIR}${INSTALLATION_DIR}/plugins/opensearch-security/securityconfig/ cp -pr /internal_users.yml ${TARGET_DIR}${INSTALLATION_DIR}/opensearch-security/
cp -pr /opensearch.yml ${TARGET_DIR}${CONFIG_DIR} cp -pr /opensearch.yml ${TARGET_DIR}${CONFIG_DIR}
# Copy Wazuh indexer's certificates # Copy Wazuh indexer's certificates
cp -pr /wazuh-certificates/demo.indexer.pem ${TARGET_DIR}${CONFIG_DIR}/certs/indexer.pem cp -pr /wazuh-certificates/demo.indexer.pem ${TARGET_DIR}${CONFIG_DIR}/certs/indexer.pem
@@ -113,5 +130,9 @@ cp -pr /wazuh-certificates/root-ca.pem ${TARGET_DIR}${CONFIG_DIR}/certs/root-ca.
cp -pr /wazuh-certificates/admin.pem ${TARGET_DIR}${CONFIG_DIR}/certs/admin.pem cp -pr /wazuh-certificates/admin.pem ${TARGET_DIR}${CONFIG_DIR}/certs/admin.pem
cp -pr /wazuh-certificates/admin-key.pem ${TARGET_DIR}${CONFIG_DIR}/certs/admin-key.pem cp -pr /wazuh-certificates/admin-key.pem ${TARGET_DIR}${CONFIG_DIR}/certs/admin-key.pem
# Delete xms and xmx parameters in jvm.options
sed '/-Xms/d' -i ${TARGET_DIR}${CONFIG_DIR}/jvm.options
sed '/-Xmx/d' -i ${TARGET_DIR}${CONFIG_DIR}/jvm.options
chmod -R 500 ${TARGET_DIR}${CONFIG_DIR}/certs chmod -R 500 ${TARGET_DIR}${CONFIG_DIR}/certs
chmod -R 400 ${TARGET_DIR}${CONFIG_DIR}/certs/* chmod -R 400 ${TARGET_DIR}${CONFIG_DIR}/certs/*

View File

@@ -6,7 +6,7 @@ umask 0002
export USER=wazuh-indexer export USER=wazuh-indexer
export INSTALLATION_DIR=/usr/share/wazuh-indexer export INSTALLATION_DIR=/usr/share/wazuh-indexer
export OPENSEARCH_PATH_CONF=${INSTALLATION_DIR}/config export OPENSEARCH_PATH_CONF=${INSTALLATION_DIR}
export JAVA_HOME=${INSTALLATION_DIR}/jdk export JAVA_HOME=${INSTALLATION_DIR}/jdk
export DISCOVERY=$(grep -oP "(?<=discovery.type: ).*" ${OPENSEARCH_PATH_CONF}/opensearch.yml) export DISCOVERY=$(grep -oP "(?<=discovery.type: ).*" ${OPENSEARCH_PATH_CONF}/opensearch.yml)
export CACERT=$(grep -oP "(?<=plugins.security.ssl.transport.pemtrustedcas_filepath: ).*" ${OPENSEARCH_PATH_CONF}/opensearch.yml) export CACERT=$(grep -oP "(?<=plugins.security.ssl.transport.pemtrustedcas_filepath: ).*" ${OPENSEARCH_PATH_CONF}/opensearch.yml)
@@ -59,7 +59,7 @@ if [[ -f bin/opensearch-users ]]; then
# enabled, but we have no way of knowing which node we are yet. We'll just # enabled, but we have no way of knowing which node we are yet. We'll just
# honor the variable if it's present. # honor the variable if it's present.
if [[ -n "$INDEXER_PASSWORD" ]]; then if [[ -n "$INDEXER_PASSWORD" ]]; then
[[ -f /usr/share/wazuh-indexer/config/opensearch.keystore ]] || (run_as_other_user_if_needed opensearch-keystore create) [[ -f /usr/share/wazuh-indexer/opensearch.keystore ]] || (run_as_other_user_if_needed opensearch-keystore create)
if ! (run_as_other_user_if_needed opensearch-keystore has-passwd --silent) ; then if ! (run_as_other_user_if_needed opensearch-keystore has-passwd --silent) ; then
# keystore is unencrypted # keystore is unencrypted
if ! (run_as_other_user_if_needed opensearch-keystore list | grep -q '^bootstrap.password$'); then if ! (run_as_other_user_if_needed opensearch-keystore list | grep -q '^bootstrap.password$'); then
@@ -84,10 +84,10 @@ if [[ "$(id -u)" == "0" ]]; then
fi fi
if [[ "$DISCOVERY" == "single-node" ]] && [[ ! -f "/var/lib/wazuh-indexer/.flag" ]]; then #if [[ "$DISCOVERY" == "single-node" ]] && [[ ! -f "/var/lib/wazuh-indexer/.flag" ]]; then
# run securityadmin.sh for single node with CACERT, CERT and KEY parameter # run securityadmin.sh for single node with CACERT, CERT and KEY parameter
nohup /securityadmin.sh & # nohup /securityadmin.sh &
touch "/var/lib/wazuh-indexer/.flag" # touch "/var/lib/wazuh-indexer/.flag"
fi #fi
run_as_other_user_if_needed /usr/share/wazuh-indexer/bin/opensearch <<<"$KEYSTORE_PASSWORD" run_as_other_user_if_needed /usr/share/wazuh-indexer/bin/opensearch <<<"$KEYSTORE_PASSWORD"

View File

@@ -4,12 +4,12 @@ path.data: /var/lib/wazuh-indexer
path.logs: /var/log/wazuh-indexer path.logs: /var/log/wazuh-indexer
discovery.type: single-node discovery.type: single-node
compatibility.override_main_response_version: true compatibility.override_main_response_version: true
plugins.security.ssl.http.pemcert_filepath: ${OPENSEARCH_PATH_CONF}/certs/indexer.pem plugins.security.ssl.http.pemcert_filepath: /usr/share/wazuh-indexer/certs/indexer.pem
plugins.security.ssl.http.pemkey_filepath: ${OPENSEARCH_PATH_CONF}/certs/indexer-key.pem plugins.security.ssl.http.pemkey_filepath: /usr/share/wazuh-indexer/certs/indexer-key.pem
plugins.security.ssl.http.pemtrustedcas_filepath: ${OPENSEARCH_PATH_CONF}/certs/root-ca.pem plugins.security.ssl.http.pemtrustedcas_filepath: /usr/share/wazuh-indexer/certs/root-ca.pem
plugins.security.ssl.transport.pemcert_filepath: ${OPENSEARCH_PATH_CONF}/certs/indexer.pem plugins.security.ssl.transport.pemcert_filepath: /usr/share/wazuh-indexer/certs/indexer.pem
plugins.security.ssl.transport.pemkey_filepath: ${OPENSEARCH_PATH_CONF}/certs/indexer-key.pem plugins.security.ssl.transport.pemkey_filepath: /usr/share/wazuh-indexer/certs/indexer-key.pem
plugins.security.ssl.transport.pemtrustedcas_filepath: ${OPENSEARCH_PATH_CONF}/certs/root-ca.pem plugins.security.ssl.transport.pemtrustedcas_filepath: /usr/share/wazuh-indexer/certs/root-ca.pem
plugins.security.ssl.http.enabled: true plugins.security.ssl.http.enabled: true
plugins.security.ssl.transport.enforce_hostname_verification: false plugins.security.ssl.transport.enforce_hostname_verification: false
plugins.security.ssl.transport.resolve_hostname: false plugins.security.ssl.transport.resolve_hostname: false

View File

@@ -1,3 +1,3 @@
# Wazuh Docker Copyright (C) 2017, Wazuh Inc. (License GPLv2) # Wazuh Docker Copyright (C) 2017, Wazuh Inc. (License GPLv2)
sleep 30 sleep 30
bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/securityadmin.sh -cd /usr/share/wazuh-indexer/plugins/opensearch-security/securityconfig/ -nhnv -cacert $CACERT -cert $CERT -key $KEY -p 9300 -icl bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/securityadmin.sh -cd /usr/share/wazuh-indexer/opensearch-security/ -nhnv -cacert $CACERT -cert $CERT -key $KEY -p 9200 -icl

View File

@@ -5,7 +5,7 @@ RUN rm /bin/sh && ln -s /bin/bash /bin/sh
ARG WAZUH_VERSION ARG WAZUH_VERSION
ARG WAZUH_TAG_REVISION ARG WAZUH_TAG_REVISION
ARG TEMPLATE_VERSION=4.3 ARG TEMPLATE_VERSION=4.4
ARG FILEBEAT_CHANNEL=filebeat-oss ARG FILEBEAT_CHANNEL=filebeat-oss
ARG FILEBEAT_VERSION=7.10.2 ARG FILEBEAT_VERSION=7.10.2
ARG WAZUH_FILEBEAT_MODULE="wazuh-filebeat-0.2.tar.gz" ARG WAZUH_FILEBEAT_MODULE="wazuh-filebeat-0.2.tar.gz"

View File

@@ -1,13 +1,29 @@
## Variables ## variables
WAZUH_IMAGE_VERSION=$(echo $WAZUH_VERSION | sed -e 's/\.//g') APT_KEY=https://packages.wazuh.com/key/GPG-KEY-WAZUH
WAZUH_CURRENT_VERSION=$(curl --silent https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 2- | sed -e 's/\.//g') REPOSITORY="deb https://packages.wazuh.com/4.x/apt/ stable main"
## If wazuh manager exists in apt dev repository, change variables, if not exit 1 WAZUH_CURRENT_VERSION=$(curl --silent https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '\"tag_name\":' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 2-)
if [ "$WAZUH_IMAGE_VERSION" -le "$WAZUH_CURRENT_VERSION" ]; then MAJOR_BUILD=$(echo $WAZUH_VERSION | cut -d. -f1)
APT_KEY=https://packages.wazuh.com/key/GPG-KEY-WAZUH MID_BUILD=$(echo $WAZUH_VERSION | cut -d. -f2)
REPOSITORY="deb https://packages.wazuh.com/4.x/apt/ stable main" MINOR_BUILD=$(echo $WAZUH_VERSION | cut -d. -f3)
else MAJOR_CURRENT=$(echo $WAZUH_CURRENT_VERSION | cut -d. -f1)
MID_CURRENT=$(echo $WAZUH_CURRENT_VERSION | cut -d. -f2)
MINOR_CURRENT=$(echo $WAZUH_CURRENT_VERSION | cut -d. -f3)
## check version to use the correct repository
if [ "$MAJOR_BUILD" -gt "$MAJOR_CURRENT" ]; then
APT_KEY=https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH APT_KEY=https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH
REPOSITORY="deb https://packages-dev.wazuh.com/pre-release/apt/ unstable main" REPOSITORY="deb https://packages-dev.wazuh.com/pre-release/apt/ unstable main"
elif [ "$MAJOR_BUILD" -eq "$MAJOR_CURRENT" ]; then
if [ "$MID_BUILD" -gt "$MID_CURRENT" ]; then
APT_KEY=https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH
REPOSITORY="deb https://packages-dev.wazuh.com/pre-release/apt/ unstable main"
elif [ "$MID_BUILD" -eq "$MID_CURRENT" ]; then
if [ "$MINOR_BUILD" -gt "$MINOR_CURRENT" ]; then
APT_KEY=https://packages-dev.wazuh.com/key/GPG-KEY-WAZUH
REPOSITORY="deb https://packages-dev.wazuh.com/pre-release/apt/ unstable main"
fi
fi
fi fi
apt-key adv --fetch-keys ${APT_KEY} apt-key adv --fetch-keys ${APT_KEY}
echo ${REPOSITORY} | tee -a /etc/apt/sources.list.d/wazuh.list echo ${REPOSITORY} | tee -a /etc/apt/sources.list.d/wazuh.list

View File

@@ -179,6 +179,15 @@ set_rids_owner() {
chown -R wazuh:wazuh /var/ossec/queue/rids chown -R wazuh:wazuh /var/ossec/queue/rids
} }
##############################################################################
# Change any ossec user/group to wazuh user/group
##############################################################################
set_correct_permOwner() {
find / -group 997 -exec chown :101 {} +;
find / -user 999 -exec chown 101 {} +;
}
############################################################################## ##############################################################################
# Main function # Main function
############################################################################## ##############################################################################
@@ -189,6 +198,9 @@ main() {
# Restore files stored in permanent data that are not permanent (i.e. internal_options.conf) # Restore files stored in permanent data that are not permanent (i.e. internal_options.conf)
apply_exclusion_data apply_exclusion_data
# Apply correct permission and ownership
set_correct_permOwner
# Rename files stored in permanent data (i.e. queue/ossec) # Rename files stored in permanent data (i.e. queue/ossec)
move_data_files move_data_files

View File

@@ -12,32 +12,38 @@ fi
if [ "$INDEXER_USERNAME" != "" ]; then if [ "$INDEXER_USERNAME" != "" ]; then
>&2 echo "Configuring username." >&2 echo "Configuring username."
sed -i "s|#username:.*|username: '$INDEXER_USERNAME'|g" /etc/filebeat/filebeat.yml sed -i "s|#username:.*|username:|g" /etc/filebeat/filebeat.yml
sed -i "s|username:.*|username: '$INDEXER_USERNAME'|g" /etc/filebeat/filebeat.yml
fi fi
if [ "$INDEXER_PASSWORD" != "" ]; then if [ "$INDEXER_PASSWORD" != "" ]; then
>&2 echo "Configuring password." >&2 echo "Configuring password."
sed -i "s|#password:.*|password: '$INDEXER_PASSWORD'|g" /etc/filebeat/filebeat.yml sed -i "s|#password:.*|password:|g" /etc/filebeat/filebeat.yml
sed -i "s|password:.*|password: '$INDEXER_PASSWORD'|g" /etc/filebeat/filebeat.yml
fi fi
if [ "$FILEBEAT_SSL_VERIFICATION_MODE" != "" ]; then if [ "$FILEBEAT_SSL_VERIFICATION_MODE" != "" ]; then
>&2 echo "Configuring SSL verification mode." >&2 echo "Configuring SSL verification mode."
sed -i "s|#ssl.verification_mode:.*|ssl.verification_mode: $FILEBEAT_SSL_VERIFICATION_MODE|g" /etc/filebeat/filebeat.yml sed -i "s|#ssl.verification_mode:.*|ssl.verification_mode:|g" /etc/filebeat/filebeat.yml
sed -i "s|ssl.verification_mode:.*|ssl.verification_mode: '$FILEBEAT_SSL_VERIFICATION_MODE'|g" /etc/filebeat/filebeat.yml
fi fi
if [ "$SSL_CERTIFICATE_AUTHORITIES" != "" ]; then if [ "$SSL_CERTIFICATE_AUTHORITIES" != "" ]; then
>&2 echo "Configuring Certificate Authorities." >&2 echo "Configuring Certificate Authorities."
sed -i "s|#ssl.certificate_authorities:.*|ssl.certificate_authorities: ['$SSL_CERTIFICATE_AUTHORITIES']|g" /etc/filebeat/filebeat.yml sed -i "s|#ssl.certificate_authorities:.*|ssl.certificate_authorities:|g" /etc/filebeat/filebeat.yml
sed -i "s|ssl.certificate_authorities:.*|ssl.certificate_authorities: ['$SSL_CERTIFICATE_AUTHORITIES']|g" /etc/filebeat/filebeat.yml
fi fi
if [ "$SSL_CERTIFICATE" != "" ]; then if [ "$SSL_CERTIFICATE" != "" ]; then
>&2 echo "Configuring SSL Certificate." >&2 echo "Configuring SSL Certificate."
sed -i "s|#ssl.certificate:.*|ssl.certificate: '$SSL_CERTIFICATE'|g" /etc/filebeat/filebeat.yml sed -i "s|#ssl.certificate:.*|ssl.certificate:|g" /etc/filebeat/filebeat.yml
sed -i "s|ssl.certificate:.*|ssl.certificate: '$SSL_CERTIFICATE'|g" /etc/filebeat/filebeat.yml
fi fi
if [ "$SSL_KEY" != "" ]; then if [ "$SSL_KEY" != "" ]; then
>&2 echo "Configuring SSL Key." >&2 echo "Configuring SSL Key."
sed -i "s|#ssl.key:.*|ssl.key: '$SSL_KEY'|g" /etc/filebeat/filebeat.yml sed -i "s|#ssl.key:.*|ssl.key:|g" /etc/filebeat/filebeat.yml
sed -i "s|ssl.key:.*|ssl.key: '$SSL_KEY'|g" /etc/filebeat/filebeat.yml
fi fi

View File

@@ -8,8 +8,8 @@
## Variables ## Variables
CERT_TOOL=wazuh-certs-tool.sh CERT_TOOL=wazuh-certs-tool.sh
PASSWORD_TOOL=wazuh-passwords-tool.sh PASSWORD_TOOL=wazuh-passwords-tool.sh
PACKAGES_URL=https://packages.wazuh.com/4.3/ PACKAGES_URL=https://packages.wazuh.com/4.4/
PACKAGES_DEV_URL=https://packages-dev.wazuh.com/4.3/ PACKAGES_DEV_URL=https://packages-dev.wazuh.com/4.4/
## Check if the cert tool exists in S3 buckets ## Check if the cert tool exists in S3 buckets
CERT_TOOL_PACKAGES=$(curl --silent -I $PACKAGES_URL$CERT_TOOL | grep -E "^HTTP" | awk '{print $2}') CERT_TOOL_PACKAGES=$(curl --silent -I $PACKAGES_URL$CERT_TOOL | grep -E "^HTTP" | awk '{print $2}')
@@ -54,8 +54,8 @@ cp /certificates/root-ca.key /certificates/root-ca-manager.key
chown 101:101 /certificates/root-ca-manager.pem chown 101:101 /certificates/root-ca-manager.pem
chown 101:101 /certificates/root-ca-manager.key chown 101:101 /certificates/root-ca-manager.key
for i in ${node_names[@]}; for i in ${node_names[@]};
do do
chown 101:101 "/certificates/${i}.pem" chown 101:101 "/certificates/${i}.pem"
chown 101:101 "/certificates/${i}-key.pem" chown 101:101 "/certificates/${i}-key.pem"
done done

View File

@@ -1,6 +1,6 @@
# Opendistro data migration to Wazuh indexer on docker. # Opendistro data migration to Wazuh indexer on docker.
This procedure explains how to migrate Opendistro data from Opendistro to Wazuh indexer in docker production deployments. This procedure explains how to migrate Opendistro data from Opendistro to Wazuh indexer in docker production deployments.
The example is migrating from v4.2 to v4.3. The example is migrating from v4.2 to v4.4.
## Procedure ## Procedure
Assuming that you have a v4.2 production deployment, perform the following steps. Assuming that you have a v4.2 production deployment, perform the following steps.
@@ -350,9 +350,9 @@ docker container run --rm -it \
alpine ash -c "cd /from ; cp -avp . /to" alpine ash -c "cd /from ; cp -avp . /to"
``` ```
**7. Start the 4.3 environment.** **7. Start the 4.4 environment.**
``` ```
git checkout 4.3 git checkout 4.4
cd multi-node cd multi-node
docker-compose -f generate-indexer-certs.yml run --rm generator docker-compose -f generate-indexer-certs.yml run --rm generator
docker-compose up -d docker-compose up -d

View File

@@ -21,4 +21,4 @@ nodes:
# Wazuh dashboard node # Wazuh dashboard node
dashboard: dashboard:
- name: wazuh.dashboard - name: wazuh.dashboard
ip: wazuh.dashboard ip: wazuh.dashboard

View File

@@ -3,5 +3,5 @@ hosts:
url: "https://wazuh.master" url: "https://wazuh.master"
port: 55000 port: 55000
username: wazuh-wui username: wazuh-wui
password: MyS3cr37P450r.*- password: "MyS3cr37P450r.*-"
run_as: false run_as: false

View File

@@ -3,7 +3,7 @@ version: '3.7'
services: services:
wazuh.master: wazuh.master:
image: wazuh/wazuh-manager:4.3.6 image: wazuh/wazuh-manager:4.4.5
hostname: wazuh.master hostname: wazuh.master
restart: always restart: always
ports: ports:
@@ -38,7 +38,7 @@ services:
- ./config/wazuh_cluster/wazuh_manager.conf:/wazuh-config-mount/etc/ossec.conf - ./config/wazuh_cluster/wazuh_manager.conf:/wazuh-config-mount/etc/ossec.conf
wazuh.worker: wazuh.worker:
image: wazuh/wazuh-manager:4.3.6 image: wazuh/wazuh-manager:4.4.5
hostname: wazuh.worker hostname: wazuh.worker
restart: always restart: always
environment: environment:
@@ -67,7 +67,7 @@ services:
- ./config/wazuh_cluster/wazuh_worker.conf:/wazuh-config-mount/etc/ossec.conf - ./config/wazuh_cluster/wazuh_worker.conf:/wazuh-config-mount/etc/ossec.conf
wazuh1.indexer: wazuh1.indexer:
image: wazuh/wazuh-indexer:4.3.6 image: wazuh/wazuh-indexer:4.4.5
hostname: wazuh1.indexer hostname: wazuh1.indexer
restart: always restart: always
ports: ports:
@@ -84,16 +84,16 @@ services:
hard: 65536 hard: 65536
volumes: volumes:
- wazuh-indexer-data-1:/var/lib/wazuh-indexer - wazuh-indexer-data-1:/var/lib/wazuh-indexer
- ./config/wazuh_indexer_ssl_certs/root-ca.pem:/usr/share/wazuh-indexer/config/certs/root-ca.pem - ./config/wazuh_indexer_ssl_certs/root-ca.pem:/usr/share/wazuh-indexer/certs/root-ca.pem
- ./config/wazuh_indexer_ssl_certs/wazuh1.indexer-key.pem:/usr/share/wazuh-indexer/config/certs/wazuh1.indexer.key - ./config/wazuh_indexer_ssl_certs/wazuh1.indexer-key.pem:/usr/share/wazuh-indexer/certs/wazuh1.indexer.key
- ./config/wazuh_indexer_ssl_certs/wazuh1.indexer.pem:/usr/share/wazuh-indexer/config/certs/wazuh1.indexer.pem - ./config/wazuh_indexer_ssl_certs/wazuh1.indexer.pem:/usr/share/wazuh-indexer/certs/wazuh1.indexer.pem
- ./config/wazuh_indexer_ssl_certs/admin.pem:/usr/share/wazuh-indexer/config/certs/admin.pem - ./config/wazuh_indexer_ssl_certs/admin.pem:/usr/share/wazuh-indexer/certs/admin.pem
- ./config/wazuh_indexer_ssl_certs/admin-key.pem:/usr/share/wazuh-indexer/config/certs/admin-key.pem - ./config/wazuh_indexer_ssl_certs/admin-key.pem:/usr/share/wazuh-indexer/certs/admin-key.pem
- ./config/wazuh_indexer/wazuh1.indexer.yml:/usr/share/wazuh-indexer/config/opensearch.yml - ./config/wazuh_indexer/wazuh1.indexer.yml:/usr/share/wazuh-indexer/opensearch.yml
- ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/plugins/opensearch-security/securityconfig/internal_users.yml - ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/opensearch-security/internal_users.yml
wazuh2.indexer: wazuh2.indexer:
image: wazuh/wazuh-indexer:4.3.6 image: wazuh/wazuh-indexer:4.4.5
hostname: wazuh2.indexer hostname: wazuh2.indexer
restart: always restart: always
environment: environment:
@@ -108,14 +108,14 @@ services:
hard: 65536 hard: 65536
volumes: volumes:
- wazuh-indexer-data-2:/var/lib/wazuh-indexer - wazuh-indexer-data-2:/var/lib/wazuh-indexer
- ./config/wazuh_indexer_ssl_certs/root-ca.pem:/usr/share/wazuh-indexer/config/certs/root-ca.pem - ./config/wazuh_indexer_ssl_certs/root-ca.pem:/usr/share/wazuh-indexer/certs/root-ca.pem
- ./config/wazuh_indexer_ssl_certs/wazuh2.indexer-key.pem:/usr/share/wazuh-indexer/config/certs/wazuh2.indexer.key - ./config/wazuh_indexer_ssl_certs/wazuh2.indexer-key.pem:/usr/share/wazuh-indexer/certs/wazuh2.indexer.key
- ./config/wazuh_indexer_ssl_certs/wazuh2.indexer.pem:/usr/share/wazuh-indexer/config/certs/wazuh2.indexer.pem - ./config/wazuh_indexer_ssl_certs/wazuh2.indexer.pem:/usr/share/wazuh-indexer/certs/wazuh2.indexer.pem
- ./config/wazuh_indexer/wazuh2.indexer.yml:/usr/share/wazuh-indexer/config/opensearch.yml - ./config/wazuh_indexer/wazuh2.indexer.yml:/usr/share/wazuh-indexer/opensearch.yml
- ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/plugins/opensearch-security/securityconfig/internal_users.yml - ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/opensearch-security/internal_users.yml
wazuh3.indexer: wazuh3.indexer:
image: wazuh/wazuh-indexer:4.3.6 image: wazuh/wazuh-indexer:4.4.5
hostname: wazuh3.indexer hostname: wazuh3.indexer
restart: always restart: always
environment: environment:
@@ -130,14 +130,14 @@ services:
hard: 65536 hard: 65536
volumes: volumes:
- wazuh-indexer-data-3:/var/lib/wazuh-indexer - wazuh-indexer-data-3:/var/lib/wazuh-indexer
- ./config/wazuh_indexer_ssl_certs/root-ca.pem:/usr/share/wazuh-indexer/config/certs/root-ca.pem - ./config/wazuh_indexer_ssl_certs/root-ca.pem:/usr/share/wazuh-indexer/certs/root-ca.pem
- ./config/wazuh_indexer_ssl_certs/wazuh3.indexer-key.pem:/usr/share/wazuh-indexer/config/certs/wazuh3.indexer.key - ./config/wazuh_indexer_ssl_certs/wazuh3.indexer-key.pem:/usr/share/wazuh-indexer/certs/wazuh3.indexer.key
- ./config/wazuh_indexer_ssl_certs/wazuh3.indexer.pem:/usr/share/wazuh-indexer/config/certs/wazuh3.indexer.pem - ./config/wazuh_indexer_ssl_certs/wazuh3.indexer.pem:/usr/share/wazuh-indexer/certs/wazuh3.indexer.pem
- ./config/wazuh_indexer/wazuh3.indexer.yml:/usr/share/wazuh-indexer/config/opensearch.yml - ./config/wazuh_indexer/wazuh3.indexer.yml:/usr/share/wazuh-indexer/opensearch.yml
- ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/plugins/opensearch-security/securityconfig/internal_users.yml - ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/opensearch-security/internal_users.yml
wazuh.dashboard: wazuh.dashboard:
image: wazuh/wazuh-dashboard:4.3.6 image: wazuh/wazuh-dashboard:4.4.5
hostname: wazuh.dashboard hostname: wazuh.dashboard
restart: always restart: always
ports: ports:
@@ -147,6 +147,8 @@ services:
- WAZUH_API_URL="https://wazuh.master" - WAZUH_API_URL="https://wazuh.master"
- API_USERNAME=wazuh-wui - API_USERNAME=wazuh-wui
- API_PASSWORD=MyS3cr37P450r.*- - API_PASSWORD=MyS3cr37P450r.*-
- DASHBOARD_USERNAME=kibanaserver
- DASHBOARD_PASSWORD=kibanaserver
volumes: volumes:
- ./config/wazuh_indexer_ssl_certs/wazuh.dashboard.pem:/usr/share/wazuh-dashboard/certs/wazuh-dashboard.pem - ./config/wazuh_indexer_ssl_certs/wazuh.dashboard.pem:/usr/share/wazuh-dashboard/certs/wazuh-dashboard.pem
- ./config/wazuh_indexer_ssl_certs/wazuh.dashboard-key.pem:/usr/share/wazuh-dashboard/certs/wazuh-dashboard-key.pem - ./config/wazuh_indexer_ssl_certs/wazuh.dashboard-key.pem:/usr/share/wazuh-dashboard/certs/wazuh-dashboard-key.pem

View File

@@ -13,4 +13,4 @@ nodes:
# Wazuh dashboard node # Wazuh dashboard node
dashboard: dashboard:
- name: wazuh.dashboard - name: wazuh.dashboard
ip: wazuh.dashboard ip: wazuh.dashboard

View File

@@ -331,11 +331,11 @@
<name>wazuh</name> <name>wazuh</name>
<node_name>node01</node_name> <node_name>node01</node_name>
<node_type>master</node_type> <node_type>master</node_type>
<key></key> <key>aa093264ef885029653eea20dfcf51ae</key>
<port>1516</port> <port>1516</port>
<bind_addr>0.0.0.0</bind_addr> <bind_addr>0.0.0.0</bind_addr>
<nodes> <nodes>
<node>NODE_IP</node> <node>wazuh.manager</node>
</nodes> </nodes>
<hidden>no</hidden> <hidden>no</hidden>
<disabled>yes</disabled> <disabled>yes</disabled>

View File

@@ -3,5 +3,5 @@ hosts:
url: "https://wazuh.manager" url: "https://wazuh.manager"
port: 55000 port: 55000
username: wazuh-wui username: wazuh-wui
password: MyS3cr37P450r.*- password: "MyS3cr37P450r.*-"
run_as: false run_as: false

View File

@@ -3,13 +3,15 @@ node.name: "wazuh.indexer"
path.data: /var/lib/wazuh-indexer path.data: /var/lib/wazuh-indexer
path.logs: /var/log/wazuh-indexer path.logs: /var/log/wazuh-indexer
discovery.type: single-node discovery.type: single-node
http.port: 9200-9299
transport.tcp.port: 9300-9399
compatibility.override_main_response_version: true compatibility.override_main_response_version: true
plugins.security.ssl.http.pemcert_filepath: ${OPENSEARCH_PATH_CONF}/certs/wazuh.indexer.pem plugins.security.ssl.http.pemcert_filepath: /usr/share/wazuh-indexer/certs/wazuh.indexer.pem
plugins.security.ssl.http.pemkey_filepath: ${OPENSEARCH_PATH_CONF}/certs/wazuh.indexer.key plugins.security.ssl.http.pemkey_filepath: /usr/share/wazuh-indexer/certs/wazuh.indexer.key
plugins.security.ssl.http.pemtrustedcas_filepath: ${OPENSEARCH_PATH_CONF}/certs/root-ca.pem plugins.security.ssl.http.pemtrustedcas_filepath: /usr/share/wazuh-indexer/certs/root-ca.pem
plugins.security.ssl.transport.pemcert_filepath: ${OPENSEARCH_PATH_CONF}/certs/wazuh.indexer.pem plugins.security.ssl.transport.pemcert_filepath: /usr/share/wazuh-indexer/certs/wazuh.indexer.pem
plugins.security.ssl.transport.pemkey_filepath: ${OPENSEARCH_PATH_CONF}/certs/wazuh.indexer.key plugins.security.ssl.transport.pemkey_filepath: /usr/share/wazuh-indexer/certs/wazuh.indexer.key
plugins.security.ssl.transport.pemtrustedcas_filepath: ${OPENSEARCH_PATH_CONF}/certs/root-ca.pem plugins.security.ssl.transport.pemtrustedcas_filepath: /usr/share/wazuh-indexer/certs/root-ca.pem
plugins.security.ssl.http.enabled: true plugins.security.ssl.http.enabled: true
plugins.security.ssl.transport.enforce_hostname_verification: false plugins.security.ssl.transport.enforce_hostname_verification: false
plugins.security.ssl.transport.resolve_hostname: false plugins.security.ssl.transport.resolve_hostname: false

View File

@@ -3,7 +3,7 @@ version: '3.7'
services: services:
wazuh.manager: wazuh.manager:
image: wazuh/wazuh-manager:4.3.6 image: wazuh/wazuh-manager:4.4.5
hostname: wazuh.manager hostname: wazuh.manager
restart: always restart: always
ports: ports:
@@ -39,7 +39,7 @@ services:
- ./config/wazuh_cluster/wazuh_manager.conf:/wazuh-config-mount/etc/ossec.conf - ./config/wazuh_cluster/wazuh_manager.conf:/wazuh-config-mount/etc/ossec.conf
wazuh.indexer: wazuh.indexer:
image: wazuh/wazuh-indexer:4.3.6 image: wazuh/wazuh-indexer:4.4.5
hostname: wazuh.indexer hostname: wazuh.indexer
restart: always restart: always
ports: ports:
@@ -55,16 +55,16 @@ services:
hard: 65536 hard: 65536
volumes: volumes:
- wazuh-indexer-data:/var/lib/wazuh-indexer - wazuh-indexer-data:/var/lib/wazuh-indexer
- ./config/wazuh_indexer_ssl_certs/root-ca.pem:/usr/share/wazuh-indexer/config/certs/root-ca.pem - ./config/wazuh_indexer_ssl_certs/root-ca.pem:/usr/share/wazuh-indexer/certs/root-ca.pem
- ./config/wazuh_indexer_ssl_certs/wazuh.indexer-key.pem:/usr/share/wazuh-indexer/config/certs/wazuh.indexer.key - ./config/wazuh_indexer_ssl_certs/wazuh.indexer-key.pem:/usr/share/wazuh-indexer/certs/wazuh.indexer.key
- ./config/wazuh_indexer_ssl_certs/wazuh.indexer.pem:/usr/share/wazuh-indexer/config/certs/wazuh.indexer.pem - ./config/wazuh_indexer_ssl_certs/wazuh.indexer.pem:/usr/share/wazuh-indexer/certs/wazuh.indexer.pem
- ./config/wazuh_indexer_ssl_certs/admin.pem:/usr/share/wazuh-indexer/config/certs/admin.pem - ./config/wazuh_indexer_ssl_certs/admin.pem:/usr/share/wazuh-indexer/certs/admin.pem
- ./config/wazuh_indexer_ssl_certs/admin-key.pem:/usr/share/wazuh-indexer/config/certs/admin-key.pem - ./config/wazuh_indexer_ssl_certs/admin-key.pem:/usr/share/wazuh-indexer/certs/admin-key.pem
- ./config/wazuh_indexer/wazuh.indexer.yml:/usr/share/wazuh-indexer/config/opensearch.yml - ./config/wazuh_indexer/wazuh.indexer.yml:/usr/share/wazuh-indexer/opensearch.yml
- ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/plugins/opensearch-security/securityconfig/internal_users.yml - ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/opensearch-security/internal_users.yml
wazuh.dashboard: wazuh.dashboard:
image: wazuh/wazuh-dashboard:4.3.6 image: wazuh/wazuh-dashboard:4.4.5
hostname: wazuh.dashboard hostname: wazuh.dashboard
restart: always restart: always
ports: ports:
@@ -73,6 +73,8 @@ services:
- INDEXER_USERNAME=admin - INDEXER_USERNAME=admin
- INDEXER_PASSWORD=SecretPassword - INDEXER_PASSWORD=SecretPassword
- WAZUH_API_URL=https://wazuh.manager - WAZUH_API_URL=https://wazuh.manager
- DASHBOARD_USERNAME=kibanaserver
- DASHBOARD_PASSWORD=kibanaserver
- API_USERNAME=wazuh-wui - API_USERNAME=wazuh-wui
- API_PASSWORD=MyS3cr37P450r.*- - API_PASSWORD=MyS3cr37P450r.*-
volumes: volumes:

View File

@@ -7,4 +7,4 @@ services:
hostname: wazuh-certs-generator hostname: wazuh-certs-generator
volumes: volumes:
- ./config/wazuh_indexer_ssl_certs/:/certificates/ - ./config/wazuh_indexer_ssl_certs/:/certificates/
- ./config/certs.yml:/config/certs.yml - ./config/certs.yml:/config/certs.yml