Skip to content

Commit

Permalink
Resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
vcerenu committed Oct 17, 2024
2 parents f809a1e + 2059833 commit 69df531
Show file tree
Hide file tree
Showing 35 changed files with 839 additions and 630 deletions.
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
WAZUH_VERSION=4.10.2
WAZUH_IMAGE_VERSION=4.10.2
WAZUH_VERSION=5.0.0
WAZUH_IMAGE_VERSION=5.0.0
WAZUH_TAG_REVISION=1
FILEBEAT_TEMPLATE_BRANCH=4.10.2
FILEBEAT_TEMPLATE_BRANCH=5.0.0
WAZUH_FILEBEAT_MODULE=wazuh-filebeat-0.4.tar.gz
WAZUH_UI_REVISION=1
2 changes: 1 addition & 1 deletion .github/.goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ package:
wazuh-manager:
installed: true
versions:
- 4.10.2-1
- 5.0.0-1
port:
tcp:1514:
listening: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/Procedure_push_docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on:
inputs:
image_tag:
description: 'Docker image tag'
default: '4.10.2'
default: '5.0.0'
required: true
docker_reference:
description: 'wazuh-docker reference'
default: 'v4.10.2'
default: 'v5.0.0'
required: true
PRODUCTS:
description: 'Comma-separated list of the image names to build and push'
Expand Down Expand Up @@ -42,12 +42,12 @@ on:
inputs:
image_tag:
description: 'Docker image tag'
default: '4.10.0'
default: '5.0.0'
required: true
type: string
docker_reference:
description: 'wazuh-docker reference'
default: 'v4.10.0'
default: 'v5.0.0'
required: false
type: string
products:
Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
docker save wazuh/wazuh-manager:${{env.WAZUH_IMAGE_VERSION}} -o /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-manager.tar
docker save wazuh/wazuh-indexer:${{env.WAZUH_IMAGE_VERSION}} -o /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-indexer.tar
docker save wazuh/wazuh-dashboard:${{env.WAZUH_IMAGE_VERSION}} -o /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-dashboard.tar
docker save wazuh/wazuh-cert-tool:${{env.WAZUH_IMAGE_VERSION}} -o /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-cert-tool.tar
- name: Temporarily save Wazuh manager Docker image
uses: actions/upload-artifact@v3
Expand All @@ -49,6 +50,13 @@ jobs:
path: /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-dashboard.tar
retention-days: 1

- name: Temporarily save Wazuh Cert Tool Docker image
uses: actions/upload-artifact@v3
with:
name: docker-artifact-cert-tool
path: /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-cert-tool.tar
retention-days: 1

- name: Install Goss
uses: e1himself/[email protected]
with:
Expand Down Expand Up @@ -91,15 +99,22 @@ jobs:
with:
name: docker-artifact-dashboard

- name: Retrieve saved Wazuh Cert Tool Docker image
uses: actions/download-artifact@v3
with:
name: docker-artifact-cert-tool

- name: Docker load
run: |
docker load --input ./wazuh-indexer.tar
docker load --input ./wazuh-dashboard.tar
docker load --input ./wazuh-manager.tar
docker load --input ./wazuh-cert-tool.tar
rm -rf wazuh-manager.tar wazuh-indexer.tar wazuh-dashboard.tar wazuh-cert-tool.tar
- name: Create single node certficates
run: docker-compose -f single-node/generate-indexer-certs.yml run --rm generator
run: docker-compose -f single-node/generate-certs.yml run --rm generator

- name: Start single node stack
run: docker-compose -f single-node/docker-compose.yml up -d
Expand Down Expand Up @@ -227,15 +242,21 @@ jobs:
with:
name: docker-artifact-indexer

- name: Retrieve saved Wazuh Cert Tool Docker image
uses: actions/download-artifact@v3
with:
name: docker-artifact-cert-tool

