diff --git a/.github/workflows/4_build_and_push_images.yml b/.github/workflows/4_build_and_push_images.yml index 4eaa38e7..bea1b2e9 100644 --- a/.github/workflows/4_build_and_push_images.yml +++ b/.github/workflows/4_build_and_push_images.yml @@ -155,9 +155,6 @@ jobs: with: ref: ${{ inputs.docker_reference }} - - name: free disk space - uses: ./.github/free-disk-space - - name: Set up QEMU uses: docker/setup-qemu-action@v4 @@ -176,7 +173,6 @@ jobs: uses: aws-actions/amazon-ecr-login@v2 - name: Log in to Docker Hub - if: ${{ inputs.dev == false }} uses: docker/login-action@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} diff --git a/.github/workflows/4_pr_check.yml b/.github/workflows/4_pr_check.yml index 941de780..ece3e842 100644 --- a/.github/workflows/4_pr_check.yml +++ b/.github/workflows/4_pr_check.yml @@ -20,6 +20,12 @@ jobs: - name: Check out code uses: actions/checkout@v6 + - name: Log in to Docker Hub + uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Build Wazuh images run: ./build-images.sh working-directory: ./build-docker-images @@ -63,17 +69,6 @@ jobs: 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: - 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 - check-single-node: runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }} needs: build-docker-images @@ -85,6 +80,12 @@ jobs: - name: Create enviroment variables run: cat .env > $GITHUB_ENV + - name: Log in to Docker Hub + uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Retrieve saved Wazuh indexer Docker image uses: actions/download-artifact@v8 with: @@ -148,17 +149,6 @@ jobs: exit 1 fi - - name: Check documents into wazuh-alerts index - run: | - sleep 120 - docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_count" -u admin:SecretPassword -k -s | jq -r ".count"`" - if [[ $docs -gt 0 ]]; then - echo "wazuh-alerts index documents: ${docs}" - else - echo "wazuh-alerts index documents: ${docs}" - exit 1 - fi - - name: Check Wazuh templates run: | qty_templates="`curl -XGET "https://0.0.0.0:9200/_cat/templates" -u admin:SecretPassword -k -s | grep -P "wazuh|wazuh-agent|wazuh-statistics" | wc -l`" @@ -212,6 +202,17 @@ jobs: env: TOKEN: $(curl -s -u wazuh-wui:MyS3cr37P450r.*- -k -X GET "https://0.0.0.0:55000/security/user/authenticate?raw=true") + - name: Check documents into wazuh-alerts index + run: | + sleep 120 + docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_count" -u admin:SecretPassword -k -s | jq -r ".count"`" + if [[ $docs -gt 0 ]]; then + echo "wazuh-alerts index documents: ${docs}" + else + echo "wazuh-alerts index documents: ${docs}" + exit 1 + fi + - name: Check errors in ossec.log for Wazuh manager run: ./.github/single-node-log-check.sh @@ -226,8 +227,11 @@ jobs: - name: Create enviroment variables run: cat .env > $GITHUB_ENV - - name: free disk space - uses: ./.github/free-disk-space + - name: Log in to Docker Hub + uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Retrieve saved Wazuh dashboard Docker image uses: actions/download-artifact@v8 @@ -298,23 +302,6 @@ jobs: exit 1 fi - - name: Check documents into wazuh-alerts index - run: | - until [[ $(``curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_count" -u admin:SecretPassword -k -s | jq -r ".count"``) -gt 0 ]] - do - echo 'Waiting for Wazuh indexer events' - free -m - df -h - sleep 10 - done - docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_count" -u admin:SecretPassword -k -s | jq -r ".count"`" - if [[ $docs -gt 0 ]]; then - echo "wazuh-alerts index documents: ${docs}" - else - echo "wazuh-alerts index documents: ${docs}" - exit 1 - fi - - name: Check Wazuh templates run: | qty_templates="`curl -XGET "https://0.0.0.0:9200/_cat/templates" -u admin:SecretPassword -k -s | grep "wazuh" | wc -l`" @@ -375,5 +362,22 @@ jobs: env: TOKEN: $(curl -s -u wazuh-wui:MyS3cr37P450r.*- -k -X GET "https://0.0.0.0:55000/security/user/authenticate?raw=true") + - name: Check documents into wazuh-alerts index + run: | + until [[ $(``curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_count" -u admin:SecretPassword -k -s | jq -r ".count"``) -gt 0 ]] + do + echo 'Waiting for Wazuh indexer events' + free -m + df -h + sleep 10 + done + docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_count" -u admin:SecretPassword -k -s | jq -r ".count"`" + if [[ $docs -gt 0 ]]; then + echo "wazuh-alerts index documents: ${docs}" + else + echo "wazuh-alerts index documents: ${docs}" + exit 1 + fi + - name: Check errors in ossec.log for Wazuh manager run: ./.github/multi-node-log-check.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a5996d4..5db28cfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,7 +80,7 @@ All notable changes to this project will be documented in this file. ### Changed -- None +- PR revamp modifications 4.x ([#2445](https://github.com/wazuh/wazuh-docker/pull/2445)) ### Fixed @@ -98,7 +98,7 @@ All notable changes to this project will be documented in this file. ### Changed -- None +- Change runners on repository workflows ([#2470](https://github.com/wazuh/wazuh-docker/pull/2470)) ### Fixed @@ -363,7 +363,8 @@ All notable changes to this project will be documented in this file. ### Changed -- None +- Change runner name for Codebuild ([#2474](https://github.com/wazuh/wazuh-docker/pull/2474)) +- PR revamp modifications LTS ([#2449](https://github.com/wazuh/wazuh-docker/pull/2449)) ### Fixed