mirror of
https://github.com/wazuh/wazuh-docker.git
synced 2025-11-02 21:13:14 +00:00
Merge pull request #1809 from wazuh/enhancement/1794-add-wazuh-agent-test-and-push
Add wazuh agent test and push
This commit is contained in:
@@ -14,7 +14,7 @@ on:
|
||||
required: true
|
||||
products:
|
||||
description: 'Comma-separated list of the image names to build and push'
|
||||
default: 'wazuh-manager,wazuh-dashboard,wazuh-indexer'
|
||||
default: 'wazuh-manager,wazuh-dashboard,wazuh-indexer,wazuh-agent'
|
||||
required: true
|
||||
filebeat_module_version:
|
||||
description: 'Filebeat module version'
|
||||
@@ -52,7 +52,7 @@ on:
|
||||
type: string
|
||||
products:
|
||||
description: 'Comma-separated list of the image names to build and push'
|
||||
default: 'wazuh-manager,wazuh-dashboard,wazuh-indexer'
|
||||
default: 'wazuh-manager,wazuh-dashboard,wazuh-indexer,wazuh-agent'
|
||||
required: true
|
||||
type: string
|
||||
filebeat_module_version:
|
||||
|
||||
61
.github/workflows/push.yml
vendored
61
.github/workflows/push.yml
vendored
@@ -8,7 +8,7 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install docker-compose
|
||||
run: |
|
||||
@@ -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-agent:${{env.WAZUH_IMAGE_VERSION}} -o /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-agent.tar
|
||||
|
||||
- name: Temporarily save Wazuh manager Docker image
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -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 agent Docker image
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: docker-artifact-agent
|
||||
path: /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-agent.tar
|
||||
retention-days: 1
|
||||
|
||||
- name: Install Goss
|
||||
uses: e1himself/goss-installation-action@v1.0.3
|
||||
with:
|
||||
@@ -66,7 +74,7 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install docker-compose
|
||||
run: |
|
||||
@@ -91,12 +99,17 @@ jobs:
|
||||
with:
|
||||
name: docker-artifact-dashboard
|
||||
|
||||
- name: Retrieve saved Wazuh agent Docker image
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: docker-artifact-agent
|
||||
|
||||
- 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-agent.tar
|
||||
|
||||
- name: Create single node certficates
|
||||
run: docker-compose -f single-node/generate-indexer-certs.yml run --rm generator
|
||||
@@ -185,7 +198,20 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Check errors in ossec.log
|
||||
- name: Modify Docker endpoint into Wazuh agent docker-compose.yml file
|
||||
run: sed -i "s/<WAZUH_MANAGER_IP>/$(ip addr show docker0 | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1)/g" wazuh-agent/docker-compose.yml
|
||||
|
||||
- name: Start Wazuh agent
|
||||
run: docker-compose -f wazuh-agent/docker-compose.yml up -d
|
||||
|
||||
- name: Check Wazuh agent enrollment
|
||||
run: |
|
||||
sleep 20
|
||||
curl -k -s -X GET "https://localhost:55000/agents?pretty=true" -H "Authorization: Bearer ${{env.TOKEN}}"
|
||||
env:
|
||||
TOKEN: $(curl -s -u wazuh-wui:MyS3cr37P450r.*- -k -X GET "https://0.0.0.0:55000/security/user/authenticate?raw=true")
|
||||
|
||||
- name: Check errors in ossec.log for Wazuh manager
|
||||
run: ./.github/single-node-log-check.sh
|
||||
|
||||
check-multi-node:
|
||||
@@ -194,7 +220,7 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install docker-compose
|
||||
run: |
|
||||
@@ -222,12 +248,18 @@ jobs:
|
||||
with:
|
||||
name: docker-artifact-indexer
|
||||
|
||||
- name: Retrieve saved Wazuh agent Docker image
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: docker-artifact-agent
|
||||
|
||||
- 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-agent.tar
|
||||
rm -rf wazuh-manager.tar wazuh-indexer.tar wazuh-dashboard.tar wazuh-agent.tar
|
||||
|
||||
- name: Create multi node certficates
|
||||
run: docker-compose -f multi-node/generate-indexer-certs.yml run --rm generator
|
||||
@@ -334,5 +366,18 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Check errors in ossec.log
|
||||
run: ./.github/multi-node-log-check.sh
|
||||
- name: Modify Docker endpoint into Wazuh agent docker-compose.yml file
|
||||
run: sed -i "s/<WAZUH_MANAGER_IP>/$(ip addr show docker0 | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1)/g" wazuh-agent/docker-compose.yml
|
||||
|
||||
- name: Start Wazuh agent
|
||||
run: docker-compose -f wazuh-agent/docker-compose.yml up -d
|
||||
|
||||
- name: Check Wazuh agent enrollment
|
||||
run: |
|
||||
sleep 20
|
||||
curl -k -s -X GET "https://localhost:55000/agents?pretty=true" -H "Authorization: Bearer ${{env.TOKEN}}"
|
||||
env:
|
||||
TOKEN: $(curl -s -u wazuh-wui:MyS3cr37P450r.*- -k -X GET "https://0.0.0.0:55000/security/user/authenticate?raw=true")
|
||||
|
||||
- name: Check errors in ossec.log for Wazuh manager
|
||||
run: ./.github/multi-node-log-check.sh
|
||||
|
||||
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
### Added
|
||||
|
||||
- Add wazuh agent test and push ([#1809](https://github.com/wazuh/wazuh-docker/pull/1809))
|
||||
- Add Wazuh agent image build and deploy ([#1801](https://github.com/wazuh/wazuh-docker/pull/1801))
|
||||
|
||||
### Changed
|
||||
|
||||
Reference in New Issue
Block a user