- name: Docker load
run: |
docker load --input ./wazuh-manager.tar
docker load --input ./wazuh-indexer.tar
docker load --input ./wazuh-dashboard.tar
rm -rf wazuh-manager.tar wazuh-indexer.tar wazuh-dashboard.tar
docker load --input ./wazuh-manager.tar
docker load --input ./wazuh-cert-tool.tar
rm -rf wazuh-manager.tar wazuh-indexer.tar wazuh-dashboard.tar wazuh-cert-tool.tar
- name: Create multi node certficates
run: docker-compose -f multi-node/generate-indexer-certs.yml run --rm generator
run: docker-compose -f multi-node/generate-certs.yml run --rm generator

- name: Start multi node stack
run: docker-compose -f multi-node/docker-compose.yml up -d
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# Change Log
All notable changes to this project will be documented in this file.

## [5.0.0]

### Added

- none

### Changed

- None

### Fixed

- None

### Deleted

- None

## [4.10.2]

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ WAZUH_MONITORING_REPLICAS=0 ##
└── VERSION



## Branches

* `master` branch contains the latest code, be aware of possible bugs on this branch.
Expand All @@ -178,6 +177,7 @@ WAZUH_MONITORING_REPLICAS=0 ##

| Wazuh version | ODFE | XPACK |
|---------------|---------|--------|
| v5.0.0 | | |
| v4.10.2 | | |
| v4.10.1 | | |
| v4.10.0 | | |
Expand Down
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
WAZUH-DOCKER_VERSION="4.10.2"
REVISION="41020"
WAZUH-DOCKER_VERSION="5.0.0"
REVISION="50000"
4 changes: 2 additions & 2 deletions build-docker-images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This script initializes the environment variables needed to build each of the im
The script allows you to build images from other versions of Wazuh, to do this you must use the -v or --version argument:

```
$ build-docker-images/build-images.sh -v 4.10.2
$ build-docker-images/build-images.sh -v 5.0.0
```

