From e181132921242fab5195c6a91ed1cf98bef28af2 Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Tue, 9 Jun 2026 01:51:42 +0700 Subject: [PATCH 1/6] PR revamp modifications --- ...images.yml => 4_build_and_push_images.yml} | 6 +- .../workflows/{push.yml => 4_pr_check.yml} | 11 ++- .github/workflows/trivy-dashboard.yml | 76 ------------------- .github/workflows/trivy-indexer.yml | 76 ------------------- .github/workflows/trivy-manager.yml | 76 ------------------- 5 files changed, 12 insertions(+), 233 deletions(-) rename .github/workflows/{Procedure_push_docker_images.yml => 4_build_and_push_images.yml} (98%) rename .github/workflows/{push.yml => 4_pr_check.yml} (98%) delete mode 100644 .github/workflows/trivy-dashboard.yml delete mode 100644 .github/workflows/trivy-indexer.yml delete mode 100644 .github/workflows/trivy-manager.yml diff --git a/.github/workflows/Procedure_push_docker_images.yml b/.github/workflows/4_build_and_push_images.yml similarity index 98% rename from .github/workflows/Procedure_push_docker_images.yml rename to .github/workflows/4_build_and_push_images.yml index 3dc541f2..afef0da3 100644 --- a/.github/workflows/Procedure_push_docker_images.yml +++ b/.github/workflows/4_build_and_push_images.yml @@ -1,5 +1,5 @@ -run-name: Launch Push Docker Images - ${{ inputs.id }} -name: Push Docker Images +run-name: Build and push images 4.x - ${{ inputs.dev && 'dev' || 'release' }} - ${{ inputs.id }} +name: Build and push images 4.x on: workflow_dispatch: @@ -92,7 +92,7 @@ jobs: - name: Print inputs run: | echo "---------------------------------------------" - echo "Running Procedure_push_docker_images workflow" + echo "Running 4_build_and_push_images workflow" echo "---------------------------------------------" echo "* BRANCH: ${{ github.ref }}" echo "* COMMIT: ${{ github.sha }}" diff --git a/.github/workflows/push.yml b/.github/workflows/4_pr_check.yml similarity index 98% rename from .github/workflows/push.yml rename to .github/workflows/4_pr_check.yml index 684a4ec5..a7b7f344 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/4_pr_check.yml @@ -1,6 +1,13 @@ -name: Wazuh Docker pipeline +name: Wazuh Docker pipeline 4.x -on: [pull_request] +on: + pull_request: + paths: + - 'build-docker-images/**' + - 'multi-node/**' + - 'single-node/**' + - 'wazuh-agent/**' + - '.github/**' jobs: build-docker-images: diff --git a/.github/workflows/trivy-dashboard.yml b/.github/workflows/trivy-dashboard.yml deleted file mode 100644 index f4731b21..00000000 --- a/.github/workflows/trivy-dashboard.yml +++ /dev/null @@ -1,76 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Trivy scan Wazuh dashboard - -on: - release: - types: - - published - pull_request: - branches: - - main - schedule: - - cron: '34 2 * * 1' - workflow_dispatch: - -permissions: - contents: read - -jobs: - build: - permissions: - contents: read # for actions/checkout to fetch code - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results - - name: Build images and upload Trivy results - runs-on: "ubuntu-22.04" - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Installing dependencies - run: | - sudo apt-get update - sudo apt-get install -y jq - - - name: Checkout latest tag - run: | - latest=$(curl -s "https://api.github.com/repos/wazuh/wazuh-docker/releases/latest" | jq -r '.tag_name') - git fetch origin - git checkout $latest - - - name: Build Wazuh images - run: build-docker-images/build-images.sh - - - name: Create enviroment variables - run: | - cat .env > $GITHUB_ENV - echo "GITHUB_REF_NAME="${GITHUB_REF_NAME%/*} >> $GITHUB_ENV - - - name: Run Trivy vulnerability scanner for Wazuh dashboard - uses: aquasecurity/trivy-action@2a2157eb22c08c9a1fac99263430307b8d1bc7a2 - with: - image-ref: 'wazuh/wazuh-dashboard:${{env.WAZUH_IMAGE_VERSION}}' - format: 'template' - template: '@/contrib/sarif.tpl' - output: 'trivy-results-dashboard.sarif' - severity: 'LOW,MEDIUM,CRITICAL,HIGH' - - - name: Upload Trivy scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: 'trivy-results-dashboard.sarif' - - - name: Slack notification - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: cicd-monitoring - SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff' - #SLACK_ICON: https://github.com/rtCamp.png?size=48 - SLACK_MESSAGE: "Check the results: https://github.com/wazuh/wazuh-docker/security/code-scanning?query=is%3Aopen+branch%3A${{ env.GITHUB_REF_NAME }}" - SLACK_TITLE: Wazuh docker Trivy vulnerability scan finished. - SLACK_USERNAME: github_actions - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file diff --git a/.github/workflows/trivy-indexer.yml b/.github/workflows/trivy-indexer.yml deleted file mode 100644 index bad0abef..00000000 --- a/.github/workflows/trivy-indexer.yml +++ /dev/null @@ -1,76 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Trivy scan Wazuh indexer - -on: - release: - types: - - published - pull_request: - branches: - - main - schedule: - - cron: '34 2 * * 1' - workflow_dispatch: - -permissions: - contents: read - -jobs: - build: - permissions: - contents: read # for actions/checkout to fetch code - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results - - name: Build images and upload Trivy results - runs-on: "ubuntu-22.04" - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Installing dependencies - run: | - sudo apt-get update - sudo apt-get install -y jq - - - name: Checkout latest tag - run: | - latest=$(curl -s "https://api.github.com/repos/wazuh/wazuh-docker/releases/latest" | jq -r '.tag_name') - git fetch origin - git checkout $latest - - - name: Build Wazuh images - run: build-docker-images/build-images.sh - - - name: Create enviroment variables - run: | - cat .env > $GITHUB_ENV - echo "GITHUB_REF_NAME="${GITHUB_REF_NAME%/*} >> $GITHUB_ENV - - - name: Run Trivy vulnerability scanner for Wazuh indexer - uses: aquasecurity/trivy-action@2a2157eb22c08c9a1fac99263430307b8d1bc7a2 - with: - image-ref: 'wazuh/wazuh-indexer:${{env.WAZUH_IMAGE_VERSION}}' - format: 'template' - template: '@/contrib/sarif.tpl' - output: 'trivy-results-indexer.sarif' - severity: 'LOW,MEDIUM,CRITICAL,HIGH' - - - name: Upload Trivy scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: 'trivy-results-indexer.sarif' - - - name: Slack notification - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: cicd-monitoring - SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff' - #SLACK_ICON: https://github.com/rtCamp.png?size=48 - SLACK_MESSAGE: "Check the results: https://github.com/wazuh/wazuh-docker/security/code-scanning?query=is%3Aopen+branch%3A${{ env.GITHUB_REF_NAME }}" - SLACK_TITLE: Wazuh docker Trivy vulnerability scan finished. - SLACK_USERNAME: github_actions - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file diff --git a/.github/workflows/trivy-manager.yml b/.github/workflows/trivy-manager.yml deleted file mode 100644 index 609f36ac..00000000 --- a/.github/workflows/trivy-manager.yml +++ /dev/null @@ -1,76 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Trivy scan Wazuh manager - -on: - release: - types: - - published - pull_request: - branches: - - main - schedule: - - cron: '34 2 * * 1' - workflow_dispatch: - -permissions: - contents: read - -jobs: - build: - permissions: - contents: read # for actions/checkout to fetch code - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results - - name: Build images and upload Trivy results - runs-on: "ubuntu-22.04" - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Installing dependencies - run: | - sudo apt-get update - sudo apt-get install -y jq - - - name: Checkout latest tag - run: | - latest=$(curl -s "https://api.github.com/repos/wazuh/wazuh-docker/releases/latest" | jq -r '.tag_name') - git fetch origin - git checkout $latest - - - name: Build Wazuh images - run: build-docker-images/build-images.sh - - - name: Create enviroment variables - run: | - cat .env > $GITHUB_ENV - echo "GITHUB_REF_NAME="${GITHUB_REF_NAME%/*} >> $GITHUB_ENV - - - name: Run Trivy vulnerability scanner for Wazuh manager - uses: aquasecurity/trivy-action@2a2157eb22c08c9a1fac99263430307b8d1bc7a2 - with: - image-ref: 'wazuh/wazuh-manager:${{env.WAZUH_IMAGE_VERSION}}' - format: 'template' - template: '@/contrib/sarif.tpl' - output: 'trivy-results-manager.sarif' - severity: 'LOW,MEDIUM,CRITICAL,HIGH' - - - name: Upload Trivy scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: 'trivy-results-manager.sarif' - - - name: Slack notification - uses: rtCamp/action-slack-notify@v2 - env: - SLACK_CHANNEL: cicd-monitoring - SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff' - #SLACK_ICON: https://github.com/rtCamp.png?size=48 - SLACK_MESSAGE: "Check the results: https://github.com/wazuh/wazuh-docker/security/code-scanning?query=is%3Aopen+branch%3A${{ env.GITHUB_REF_NAME }}" - SLACK_TITLE: Wazuh docker Trivy vulnerability scan finished. - SLACK_USERNAME: github_actions - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file From 68faac3ac19a9049d913e20720182fed99a7ccf6 Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Wed, 10 Jun 2026 20:16:37 +0700 Subject: [PATCH 2/6] Move the Wazuh version of the workflow name from the end to the beginning --- .github/workflows/4_build_and_push_images.yml | 4 ++-- .github/workflows/4_bumper_repository.yml | 2 +- .github/workflows/4_pr_check.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/4_build_and_push_images.yml b/.github/workflows/4_build_and_push_images.yml index afef0da3..fab5601d 100644 --- a/.github/workflows/4_build_and_push_images.yml +++ b/.github/workflows/4_build_and_push_images.yml @@ -1,5 +1,5 @@ -run-name: Build and push images 4.x - ${{ inputs.dev && 'dev' || 'release' }} - ${{ inputs.id }} -name: Build and push images 4.x +run-name: (4.x) Build and push images - ${{ inputs.dev && 'dev' || 'release' }} - ${{ inputs.id }} +name: (4.x) Build and push images on: workflow_dispatch: diff --git a/.github/workflows/4_bumper_repository.yml b/.github/workflows/4_bumper_repository.yml index a215726c..ce540bf0 100644 --- a/.github/workflows/4_bumper_repository.yml +++ b/.github/workflows/4_bumper_repository.yml @@ -1,4 +1,4 @@ -name: Repository bumper +name: (4.x) Repository bumper run-name: Bump ${{ github.ref_name }} (${{ inputs.id }}) on: diff --git a/.github/workflows/4_pr_check.yml b/.github/workflows/4_pr_check.yml index a7b7f344..1db63adf 100644 --- a/.github/workflows/4_pr_check.yml +++ b/.github/workflows/4_pr_check.yml @@ -1,4 +1,4 @@ -name: Wazuh Docker pipeline 4.x +name: (4.x) Wazuh Docker pipeline on: pull_request: From 644cdba3a9a7db82a2caea43c2b1e16bc10dd2d9 Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Wed, 10 Jun 2026 21:04:49 +0700 Subject: [PATCH 3/6] Add affected branchs --- .github/workflows/4_pr_check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/4_pr_check.yml b/.github/workflows/4_pr_check.yml index 1db63adf..dd12b8ca 100644 --- a/.github/workflows/4_pr_check.yml +++ b/.github/workflows/4_pr_check.yml @@ -2,6 +2,8 @@ name: (4.x) Wazuh Docker pipeline on: pull_request: + branches: + - 4.* paths: - 'build-docker-images/**' - 'multi-node/**' From 271f6c2eb863c7b025e6cd44d8bd5ce4f5c1f53f Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Wed, 10 Jun 2026 21:14:32 +0700 Subject: [PATCH 4/6] Add types --- .github/workflows/4_pr_check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/4_pr_check.yml b/.github/workflows/4_pr_check.yml index dd12b8ca..53616334 100644 --- a/.github/workflows/4_pr_check.yml +++ b/.github/workflows/4_pr_check.yml @@ -2,6 +2,7 @@ name: (4.x) Wazuh Docker pipeline on: pull_request: + types: [opened, synchronize, reopened, ready_for_review] branches: - 4.* paths: From 70f585de4d9c148fbce4f7d8de174d9053c09a93 Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Wed, 10 Jun 2026 23:23:32 +0700 Subject: [PATCH 5/6] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c722be48..f997e189 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,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 From c6c00fa9db74bfb9cd0bb8131ed60df4b2327bb9 Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Tue, 16 Jun 2026 20:06:29 +0700 Subject: [PATCH 6/6] Change PR check name --- .github/workflows/4_pr_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/4_pr_check.yml b/.github/workflows/4_pr_check.yml index 53616334..66627d23 100644 --- a/.github/workflows/4_pr_check.yml +++ b/.github/workflows/4_pr_check.yml @@ -1,4 +1,4 @@ -name: (4.x) Wazuh Docker pipeline +name: (4.x) Docker PR check on: pull_request: