Skip to content

Commit

Permalink
Merge pull request #1151 from wazuh/merge-4.10.2-into-master
Browse files Browse the repository at this point in the history
Merge 4.10.2 into master
  • Loading branch information
teddytpc1 authored Oct 17, 2024
2 parents c3c99e1 + c56e87f commit a583f3c
Show file tree
Hide file tree
Showing 7 changed files with 192 additions and 41 deletions.
130 changes: 99 additions & 31 deletions .github/workflows/Puppet_module_builder.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,143 @@
run-name: Build Wazuh Puppet module ${{ inputs.BRANCH_NAME }}
run-name: Puppet module ${{ inputs.is_stage && ' - is stage' || '' }}${{ inputs.checksum && ' - checksum' || '' }} ${{ inputs.id }}
name: Puppet Module Builder

on:
workflow_dispatch:
inputs:
BRANCH_NAME:
upload:
description: "Upload ?"
type: boolean
default: false
is_stage:
description: "Is stage ?"
type: boolean
default: false
checksum:
description: "Checksum ?"
type: boolean
default: false
wazuh_puppet_reference:
description: "wazuh-puppet reference"
type: string
default: "5.0.0"
required: false
id:
description: "ID used to identify the workflow uniquely."
type: string
description: "Branch or tag name"
required: true
default: "v5.0.0"
UPLOAD_S3:
required: false
workflow_call:
inputs:
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
checksum:
description: "Checksum ?"
type: boolean
default: false
wazuh_puppet_reference:
description: "wazuh-puppet reference"
type: string
default: "5.0.0"
required: false
id:
type: string
required: false

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
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.BRANCH_NAME }}
ref: ${{ inputs.wazuh_puppet_reference }}

- 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 }}$)
echo "WAZUH_TAG=$WAZUH_TAG" >> "$GITHUB_ENV"
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')
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: |
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-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
- name: Modify name for stage build
if: ${{ inputs.is_stage == false }}
run: |
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"
- name: Build Wazuh Puppet module
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: 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:
name: Puppet module artifact
path: ${{ github.workspace }}/output/wazuh-wazuh-.tar.gz
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 checksum artifact
path: ${{ github.workspace }}/output/${{ env.PUPPET_MODULE_NAME }}.sha512
retention-days: 1

- name: Configure aws credentials
if: ${{ env.WAZUH_TAG != '' && inputs.UPLOAD_S3 == true }}
uses: aws-actions/configure-aws-credentials@v3
if: ${{ inputs.upload == true }}
uses: aws-actions/configure-aws-credentials@v4
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 }}
run: aws s3 cp ${{ github.workspace }}/output/*.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://${{ 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://${{ 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}"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ kitchen/.librarian/
kitchen/.pytest_cache/
kitchen/.*
kitchen/modules/
output/
64 changes: 63 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,73 @@ All notable changes to this project will be documented in this file.

- Support to 5.0.0 Wazuh release.

### Changed

- None

### Fixed

- None

### Deleted

- None

## Wazuh Puppet v4.10.2

### Added

- None

### Changed

- None

### Fixed

- None

### Deleted

- None

## Wazuh Puppet v4.10.1

### Added

- None

### Changed

- None

### Fixed

- None

### Deleted

- None

## Wazuh Puppet v4.10.0

### 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

- 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

- Changed GitHub Runner OS version to Ubuntu 22.04. ([#1142](https://github.com/wazuh/wazuh-puppet/pull/1142))

### Deleted

- None

## Wazuh Puppet v4.9.1

Expand Down
14 changes: 7 additions & 7 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Please submit your findings as security advisories under the "Security" tab in t
## Vulnerability Disclosure Policy
Upon receiving a report of a potential vulnerability, our team will initiate an investigation. If the reported issue is confirmed as a vulnerability, we will take the following steps:

- Acknowledgment: We will acknowledge the receipt of your vulnerability report and begin our investigation.
- Validation: We will validate the issue and work on reproducing it in our environment.
- Remediation: We will work on a fix and thoroughly test it
- Release & Disclosure: After 90 days from the discovery of the vulnerability, or as soon as a fix is ready and thoroughly tested (whichever comes first), we will release a security update for the affected project. We will also publicly disclose the vulnerability by publishing a CVE (Common Vulnerabilities and Exposures) and acknowledging the discovering party.
- Exceptions: In order to preserve the security of the Wazuh community at large, we might extend the disclosure period to allow users to patch their deployments.
1. Acknowledgment: We will acknowledge the receipt of your vulnerability report and begin our investigation.
2. Validation: We will validate the issue and work on reproducing it in our environment.
3. Remediation: We will work on a fix and thoroughly test it
4. Release & Disclosure: After 90 days from the discovery of the vulnerability, or as soon as a fix is ready and thoroughly tested (whichever comes first), we will release a security update for the affected project. We will also publicly disclose the vulnerability by publishing a CVE (Common Vulnerabilities and Exposures) and acknowledging the discovering party.
5. Exceptions: In order to preserve the security of the Wazuh community at large, we might extend the disclosure period to allow users to patch their deployments.

This 90-day period allows for end-users to update their systems and minimizes the risk of widespread exploitation of the vulnerability.

Expand All @@ -33,7 +33,7 @@ We believe in giving credit where credit is due. If you report a security vulner
We do appreciate and encourage feedback from our community, but currently we do not have a bounty program. We might start bounty programs in the future.

## Compliance with this Policy
We consider the discovery and reporting of security vulnerabilities an important public service. We encourage responsible reporting of any vulnerabilities that may be found in our site or applications.
We consider the discovery and reporting of security vulnerabilities an important public service. We encourage responsible reporting of any vulnerabilities that may be found in our site or applications.

Furthermore, we will not take legal action against or suspend or terminate access to the site or services of those who discover and report security vulnerabilities in accordance with this policy because of the fact.

Expand All @@ -42,4 +42,4 @@ We ask that all users and contributors respect this policy and the security of o
## Changes to this Security Policy
This policy may be revised from time to time. Each version of the policy will be identified at the top of the page by its effective date.

If you have any questions about this Security Policy, please contact us at [[email protected]](mailto:[email protected]).
If you have any questions about this Security Policy, please contact us at [[email protected]](mailto:[email protected])
12 changes: 11 additions & 1 deletion manifests/indexer.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,19 @@
$jvm_options_memory = '1g',
) {

# assign version according to the package manager
case $facts['os']['family'] {
'Debian': {
$indexer_version_install = "${indexer_version}-*"
}
'Linux', 'RedHat', default: {
$indexer_version_install = $indexer_version
}
}

# install package
package { 'wazuh-indexer':
ensure => $indexer_version,
ensure => $indexer_version_install,
name => $indexer_package,
}

Expand Down
12 changes: 11 additions & 1 deletion manifests/manager.pp
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,20 @@
fail('The ossec module does not yet support installing the OSSEC HIDS server on Windows')
}

# assign version according to the package manager
case $facts['os']['family'] {
'Debian': {
$server_version_install = "${server_package_version}-*"
}
'Linux', 'RedHat', default: {
$server_version_install = $server_package_version
}
}

# Install and configure Wazuh-manager package

package { $wazuh::params_manager::server_package:
ensure => $server_package_version, # lint:ignore:security_package_pinned_version
ensure => $server_version_install, # lint:ignore:security_package_pinned_version
}

file {
Expand Down
Empty file modified metadata.json
100644 → 100755
Empty file.

0 comments on commit a583f3c

Please sign in to comment.