From 622e74adf7247eaccc648c7c0df3b5e502a11cad Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 19 Jun 2024 10:43:37 -0300 Subject: [PATCH 01/43] Bump 4.10.0 version --- CHANGELOG.md | 6 ++++++ VERSION | 6 +++--- kitchen/test/integration/agent/agent_spec.rb | 2 +- kitchen/test/integration/mngr/manager_spec.rb | 2 +- manifests/dashboard.pp | 2 +- manifests/filebeat_oss.pp | 4 ++-- manifests/indexer.pp | 2 +- manifests/params_agent.pp | 2 +- manifests/params_manager.pp | 4 ++-- metadata.json | 2 +- 10 files changed, 19 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2618535..4e5273da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changes to this project will be documented in this file. +## Wazuh Puppet v4.10.0 + +### Added + +- Support to 4.10.0 Wazuh release. + ## Wazuh Puppet v4.9.0 ### Added diff --git a/VERSION b/VERSION index 1799a5ac..dcd1d87e 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,3 @@ -WAZUH-PUPPET_VERSION="v4.9.0" -REVISION="40900" -VERSION=4.9.0 +WAZUH-PUPPET_VERSION="v4.10.0" +REVISION="41000" +VERSION=4.10.0 diff --git a/kitchen/test/integration/agent/agent_spec.rb b/kitchen/test/integration/agent/agent_spec.rb index 424a2b32..032f460c 100644 --- a/kitchen/test/integration/agent/agent_spec.rb +++ b/kitchen/test/integration/agent/agent_spec.rb @@ -4,7 +4,7 @@ describe package('wazuh-agent') do it { is_expected.to be_installed } - its('version') { is_expected.to eq '4.9.0-1' } + its('version') { is_expected.to eq '4.10.0-1' } end describe service('wazuh-agent') do diff --git a/kitchen/test/integration/mngr/manager_spec.rb b/kitchen/test/integration/mngr/manager_spec.rb index 2b623f36..ad91e132 100644 --- a/kitchen/test/integration/mngr/manager_spec.rb +++ b/kitchen/test/integration/mngr/manager_spec.rb @@ -4,7 +4,7 @@ describe package('wazuh-manager') do it { is_expected.to be_installed } - its('version') { is_expected.to eq '4.9.0-1' } + its('version') { is_expected.to eq '4.10.0-1' } end # Verifying service diff --git a/manifests/dashboard.pp b/manifests/dashboard.pp index 40eb7603..2ef790ce 100644 --- a/manifests/dashboard.pp +++ b/manifests/dashboard.pp @@ -3,7 +3,7 @@ class wazuh::dashboard ( $dashboard_package = 'wazuh-dashboard', $dashboard_service = 'wazuh-dashboard', - $dashboard_version = '4.9.0', + $dashboard_version = '4.10.0', $indexer_server_ip = 'localhost', $indexer_server_port = '9200', $manager_api_host = '127.0.0.1', diff --git a/manifests/filebeat_oss.pp b/manifests/filebeat_oss.pp index fdeeb325..74b68a7a 100644 --- a/manifests/filebeat_oss.pp +++ b/manifests/filebeat_oss.pp @@ -11,8 +11,8 @@ $filebeat_oss_elastic_user = 'admin', $filebeat_oss_elastic_password = 'admin', $filebeat_oss_version = '7.10.2', - $wazuh_app_version = '4.9.0_7.10.2', - $wazuh_extensions_version = 'v4.9.0', + $wazuh_app_version = '4.10.0_7.10.2', + $wazuh_extensions_version = 'v4.10.0', $wazuh_filebeat_module = 'wazuh-filebeat-0.4.tar.gz', $wazuh_node_name = 'master', diff --git a/manifests/indexer.pp b/manifests/indexer.pp index 18996e4f..141ff6d3 100644 --- a/manifests/indexer.pp +++ b/manifests/indexer.pp @@ -8,7 +8,7 @@ $indexer_node_max_local_storage_nodes = '1', $indexer_service = 'wazuh-indexer', $indexer_package = 'wazuh-indexer', - $indexer_version = '4.9.0-1', + $indexer_version = '4.10.0-1', $indexer_fileuser = 'wazuh-indexer', $indexer_filegroup = 'wazuh-indexer', diff --git a/manifests/params_agent.pp b/manifests/params_agent.pp index 4f8d7589..a39a5254 100644 --- a/manifests/params_agent.pp +++ b/manifests/params_agent.pp @@ -1,7 +1,7 @@ # Copyright (C) 2015, Wazuh Inc. # Wazuh-Agent configuration parameters class wazuh::params_agent { - $agent_package_version = '4.9.0' + $agent_package_version = '4.10.0' $agent_package_revision = '1' $agent_service_ensure = 'running' $agent_msi_download_location = 'https://packages.wazuh.com/4.x/windows' diff --git a/manifests/params_manager.pp b/manifests/params_manager.pp index 7d7a2980..65582de9 100644 --- a/manifests/params_manager.pp +++ b/manifests/params_manager.pp @@ -5,7 +5,7 @@ 'Linux': { # Installation - $server_package_version = '4.9.0-1' + $server_package_version = '4.10.0-1' $manage_firewall = false @@ -557,7 +557,7 @@ $keys_group = 'Administrators' $agent_service = 'WazuhSvc' - $agent_package = 'Wazuh Agent 4.9.0' + $agent_package = 'Wazuh Agent 4.10.0' $server_service = '' $server_package = '' $api_service = '' diff --git a/metadata.json b/metadata.json index a3a7d841..b317b3af 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "wazuh-wazuh", - "version": "4.9.0", + "version": "4.10.0", "author": "WAZUH", "summary": "Install and configure Wazuh-HIDS client and server", "license": "Apache-2.0", From 95c8f62aa64282dd47c42aa32527c0e1baa5d4e4 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 11 Sep 2024 10:00:54 -0300 Subject: [PATCH 02/43] Add a new workflow for Puppet module Builder --- .github/workflows/Puppet_module_builder.yml | 79 +++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/Puppet_module_builder.yml diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml new file mode 100644 index 00000000..8c8e8211 --- /dev/null +++ b/.github/workflows/Puppet_module_builder.yml @@ -0,0 +1,79 @@ +run-name: Build Wazuh Puppet module ${{ inputs.BRANCH_NAME }} +name: Puppet Module Builder + +on: + workflow_dispatch: + inputs: + BRANCH_NAME: + type: string + description: "Branch or tag name" + required: true + default: "v4.10.0" + UPLOAD_S3: + type: boolean + description: "Upload Puppet module to S3" + required: true + default: false + S3_REPOSITORY: + type: choice + description: "S3 Repository" + required: true + options: + - staging + - pre-release + +env: + BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET }} + AWS_REGION: ${{ secrets.AAWS_REGION }} + +permissions: + id-token: write # This is required for requesting the JWT + contents: read # This is required for actions/checkout + +jobs: + build_module: + runs-on: ubuntu-24.04 + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ inputs.BRANCH_NAME }} + + - name: Verify Tag name + run: | + WAZUH_TAG=$(curl --silent https://api.github.com/repos/wazuh/wazuh/git/refs/tags | grep '["]ref["]:' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 11- | grep ^${{ inputs.BRANCH_NAME }}$) + echo "WAZUH_TAG=$WAZUH_TAG" >> "$GITHUB_ENV" + + - name: Install dependencies + run: | + curl -O https://apt.puppet.com/puppet-tools-release-noble.deb && \ + dpkg -i puppet-tools-release-noble.deb && \ + apt-get update && \ + apt-get install pdk + pdk set config user.analytics.disabled false --type boolean --force + + - name: Build Wazuh Puppet module + run: | + mkdir -p ${{ github.workspace }}/output + pdk build --force --target-dir=${{ github.workspace }}/output/ + + - name: Create Puppet module artifact + uses: actions/upload-artifact@v4 + with: + name: Puppet module artifact + path: ${{ github.workspace }}/output/wazuh-wazuh-.tar.gz + retention-days: 1 + + - name: Configure aws credentials + if: ${{ env.WAZUH_TAG != '' && inputs.UPLOAD_S3 == true }} + uses: aws-actions/configure-aws-credentials@v3 + with: + role-to-assume: ${{ secrets.AWS_IAM_PUPPET_ROLE }} + role-session-name: "Puppet module-Builder" + aws-region: "${{ env.AWS_REGION }}" + role-duration-seconds: 10800 + + - name: Upload Puppet module to S3 + if: ${{ env.WAZUH_TAG != '' && inputs.UPLOAD_S3 == true }} + run: aws s3 cp ${{ github.workspace }}/output/*.tar.gz s3://${{ env.BUCKET_NAME }}/${{ inputs.S3_REPOSITORY }}/puppet-module/ + From 633bda8bd0f44650fced816d1fc54ae89786542b Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 11 Sep 2024 10:03:27 -0300 Subject: [PATCH 03/43] Modify secret assign --- .github/workflows/Puppet_module_builder.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 8c8e8211..c176b7b6 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -22,10 +22,6 @@ on: - staging - pre-release -env: - BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET }} - AWS_REGION: ${{ secrets.AAWS_REGION }} - permissions: id-token: write # This is required for requesting the JWT contents: read # This is required for actions/checkout @@ -70,10 +66,10 @@ jobs: with: role-to-assume: ${{ secrets.AWS_IAM_PUPPET_ROLE }} role-session-name: "Puppet module-Builder" - aws-region: "${{ env.AWS_REGION }}" + aws-region: "${{ secrets.AWS_REGION }}" role-duration-seconds: 10800 - name: Upload Puppet module to S3 if: ${{ env.WAZUH_TAG != '' && inputs.UPLOAD_S3 == true }} - run: aws s3 cp ${{ github.workspace }}/output/*.tar.gz s3://${{ env.BUCKET_NAME }}/${{ inputs.S3_REPOSITORY }}/puppet-module/ + run: aws s3 cp ${{ github.workspace }}/output/*.tar.gz s3://${{ secrets.AWS_S3_BUCKET }}/${{ inputs.S3_REPOSITORY }}/puppet-module/ From 95296003553ab7cf8bcd9eaacacb8ef8243145ec Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 11 Sep 2024 11:13:51 -0300 Subject: [PATCH 04/43] Add view parameter step and sudo commands --- .github/workflows/Puppet_module_builder.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index c176b7b6..9f809125 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -35,6 +35,9 @@ jobs: with: ref: ${{ inputs.BRANCH_NAME }} + - name: View parameters + run: echo "${{ toJson(inputs) }}" + - name: Verify Tag name run: | WAZUH_TAG=$(curl --silent https://api.github.com/repos/wazuh/wazuh/git/refs/tags | grep '["]ref["]:' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 11- | grep ^${{ inputs.BRANCH_NAME }}$) @@ -42,10 +45,10 @@ jobs: - name: Install dependencies run: | - curl -O https://apt.puppet.com/puppet-tools-release-noble.deb && \ - dpkg -i puppet-tools-release-noble.deb && \ - apt-get update && \ - apt-get install pdk + curl -O https://apt.puppet.com/puppet-tools-release-noble.deb + sudo dpkg -i puppet-tools-release-noble.deb + sudo apt-get update + sudo apt-get install pdk pdk set config user.analytics.disabled false --type boolean --force - name: Build Wazuh Puppet module From 1cc301c3d0a83ae61c93f39b6abdb38cac495670 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 11 Sep 2024 11:27:39 -0300 Subject: [PATCH 05/43] Add parameters and module name --- .github/workflows/Puppet_module_builder.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 9f809125..8c11df7e 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -38,10 +38,14 @@ jobs: - name: View parameters run: echo "${{ toJson(inputs) }}" - - name: Verify Tag name + - name: Create environment variables for workflow run: | WAZUH_TAG=$(curl --silent https://api.github.com/repos/wazuh/wazuh/git/refs/tags | grep '["]ref["]:' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 11- | grep ^${{ inputs.BRANCH_NAME }}$) + PUPPET_MODULE_NAME=$(jq .name ${{ github.workspace }}/metadata.json | sed -e 's|["'\'']||g') + PUPPET_MODULE_VERSOIN=$(jq .version ${{ github.workspace }}/metadata.json | sed -e 's|["'\'']||g') echo "WAZUH_TAG=$WAZUH_TAG" >> "$GITHUB_ENV" + echo "PUPPET_MODULE_NAME=$PUPPET_MODULE_NAME" >> "$GITHUB_ENV" + echo "PUPPET_MODULE_VERSOIN=$PUPPET_MODULE_VERSOIN" >> "$GITHUB_ENV" - name: Install dependencies run: | @@ -60,7 +64,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: Puppet module artifact - path: ${{ github.workspace }}/output/wazuh-wazuh-.tar.gz + path: ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz retention-days: 1 - name: Configure aws credentials @@ -74,5 +78,5 @@ jobs: - name: Upload Puppet module to S3 if: ${{ env.WAZUH_TAG != '' && inputs.UPLOAD_S3 == true }} - run: aws s3 cp ${{ github.workspace }}/output/*.tar.gz s3://${{ secrets.AWS_S3_BUCKET }}/${{ inputs.S3_REPOSITORY }}/puppet-module/ + run: aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz s3://${{ secrets.AWS_S3_BUCKET }}/${{ inputs.S3_REPOSITORY }}/puppet-module/ From 3cbd7ccfcb87f9ad1c18ae07d3f42606e28fe1de Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 11 Sep 2024 11:30:58 -0300 Subject: [PATCH 06/43] Fix parameter name --- .github/workflows/Puppet_module_builder.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 8c11df7e..179d88cc 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -42,10 +42,10 @@ jobs: run: | WAZUH_TAG=$(curl --silent https://api.github.com/repos/wazuh/wazuh/git/refs/tags | grep '["]ref["]:' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 11- | grep ^${{ inputs.BRANCH_NAME }}$) PUPPET_MODULE_NAME=$(jq .name ${{ github.workspace }}/metadata.json | sed -e 's|["'\'']||g') - PUPPET_MODULE_VERSOIN=$(jq .version ${{ github.workspace }}/metadata.json | sed -e 's|["'\'']||g') + PUPPET_MODULE_VERSION=$(jq .version ${{ github.workspace }}/metadata.json | sed -e 's|["'\'']||g') echo "WAZUH_TAG=$WAZUH_TAG" >> "$GITHUB_ENV" echo "PUPPET_MODULE_NAME=$PUPPET_MODULE_NAME" >> "$GITHUB_ENV" - echo "PUPPET_MODULE_VERSOIN=$PUPPET_MODULE_VERSOIN" >> "$GITHUB_ENV" + echo "PUPPET_MODULE_VERSION=$PUPPET_MODULE_VERSION" >> "$GITHUB_ENV" - name: Install dependencies run: | From 19b32e011f49e6a6c9f2d78f7b15b52d06915806 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 11 Sep 2024 11:41:09 -0300 Subject: [PATCH 07/43] Fix parameter name --- .github/workflows/Puppet_module_builder.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 179d88cc..44b9a4e5 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -72,9 +72,7 @@ jobs: uses: aws-actions/configure-aws-credentials@v3 with: role-to-assume: ${{ secrets.AWS_IAM_PUPPET_ROLE }} - role-session-name: "Puppet module-Builder" aws-region: "${{ secrets.AWS_REGION }}" - role-duration-seconds: 10800 - name: Upload Puppet module to S3 if: ${{ env.WAZUH_TAG != '' && inputs.UPLOAD_S3 == true }} From d4a726e4adbadeaee7dcde1267fd7273ff6b7920 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 11 Sep 2024 12:49:18 -0300 Subject: [PATCH 08/43] Fix tag repository --- .github/workflows/Puppet_module_builder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 44b9a4e5..7fd93904 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -40,7 +40,7 @@ jobs: - name: Create environment variables for workflow run: | - WAZUH_TAG=$(curl --silent https://api.github.com/repos/wazuh/wazuh/git/refs/tags | grep '["]ref["]:' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 11- | grep ^${{ inputs.BRANCH_NAME }}$) + WAZUH_TAG=$(curl --silent https://api.github.com/repos/wazuh/wazuh-puppet/git/refs/tags | grep '["]ref["]:' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 11- | grep ^${{ inputs.BRANCH_NAME }}$) PUPPET_MODULE_NAME=$(jq .name ${{ github.workspace }}/metadata.json | sed -e 's|["'\'']||g') PUPPET_MODULE_VERSION=$(jq .version ${{ github.workspace }}/metadata.json | sed -e 's|["'\'']||g') echo "WAZUH_TAG=$WAZUH_TAG" >> "$GITHUB_ENV" From e32f364eff4ec1d02c785530b6502a866f2cd639 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 11 Sep 2024 13:01:57 -0300 Subject: [PATCH 09/43] Added the account name of the job executor --- .github/workflows/Puppet_module_builder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 7fd93904..e0e4d891 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -1,4 +1,4 @@ -run-name: Build Wazuh Puppet module ${{ inputs.BRANCH_NAME }} +run-name: Build Wazuh Puppet module ${{ inputs.BRANCH_NAME }} - Launched by @${{ github.actor }} name: Puppet Module Builder on: From 7b2f4f592fd36bdcae856a08ac14cbbef5badef3 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 11 Sep 2024 13:54:13 -0300 Subject: [PATCH 10/43] Add changelog --- CHANGELOG.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46c265ef..794024a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,20 @@ All notable changes to this project will be documented in this file. ### Added -- Support to 4.10.0 Wazuh release. +- Wazuh Puppet module builder ([#1107](https://github.com/wazuh/wazuh-puppet/pull/1107)) \- (Puppet Module Builder) +- Wazuh Puppet module builder ([#1109](https://github.com/wazuh/wazuh-puppet/pull/1109)) \- (Puppet Module Builder) + +### Changed + +- None + +### Fixed + +- None + +### Deleted + +- None ## Wazuh Puppet v4.9.1 From 32a86cc9237be1438335fb42b99076d27211e40d Mon Sep 17 00:00:00 2001 From: vcerenu Date: Thu, 12 Sep 2024 15:01:43 -0300 Subject: [PATCH 11/43] Delete tag verification --- .github/workflows/Puppet_module_builder.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index e0e4d891..23e0f67e 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -40,10 +40,8 @@ jobs: - name: Create environment variables for workflow run: | - WAZUH_TAG=$(curl --silent https://api.github.com/repos/wazuh/wazuh-puppet/git/refs/tags | grep '["]ref["]:' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 11- | grep ^${{ inputs.BRANCH_NAME }}$) PUPPET_MODULE_NAME=$(jq .name ${{ github.workspace }}/metadata.json | sed -e 's|["'\'']||g') PUPPET_MODULE_VERSION=$(jq .version ${{ github.workspace }}/metadata.json | sed -e 's|["'\'']||g') - echo "WAZUH_TAG=$WAZUH_TAG" >> "$GITHUB_ENV" echo "PUPPET_MODULE_NAME=$PUPPET_MODULE_NAME" >> "$GITHUB_ENV" echo "PUPPET_MODULE_VERSION=$PUPPET_MODULE_VERSION" >> "$GITHUB_ENV" @@ -68,13 +66,13 @@ jobs: retention-days: 1 - name: Configure aws credentials - if: ${{ env.WAZUH_TAG != '' && inputs.UPLOAD_S3 == true }} + if: ${{ inputs.UPLOAD_S3 == true }} uses: aws-actions/configure-aws-credentials@v3 with: role-to-assume: ${{ secrets.AWS_IAM_PUPPET_ROLE }} aws-region: "${{ secrets.AWS_REGION }}" - name: Upload Puppet module to S3 - if: ${{ env.WAZUH_TAG != '' && inputs.UPLOAD_S3 == true }} + if: ${{ inputs.UPLOAD_S3 == true }} run: aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz s3://${{ secrets.AWS_S3_BUCKET }}/${{ inputs.S3_REPOSITORY }}/puppet-module/ From 1b9ad0fcff84d368ac2ef5a42d2b7abec1ef9b2b Mon Sep 17 00:00:00 2001 From: vcerenu Date: Thu, 12 Sep 2024 15:06:39 -0300 Subject: [PATCH 12/43] Add changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 794024a1..3c1e57cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file. ### Changed -- None +- Delete tag verification ([#1113](https://github.com/wazuh/wazuh-puppet/pull/1113)) \- (Puppet Module Builder) ### Fixed From 34650150787d088523bec4ee2c39211141bbcf44 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Mon, 16 Sep 2024 12:00:03 -0300 Subject: [PATCH 13/43] Modify upload path and module nae --- .github/workflows/Puppet_module_builder.yml | 50 +++++++++++---------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 23e0f67e..cc45e86d 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -4,46 +4,40 @@ name: Puppet Module Builder on: workflow_dispatch: inputs: - BRANCH_NAME: - type: string - description: "Branch or tag name" - required: true - default: "v4.10.0" - UPLOAD_S3: + upload: + description: "Upload ?" + type: boolean + default: false + is_stage: + description: "Is stage ?" type: boolean - description: "Upload Puppet module to S3" - required: true default: false - S3_REPOSITORY: - type: choice - description: "S3 Repository" - required: true - options: - - staging - - pre-release permissions: id-token: write # This is required for requesting the JWT contents: read # This is required for actions/checkout +env: + S3_PATH: "/development/wazuh/4.x/secondary/puppet-module/" + jobs: build_module: runs-on: ubuntu-24.04 steps: - name: Checkout code uses: actions/checkout@v4 - with: - ref: ${{ inputs.BRANCH_NAME }} - name: View parameters run: echo "${{ toJson(inputs) }}" - name: Create environment variables for workflow run: | - PUPPET_MODULE_NAME=$(jq .name ${{ github.workspace }}/metadata.json | sed -e 's|["'\'']||g') + PUPPET_MODULE_REPO=$(jq .name ${{ github.workspace }}/metadata.json | sed -e 's|["'\'']||g') PUPPET_MODULE_VERSION=$(jq .version ${{ github.workspace }}/metadata.json | sed -e 's|["'\'']||g') - echo "PUPPET_MODULE_NAME=$PUPPET_MODULE_NAME" >> "$GITHUB_ENV" + calculatedSha=$(git rev-parse --short ${{ github.sha }}) + echo "PUPPET_MODULE_REPO=$PUPPET_MODULE_REPO" >> "$GITHUB_ENV" echo "PUPPET_MODULE_VERSION=$PUPPET_MODULE_VERSION" >> "$GITHUB_ENV" + echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV - name: Install dependencies run: | @@ -57,22 +51,32 @@ jobs: run: | mkdir -p ${{ github.workspace }}/output pdk build --force --target-dir=${{ github.workspace }}/output/ + PUPPET_MODULE_NAME=${{ env.PUPPET_MODULE_REPO }}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz + echo "PUPPET_MODULE_NAME=$PUPPET_MODULE_NAME" >> "$GITHUB_ENV" + + - name: Modify name for stage build + if: ${{ inputs.is_stage == true }} + run: + mv ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_REPO }}-${{ env.COMMIT_SHORT_SHA}}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz + PUPPET_MODULE_NAME=${{ env.PUPPET_MODULE_REPO }}-${{ env.COMMIT_SHORT_SHA}}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz + echo "PUPPET_MODULE_NAME=$PUPPET_MODULE_NAME" >> "$GITHUB_ENV" + - name: Create Puppet module artifact uses: actions/upload-artifact@v4 with: name: Puppet module artifact - path: ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz + path: ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} retention-days: 1 - name: Configure aws credentials - if: ${{ inputs.UPLOAD_S3 == true }} + if: ${{ inputs.upload == true }} uses: aws-actions/configure-aws-credentials@v3 with: role-to-assume: ${{ secrets.AWS_IAM_PUPPET_ROLE }} aws-region: "${{ secrets.AWS_REGION }}" - name: Upload Puppet module to S3 - if: ${{ inputs.UPLOAD_S3 == true }} - run: aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz s3://${{ secrets.AWS_S3_BUCKET }}/${{ inputs.S3_REPOSITORY }}/puppet-module/ + if: ${{ inputs.upload == true }} + run: aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }} From a9c68bae52cbacb177b7631906097c4ca2a535c9 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Mon, 16 Sep 2024 12:15:09 -0300 Subject: [PATCH 14/43] Add multiline sign --- .github/workflows/Puppet_module_builder.yml | 2 +- .gitignore | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index cc45e86d..8a9301fd 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -56,7 +56,7 @@ jobs: - name: Modify name for stage build if: ${{ inputs.is_stage == true }} - run: + run: | mv ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_REPO }}-${{ env.COMMIT_SHORT_SHA}}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz PUPPET_MODULE_NAME=${{ env.PUPPET_MODULE_REPO }}-${{ env.COMMIT_SHORT_SHA}}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz echo "PUPPET_MODULE_NAME=$PUPPET_MODULE_NAME" >> "$GITHUB_ENV" diff --git a/.gitignore b/.gitignore index 1c34e1e3..bf57b6a1 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ kitchen/.librarian/ kitchen/.pytest_cache/ kitchen/.* kitchen/modules/ +output/ \ No newline at end of file From c4dd4983f3e6554b6f577440abec981258fe2c44 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Mon, 16 Sep 2024 12:25:52 -0300 Subject: [PATCH 15/43] Add newline --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index bf57b6a1..d9052c2b 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,4 @@ kitchen/.librarian/ kitchen/.pytest_cache/ kitchen/.* kitchen/modules/ -output/ \ No newline at end of file +output/ From c783574254f4b62fbfced422d9acfeff1b0b7ba8 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Mon, 16 Sep 2024 14:07:00 -0300 Subject: [PATCH 16/43] Fix path --- .github/workflows/Puppet_module_builder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 8a9301fd..7dc8b5b0 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -18,7 +18,7 @@ permissions: contents: read # This is required for actions/checkout env: - S3_PATH: "/development/wazuh/4.x/secondary/puppet-module/" + S3_PATH: "development/wazuh/4.x/secondary/puppet-module/" jobs: build_module: From 8095b78aa09098aeed44f6355d28d26a614ac2bc Mon Sep 17 00:00:00 2001 From: vcerenu Date: Mon, 16 Sep 2024 14:15:17 -0300 Subject: [PATCH 17/43] Update aws credentials configuration actions --- .github/workflows/Puppet_module_builder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 7dc8b5b0..178240c1 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -71,7 +71,7 @@ jobs: - name: Configure aws credentials if: ${{ inputs.upload == true }} - uses: aws-actions/configure-aws-credentials@v3 + uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: ${{ secrets.AWS_IAM_PUPPET_ROLE }} aws-region: "${{ secrets.AWS_REGION }}" From 3b0ccd21ce9f853b7a24e96a7c00f55c324752da Mon Sep 17 00:00:00 2001 From: vcerenu Date: Tue, 17 Sep 2024 08:53:56 -0300 Subject: [PATCH 18/43] Fix stage puppet module name --- .github/workflows/Puppet_module_builder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 178240c1..a38a8faf 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -58,7 +58,7 @@ jobs: if: ${{ inputs.is_stage == true }} run: | mv ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_REPO }}-${{ env.COMMIT_SHORT_SHA}}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz - PUPPET_MODULE_NAME=${{ env.PUPPET_MODULE_REPO }}-${{ env.COMMIT_SHORT_SHA}}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz + PUPPET_MODULE_NAME=${{ env.PUPPET_MODULE_REPO }}-${{ env.PUPPET_MODULE_VERSION }}-${{ env.COMMIT_SHORT_SHA}}.tar.gz echo "PUPPET_MODULE_NAME=$PUPPET_MODULE_NAME" >> "$GITHUB_ENV" From f0903bd67ba7e26ea416fe413490de9dd458fe7f Mon Sep 17 00:00:00 2001 From: vcerenu Date: Tue, 17 Sep 2024 15:29:03 -0300 Subject: [PATCH 19/43] Modify puppet version for stage --- .github/workflows/Puppet_module_builder.yml | 16 ++++++++-------- metadata.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) mode change 100644 => 100755 metadata.json diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index a38a8faf..1f53bea6 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -47,6 +47,14 @@ jobs: sudo apt-get install pdk pdk set config user.analytics.disabled false --type boolean --force + - name: Modify name for stage build + if: ${{ inputs.is_stage == false }} + run: | + pip install sde + PUPPET_MODULE_VERSION="${PUPPET_MODULE_VERSION%-*}-0-${{ env.COMMIT_SHORT_SHA}}" + sde version $PUPPET_MODULE_VERSION metadata.json + echo "PUPPET_MODULE_VERSION=$PUPPET_MODULE_VERSION" >> "$GITHUB_ENV" + - name: Build Wazuh Puppet module run: | mkdir -p ${{ github.workspace }}/output @@ -54,14 +62,6 @@ jobs: PUPPET_MODULE_NAME=${{ env.PUPPET_MODULE_REPO }}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz echo "PUPPET_MODULE_NAME=$PUPPET_MODULE_NAME" >> "$GITHUB_ENV" - - name: Modify name for stage build - if: ${{ inputs.is_stage == true }} - run: | - mv ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_REPO }}-${{ env.COMMIT_SHORT_SHA}}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz - PUPPET_MODULE_NAME=${{ env.PUPPET_MODULE_REPO }}-${{ env.PUPPET_MODULE_VERSION }}-${{ env.COMMIT_SHORT_SHA}}.tar.gz - echo "PUPPET_MODULE_NAME=$PUPPET_MODULE_NAME" >> "$GITHUB_ENV" - - - name: Create Puppet module artifact uses: actions/upload-artifact@v4 with: diff --git a/metadata.json b/metadata.json old mode 100644 new mode 100755 index b317b3af..a5d2887d --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "wazuh-wazuh", - "version": "4.10.0", + "version": "4.10.0-1", "author": "WAZUH", "summary": "Install and configure Wazuh-HIDS client and server", "license": "Apache-2.0", From 0bb2ce622774037c512f9704223528921cc8e008 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Tue, 17 Sep 2024 15:36:29 -0300 Subject: [PATCH 20/43] Modify options --- .github/workflows/Puppet_module_builder.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 1f53bea6..9d92a66d 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -50,9 +50,9 @@ jobs: - name: Modify name for stage build if: ${{ inputs.is_stage == false }} run: | - pip install sde + pip install sde --break-system-packages, PUPPET_MODULE_VERSION="${PUPPET_MODULE_VERSION%-*}-0-${{ env.COMMIT_SHORT_SHA}}" - sde version $PUPPET_MODULE_VERSION metadata.json + sde version $PUPPET_MODULE_VERSION ${{ github.workspace }}/metadata.json echo "PUPPET_MODULE_VERSION=$PUPPET_MODULE_VERSION" >> "$GITHUB_ENV" - name: Build Wazuh Puppet module From bd06e3ff590b0878fcb3d3fc0fe70e937e1aa2a9 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Tue, 17 Sep 2024 15:40:07 -0300 Subject: [PATCH 21/43] Modify options --- .github/workflows/Puppet_module_builder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 9d92a66d..6ff15206 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -50,7 +50,7 @@ jobs: - name: Modify name for stage build if: ${{ inputs.is_stage == false }} run: | - pip install sde --break-system-packages, + pip install sde --break-system-packages PUPPET_MODULE_VERSION="${PUPPET_MODULE_VERSION%-*}-0-${{ env.COMMIT_SHORT_SHA}}" sde version $PUPPET_MODULE_VERSION ${{ github.workspace }}/metadata.json echo "PUPPET_MODULE_VERSION=$PUPPET_MODULE_VERSION" >> "$GITHUB_ENV" From 0c591027bf36a9c5e0934faf5300d45416fa1a57 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Tue, 17 Sep 2024 15:45:56 -0300 Subject: [PATCH 22/43] Modify Changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c1e57cb..4ce1cd36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file. ### Changed -- Delete tag verification ([#1113](https://github.com/wazuh/wazuh-puppet/pull/1113)) \- (Puppet Module Builder) +- Modfy Puppet module builder ([#1113](https://github.com/wazuh/wazuh-puppet/pull/1113)) \- (Puppet Module Builder) ### Fixed From ed1e8c8c3437d26c8dfb65b22ddb38d912a5a9a3 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Thu, 19 Sep 2024 08:34:11 -0300 Subject: [PATCH 23/43] Delete revision number --- .github/workflows/Puppet_module_builder.yml | 2 +- metadata.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 6ff15206..4d882572 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -51,7 +51,7 @@ jobs: if: ${{ inputs.is_stage == false }} run: | pip install sde --break-system-packages - PUPPET_MODULE_VERSION="${PUPPET_MODULE_VERSION%-*}-0-${{ env.COMMIT_SHORT_SHA}}" + PUPPET_MODULE_VERSION="${PUPPET_MODULE_VERSION}-${{ env.COMMIT_SHORT_SHA}}" sde version $PUPPET_MODULE_VERSION ${{ github.workspace }}/metadata.json echo "PUPPET_MODULE_VERSION=$PUPPET_MODULE_VERSION" >> "$GITHUB_ENV" diff --git a/metadata.json b/metadata.json index a5d2887d..b317b3af 100755 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "wazuh-wazuh", - "version": "4.10.0-1", + "version": "4.10.0", "author": "WAZUH", "summary": "Install and configure Wazuh-HIDS client and server", "license": "Apache-2.0", From 547c70bf5854fc5b3194f387858e561d2acddcd3 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Fri, 20 Sep 2024 08:57:22 -0300 Subject: [PATCH 24/43] Add inputs requested --- .github/workflows/Puppet_module_builder.yml | 27 ++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 4d882572..f98f995a 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -1,4 +1,4 @@ -run-name: Build Wazuh Puppet module ${{ inputs.BRANCH_NAME }} - Launched by @${{ github.actor }} +run-name: Puppet module ${{ inputs.is_stage && ' - is stage' || '' }}${{ inputs.checksum && ' - checksum' || '' }} ${{ inputs.id }} name: Puppet Module Builder on: @@ -12,6 +12,31 @@ on: description: "Is stage ?" type: boolean default: false + checksum: + description: "Checksum ?" + type: boolean + default: false + id: + description: "ID used to identify the workflow uniquely." + type: string + required: false + workflow_call: + inputs: + upload: + description: "Upload ?" + type: boolean + default: false + is_stage: + description: "Is stage ?" + type: boolean + default: false + checksum: + description: "Checksum ?" + type: boolean + default: false + id: + type: string + required: false permissions: id-token: write # This is required for requesting the JWT From 35396401f3b5bebba35820b7f0d4b837fbb639c0 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Fri, 20 Sep 2024 11:20:16 -0300 Subject: [PATCH 25/43] Add checksum file creation and upload --- .github/workflows/Puppet_module_builder.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index f98f995a..af31875c 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -105,3 +105,9 @@ jobs: if: ${{ inputs.upload == true }} run: aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }} + - name: Create checksum file and upload + if: ${{ inputs.checksum == true }} + run: | + sha512sum ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} > ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}.sha512 + aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}.sha512 s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }} + From bd309942bf40706e165a187885f3c918112ae6b2 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Fri, 20 Sep 2024 11:26:45 -0300 Subject: [PATCH 26/43] Add artifasct creation --- .github/workflows/Puppet_module_builder.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index af31875c..e1e9f8fc 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -87,6 +87,12 @@ jobs: PUPPET_MODULE_NAME=${{ env.PUPPET_MODULE_REPO }}-${{ env.PUPPET_MODULE_VERSION }}.tar.gz echo "PUPPET_MODULE_NAME=$PUPPET_MODULE_NAME" >> "$GITHUB_ENV" + - name: Build Wazuh Puppet module checksum + if: ${{ inputs.checksum == true }} + run: | + sha512sum ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} > ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}.sha512 + + - name: Create Puppet module artifact uses: actions/upload-artifact@v4 with: @@ -94,6 +100,14 @@ jobs: path: ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} retention-days: 1 + - name: Create Puppet module checksum artifact + if: ${{ inputs.checksum == true }} + uses: actions/upload-artifact@v4 + with: + name: Puppet module artifact + path: ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}.sha512 + retention-days: 1 + - name: Configure aws credentials if: ${{ inputs.upload == true }} uses: aws-actions/configure-aws-credentials@v4 @@ -108,6 +122,5 @@ jobs: - name: Create checksum file and upload if: ${{ inputs.checksum == true }} run: | - sha512sum ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} > ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}.sha512 aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}.sha512 s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }} From 5205f0c496d5f30b71c8d6e9552e608f1276a29a Mon Sep 17 00:00:00 2001 From: vcerenu Date: Fri, 20 Sep 2024 11:30:31 -0300 Subject: [PATCH 27/43] Add artifasct name --- .github/workflows/Puppet_module_builder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index e1e9f8fc..f5733fd5 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -104,7 +104,7 @@ jobs: if: ${{ inputs.checksum == true }} uses: actions/upload-artifact@v4 with: - name: Puppet module artifact + name: Puppet module checksum artifact path: ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}.sha512 retention-days: 1 From 618df92a37f3faddc071a932cb6d64c7c4668c91 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Fri, 20 Sep 2024 11:36:01 -0300 Subject: [PATCH 28/43] Add upload option to checksum upload --- .github/workflows/Puppet_module_builder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index f5733fd5..1de6c4c5 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -120,7 +120,7 @@ jobs: run: aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }} - name: Create checksum file and upload - if: ${{ inputs.checksum == true }} + if: ${{ inputs.checksum == true && inputs.upload == true }} run: | aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}.sha512 s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }} From a81ac69a9c65798c376cfef350c03f1adc7fa5bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Correa=20Rodr=C3=ADguez?= Date: Tue, 24 Sep 2024 08:44:05 +0200 Subject: [PATCH 29/43] Bumped revision for 4.10.0-alpha1 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index dcd1d87e..6a073da3 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,3 @@ WAZUH-PUPPET_VERSION="v4.10.0" -REVISION="41000" +REVISION="41001" VERSION=4.10.0 From c08d95d308d1dc16cedc18056b74379d2623481a Mon Sep 17 00:00:00 2001 From: "JESUS D. GARCIA" Date: Fri, 4 Oct 2024 15:15:14 -0500 Subject: [PATCH 30/43] Add wazuh-puppet ref input to builder workflow --- .github/workflows/Puppet_module_builder.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 1de6c4c5..5627adee 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -16,6 +16,11 @@ on: description: "Checksum ?" type: boolean default: false + wazuh_puppet_reference: + description: "wazuh-puppet reference" + type: string + default: "4.10.0" + required: false id: description: "ID used to identify the workflow uniquely." type: string @@ -34,6 +39,11 @@ on: description: "Checksum ?" type: boolean default: false + wazuh_puppet_reference: + description: "wazuh-puppet reference" + type: string + default: "4.10.0" + required: false id: type: string required: false @@ -51,6 +61,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + ref: ${{ inputs.wazuh_puppet_reference }} - name: View parameters run: echo "${{ toJson(inputs) }}" From 1500dc0a07c4b2de14b2834b8550238ae08536cd Mon Sep 17 00:00:00 2001 From: "JESUS D. GARCIA" Date: Thu, 10 Oct 2024 10:35:42 -0500 Subject: [PATCH 31/43] Bump revision --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 6a073da3..b204178d 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,3 @@ WAZUH-PUPPET_VERSION="v4.10.0" -REVISION="41001" +REVISION="41002" VERSION=4.10.0 From d9185f06ee0824e12c765270373de1f1c063d891 Mon Sep 17 00:00:00 2001 From: c-bordon Date: Mon, 14 Oct 2024 15:57:54 -0300 Subject: [PATCH 32/43] Changed GitHub Runner OS version to Ubuntu 22.04 --- .github/workflows/Puppet_module_builder.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 5627adee..7be875e3 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -57,7 +57,7 @@ env: jobs: build_module: - runs-on: ubuntu-24.04 + runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v4 @@ -87,7 +87,7 @@ jobs: - name: Modify name for stage build if: ${{ inputs.is_stage == false }} run: | - pip install sde --break-system-packages + pip install sde PUPPET_MODULE_VERSION="${PUPPET_MODULE_VERSION}-${{ env.COMMIT_SHORT_SHA}}" sde version $PUPPET_MODULE_VERSION ${{ github.workspace }}/metadata.json echo "PUPPET_MODULE_VERSION=$PUPPET_MODULE_VERSION" >> "$GITHUB_ENV" From 2859932087875475cd242102f0f0c6bae6832219 Mon Sep 17 00:00:00 2001 From: c-bordon Date: Mon, 14 Oct 2024 16:04:10 -0300 Subject: [PATCH 33/43] Changed Puppet download --- .github/workflows/Puppet_module_builder.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 7be875e3..92f0700d 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -78,8 +78,8 @@ jobs: - name: Install dependencies run: | - curl -O https://apt.puppet.com/puppet-tools-release-noble.deb - sudo dpkg -i puppet-tools-release-noble.deb + curl -O https://apt.puppet.com/puppet-tools-release-jammy.deb + sudo dpkg -i puppet-tools-release-jammy.deb sudo apt-get update sudo apt-get install pdk pdk set config user.analytics.disabled false --type boolean --force From a841f238a61fbb732ee78abbf9be32e301426a94 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Tue, 15 Oct 2024 08:36:04 -0300 Subject: [PATCH 34/43] Add s3 URI --- .github/workflows/Puppet_module_builder.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 5627adee..0c576577 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -129,10 +129,15 @@ jobs: - name: Upload Puppet module to S3 if: ${{ inputs.upload == true }} - run: aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }} + run: | + aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }} + s3uri="s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }}/${{ env.PUPPET_MODULE_NAME }}" + echo "S3 URI: ${s3uri}" - name: Create checksum file and upload if: ${{ inputs.checksum == true && inputs.upload == true }} run: | aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}.sha512 s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }} + s3uri="s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }}/${{ env.PUPPET_MODULE_NAME }}.sha512" + echo "S3 sha512 URI: ${s3uri}" From e8a1d4bfb978ad7fec2575fd8e16b7ddc8c119e0 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Tue, 15 Oct 2024 09:43:21 -0300 Subject: [PATCH 35/43] Modify secret to variable --- .github/workflows/Puppet_module_builder.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Puppet_module_builder.yml b/.github/workflows/Puppet_module_builder.yml index 0c576577..d577d290 100644 --- a/.github/workflows/Puppet_module_builder.yml +++ b/.github/workflows/Puppet_module_builder.yml @@ -130,14 +130,14 @@ jobs: - name: Upload Puppet module to S3 if: ${{ inputs.upload == true }} run: | - aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }} - s3uri="s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }}/${{ env.PUPPET_MODULE_NAME }}" + aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }} s3://${{ vars.AWS_S3_BUCKET }}/${{ env.S3_PATH }} + s3uri="s3://${{ vars.AWS_S3_BUCKET }}/${{ env.S3_PATH }}/${{ env.PUPPET_MODULE_NAME }}" echo "S3 URI: ${s3uri}" - name: Create checksum file and upload if: ${{ inputs.checksum == true && inputs.upload == true }} run: | - aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}.sha512 s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }} - s3uri="s3://${{ secrets.AWS_S3_BUCKET }}/${{ env.S3_PATH }}/${{ env.PUPPET_MODULE_NAME }}.sha512" + aws s3 cp ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}.sha512 s3://${{ vars.AWS_S3_BUCKET }}/${{ env.S3_PATH }} + s3uri="s3://${{ vars.AWS_S3_BUCKET }}/${{ env.S3_PATH }}/${{ env.PUPPET_MODULE_NAME }}.sha512" echo "S3 sha512 URI: ${s3uri}" From a598da83994522be46dda74691b4ed80fd63bd7e Mon Sep 17 00:00:00 2001 From: vcerenu Date: Tue, 15 Oct 2024 10:15:53 -0300 Subject: [PATCH 36/43] Add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ce1cd36..be56e1c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file. ### Changed - Modfy Puppet module builder ([#1113](https://github.com/wazuh/wazuh-puppet/pull/1113)) \- (Puppet Module Builder) +- Add URI file after upload ([#1143](https://github.com/wazuh/wazuh-puppet/pull/1143)) \- (Puppet Module Builder) ### Fixed From 98f182af07715d9be4862876fb68d1a972cabafb Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 16 Oct 2024 06:27:19 -0300 Subject: [PATCH 37/43] Modify changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be56e1c1..a3a0acd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,8 @@ All notable changes to this project will be documented in this file. ### Changed -- Modfy Puppet module builder ([#1113](https://github.com/wazuh/wazuh-puppet/pull/1113)) \- (Puppet Module Builder) - Add URI file after upload ([#1143](https://github.com/wazuh/wazuh-puppet/pull/1143)) \- (Puppet Module Builder) +- Modfy Puppet module builder ([#1113](https://github.com/wazuh/wazuh-puppet/pull/1113)) \- (Puppet Module Builder) ### Fixed From 8f90055b835ea1b81492517582d0c143beb322e6 Mon Sep 17 00:00:00 2001 From: c-bordon Date: Thu, 17 Oct 2024 10:49:58 -0300 Subject: [PATCH 38/43] Updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ce1cd36..0981643f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ All notable changes to this project will be documented in this file. ### Fixed -- None +- Changed GitHub Runner OS version to Ubuntu 22.04. ([#1142](https://github.com/wazuh/wazuh-puppet/pull/1142)) ### Deleted From 27c80b6a501c03ad536e7dea1c39a7ee0752d937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Anguita=20L=C3=B3pez?= Date: Fri, 18 Oct 2024 10:23:56 +0200 Subject: [PATCH 39/43] bump revision to 41003 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index b204178d..b8909609 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,3 @@ WAZUH-PUPPET_VERSION="v4.10.0" -REVISION="41002" +REVISION="41003" VERSION=4.10.0 From 90baab33eec82d0fed009e621a5a49cec198581d Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 23 Oct 2024 13:54:53 -0300 Subject: [PATCH 40/43] Delete API parameters from wazuh.yml template --- manifests/params_manager.pp | 6 +----- templates/wazuh_api_yml.erb | 4 ---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/manifests/params_manager.pp b/manifests/params_manager.pp index 65582de9..e3740a21 100644 --- a/manifests/params_manager.pp +++ b/manifests/params_manager.pp @@ -314,7 +314,7 @@ #API - $wazuh_api_host = '0.0.0.0' + $wazuh_api_host = ['0.0.0.0'] $wazuh_api_port = '55000' $wazuh_api_file = undef @@ -341,10 +341,6 @@ $wazuh_api_cors_allow_headers = '"*"' $wazuh_api_cors_allow_credentials = 'no' - # Cache (time in seconds) - $wazuh_api_cache_enabled = 'yes' - $wazuh_api_cache_time = '0.750' - # Access parameters $wazuh_api_access_max_login_attempts = 5 $wazuh_api_access_block_time = 300 diff --git a/templates/wazuh_api_yml.erb b/templates/wazuh_api_yml.erb index 6b2e67b0..f8b856af 100644 --- a/templates/wazuh_api_yml.erb +++ b/templates/wazuh_api_yml.erb @@ -24,10 +24,6 @@ cors: expose_headers: <%= @wazuh_api_cors_expose_headers %> allow_headers: <%= @wazuh_api_cors_allow_headers %> allow_credentials: <%= @wazuh_api_cors_allow_credentials %> -# Cache (time in seconds) -cache: - enabled: <%= @wazuh_api_cache_enabled %> - time: <%= @wazuh_api_cache_time %> # Access parameters access: max_login_attempts: <%= @wazuh_api_access_max_login_attempts %> From dd93a3254fb408ee571ab1289f1f688d8e0be601 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 23 Oct 2024 14:05:18 -0300 Subject: [PATCH 41/43] Delete API parameters from wazuh.yml template --- manifests/manager.pp | 3 --- 1 file changed, 3 deletions(-) diff --git a/manifests/manager.pp b/manifests/manager.pp index 702d0639..33c8d5be 100644 --- a/manifests/manager.pp +++ b/manifests/manager.pp @@ -283,9 +283,6 @@ $wazuh_api_cors_allow_credentials = $::wazuh::params_manager::wazuh_api_cors_allow_credentials, - $wazuh_api_cache_enabled = $::wazuh::params_manager::wazuh_api_cache_enabled, - - $wazuh_api_cache_time = $::wazuh::params_manager::wazuh_api_cache_time, $wazuh_api_access_max_login_attempts = $::wazuh::params_manager::wazuh_api_access_max_login_attempts, $wazuh_api_access_block_time = $::wazuh::params_manager::wazuh_api_access_block_time, From 8eb25c299e389b312ad91358ff6d88244cc8d495 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 23 Oct 2024 14:11:08 -0300 Subject: [PATCH 42/43] Add Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26468f63..26c33080 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file. ### Changed +- Delete API parameters from wazuh.yml template ([#1155](https://github.com/wazuh/wazuh-puppet/pull/1155)) \- - Add URI file after upload ([#1143](https://github.com/wazuh/wazuh-puppet/pull/1143)) \- (Puppet Module Builder) - Modfy Puppet module builder ([#1113](https://github.com/wazuh/wazuh-puppet/pull/1113)) \- (Puppet Module Builder) From f81333eb53205646629e3afed6f7330080ceef41 Mon Sep 17 00:00:00 2001 From: vcerenu Date: Wed, 23 Oct 2024 14:16:01 -0300 Subject: [PATCH 43/43] Add Changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26c33080..fd613c73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file. ### Changed -- Delete API parameters from wazuh.yml template ([#1155](https://github.com/wazuh/wazuh-puppet/pull/1155)) \- +- Delete API parameters from wazuh.yml template ([#1155](https://github.com/wazuh/wazuh-puppet/pull/1155)) \- (Puppet Module) - Add URI file after upload ([#1143](https://github.com/wazuh/wazuh-puppet/pull/1143)) \- (Puppet Module Builder) - Modfy Puppet module builder ([#1113](https://github.com/wazuh/wazuh-puppet/pull/1113)) \- (Puppet Module Builder)