Merge pull request #1385 from wazuh/enhancement/1256-wazuh-cert-tool

Add Wazuh cert tool image build into Wazuh images build process
This commit is contained in:
Gonzalo Acuña
2024-06-12 07:09:12 -03:00
committed by GitHub
11 changed files with 42 additions and 25 deletions
+25 -4
View File
@@ -22,6 +22,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-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-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-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 - name: Temporarily save Wazuh manager Docker image
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@@ -44,6 +45,13 @@ jobs:
path: /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-dashboard.tar path: /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-dashboard.tar
retention-days: 1 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 - name: Install Goss
uses: e1himself/goss-installation-action@v1.0.3 uses: e1himself/goss-installation-action@v1.0.3
with: with:
@@ -81,15 +89,22 @@ jobs:
with: with:
name: docker-artifact-dashboard 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 - name: Docker load
run: | run: |
docker load --input ./wazuh-indexer.tar docker load --input ./wazuh-indexer.tar
docker load --input ./wazuh-dashboard.tar docker load --input ./wazuh-dashboard.tar
docker load --input ./wazuh-manager.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 - 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 - name: Start single node stack
run: docker-compose -f single-node/docker-compose.yml up -d run: docker-compose -f single-node/docker-compose.yml up -d
@@ -212,15 +227,21 @@ jobs:
with: with:
name: docker-artifact-indexer 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 - name: Docker load
run: | run: |
docker load --input ./wazuh-manager.tar
docker load --input ./wazuh-indexer.tar docker load --input ./wazuh-indexer.tar
docker load --input ./wazuh-dashboard.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 - 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 - name: Start multi node stack
run: docker-compose -f multi-node/docker-compose.yml up -d run: docker-compose -f multi-node/docker-compose.yml up -d
+2 -2
View File
@@ -154,7 +154,7 @@ WAZUH_MONITORING_REPLICAS=0 ##
│   │   └── wazuh_indexer_ssl_certs │   │   └── wazuh_indexer_ssl_certs
│   │   └── certs.yml │   │   └── certs.yml
│   ├── docker-compose.yml │   ├── docker-compose.yml
│   ├── generate-indexer-certs.yml │   ├── generate-certs.yml
│   ├── Migration-to-Wazuh-4.3.md │   ├── Migration-to-Wazuh-4.3.md
│   └── volume-migrator.sh │   └── volume-migrator.sh
├── README.md ├── README.md
@@ -181,7 +181,7 @@ WAZUH_MONITORING_REPLICAS=0 ##
│   │   ├── wazuh.manager-key.pem │   │   ├── wazuh.manager-key.pem
│   │   └── wazuh.manager.pem │   │   └── wazuh.manager.pem
│   ├── docker-compose.yml │   ├── docker-compose.yml
│   ├── generate-indexer-certs.yml │   ├── generate-certs.yml
│   └── README.md │   └── README.md
└── VERSION └── VERSION
+1
View File
@@ -71,6 +71,7 @@ build() {
echo WAZUH_UI_REVISION=$WAZUH_UI_REVISION >> .env echo WAZUH_UI_REVISION=$WAZUH_UI_REVISION >> .env
docker-compose -f build-docker-images/build-images.yml --env-file .env build --no-cache 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 return 0
} }
@@ -1,7 +1,8 @@
# Wazuh Docker Copyright (C) 2017, Wazuh Inc. (License GPLv2) # 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 / WORKDIR /
-9
View File
@@ -1,9 +0,0 @@
# Certificate creation image build
The dockerfile hosted in this directory is used to build the image used to boot Wazuh's single node and multi node stacks.
To create the image, the following command must be executed:
```
$ docker build -t wazuh/wazuh-certs-generator:0.0.1 .
```
+1 -1
View File
@@ -354,7 +354,7 @@ docker container run --rm -it \
``` ```
git checkout 4.4 git checkout 4.4
cd multi-node cd multi-node
docker-compose -f generate-indexer-certs.yml run --rm generator docker-compose -f generate-certs.yml run --rm generator
docker-compose up -d docker-compose up -d
``` ```
+1 -1
View File
@@ -8,7 +8,7 @@ $ sysctl -w vm.max_map_count=262144
``` ```
2) Run the certificate creation script: 2) Run the certificate creation script:
``` ```
$ docker-compose -f generate-indexer-certs.yml run --rm generator $ docker-compose -f generate-certs.yml run --rm generator
``` ```
3) Start the environment with docker-compose: 3) Start the environment with docker-compose:
@@ -3,8 +3,9 @@ version: '3'
services: services:
generator: generator:
image: wazuh/wazuh-certs-generator:0.0.2 image: wazuh/wazuh-cert-tool:5.0.0
hostname: wazuh-certs-generator hostname: wazuh-cert-tool
container_name: wazuh-cert-tool
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
+1 -1
View File
@@ -8,7 +8,7 @@ $ sysctl -w vm.max_map_count=262144
``` ```
2) Run the certificate creation script: 2) Run the certificate creation script:
``` ```
$ docker-compose -f generate-indexer-certs.yml run --rm generator $ docker-compose -f generate-certs.yml run --rm generator
``` ```
3) Start the environment with docker-compose: 3) Start the environment with docker-compose:
@@ -3,8 +3,10 @@ version: '3'
services: services:
generator: generator:
image: wazuh/wazuh-certs-generator:0.0.2 image: wazuh/wazuh-cert-tool:5.0.0
hostname: wazuh-certs-generator hostname: wazuh-cert-tool
container_name: wazuh-cert-tool
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