To get all the available script options use the -h or --help option:
Expand All @@ -26,7 +26,7 @@ Usage: build-docker-images/build-images.sh [OPTIONS]
-d, --dev <ref> [Optional] Set the development stage you want to build, example rc1 or beta1, not used by default.
-f, --filebeat-module <ref> [Optional] Set Filebeat module version. By default 0.4.
-r, --revision <rev> [Optional] Package revision. By default 1
-v, --version <ver> [Optional] Set the Wazuh version should be builded. By default, 4.10.2.
-v, --version <ver> [Optional] Set the Wazuh version should be builded. By default, 5.0.0.
-h, --help Show this help.
```
7 changes: 4 additions & 3 deletions build-docker-images/build-images.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
WAZUH_IMAGE_VERSION=4.10.2
WAZUH_IMAGE_VERSION=5.0.0
WAZUH_VERSION=$(echo $WAZUH_IMAGE_VERSION | sed -e 's/\.//g')
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')
Expand All @@ -12,7 +12,7 @@ IMAGE_VERSION=${WAZUH_IMAGE_VERSION}
# License (version 2) as published by the FSF - Free Software
# Foundation.

WAZUH_IMAGE_VERSION="4.10.2"
WAZUH_IMAGE_VERSION="5.0.0"
WAZUH_TAG_REVISION="1"
WAZUH_DEV_STAGE=""
FILEBEAT_MODULE_VERSION="0.4"
Expand Down Expand Up @@ -70,7 +70,8 @@ build() {
echo WAZUH_FILEBEAT_MODULE=$WAZUH_FILEBEAT_MODULE >> .env
echo WAZUH_UI_REVISION=$WAZUH_UI_REVISION >> .env

docker-compose -f build-docker-images/build-images.yml --env-file .env build --no-cache || clean 1
docker-compose -f build-docker-images/build-images.yml --env-file .env build --no-cache
docker build -t wazuh/wazuh-cert-tool:$WAZUH_IMAGE_VERSION build-docker-images/cert-tool-image/

return 0
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Wazuh Docker Copyright (C) 2017, Wazuh Inc. (License GPLv2)
FROM ubuntu:focal
FROM amazonlinux:2023

RUN apt-get update && apt-get install openssl curl -y
RUN yum install curl-minimal openssl -y &&\
yum clean all

WORKDIR /

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
## Variables
CERT_TOOL=wazuh-certs-tool.sh
PASSWORD_TOOL=wazuh-passwords-tool.sh
PACKAGES_URL=https://packages.wazuh.com/4.10/
PACKAGES_DEV_URL=https://packages-dev.wazuh.com/4.10/
PACKAGES_URL=https://packages.wazuh.com/5.0/
PACKAGES_DEV_URL=https://packages-dev.wazuh.com/5.0/

## 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}')
Expand Down
11 changes: 11 additions & 0 deletions build-docker-images/wazuh-dashboard/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ COPY --from=builder --chown=1000:1000 $INSTALL_DIR $INSTALL_DIR
RUN mkdir -p /usr/share/wazuh-dashboard/plugins/wazuh/public/assets/custom
RUN chown 1000:1000 /usr/share/wazuh-dashboard/plugins/wazuh/public/assets/custom

# Set $JAVA_HOME
RUN echo "export JAVA_HOME=$INSTALL_DIR/jdk" >> /etc/profile.d/java_home.sh && \
echo "export PATH=\$PATH:\$JAVA_HOME/bin" >> /etc/profile.d/java_home.sh
ENV JAVA_HOME=$INSTALL_DIR/jdk
ENV PATH=$PATH:$JAVA_HOME/bin:$INSTALL_DIR/bin

# Add k-NN lib directory to library loading path variable
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$INSTALL_DIR/plugins/opensearch-knn/lib"

# Set workdir and user
WORKDIR $INSTALL_DIR
USER wazuh-dashboard
Expand All @@ -93,3 +102,5 @@ USER wazuh-dashboard
EXPOSE 443

ENTRYPOINT [ "/entrypoint.sh" ]

CMD ["opensearch-dashboards"]
8 changes: 4 additions & 4 deletions build-docker-images/wazuh-dashboard/config/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export CONFIG_DIR=${INSTALLATION_DIR}/config

## Variables
CERT_TOOL=wazuh-certs-tool.sh
PACKAGES_URL=https://packages.wazuh.com/4.10/
PACKAGES_DEV_URL=https://packages-dev.wazuh.com/4.10/
PACKAGES_URL=https://packages.wazuh.com/5.0/
PACKAGES_DEV_URL=https://packages-dev.wazuh.com/5.0/

## 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}')
Expand All @@ -34,8 +34,8 @@ chmod 755 $CERT_TOOL && bash /$CERT_TOOL -A
mkdir -p ${CONFIG_DIR}/certs

# Copy Wazuh dashboard certs to install config dir
cp /wazuh-certificates/demo.dashboard.pem ${CONFIG_DIR}/certs/dashboard.pem
cp /wazuh-certificates/demo.dashboard-key.pem ${CONFIG_DIR}/certs/dashboard-key.pem
cp /wazuh-certificates/dashboard.pem ${CONFIG_DIR}/certs/dashboard.pem
cp /wazuh-certificates/dashboard-key.pem ${CONFIG_DIR}/certs/dashboard-key.pem
cp /wazuh-certificates/root-ca.pem ${CONFIG_DIR}/certs/root-ca.pem

chmod -R 500 ${CONFIG_DIR}/certs
Expand Down
4 changes: 2 additions & 2 deletions build-docker-images/wazuh-dashboard/config/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
nodes:
# Wazuh dashboard server nodes
dashboard:
- name: demo.dashboard
ip: demo.dashboard
- name: dashboard
ip: wazuh.dashboard
Loading

0 comments on commit 69df531

Please sign in to comment.