diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 17968275..eccb6689 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -32,20 +32,20 @@ jobs: echo "WAZUH_MINOR_VERSION=$MINOR_VERSION" >> "$GITHUB_OUTPUT" -# build-images: -# needs: prepare-variables -# uses: ./.github/workflows/Procedure_push_docker_images.yml -# secrets: inherit -# with: -# image_tag: ${{ needs.prepare-variables.outputs.WAZUH_IMAGE_VERSION }} -# docker_reference: ${{ github.head_ref }} -# revision: ${{ needs.prepare-variables.outputs.WAZUH_TAG_REVISION }} -# reference: "latest" -# id: ${{ github.run_id }} -# dev: true + build-images: + needs: prepare-variables + uses: ./.github/workflows/Procedure_push_docker_images.yml + secrets: inherit + with: + image_tag: ${{ needs.prepare-variables.outputs.WAZUH_IMAGE_VERSION }} + docker_reference: ${{ github.head_ref }} + revision: ${{ needs.prepare-variables.outputs.WAZUH_TAG_REVISION }} + reference: "latest" + id: ${{ github.run_id }} + dev: true Execute-Goss-tests: - needs: [prepare-variables] #, build-images] + needs: [prepare-variables, build-images] runs-on: ubuntu-22.04 env: WAZUH_IMAGE_VERSION: ${{ needs.prepare-variables.outputs.WAZUH_IMAGE_VERSION }} @@ -75,9 +75,14 @@ jobs: GOSS_SLEEP: 30 GOSS_FILE: .github/.goss.yaml - check-intel-single-node: - runs-on: ubuntu-22.04 - needs: [prepare-variables, Execute-Goss-tests] #, build-images] + check-single-node: + name: Check single node on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-22.04, ubuntu-22.04-arm] + fail-fast: false + needs: [prepare-variables, Execute-Goss-tests, build-images] env: WAZUH_IMAGE_VERSION: ${{ needs.prepare-variables.outputs.WAZUH_IMAGE_VERSION }} WAZUH_MINOR_VERSION: ${{ needs.prepare-variables.outputs.WAZUH_MINOR_VERSION }} @@ -258,192 +263,14 @@ jobs: - name: Check errors in ossec.log for Wazuh manager run: ./.github/single-node-log-check.sh - check-arm-single-node: - runs-on: ubuntu-22.04-arm - needs: [prepare-variables, Execute-Goss-tests] #, build-images] - 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 }} - 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: Create single node certficates - run: | - wazuh_certs_tool_url=$(aws s3 presign s3://${{ vars.AWS_S3_BUCKET_DEV }}/development/wazuh/5.x/secondary/installation-assistant/${{ env.WAZUH_IMAGE_VERSION }}/wazuh-certs-tool.sh --expires-in 3600 --region us-west-1) - curl -sL "$wazuh_certs_tool_url" -o ./wazuh-certs-tool.sh - 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 - 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" - else - echo "File $TARGET_FILE not found" - exit 1 - fi - - - name: Start Wazuh agent - run: docker compose up -d - working-directory: ./wazuh-agent - - - 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-intel-multi-node: - runs-on: ubuntu-22.04 - needs: [prepare-variables, Execute-Goss-tests] #, build-images] + check-multi-node: + name: Check multi node on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-22.04, ubuntu-22.04-arm] + fail-fast: false + needs: [prepare-variables, Execute-Goss-tests, build-images] env: WAZUH_IMAGE_VERSION: ${{ needs.prepare-variables.outputs.WAZUH_IMAGE_VERSION }} WAZUH_MINOR_VERSION: ${{ needs.prepare-variables.outputs.WAZUH_MINOR_VERSION }} @@ -637,202 +464,4 @@ jobs: 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 - - check-arm-multi-node: - runs-on: ubuntu-22.04-arm - needs: [prepare-variables, Execute-Goss-tests] #, build-images] - 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 }} - steps: - - - name: Check out code - uses: actions/checkout@v4 - - - name: free disk space - uses: ./.github/free-disk-space - - - 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: Create multi node certficates - run: | - wazuh_certs_tool_url=$(aws s3 presign s3://${{ vars.AWS_S3_BUCKET_DEV }}/development/wazuh/5.x/secondary/installation-assistant/${{ env.WAZUH_IMAGE_VERSION }}/wazuh-certs-tool.sh --expires-in 3600 --region us-west-1) - curl -sL "$wazuh_certs_tool_url" -o ./wazuh-certs-tool.sh - 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 - 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" - else - echo "File $TARGET_FILE not found" - exit 1 - fi - - - 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 + run: ./.github/multi-node-log-check.sh \ No newline at end of file