From 14cdfe9bd6a9f64d6c7b178a605612f379e3b4c5 Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Tue, 30 Jun 2026 18:05:30 +0700 Subject: [PATCH 01/11] Change upload and download methods --- .github/workflows/5_build_and_push_images.yml | 15 +- .../workflows/5_check_integration_tools.yml | 21 +- .github/workflows/5_pr_check.yml | 664 ------------------ CHANGELOG.md | 1 + 4 files changed, 19 insertions(+), 682 deletions(-) delete mode 100644 .github/workflows/5_pr_check.yml diff --git a/.github/workflows/5_build_and_push_images.yml b/.github/workflows/5_build_and_push_images.yml index e39cf756..dca1711d 100644 --- a/.github/workflows/5_build_and_push_images.yml +++ b/.github/workflows/5_build_and_push_images.yml @@ -284,10 +284,9 @@ jobs: - name: Save presigned URLs file to artifact if: ${{ inputs.dev == true }} - uses: actions/upload-artifact@v4 - with: - name: presigned-artifact-urls-${{ github.run_id }} - path: ${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }} + run: | + echo "Uploading presigned URLs artifact..." + aws s3 cp "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" "${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_build_and_push_images/${{ github.run_id }}/${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" build-and-push: runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }} @@ -337,10 +336,10 @@ jobs: - name: Download artifact_urls.yaml (dev) if: ${{ inputs.dev == true }} - uses: actions/download-artifact@v4 - with: - name: presigned-artifact-urls-${{ github.run_id }} - path: ./build-docker-images + run: | + echo "Downloading presigned URLs artifact..." + aws s3 cp "${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_build_and_push_images/${{ github.run_id }}/${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" + mv "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" ./build-docker-images/${{ vars.ARTIFACT_URL_FILE_NAME }} - name: Compute component reference (dev) if: ${{ inputs.dev == true }} diff --git a/.github/workflows/5_check_integration_tools.yml b/.github/workflows/5_check_integration_tools.yml index c22c363a..df0587de 100644 --- a/.github/workflows/5_check_integration_tools.yml +++ b/.github/workflows/5_check_integration_tools.yml @@ -53,6 +53,7 @@ env: AUTOMATION_REFERENCE: ${{ inputs.automation_reference || 'main' }} ALLOCATOR_PATH: /tmp/allocator_instance REGION: us-east-1 + LOGS_ARTIFACT_ZIP_FILE: "docker_logs_artifacts_${{ github.run_id }}.zip" jobs: # ------------------------------------------------------------------------- @@ -732,11 +733,10 @@ jobs: - name: Upload Docker logs if: failure() || steps.run_tests.outcome == 'failure' - uses: actions/upload-artifact@v4 - with: - name: docker-logs-${{ matrix.deployment_type }}-${{ github.run_id }} - path: docker-logs-*.txt - retention-days: 7 + run: | + echo "Uploading Docker logs artifact..." + zip "${{ env.LOGS_ARTIFACT_ZIP_FILE }}" docker-logs-*.txt + aws s3 cp "${{ env.LOGS_ARTIFACT_ZIP_FILE }}" "${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_check_integration_tools/${{ github.run_id }}/${{ env.LOGS_ARTIFACT_ZIP_FILE }}" # ----------------------------------------------------------------------- # Reporting @@ -810,11 +810,12 @@ jobs: - name: Upload test results if: always() - uses: actions/upload-artifact@v4 - with: - name: test-results-docker-${{ matrix.deployment_type }}-${{ github.run_id }} - path: test-results-docker-${{ matrix.deployment_type }}.github - retention-days: 7 + env: + S3_ARTIFACTS_PATH: ${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_check_integration_tools/${{ github.run_id }} + LOCAL_RESULTS_PATH: test-results-docker-${{ matrix.deployment_type }}.github + run: | + echo "Uploading test results to S3..." + aws s3 cp "${LOCAL_RESULTS_PATH}" "${S3_ARTIFACTS_PATH}/test-results-docker-${{ matrix.deployment_type }}/" --recursive # ----------------------------------------------------------------------- # Cleanup: always stop stack and deallocate VM diff --git a/.github/workflows/5_pr_check.yml b/.github/workflows/5_pr_check.yml deleted file mode 100644 index 6bc408d9..00000000 --- a/.github/workflows/5_pr_check.yml +++ /dev/null @@ -1,664 +0,0 @@ -name: (5.x) Docker PR check -permissions: - contents: read - id-token: write -on: - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - branches: - - 5.* - - main - paths: - - 'build-docker-images/**' - - 'multi-node/**' - - 'single-node/**' - - 'wazuh-agent/**' - - '.github/**' - workflow_dispatch: - inputs: - docker_reference: - description: 'Branch or tag to build from' - required: true - type: string - -jobs: - - prepare-variables: - if: ${{ !github.event.pull_request.draft }} - runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }} - outputs: - WAZUH_VERSION: ${{ steps.dotenv.outputs.WAZUH_VERSION }} - WAZUH_IMAGE_VERSION: ${{ steps.dotenv.outputs.WAZUH_IMAGE_VERSION }} - WAZUH_REGISTRY: ${{ vars.IMAGE_REGISTRY_DEV }} - IMAGE_TAG: ${{ steps.dotenv.outputs.IMAGE_TAG }} - WAZUH_MINOR_VERSION: ${{ steps.dotenv.outputs.WAZUH_MINOR_VERSION }} - steps: - - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Export .env variables - id: dotenv - shell: bash - run: | - if [ ! -f .env ]; then echo "::error::.env missing"; exit 1; fi - grep -v '^#' .env | grep -v '^\s*$' >> "$GITHUB_OUTPUT" - FULL_VERSION=$(grep "^WAZUH_VERSION=" .env | cut -d'=' -f2) - MINOR_VERSION=$(echo "$FULL_VERSION" | cut -d'.' -f1,2) - echo "WAZUH_MINOR_VERSION=$MINOR_VERSION" >> "$GITHUB_OUTPUT" - - - build-images: - needs: prepare-variables - uses: ./.github/workflows/5_build_and_push_images.yml - secrets: inherit - with: - image_tag: ${{ needs.prepare-variables.outputs.WAZUH_IMAGE_VERSION }} - docker_reference: ${{ github.head_ref || inputs.docker_reference }} - wazuh_automation_reference: '5.0.0' - commit_list: '["latest", "latest", "latest", "latest"]' - assistant_revision: 'latest' - id: ${{ github.run_id }} - dev: true - - Execute-Goss-tests: - needs: [prepare-variables, build-images] - runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }} - env: - WAZUH_IMAGE_VERSION: ${{ needs.prepare-variables.outputs.WAZUH_IMAGE_VERSION }} - WAZUH_REGISTRY: ${{ needs.prepare-variables.outputs.WAZUH_REGISTRY }} - steps: - - - name: Check out code - uses: actions/checkout@v4 - - - name: Install Goss - uses: e1himself/goss-installation-action@v1.0.3 - with: - version: 'v0.4.4' - - - name: Configure aws credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_IAM_DOCKER_ROLE }} - aws-region: "${{ secrets.AWS_REGION }}" - - - name: Log in to Amazon ECR - uses: aws-actions/amazon-ecr-login@v2 - - - name: Execute Goss tests (wazuh-manager) - run: dgoss run ${{ env.WAZUH_REGISTRY }}/wazuh/wazuh-manager:${{ env.WAZUH_IMAGE_VERSION }}-latest - env: - GOSS_SLEEP: 30 - GOSS_FILE: .github/.goss.yaml - - check-single-node: - name: Check single node on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: ["codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }}", "codebuild-github-actions-codebuild-runner-devops-arm-${{ github.run_id }}-${{ github.run_attempt }}"] - fail-fast: false - needs: [prepare-variables, Execute-Goss-tests] - env: - WAZUH_IMAGE_VERSION: ${{ needs.prepare-variables.outputs.WAZUH_IMAGE_VERSION }} - WAZUH_MINOR_VERSION: ${{ needs.prepare-variables.outputs.WAZUH_MINOR_VERSION }} - WAZUH_REGISTRY: ${{ needs.prepare-variables.outputs.WAZUH_REGISTRY }} - INDEXER_USERNAME: admin - INDEXER_PASSWORD: admin - MANAGER_NODES: "manager" - API_USERNAME: wazuh-wui - API_PASSWORD: wazuh-wui - steps: - - - name: Check out code - uses: actions/checkout@v4 - - - name: Configure aws credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_IAM_DOCKER_ROLE }} - aws-region: "${{ secrets.AWS_REGION }}" - - - name: Log in to Amazon ECR - uses: aws-actions/amazon-ecr-login@v2 - - - name: Download artifact_urls.yaml - uses: actions/download-artifact@v4 - with: - name: presigned-artifact-urls-${{ github.run_id }} - path: ./single-node/ - - - name: Log in to Docker Hub - uses: docker/login-action@v4 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Add environment variables into GITHUB_ENV - run: | - # Export variables to the environment - awk -F':' '!/^#/ && NF>1 {name=$1; val=substr($0,length(name)+3); gsub(/[-.]/,"_",name); print name "=" val}' ${{ vars.ARTIFACT_URL_FILE_NAME }} >> "$GITHUB_ENV" - working-directory: ./single-node/ - - - name: Create single node certficates - run: | - curl --output ./wazuh-certs-tool.sh "${{ env.wazuh_certs_tool }}" - cat > config.yml </$(ip addr show docker0 | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1)/g" wazuh-agent/docker-compose.yml - - - name: Edit Wazuh agent docker-compose file - if: ${{ always() && steps.start_single_node_stack.outcome == 'success' }} - shell: bash - env: - WAZUH_REGISTRY: ${{ env.WAZUH_REGISTRY }} - run: | - TARGET_FILE="wazuh-agent/docker-compose.yml" - if [ -f "$TARGET_FILE" ]; then - echo "Updating registry in $TARGET_FILE to: ${{ env.WAZUH_REGISTRY }}" - sed -i "s|wazuh/wazuh-|${{ env.WAZUH_REGISTRY }}/wazuh/wazuh-|g" "$TARGET_FILE" - sed -i "s/\(.*wazuh\/wazuh-.*:\)${{ env.WAZUH_IMAGE_VERSION }}/\1${{ env.WAZUH_IMAGE_VERSION }}-latest/g" "$TARGET_FILE" - else - echo "File $TARGET_FILE not found" - exit 1 - fi - - - name: Start Wazuh agent - if: ${{ always() && steps.start_single_node_stack.outcome == 'success' }} - run: docker compose up -d - working-directory: ./wazuh-agent - - - name: Check Wazuh agent enrollment - if: ${{ always() && steps.start_single_node_stack.outcome == 'success' }} - run: | - enrolled=false - for i in {1..5}; do - TOKEN=$(curl -s -u ${{ env.API_USERNAME }}:${{ env.API_PASSWORD }} -k -X POST "https://127.0.0.1:55000/security/user/authenticate?raw=true") - agents="`curl -k -s -X GET "https://127.0.0.1:55000/agents?pretty=true" -H "Authorization: Bearer ${TOKEN}" | jq -r .data.affected_items | grep active | wc -l`" - if [[ $agents -gt 0 ]]; then - echo "Wazuh agents: ${agents}" - echo "OK" - enrolled=true - break - else - curl -k -s -X GET "https://127.0.0.1:55000/agents?pretty=true" -H "Authorization: Bearer ${TOKEN}" - echo "Wazuh agents: ${agents}. Retrying in 10s" - [ $i -lt 5 ] && sleep 10 - fi - done - if [[ "$enrolled" != "true" ]]; then - echo "Error: Wazuh agent enrollment did not reach expected active agents threshold" - exit 1 - fi - - - name: Check errors in wazuh-manager.log for Wazuh manager - if: ${{ always() && steps.start_single_node_stack.outcome == 'success' }} - run: ./.github/single-node-log-check.sh - - - name: Check documents into wazuh-states index - if: ${{ always() && steps.start_single_node_stack.outcome == 'success' }} - run: | - for i in {1..20}; do - echo "Checking documents in wazuh-states (Attempt $i/20)..." - RESPONSE=$(curl -XGET "https://127.0.0.1:9200/wazuh-states*/_count" -u ${{ env.INDEXER_USERNAME }}:${{ env.INDEXER_PASSWORD }} -k -s || echo "{}") - DOCS=$(echo "$RESPONSE" | jq -r '.count // 0') - if [[ "$DOCS" -gt 0 ]]; then - echo "wazuh-states index has documents: ${DOCS}" - exit 0 - fi - echo "The index is empty or does not exist yet (Count: $DOCS). Waiting 60s" - [ $i -lt 20 ] && sleep 60 - done - echo "Error: No documents found in wazuh-states after 20 attempts." - echo "Last response: $RESPONSE" - exit 1 - - - name: Docker logs - if: always() - continue-on-error: true - run: | - INDEXER_CONTAINERS=$(docker ps --format '{{.Names}}') - for CONTAINER_NAME in $INDEXER_CONTAINERS; do - echo "" - echo "=========================================================" - echo "Container logs for $CONTAINER_NAME" - echo "=========================================================" - docker logs "$CONTAINER_NAME" - echo "---------------------------------------------------------" - done - working-directory: ./single-node - - check-multi-node: - name: Check multi node on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: ["codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }}", "codebuild-github-actions-codebuild-runner-devops-arm-${{ github.run_id }}-${{ github.run_attempt }}"] - fail-fast: false - needs: [prepare-variables, Execute-Goss-tests] - env: - WAZUH_IMAGE_VERSION: ${{ needs.prepare-variables.outputs.WAZUH_IMAGE_VERSION }} - WAZUH_MINOR_VERSION: ${{ needs.prepare-variables.outputs.WAZUH_MINOR_VERSION }} - WAZUH_REGISTRY: ${{ needs.prepare-variables.outputs.WAZUH_REGISTRY }} - INDEXER_USERNAME: admin - INDEXER_PASSWORD: admin - MANAGER_NODES: "master,worker01" - API_USERNAME: wazuh-wui - API_PASSWORD: wazuh-wui - steps: - - - name: Check out code - uses: actions/checkout@v4 - - - name: Configure aws credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: ${{ secrets.AWS_IAM_DOCKER_ROLE }} - aws-region: "${{ secrets.AWS_REGION }}" - - - name: Log in to Amazon ECR - uses: aws-actions/amazon-ecr-login@v2 - - - name: Download artifact_urls.yaml - uses: actions/download-artifact@v4 - with: - name: presigned-artifact-urls-${{ github.run_id }} - path: ./multi-node/ - - - name: Log in to Docker Hub - uses: docker/login-action@v4 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Add environment variables into GITHUB_ENV - run: | - # Export variables to the environment - awk -F':' '!/^#/ && NF>1 {name=$1; val=substr($0,length(name)+3); gsub(/[-.]/,"_",name); print name "=" val}' ${{ vars.ARTIFACT_URL_FILE_NAME }} >> "$GITHUB_ENV" - working-directory: ./multi-node/ - - - name: Create multi node certficates - run: | - curl --output ./wazuh-certs-tool.sh "${{ env.wazuh_certs_tool }}" - cat > config.yml </$(ip addr show docker0 | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1)/g" wazuh-agent/docker-compose.yml - - - name: Edit Wazuh agent docker-compose file - if: ${{ always() && steps.start_multi_node_stack.outcome == 'success' }} - shell: bash - env: - WAZUH_REGISTRY: ${{ env.WAZUH_REGISTRY }} - run: | - TARGET_FILE="wazuh-agent/docker-compose.yml" - if [ -f "$TARGET_FILE" ]; then - echo "Updating registry in $TARGET_FILE to: ${{ env.WAZUH_REGISTRY }}" - sed -i "s|wazuh/wazuh-|${{ env.WAZUH_REGISTRY }}/wazuh/wazuh-|g" "$TARGET_FILE" - sed -i "s/\(.*wazuh\/wazuh-.*:\)${{ env.WAZUH_IMAGE_VERSION }}/\1${{ env.WAZUH_IMAGE_VERSION }}-latest/g" "$TARGET_FILE" - else - echo "File $TARGET_FILE not found" - exit 1 - fi - - - name: Start Wazuh agent - if: ${{ always() && steps.start_multi_node_stack.outcome == 'success' }} - run: docker compose -f wazuh-agent/docker-compose.yml up -d - - - name: Check Wazuh agent enrollment - if: ${{ always() && steps.start_multi_node_stack.outcome == 'success' }} - run: | - enrolled=false - for i in {1..5}; do - TOKEN=$(curl -s -u ${{ env.API_USERNAME }}:${{ env.API_PASSWORD }} -k -X POST "https://127.0.0.1:55000/security/user/authenticate?raw=true") - agents="`curl -k -s -X GET "https://127.0.0.1:55000/agents?pretty=true" -H "Authorization: Bearer ${TOKEN}" | jq -r .data.affected_items | grep active | wc -l`" - if [[ $agents -gt 0 ]]; then - echo "Wazuh agents: ${agents}" - echo "OK" - enrolled=true - break - else - curl -k -s -X GET "https://127.0.0.1:55000/agents?pretty=true" -H "Authorization: Bearer ${TOKEN}" - echo "Wazuh agents: ${agents}. Retrying in 10s" - [ $i -lt 5 ] && sleep 10 - fi - done - if [[ "$enrolled" != "true" ]]; then - echo "Error: Wazuh agent enrollment did not reach expected active agents threshold" - exit 1 - fi - - - name: Check errors in wazuh-manager.log for Wazuh manager - if: ${{ always() && steps.start_multi_node_stack.outcome == 'success' }} - run: ./.github/multi-node-log-check.sh - - - name: Check documents into wazuh-states index - if: ${{ always() && steps.start_multi_node_stack.outcome == 'success' }} - run: | - for i in {1..20}; do - echo "Checking documents in wazuh-states (Attempt $i/20)..." - RESPONSE=$(curl -XGET "https://127.0.0.1:9200/wazuh-states*/_count" -u ${{ env.INDEXER_USERNAME }}:${{ env.INDEXER_PASSWORD }} -k -s || echo "{}") - DOCS=$(echo "$RESPONSE" | jq -r '.count // 0') - if [[ "$DOCS" -gt 0 ]]; then - echo "wazuh-states index has documents: ${DOCS}" - exit 0 - fi - echo "The index is empty or does not exist yet (Count: $DOCS). Waiting 60s" - [ $i -lt 20 ] && sleep 60 - done - echo "Error: No documents found in wazuh-states after 20 attempts." - echo "Last response: $RESPONSE" - exit 1 - - - name: Docker logs - if: always() - continue-on-error: true - run: | - INDEXER_CONTAINERS=$(docker ps --format '{{.Names}}') - for CONTAINER_NAME in $INDEXER_CONTAINERS; do - echo "" - echo "=========================================================" - echo "Container logs for $CONTAINER_NAME" - echo "=========================================================" - docker logs "$CONTAINER_NAME" - echo "---------------------------------------------------------" - done - working-directory: ./multi-node diff --git a/CHANGELOG.md b/CHANGELOG.md index 5734c9cd..067454ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file. ### Changed +- Change artifact upload and download ([#2502](https://github.com/wazuh/wazuh-docker/issues/2502)) - Change runners on repository workflows 5.x ([#2471](https://github.com/wazuh/wazuh-docker/issues/2471)) - PR revamp modifications 5.x ([#2446](https://github.com/wazuh/wazuh-docker/issues/2446)) - Forbid pr_check workflow execution in draft PRs ([#2399](https://github.com/wazuh/wazuh-docker/issues/2399)) From e3d402a19058b4493b9b26fb090aee6530e9d6cd Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Tue, 30 Jun 2026 18:45:20 +0700 Subject: [PATCH 02/11] Change upload and download methods --- .github/workflows/5_build_and_push_images.yml | 4 ++-- .github/workflows/5_check_integration_tools.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/5_build_and_push_images.yml b/.github/workflows/5_build_and_push_images.yml index dca1711d..c375c1a0 100644 --- a/.github/workflows/5_build_and_push_images.yml +++ b/.github/workflows/5_build_and_push_images.yml @@ -286,7 +286,7 @@ jobs: if: ${{ inputs.dev == true }} run: | echo "Uploading presigned URLs artifact..." - aws s3 cp "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" "${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_build_and_push_images/${{ github.run_id }}/${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" + aws s3 cp "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" "s3://${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_build_and_push_images/${{ github.run_id }}/${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" build-and-push: runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }} @@ -338,7 +338,7 @@ jobs: if: ${{ inputs.dev == true }} run: | echo "Downloading presigned URLs artifact..." - aws s3 cp "${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_build_and_push_images/${{ github.run_id }}/${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" + aws s3 cp "s3://${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_build_and_push_images/${{ github.run_id }}/${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" mv "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" ./build-docker-images/${{ vars.ARTIFACT_URL_FILE_NAME }} - name: Compute component reference (dev) diff --git a/.github/workflows/5_check_integration_tools.yml b/.github/workflows/5_check_integration_tools.yml index df0587de..c6e68eee 100644 --- a/.github/workflows/5_check_integration_tools.yml +++ b/.github/workflows/5_check_integration_tools.yml @@ -736,7 +736,7 @@ jobs: run: | echo "Uploading Docker logs artifact..." zip "${{ env.LOGS_ARTIFACT_ZIP_FILE }}" docker-logs-*.txt - aws s3 cp "${{ env.LOGS_ARTIFACT_ZIP_FILE }}" "${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_check_integration_tools/${{ github.run_id }}/${{ env.LOGS_ARTIFACT_ZIP_FILE }}" + aws s3 cp "${{ env.LOGS_ARTIFACT_ZIP_FILE }}" "s3://${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_check_integration_tools/${{ github.run_id }}/${{ env.LOGS_ARTIFACT_ZIP_FILE }}" # ----------------------------------------------------------------------- # Reporting @@ -811,7 +811,7 @@ jobs: - name: Upload test results if: always() env: - S3_ARTIFACTS_PATH: ${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_check_integration_tools/${{ github.run_id }} + S3_ARTIFACTS_PATH: s3://${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_check_integration_tools/${{ github.run_id }} LOCAL_RESULTS_PATH: test-results-docker-${{ matrix.deployment_type }}.github run: | echo "Uploading test results to S3..." From 0548e0da2a629359d20e4bb7f11669c83995f353 Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Tue, 30 Jun 2026 19:19:28 +0700 Subject: [PATCH 03/11] Change upload and download methods --- .github/workflows/5_build_and_push_images.yml | 4 ++-- .github/workflows/5_check_integration_tools.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/5_build_and_push_images.yml b/.github/workflows/5_build_and_push_images.yml index c375c1a0..ee515030 100644 --- a/.github/workflows/5_build_and_push_images.yml +++ b/.github/workflows/5_build_and_push_images.yml @@ -286,7 +286,7 @@ jobs: if: ${{ inputs.dev == true }} run: | echo "Uploading presigned URLs artifact..." - aws s3 cp "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" "s3://${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_build_and_push_images/${{ github.run_id }}/${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" + aws s3 cp "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" "s3://${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/5_build_and_push_images/${{ github.run_id }}/${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" build-and-push: runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }} @@ -338,7 +338,7 @@ jobs: if: ${{ inputs.dev == true }} run: | echo "Downloading presigned URLs artifact..." - aws s3 cp "s3://${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_build_and_push_images/${{ github.run_id }}/${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" + aws s3 cp "s3://${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/5_build_and_push_images/${{ github.run_id }}/${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" mv "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" ./build-docker-images/${{ vars.ARTIFACT_URL_FILE_NAME }} - name: Compute component reference (dev) diff --git a/.github/workflows/5_check_integration_tools.yml b/.github/workflows/5_check_integration_tools.yml index c6e68eee..93701130 100644 --- a/.github/workflows/5_check_integration_tools.yml +++ b/.github/workflows/5_check_integration_tools.yml @@ -736,7 +736,7 @@ jobs: run: | echo "Uploading Docker logs artifact..." zip "${{ env.LOGS_ARTIFACT_ZIP_FILE }}" docker-logs-*.txt - aws s3 cp "${{ env.LOGS_ARTIFACT_ZIP_FILE }}" "s3://${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_check_integration_tools/${{ github.run_id }}/${{ env.LOGS_ARTIFACT_ZIP_FILE }}" + aws s3 cp "${{ env.LOGS_ARTIFACT_ZIP_FILE }}" "s3://${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/5_check_integration_tools/${{ github.run_id }}/${{ env.LOGS_ARTIFACT_ZIP_FILE }}" # ----------------------------------------------------------------------- # Reporting @@ -811,7 +811,7 @@ jobs: - name: Upload test results if: always() env: - S3_ARTIFACTS_PATH: s3://${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_check_integration_tools/${{ github.run_id }} + S3_ARTIFACTS_PATH: s3://${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/5_check_integration_tools/${{ github.run_id }} LOCAL_RESULTS_PATH: test-results-docker-${{ matrix.deployment_type }}.github run: | echo "Uploading test results to S3..." From 3df074ee9d5ebdb95f3e1136fb39edd60c26f5b2 Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Tue, 30 Jun 2026 19:27:36 +0700 Subject: [PATCH 04/11] Change upload and download methods --- .github/workflows/5_build_and_push_images.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/5_build_and_push_images.yml b/.github/workflows/5_build_and_push_images.yml index ee515030..c6933fb4 100644 --- a/.github/workflows/5_build_and_push_images.yml +++ b/.github/workflows/5_build_and_push_images.yml @@ -286,7 +286,7 @@ jobs: if: ${{ inputs.dev == true }} run: | echo "Uploading presigned URLs artifact..." - aws s3 cp "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" "s3://${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/5_build_and_push_images/${{ github.run_id }}/${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" + aws s3 cp "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" "s3://${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/5_build_and_push_images/${{ github.run_id }}/${{ vars.ARTIFACT_URL_FILE_NAME }}" build-and-push: runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }} @@ -338,7 +338,7 @@ jobs: if: ${{ inputs.dev == true }} run: | echo "Downloading presigned URLs artifact..." - aws s3 cp "s3://${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/5_build_and_push_images/${{ github.run_id }}/${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" + aws s3 cp "s3://${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/5_build_and_push_images/${{ github.run_id }}/${{ vars.ARTIFACT_URL_FILE_NAME }}" "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" mv "${{ env.LOCAL_ARTIFACT_URLS_FILEPATH }}" ./build-docker-images/${{ vars.ARTIFACT_URL_FILE_NAME }} - name: Compute component reference (dev) From b1af5a835752fa54bde322e8288277f1ae89bb95 Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Tue, 30 Jun 2026 19:42:39 +0700 Subject: [PATCH 05/11] Change upload and download methods --- .github/workflows/5_build_and_push_images.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/5_build_and_push_images.yml b/.github/workflows/5_build_and_push_images.yml index c6933fb4..d0eebded 100644 --- a/.github/workflows/5_build_and_push_images.yml +++ b/.github/workflows/5_build_and_push_images.yml @@ -81,6 +81,8 @@ on: permissions: id-token: write contents: read +env: + LOCAL_ARTIFACT_URLS_FILEPATH: /tmp/${{ vars.ARTIFACT_URL_FILE_NAME }} jobs: setup: @@ -166,7 +168,6 @@ jobs: WORKFLOW_VENV: "${{ github.workspace }}/workflow_venv" GENERATE_PRESIGNED_URLS_SCRIPT_PATH: ${{ github.workspace }}/wazuh-automation/tools/sign_urls/generate_presigned_dev_urls.py PRESIGNED_URLS_SCRIPT_PROCESS: "build_docker" - LOCAL_ARTIFACT_URLS_FILEPATH: /tmp/${{ vars.ARTIFACT_URL_FILE_NAME }} COMMIT_LIST: ${{ inputs.commit_list }} ASSISTANT_REVISION: ${{ inputs.assistant_revision }} From 8f0ae452cb91eccae370e8156d91f112661cc701 Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Tue, 30 Jun 2026 22:45:07 +0700 Subject: [PATCH 06/11] Add path verification --- .github/workflows/5_check_integration_tools.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/5_check_integration_tools.yml b/.github/workflows/5_check_integration_tools.yml index 93701130..42fda9a5 100644 --- a/.github/workflows/5_check_integration_tools.yml +++ b/.github/workflows/5_check_integration_tools.yml @@ -811,11 +811,15 @@ jobs: - name: Upload test results if: always() env: - S3_ARTIFACTS_PATH: s3://${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/5_check_integration_tools/${{ github.run_id }} + S3_ARTIFACTS_PATH: s3://${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_check_integration_tools/${{ github.run_id }} LOCAL_RESULTS_PATH: test-results-docker-${{ matrix.deployment_type }}.github run: | - echo "Uploading test results to S3..." - aws s3 cp "${LOCAL_RESULTS_PATH}" "${S3_ARTIFACTS_PATH}/test-results-docker-${{ matrix.deployment_type }}/" --recursive + if [ -f "${LOCAL_RESULTS_PATH}" ]; then + echo "Uploading test results to S3..." + aws s3 cp "${LOCAL_RESULTS_PATH}" "${S3_ARTIFACTS_PATH}/test-results-docker-${{ matrix.deployment_type }}/" --recursive + else + echo "::warning::No test results file found - skipping upload (an earlier step likely failed before test_runner produced output)." + fi # ----------------------------------------------------------------------- # Cleanup: always stop stack and deallocate VM From 21c6a015793c708fad129fb570b15cb00d4b3ffa Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Tue, 30 Jun 2026 22:54:11 +0700 Subject: [PATCH 07/11] change of quotation mark type --- .github/workflows/5_check_integration_tools.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/5_check_integration_tools.yml b/.github/workflows/5_check_integration_tools.yml index 42fda9a5..dd5c9f2f 100644 --- a/.github/workflows/5_check_integration_tools.yml +++ b/.github/workflows/5_check_integration_tools.yml @@ -177,8 +177,8 @@ jobs: echo "deployment_matrix=[\"${DEPLOY_TYPE}\"]" >> $GITHUB_OUTPUT fi else - echo "pr_head_ref=${{ needs.get_pr_info.outputs.pr_head_ref }}" >> $GITHUB_OUTPUT - echo "deployment_matrix=${{ needs.get_pr_info.outputs.deployment_matrix }}" >> $GITHUB_OUTPUT + echo 'pr_head_ref=${{ needs.get_pr_info.outputs.pr_head_ref }}' >> $GITHUB_OUTPUT + echo 'deployment_matrix=${{ needs.get_pr_info.outputs.deployment_matrix }}' >> $GITHUB_OUTPUT fi - name: Checkout wazuh-docker PR branch (VERSION.json only) From fa8d6b3de98c4e8667827e84a130a7fe825fe457 Mon Sep 17 00:00:00 2001 From: fcaffieri Date: Tue, 30 Jun 2026 13:34:46 -0300 Subject: [PATCH 08/11] Add support for generate_presigned_dev_urls srcipt --- .../workflows/5_check_integration_tools.yml | 28 ++++++------ cambios_comillas.md | 43 +++++++++++++++++++ 2 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 cambios_comillas.md diff --git a/.github/workflows/5_check_integration_tools.yml b/.github/workflows/5_check_integration_tools.yml index dd5c9f2f..58c73cb1 100644 --- a/.github/workflows/5_check_integration_tools.yml +++ b/.github/workflows/5_check_integration_tools.yml @@ -410,6 +410,7 @@ jobs: pip install -r wazuh-automation/deployability/deps/requirements.txt pip install -r wazuh-automation/integration-test-module/requirements.txt pip install -e wazuh-automation/integration-test-module/ + pip install pyyaml - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 @@ -418,6 +419,19 @@ jobs: role-session-name: docker-test-${{ github.run_id }}-${{ matrix.deployment_type }} aws-region: ${{ env.REGION }} + - name: Generate presigned cert tool URL + run: | + python wazuh-automation/tools/sign_urls/generate_presigned_dev_urls.py \ + --process build_docker \ + --wazuh-version "${{ env.DOCKER_VERSION }}" \ + --aws-s3-bucket-dev "${{ vars.AWS_S3_BUCKET_DEV }}" + + python3 -c " + import yaml + data = yaml.safe_load(open('/tmp/artifact_urls.yaml')) + print(f'wazuh_certs_tool={data[\"wazuh_certs_tool\"]}') + " >> "$GITHUB_ENV" + # ----------------------------------------------------------------------- # Provision: allocate VM and extract SSH credentials # ----------------------------------------------------------------------- @@ -503,20 +517,10 @@ jobs: - name: Prepare cert tool and config run: | DEPLOYMENT="${{ matrix.deployment_type }}" - VERSION="${{ env.WAZUH_VERSION }}" - STAGE="${{ env.WAZUH_STAGE }}" - MAJOR=$(echo "$VERSION" | cut -d. -f1) - echo "Cert tool: ${VERSION}-${STAGE} Docker image: ${{ env.DOCKER_TAG }}" + echo "Cert tool: ${{ env.wazuh_certs_tool }} Docker image: ${{ env.DOCKER_TAG }}" - # Download cert tool once on the runner - if [ -n "$STAGE" ]; then - CERT_TOOL_URL="https://packages-staging.xdrsiem.wazuh.info/pre-release/${MAJOR}.x/installation-assistant/wazuh-certs-tool-${VERSION}-${STAGE}.sh" - else - CERT_TOOL_URL="https://packages.wazuh.com/${MAJOR}.$(echo "$VERSION" | cut -d. -f2)/wazuh-certs-tool-${VERSION}-1.sh" - fi - echo "Downloading cert tool: $CERT_TOOL_URL" - curl -fsSL -o "wazuh-docker/${DEPLOYMENT}/wazuh-certs-tool.sh" "$CERT_TOOL_URL" + curl --output "wazuh-docker/${DEPLOYMENT}/wazuh-certs-tool.sh" "${{ env.wazuh_certs_tool }}" chmod +x "wazuh-docker/${DEPLOYMENT}/wazuh-certs-tool.sh" echo "Downloaded OK" diff --git a/cambios_comillas.md b/cambios_comillas.md new file mode 100644 index 00000000..9f7df4bf --- /dev/null +++ b/cambios_comillas.md @@ -0,0 +1,43 @@ + +## wazuh-docker +Archivo: `.github/workflows/5_check_integration_tools.yml` +Step: **"Resolve context"** (job `prepare`) + +A partir de la línea **179**, cambiar: + +```yaml + echo "pr_head_ref=${{ needs.get_pr_info.outputs.pr_head_ref }}" >> $GITHUB_OUTPUT + echo "deployment_matrix=${{ needs.get_pr_info.outputs.deployment_matrix }}" >> $GITHUB_OUTPUT +``` + +por: + +```yaml + echo 'pr_head_ref=${{ needs.get_pr_info.outputs.pr_head_ref }}' >> $GITHUB_OUTPUT + echo 'deployment_matrix=${{ needs.get_pr_info.outputs.deployment_matrix }}' >> $GITHUB_OUTPUT +``` + +--- + +## wazuh-ansible +Archivo: `.github/workflows/5_check_integration_tools.yaml` +Step: **"Resolve context"** (job `prepare`) + +A partir de la línea **216**, cambiar: + +```yaml + echo "pr_head_ref=${{ needs.get_pr_info.outputs.pr_head_ref }}" >> $GITHUB_OUTPUT + echo "deployment_matrix=${{ needs.get_pr_info.outputs.deployment_matrix }}" >> $GITHUB_OUTPUT +``` + +por: + +```yaml + echo 'pr_head_ref=${{ needs.get_pr_info.outputs.pr_head_ref }}' >> $GITHUB_OUTPUT + echo 'deployment_matrix=${{ needs.get_pr_info.outputs.deployment_matrix }}' >> $GITHUB_OUTPUT +``` + +(Las 4 líneas siguientes del mismo `else` — `os_list`, `environment`, `commit_list`, +`issue_url` — no se tocan, ya están bien.) + +--- \ No newline at end of file From 04af11919c80abec9bb6da9d0f45646e9b211c53 Mon Sep 17 00:00:00 2001 From: fcaffieri Date: Tue, 30 Jun 2026 13:35:28 -0300 Subject: [PATCH 09/11] Remove md report of fixes --- cambios_comillas.md | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 cambios_comillas.md diff --git a/cambios_comillas.md b/cambios_comillas.md deleted file mode 100644 index 9f7df4bf..00000000 --- a/cambios_comillas.md +++ /dev/null @@ -1,43 +0,0 @@ - -## wazuh-docker -Archivo: `.github/workflows/5_check_integration_tools.yml` -Step: **"Resolve context"** (job `prepare`) - -A partir de la línea **179**, cambiar: - -```yaml - echo "pr_head_ref=${{ needs.get_pr_info.outputs.pr_head_ref }}" >> $GITHUB_OUTPUT - echo "deployment_matrix=${{ needs.get_pr_info.outputs.deployment_matrix }}" >> $GITHUB_OUTPUT -``` - -por: - -```yaml - echo 'pr_head_ref=${{ needs.get_pr_info.outputs.pr_head_ref }}' >> $GITHUB_OUTPUT - echo 'deployment_matrix=${{ needs.get_pr_info.outputs.deployment_matrix }}' >> $GITHUB_OUTPUT -``` - ---- - -## wazuh-ansible -Archivo: `.github/workflows/5_check_integration_tools.yaml` -Step: **"Resolve context"** (job `prepare`) - -A partir de la línea **216**, cambiar: - -```yaml - echo "pr_head_ref=${{ needs.get_pr_info.outputs.pr_head_ref }}" >> $GITHUB_OUTPUT - echo "deployment_matrix=${{ needs.get_pr_info.outputs.deployment_matrix }}" >> $GITHUB_OUTPUT -``` - -por: - -```yaml - echo 'pr_head_ref=${{ needs.get_pr_info.outputs.pr_head_ref }}' >> $GITHUB_OUTPUT - echo 'deployment_matrix=${{ needs.get_pr_info.outputs.deployment_matrix }}' >> $GITHUB_OUTPUT -``` - -(Las 4 líneas siguientes del mismo `else` — `os_list`, `environment`, `commit_list`, -`issue_url` — no se tocan, ya están bien.) - ---- \ No newline at end of file From f2dd1d7f79d36299ff41e777389b7d6a6d579564 Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Wed, 1 Jul 2026 00:06:13 +0700 Subject: [PATCH 10/11] Change secret name --- .github/workflows/5_check_integration_tools.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/5_check_integration_tools.yml b/.github/workflows/5_check_integration_tools.yml index 58c73cb1..e482244c 100644 --- a/.github/workflows/5_check_integration_tools.yml +++ b/.github/workflows/5_check_integration_tools.yml @@ -815,12 +815,12 @@ jobs: - name: Upload test results if: always() env: - S3_ARTIFACTS_PATH: s3://${{ secrets.CI_DEV_INTERNAL_BUCKET }}/wazuh-docker/5_check_integration_tools/${{ github.run_id }} + S3_ARTIFACTS_PATH: s3://${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/5_check_integration_tools/${{ github.run_id }} LOCAL_RESULTS_PATH: test-results-docker-${{ matrix.deployment_type }}.github run: | if [ -f "${LOCAL_RESULTS_PATH}" ]; then echo "Uploading test results to S3..." - aws s3 cp "${LOCAL_RESULTS_PATH}" "${S3_ARTIFACTS_PATH}/test-results-docker-${{ matrix.deployment_type }}/" --recursive + aws s3 cp "${LOCAL_RESULTS_PATH}" "${S3_ARTIFACTS_PATH}/test-results-docker-${{ matrix.deployment_type }}/ else echo "::warning::No test results file found - skipping upload (an earlier step likely failed before test_runner produced output)." fi From e18a5a7be9eb19f74125d4a8a2a5c8b3b27d5244 Mon Sep 17 00:00:00 2001 From: Victor Carlos Erenu Date: Wed, 1 Jul 2026 00:06:34 +0700 Subject: [PATCH 11/11] Change secret name --- .github/workflows/5_check_integration_tools.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/5_check_integration_tools.yml b/.github/workflows/5_check_integration_tools.yml index e482244c..4f42c83c 100644 --- a/.github/workflows/5_check_integration_tools.yml +++ b/.github/workflows/5_check_integration_tools.yml @@ -820,7 +820,7 @@ jobs: run: | if [ -f "${LOCAL_RESULTS_PATH}" ]; then echo "Uploading test results to S3..." - aws s3 cp "${LOCAL_RESULTS_PATH}" "${S3_ARTIFACTS_PATH}/test-results-docker-${{ matrix.deployment_type }}/ + aws s3 cp "${LOCAL_RESULTS_PATH}" "${S3_ARTIFACTS_PATH}/test-results-docker-${{ matrix.deployment_type }}/" else echo "::warning::No test results file found - skipping upload (an earlier step likely failed before test_runner produced output)." fi