Files
fk-wazuh/.github/workflows/push.yml
T
Workflow config file is invalid. Please check your config file: model.ReadWorkflow: yaml: line 47: mapping values are not allowed in this context
2022-05-26 15:59:21 -03:00

93 lines
2.9 KiB
YAML

name: Wazuh Docker pipeline
on: [pull_request, push]
jobs:
build-stack:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Build the docker-compose stack
run: ./build.sh
- name: Create enviroment variables
run: cat .env > $GITHUB_ENV
- name: Install Goss
uses: e1himself/goss-installation-action@v1.0.3
with:
version: v0.3.16
- name: Execute Goss tests (wazuh-manager)
run: dgoss run wazuh/wazuh-manager:${{env.WAZUH_IMAGE_VERSION}}
env:
GOSS_SLEEP: 30
GOSS_FILE: .github/.goss.yaml
- name: Create single node certficates
run: docker-compose -f single-node/generate-indexer-certs.yml run --rm generator
- name: Start single node stack
run: docker-compose -f single-node/docker-compose.yml up -d
- name: Sleep for 60 seconds
uses: jakejarvis/wait-action@master
with:
time: '60s'
- name: Check Wazuh indexer start
run: |
curl -XGET "https://0.0.0.0:9200/_cluster/health?wait_for_status=green&timeout=120s" -u admin:SecretPassword -k
curl -XGET "https://0.0.0.0:9200/_cat/nodes?v" -u admin:SecretPassword -k
- name: Check Wazuh manager start
run: curl -k -X GET "https://0.0.0.0:55000" -H "Authorization: Bearer $TOKEN"
env:
TOKEN: $(curl -u wazuh-wui:MyS3cr37P450r.*- -k -X GET "https://0.0.0.0:55000/security/user/authenticate?raw=true")
- name: Stop single node stack
run: docker-compose -f single-node/docker-compose.yml down
- name: Check Wazuh dashboard service URL
uses: jtalk/url-health-check-action@v2
with:
url: https://127.0.0.1:443
follow-redirect: true
max-attempts: 3
retry-delay: 10s
retry-all: false
- name: Create multi node certficates
run: docker-compose -f multi-node/generate-indexer-certs.yml run --rm generator
- name: Start multi node stack
run: docker-compose -f multi-node/docker-compose.yml up -d
- name: Sleep for 60 seconds
uses: jakejarvis/wait-action@master
with:
time: '60s'
- name: Check Wazuh indexer start
run: |
curl -XGET "https://0.0.0.0:9200/_cluster/health?wait_for_status=green&timeout=120s" -u admin:SecretPassword -k
curl -XGET "https://0.0.0.0:9200/_cat/nodes?v" -u admin:SecretPassword -k
- name: Check Wazuh manager start
run: curl -k -X GET "https://0.0.0.0:55000/cluster/status" -H "Authorization: Bearer $TOKEN"
env:
TOKEN: $(curl -u wazuh-wui:MyS3cr37P450r.*- -k -X GET "https://0.0.0.0:55000/security/user/authenticate?raw=true")
- name: Check Wazuh dashboard service URL
uses: jtalk/url-health-check-action@v2
with:
url: https://127.0.0.1:443
follow-redirect: true
max-attempts: 3
retry-delay: 10s
retry-all: false