forked from wazuh/wazuh-docker
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be4c0d69db | ||
|
|
02547b60d8 |
@@ -1,6 +1,6 @@
|
|||||||
WAZUH_VERSION=4.14.7
|
WAZUH_VERSION=4.14.0
|
||||||
WAZUH_IMAGE_VERSION=4.14.7
|
WAZUH_IMAGE_VERSION=4.14.0
|
||||||
WAZUH_TAG_REVISION=1
|
WAZUH_TAG_REVISION=1
|
||||||
FILEBEAT_TEMPLATE_BRANCH=4.14.7
|
FILEBEAT_TEMPLATE_BRANCH=4.14.0
|
||||||
WAZUH_FILEBEAT_MODULE=wazuh-filebeat-0.5.tar.gz
|
WAZUH_FILEBEAT_MODULE=wazuh-filebeat-0.4.tar.gz
|
||||||
WAZUH_UI_REVISION=1
|
WAZUH_UI_REVISION=1
|
||||||
|
|||||||
+15
-1
@@ -34,6 +34,20 @@ file:
|
|||||||
group: wazuh
|
group: wazuh
|
||||||
filetype: file
|
filetype: file
|
||||||
contains: []
|
contains: []
|
||||||
|
/var/ossec/etc/sslmanager.cert:
|
||||||
|
exists: true
|
||||||
|
mode: "0640"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
filetype: file
|
||||||
|
contains: []
|
||||||
|
/var/ossec/etc/sslmanager.key:
|
||||||
|
exists: true
|
||||||
|
mode: "0640"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
filetype: file
|
||||||
|
contains: []
|
||||||
package:
|
package:
|
||||||
filebeat:
|
filebeat:
|
||||||
installed: true
|
installed: true
|
||||||
@@ -42,7 +56,7 @@ package:
|
|||||||
wazuh-manager:
|
wazuh-manager:
|
||||||
installed: true
|
installed: true
|
||||||
versions:
|
versions:
|
||||||
- 4.14.7
|
- 4.14.0
|
||||||
port:
|
port:
|
||||||
tcp:1514:
|
tcp:1514:
|
||||||
listening: true
|
listening: true
|
||||||
|
|||||||
@@ -1,305 +0,0 @@
|
|||||||
run-name: (4.x) Build and push images - ${{ inputs.dev && 'dev' || 'release' }} - ${{ inputs.id }}
|
|
||||||
name: (4.x) Build and push images
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
image_tag:
|
|
||||||
description: 'Docker image tag'
|
|
||||||
default: '4.14.7'
|
|
||||||
required: true
|
|
||||||
docker_reference:
|
|
||||||
description: 'wazuh-docker reference'
|
|
||||||
required: true
|
|
||||||
filebeat_module_version:
|
|
||||||
description: 'Filebeat module version'
|
|
||||||
default: '0.5'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
products:
|
|
||||||
description: 'Comma-separated list of the image names to build and push'
|
|
||||||
default: 'wazuh-manager,wazuh-dashboard,wazuh-indexer,wazuh-agent'
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
revision:
|
|
||||||
description: 'Package revision'
|
|
||||||
default: '1'
|
|
||||||
required: true
|
|
||||||
id:
|
|
||||||
description: "ID used to identify the workflow uniquely."
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
dev:
|
|
||||||
description: "Add tag suffix '-dev' to the image tag ?"
|
|
||||||
type: boolean
|
|
||||||
default: true
|
|
||||||
required: false
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
image_tag:
|
|
||||||
description: 'Docker image tag'
|
|
||||||
default: '4.14.7'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
docker_reference:
|
|
||||||
description: 'wazuh-docker reference'
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
filebeat_module_version:
|
|
||||||
description: 'Filebeat module version'
|
|
||||||
default: '0.5'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
products:
|
|
||||||
description: 'Comma-separated list of the image names to build and push'
|
|
||||||
default: 'wazuh-manager,wazuh-dashboard,wazuh-indexer,wazuh-agent'
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
revision:
|
|
||||||
description: 'Package revision'
|
|
||||||
default: '1'
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
id:
|
|
||||||
description: "ID used to identify the workflow uniquely."
|
|
||||||
type: string
|
|
||||||
required: false
|
|
||||||
dev:
|
|
||||||
description: "Add tag suffix '-dev' to the image tag ?"
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
required: false
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
setup:
|
|
||||||
runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }}
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
id-token: write
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
env:
|
|
||||||
IMAGE_REGISTRY: ${{ inputs.dev && vars.IMAGE_REGISTRY_DEV || vars.IMAGE_REGISTRY_PROD }}
|
|
||||||
IMAGE_TAG: ${{ inputs.image_tag }}
|
|
||||||
FILEBEAT_MODULE_VERSION: ${{ inputs.filebeat_module_version }}
|
|
||||||
REVISION: ${{ inputs.revision }}
|
|
||||||
|
|
||||||
outputs:
|
|
||||||
WAZUH_COMPONENTS: ${{ steps.compute-outputs.outputs.WAZUH_COMPONENTS }}
|
|
||||||
ALL_PRODUCTS_SELECTED: ${{ steps.compute-outputs.outputs.ALL_PRODUCTS_SELECTED }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Print inputs
|
|
||||||
run: |
|
|
||||||
echo "---------------------------------------------"
|
|
||||||
echo "Running 4_build_and_push_images workflow"
|
|
||||||
echo "---------------------------------------------"
|
|
||||||
echo "* BRANCH: ${{ github.ref }}"
|
|
||||||
echo "* COMMIT: ${{ github.sha }}"
|
|
||||||
echo "---------------------------------------------"
|
|
||||||
echo "Inputs provided:"
|
|
||||||
echo "---------------------------------------------"
|
|
||||||
echo "* id: ${{ inputs.id }}"
|
|
||||||
echo "* image_tag: ${{ inputs.image_tag }}"
|
|
||||||
echo "* docker_reference: ${{ inputs.docker_reference }}"
|
|
||||||
echo "* filebeat_module_version: ${{ inputs.filebeat_module_version }}"
|
|
||||||
echo "* products: ${{ inputs.products }}"
|
|
||||||
echo "* revision: ${{ inputs.revision }}"
|
|
||||||
echo "* dev: ${{ inputs.dev }}"
|
|
||||||
echo "---------------------------------------------"
|
|
||||||
|
|
||||||
- name: Set up variables
|
|
||||||
id: compute-outputs
|
|
||||||
run: |
|
|
||||||
# Use the default list if products is empty
|
|
||||||
PRODUCTS="${{ inputs.products }}"
|
|
||||||
if [[ -z "$PRODUCTS" || "$PRODUCTS" == "null" ]]; then
|
|
||||||
PRODUCTS="wazuh-manager,wazuh-dashboard,wazuh-indexer,wazuh-agent"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if all 4 core components are present in the string
|
|
||||||
if [[ "$PRODUCTS" == *"wazuh-manager"* && "$PRODUCTS" == *"wazuh-dashboard"* && "$PRODUCTS" == *"wazuh-indexer"* && "$PRODUCTS" == *"wazuh-agent"* ]]; then
|
|
||||||
echo "ALL_PRODUCTS_SELECTED=true" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "ALL_PRODUCTS_SELECTED=false" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Convert to JSON for the matrix (Your existing logic)
|
|
||||||
IFS=',' read -ra COMPONENTS <<< "$PRODUCTS"
|
|
||||||
JSON_ARRAY=$(printf '%s\n' "${COMPONENTS[@]}" | jq -R . | jq -s -c .)
|
|
||||||
echo "WAZUH_COMPONENTS=$JSON_ARRAY" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
build-and-push:
|
|
||||||
runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }}
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
id-token: write
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
needs:
|
|
||||||
- setup
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false # all jobs will run even if one fails
|
|
||||||
matrix:
|
|
||||||
wazuh_component: ${{ fromJson(needs.setup.outputs.WAZUH_COMPONENTS) }}
|
|
||||||
|
|
||||||
env:
|
|
||||||
IMAGE_REGISTRY: ${{ inputs.dev && vars.IMAGE_REGISTRY_DEV || vars.IMAGE_REGISTRY_PROD }}
|
|
||||||
IMAGE_TAG: ${{ inputs.image_tag }}
|
|
||||||
REVISION: ${{ inputs.revision }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
ref: ${{ inputs.docker_reference }}
|
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
uses: docker/login-action@v4
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v4
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v4
|
|
||||||
|
|
||||||
- name: Configure aws credentials
|
|
||||||
if: ${{ inputs.dev == true }}
|
|
||||||
uses: aws-actions/configure-aws-credentials@v6
|
|
||||||
with:
|
|
||||||
role-to-assume: ${{ secrets.AWS_IAM_DOCKER_ROLE }}
|
|
||||||
aws-region: "${{ secrets.AWS_REGION }}"
|
|
||||||
|
|
||||||
- name: Log in to Amazon ECR
|
|
||||||
if: ${{ inputs.dev == true }}
|
|
||||||
uses: aws-actions/amazon-ecr-login@v2
|
|
||||||
|
|
||||||
- name: Build Wazuh images
|
|
||||||
run: |
|
|
||||||
IMAGE_TAG="${{ inputs.image_tag }}"
|
|
||||||
FILEBEAT_MODULE_VERSION=${{ inputs.filebeat_module_version }}
|
|
||||||
REVISION=${{ inputs.revision }}
|
|
||||||
|
|
||||||
if [[ "$IMAGE_TAG" == *"-"* ]]; then
|
|
||||||
IFS='-' read -r -a tokens <<< "$IMAGE_TAG"
|
|
||||||
if [ -z "${tokens[1]}" ]; then
|
|
||||||
echo "Invalid image tag: $IMAGE_TAG"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
DEV_STAGE=${tokens[1]}
|
|
||||||
WAZUH_VER=${tokens[0]}
|
|
||||||
./build-images.sh -v $WAZUH_VER -r $REVISION -d $DEV_STAGE -f $FILEBEAT_MODULE_VERSION -rg $IMAGE_REGISTRY -m -c ${{ matrix.wazuh_component }}
|
|
||||||
else
|
|
||||||
./build-images.sh -v $IMAGE_TAG -r $REVISION -f $FILEBEAT_MODULE_VERSION -rg $IMAGE_REGISTRY -m -c ${{ matrix.wazuh_component }}
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Save .env file (generated by build-images.sh) contents to $GITHUB_ENV
|
|
||||||
ENV_FILE_PATH="../.env"
|
|
||||||
|
|
||||||
if [ -f $ENV_FILE_PATH ]; then
|
|
||||||
while IFS= read -r line || [ -n "$line" ]; do
|
|
||||||
echo "$line" >> $GITHUB_ENV
|
|
||||||
done < $ENV_FILE_PATH
|
|
||||||
else
|
|
||||||
echo "The environment file $ENV_FILE_PATH does not exist!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
working-directory: ./build-docker-images
|
|
||||||
|
|
||||||
|
|
||||||
notify:
|
|
||||||
runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }}
|
|
||||||
needs: [setup, build-and-push]
|
|
||||||
# Only run if NOT dev AND all products were selected
|
|
||||||
if: ${{ inputs.dev == false && needs.setup.outputs.ALL_PRODUCTS_SELECTED == 'true' }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Image exists validation
|
|
||||||
id: validation
|
|
||||||
run: |
|
|
||||||
IMAGE_TAG=${{ inputs.image_tag }}
|
|
||||||
IMAGE_REGISTRY="${{ vars.IMAGE_REGISTRY_PROD }}"
|
|
||||||
PURPOSE=""
|
|
||||||
|
|
||||||
if [[ "$IMAGE_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
||||||
if docker manifest inspect $IMAGE_REGISTRY/wazuh/wazuh-manager:$IMAGE_TAG > /dev/null 2>&1; then
|
|
||||||
PURPOSE="regeneration"
|
|
||||||
echo "Image wazuh/wazuh-manager:$IMAGE_TAG exists. Setting PURPOSE to 'regeneration'"
|
|
||||||
else
|
|
||||||
PURPOSE="new release"
|
|
||||||
echo "Image wazuh/wazuh-manager:$IMAGE_TAG does NOT exist. Setting PURPOSE to 'new release'"
|
|
||||||
fi
|
|
||||||
echo "✅ Release tag: '$IMAGE_TAG'"
|
|
||||||
elif [[ "$IMAGE_TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+-(alpha|beta|rc)[0-9]+$ ]]; then
|
|
||||||
PURPOSE="new stage"
|
|
||||||
echo "✅ Stage tag: '$IMAGE_TAG'. Setting PURPOSE to 'new stage'"
|
|
||||||
else
|
|
||||||
echo "❌ No release or stage tag ('$IMAGE_TAG'), the GH issue will not be created"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "purpose=$PURPOSE" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: GH issue notification
|
|
||||||
if: ${{ steps.validation.outputs.purpose != '' }}
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.NOTIFICATION_GH_ARTIFACT_TOKEN }}
|
|
||||||
run: |
|
|
||||||
IMAGE_TAG=${{ inputs.image_tag }}
|
|
||||||
PURPOSE="${{ steps.validation.outputs.purpose }}"
|
|
||||||
|
|
||||||
GH_TITLE=""
|
|
||||||
GH_MESSAGE=""
|
|
||||||
|
|
||||||
## Setting GH issue title
|
|
||||||
GH_TITLE="Artifactory vulnerabilities update \`v$IMAGE_TAG\`"
|
|
||||||
|
|
||||||
## Setting GH issue body
|
|
||||||
GH_MESSAGE=$(cat <<- EOF | tr -d '\r' | sed 's/^[[:space:]]*//'
|
|
||||||
### Description
|
|
||||||
- [ ] Update the [Artifactory vulnerabilities](${{ secrets.NOTIFICATION_SHEET_URL }}) sheet with the \`v$IMAGE_TAG\` vulnerabilities.
|
|
||||||
|
|
||||||
**Purpose**: $PURPOSE
|
|
||||||
>[!NOTE]
|
|
||||||
>To update the \`Tentative Release\` column, follow these steps:
|
|
||||||
https://github.com/wazuh/${{ secrets.NOTIFICATION_REPO }}/issues/2049#issuecomment-2671590268
|
|
||||||
EOF
|
|
||||||
)
|
|
||||||
|
|
||||||
# Print the GH Variables content
|
|
||||||
echo "--- Variable Content ---"
|
|
||||||
echo "$GH_TITLE"
|
|
||||||
echo "------------------------"
|
|
||||||
|
|
||||||
echo "--- Variable Content ---"
|
|
||||||
echo "$GH_MESSAGE"
|
|
||||||
echo "------------------------"
|
|
||||||
|
|
||||||
## GH issue creation
|
|
||||||
ISSUE_URL=$(gh issue create \
|
|
||||||
-R wazuh/${{ secrets.NOTIFICATION_REPO }} \
|
|
||||||
--title "$GH_TITLE" \
|
|
||||||
--body "$GH_MESSAGE" \
|
|
||||||
--label "level/task" \
|
|
||||||
--label "type/maintenance" \
|
|
||||||
--label "request/operational")
|
|
||||||
|
|
||||||
## Adding the issue to the team project
|
|
||||||
PROJECT_ITEM_ID=$(gh project item-add \
|
|
||||||
${{ secrets.NOTIFICATION_PROJECT_NUMBER }} \
|
|
||||||
--url $ISSUE_URL \
|
|
||||||
--owner wazuh \
|
|
||||||
--format json \
|
|
||||||
| jq -r '.id')
|
|
||||||
|
|
||||||
## Setting Objective
|
|
||||||
gh project item-edit --id $PROJECT_ITEM_ID --project-id ${{ secrets.NOTIFICATION_PROJECT_ID }} --field-id ${{ secrets.NOTIFICATION_PROJECT_OBJECTIVE_ID }} --text "Security scans"
|
|
||||||
## Setting Priority
|
|
||||||
gh project item-edit --id $PROJECT_ITEM_ID --project-id ${{ secrets.NOTIFICATION_PROJECT_ID }} --field-id ${{ secrets.NOTIFICATION_PROJECT_PRIORITY_ID }} --single-select-option-id ${{ secrets.NOTIFICATION_PROJECT_PRIORITY_OPTION_ID }}
|
|
||||||
## Setting Size
|
|
||||||
gh project item-edit --id $PROJECT_ITEM_ID --project-id ${{ secrets.NOTIFICATION_PROJECT_ID }} --field-id ${{ secrets.NOTIFICATION_PROJECT_SIZE_ID }} --single-select-option-id ${{ secrets.NOTIFICATION_PROJECT_SIZE_OPTION_ID }}
|
|
||||||
## Setting Subteam
|
|
||||||
gh project item-edit --id $PROJECT_ITEM_ID --project-id ${{ secrets.NOTIFICATION_PROJECT_ID }} --field-id ${{ secrets.NOTIFICATION_PROJECT_SUBTEAM_ID }} --single-select-option-id ${{ secrets.NOTIFICATION_PROJECT_SUBTEAM_OPTION_ID }}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: (4.x) Repository bumper
|
name: Repository bumper
|
||||||
run-name: Bump ${{ github.ref_name }} (${{ inputs.id }})
|
run-name: Bump ${{ github.ref_name }} (${{ inputs.id }})
|
||||||
|
|
||||||
on:
|
on:
|
||||||
@@ -31,7 +31,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
bump:
|
bump:
|
||||||
name: Repository bumper
|
name: Repository bumper
|
||||||
runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }}
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
@@ -70,7 +70,7 @@ jobs:
|
|||||||
export GPG_TTY=$(tty)
|
export GPG_TTY=$(tty)
|
||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
# Using workflow-specific GITHUB_TOKEN because currently CI_WAZUHCI_BUMPER_TOKEN
|
# Using workflow-specific GITHUB_TOKEN because currently CI_WAZUHCI_BUMPER_TOKEN
|
||||||
# doesn't have all the necessary permissions
|
# doesn't have all the necessary permissions
|
||||||
@@ -110,21 +110,13 @@ jobs:
|
|||||||
bash ${{ env.BUMP_SCRIPT_PATH }} ${{ steps.vars.outputs.script_params }}
|
bash ${{ env.BUMP_SCRIPT_PATH }} ${{ steps.vars.outputs.script_params }}
|
||||||
|
|
||||||
- name: Commit and push changes
|
- name: Commit and push changes
|
||||||
id: bump_commit
|
|
||||||
run: |
|
run: |
|
||||||
git add .
|
git add .
|
||||||
if git diff --staged --quiet; then
|
git commit -m "feat: bump ${{ github.ref_name }}"
|
||||||
echo "Nothing to bump: the repository is already at the requested version/stage. Skipping commit."
|
git push origin ${{ steps.vars.outputs.branch_name }}
|
||||||
echo "has_changes=false" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
git commit -m "feat: bump ${{ github.ref_name }}"
|
|
||||||
git push origin ${{ steps.vars.outputs.branch_name }}
|
|
||||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Create pull request
|
- name: Create pull request
|
||||||
id: create_pr
|
id: create_pr
|
||||||
if: steps.bump_commit.outputs.has_changes == 'true'
|
|
||||||
run: |
|
run: |
|
||||||
gh auth setup-git
|
gh auth setup-git
|
||||||
PR_URL=$(gh pr create \
|
PR_URL=$(gh pr create \
|
||||||
@@ -137,19 +129,14 @@ jobs:
|
|||||||
echo "pull_request_url=${PR_URL}" >> $GITHUB_OUTPUT
|
echo "pull_request_url=${PR_URL}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Merge pull request
|
- name: Merge pull request
|
||||||
if: steps.bump_commit.outputs.has_changes == 'true'
|
|
||||||
run: |
|
run: |
|
||||||
# Any checks for the PR are bypassed since the branch is expected to be functional (i.e. the bump process does not introduce any bugs)
|
# Any checks for the PR are bypassed since the branch is expected to be functional (i.e. the bump process does not introduce any bugs)
|
||||||
gh pr merge "${{ steps.create_pr.outputs.pull_request_url }}" --merge --admin
|
gh pr merge "${{ steps.create_pr.outputs.pull_request_url }}" --merge --admin
|
||||||
|
|
||||||
- name: Show logs
|
- name: Show logs
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ steps.bump_commit.outputs.has_changes }}" == "true" ]]; then
|
echo "Bump complete."
|
||||||
echo "Bump complete."
|
echo "Branch: ${{ steps.vars.outputs.branch_name }}"
|
||||||
echo "Branch: ${{ steps.vars.outputs.branch_name }}"
|
echo "PR: ${{ steps.create_pr.outputs.pull_request_url }}"
|
||||||
echo "PR: ${{ steps.create_pr.outputs.pull_request_url }}"
|
|
||||||
else
|
|
||||||
echo "Bump skipped: the repository is already at the requested version/stage."
|
|
||||||
fi
|
|
||||||
echo "Bumper scripts logs:"
|
echo "Bumper scripts logs:"
|
||||||
cat ${BUMP_LOG_PATH}/repository_bumper*log
|
cat ${BUMP_LOG_PATH}/repository_bumper*log
|
||||||
|
|||||||
@@ -0,0 +1,159 @@
|
|||||||
|
run-name: Launch Push Docker Images - ${{ inputs.id }}
|
||||||
|
name: Push Docker Images
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
image_tag:
|
||||||
|
description: 'Docker image tag'
|
||||||
|
default: '4.14.0'
|
||||||
|
required: true
|
||||||
|
docker_reference:
|
||||||
|
description: 'wazuh-docker reference'
|
||||||
|
required: true
|
||||||
|
products:
|
||||||
|
description: 'Comma-separated list of the image names to build and push'
|
||||||
|
default: 'wazuh-manager,wazuh-dashboard,wazuh-indexer,wazuh-agent'
|
||||||
|
required: true
|
||||||
|
filebeat_module_version:
|
||||||
|
description: 'Filebeat module version'
|
||||||
|
default: '0.4'
|
||||||
|
required: true
|
||||||
|
revision:
|
||||||
|
description: 'Package revision'
|
||||||
|
default: '1'
|
||||||
|
required: true
|
||||||
|
push_images:
|
||||||
|
description: 'Push images'
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
required: true
|
||||||
|
id:
|
||||||
|
description: "ID used to identify the workflow uniquely."
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
dev:
|
||||||
|
description: "Add tag suffix '-dev' to the image tag ?"
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
required: false
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
image_tag:
|
||||||
|
description: 'Docker image tag'
|
||||||
|
default: '4.14.0'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
docker_reference:
|
||||||
|
description: 'wazuh-docker reference'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
products:
|
||||||
|
description: 'Comma-separated list of the image names to build and push'
|
||||||
|
default: 'wazuh-manager,wazuh-dashboard,wazuh-indexer,wazuh-agent'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
filebeat_module_version:
|
||||||
|
description: 'Filebeat module version'
|
||||||
|
default: '0.4'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
revision:
|
||||||
|
description: 'Package revision'
|
||||||
|
default: '1'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
push_images:
|
||||||
|
description: 'Push images'
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
required: true
|
||||||
|
id:
|
||||||
|
description: "ID used to identify the workflow uniquely."
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
dev:
|
||||||
|
description: "Add tag suffix '-dev' to the image tag ?"
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
required: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Print inputs
|
||||||
|
run: |
|
||||||
|
echo "---------------------------------------------"
|
||||||
|
echo "Running Procedure_push_docker_images workflow"
|
||||||
|
echo "---------------------------------------------"
|
||||||
|
echo "* BRANCH: ${{ github.ref }}"
|
||||||
|
echo "* COMMIT: ${{ github.sha }}"
|
||||||
|
echo "---------------------------------------------"
|
||||||
|
echo "Inputs provided:"
|
||||||
|
echo "---------------------------------------------"
|
||||||
|
echo "* id: ${{ inputs.id }}"
|
||||||
|
echo "* image_tag: ${{ inputs.image_tag }}"
|
||||||
|
echo "* docker_reference: ${{ inputs.docker_reference }}"
|
||||||
|
echo "* products: ${{ inputs.products }}"
|
||||||
|
echo "* filebeat_module_version: ${{ inputs.filebeat_module_version }}"
|
||||||
|
echo "* revision: ${{ inputs.revision }}"
|
||||||
|
echo "* push_images: ${{ inputs.push_images }}"
|
||||||
|
echo "* dev: ${{ inputs.dev }}"
|
||||||
|
echo "---------------------------------------------"
|
||||||
|
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.docker_reference }}
|
||||||
|
|
||||||
|
- name: Log in to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build Wazuh images
|
||||||
|
run: |
|
||||||
|
IMAGE_TAG=${{ inputs.image_tag }}
|
||||||
|
FILEBEAT_MODULE_VERSION=${{ inputs.filebeat_module_version }}
|
||||||
|
REVISION=${{ inputs.revision }}
|
||||||
|
|
||||||
|
if [[ "$IMAGE_TAG" == *"-"* ]]; then
|
||||||
|
IFS='-' read -r -a tokens <<< "$IMAGE_TAG"
|
||||||
|
if [ -z "${tokens[1]}" ]; then
|
||||||
|
echo "Invalid image tag: $IMAGE_TAG"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
DEV_STAGE=${tokens[1]}
|
||||||
|
WAZUH_VER=${tokens[0]}
|
||||||
|
./build-docker-images/build-images.sh -v $WAZUH_VER -r $REVISION -d $DEV_STAGE -f $FILEBEAT_MODULE_VERSION
|
||||||
|
else
|
||||||
|
./build-docker-images/build-images.sh -v $IMAGE_TAG -r $REVISION -f $FILEBEAT_MODULE_VERSION
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Save .env file (generated by build-images.sh) contents to $GITHUB_ENV
|
||||||
|
ENV_FILE_PATH=".env"
|
||||||
|
|
||||||
|
if [ -f $ENV_FILE_PATH ]; then
|
||||||
|
while IFS= read -r line || [ -n "$line" ]; do
|
||||||
|
echo "$line" >> $GITHUB_ENV
|
||||||
|
done < $ENV_FILE_PATH
|
||||||
|
else
|
||||||
|
echo "The environment file $ENV_FILE_PATH does not exist!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Tag and Push Wazuh images
|
||||||
|
if: ${{ inputs.push_images }}
|
||||||
|
run: |
|
||||||
|
IMAGE_TAG="${{ inputs.image_tag }}$( [ "${{ inputs.dev }}" == "true" ] && echo '-dev' || true )"
|
||||||
|
IMAGE_NAMES=${{ inputs.products }}
|
||||||
|
IFS=',' read -r -a images <<< "$IMAGE_NAMES"
|
||||||
|
for image in "${images[@]}"; do
|
||||||
|
echo "Tagging and pushing wazuh/$image:${WAZUH_VERSION} to wazuh/$image:$IMAGE_TAG"
|
||||||
|
docker tag wazuh/$image:${WAZUH_VERSION} wazuh/$image:$IMAGE_TAG
|
||||||
|
echo "Pushing wazuh/$image:$IMAGE_TAG ..."
|
||||||
|
docker push wazuh/$image:$IMAGE_TAG
|
||||||
|
done
|
||||||
@@ -1,42 +1,17 @@
|
|||||||
name: (4.x) Docker PR check
|
name: Wazuh Docker pipeline
|
||||||
|
|
||||||
on:
|
on: [pull_request]
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, reopened, ready_for_review]
|
|
||||||
branches:
|
|
||||||
- 4.*
|
|
||||||
paths:
|
|
||||||
- 'build-docker-images/**'
|
|
||||||
- 'multi-node/**'
|
|
||||||
- 'single-node/**'
|
|
||||||
- 'wazuh-agent/**'
|
|
||||||
- '.github/**'
|
|
||||||
|
|
||||||
env:
|
|
||||||
ARTIFACTS_LOCAL_DIR: /home/runner/work/wazuh-docker/wazuh-docker/docker-images
|
|
||||||
ARTIFACT_NAMES: |
|
|
||||||
wazuh-manager.tar
|
|
||||||
wazuh-indexer.tar
|
|
||||||
wazuh-dashboard.tar
|
|
||||||
wazuh-agent.tar
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-docker-images:
|
build-docker-images:
|
||||||
runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }}
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
|
||||||
uses: docker/login-action@v4
|
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build Wazuh images
|
- name: Build Wazuh images
|
||||||
run: ./build-images.sh
|
run: build-docker-images/build-images.sh
|
||||||
working-directory: ./build-docker-images
|
|
||||||
|
|
||||||
- name: Create enviroment variables
|
- name: Create enviroment variables
|
||||||
run: cat .env > $GITHUB_ENV
|
run: cat .env > $GITHUB_ENV
|
||||||
@@ -49,50 +24,82 @@ jobs:
|
|||||||
docker save wazuh/wazuh-dashboard:${{env.WAZUH_IMAGE_VERSION}} -o /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-dashboard.tar
|
docker save wazuh/wazuh-dashboard:${{env.WAZUH_IMAGE_VERSION}} -o /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-dashboard.tar
|
||||||
docker save wazuh/wazuh-agent:${{env.WAZUH_IMAGE_VERSION}} -o /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-agent.tar
|
docker save wazuh/wazuh-agent:${{env.WAZUH_IMAGE_VERSION}} -o /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-agent.tar
|
||||||
|
|
||||||
- name: Temporarily save Wazuh Docker images
|
- name: Temporarily save Wazuh manager Docker image
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: docker-artifact-manager
|
||||||
|
path: /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-manager.tar
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
- name: Temporarily save Wazuh indexer Docker image
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: docker-artifact-indexer
|
||||||
|
path: /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-indexer.tar
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
- name: Temporarily save Wazuh dashboard Docker image
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: docker-artifact-dashboard
|
||||||
|
path: /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-dashboard.tar
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
- name: Temporarily save Wazuh agent Docker image
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: docker-artifact-agent
|
||||||
|
path: /home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-agent.tar
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
- name: Install Goss
|
||||||
|
uses: e1himself/goss-installation-action@v1.0.3
|
||||||
|
with:
|
||||||
|
version: v0.3.16
|
||||||
|
|
||||||
|
- name: Execute Goss tests (wazuh-manager)
|
||||||
|
run: dgoss run wazuh/wazuh-manager:${{env.WAZUH_IMAGE_VERSION}}
|
||||||
env:
|
env:
|
||||||
S3_ARTIFACTS_PATH: ${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/4_pr_check/${{ github.run_id }}
|
GOSS_SLEEP: 30
|
||||||
run: |
|
GOSS_FILE: .github/.goss.yaml
|
||||||
echo "Uploading Docker image artifacts to S3..."
|
|
||||||
while IFS= read -r artifact; do
|
|
||||||
[ -z "$artifact" ] && continue
|
|
||||||
echo " Uploading: $artifact"
|
|
||||||
aws s3 cp "${ARTIFACTS_LOCAL_DIR}/${artifact}" "${S3_ARTIFACTS_PATH}/${artifact}"
|
|
||||||
done <<< "$ARTIFACT_NAMES"
|
|
||||||
echo "All artifacts uploaded successfully."
|
|
||||||
|
|
||||||
check-single-node:
|
check-single-node:
|
||||||
runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }}
|
runs-on: ubuntu-22.04
|
||||||
needs: build-docker-images
|
needs: build-docker-images
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Create enviroment variables
|
- name: Create enviroment variables
|
||||||
run: cat .env > $GITHUB_ENV
|
run: cat .env > $GITHUB_ENV
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
- name: Retrieve saved Wazuh indexer Docker image
|
||||||
uses: docker/login-action@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
name: docker-artifact-indexer
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Retrieve saved Wazuh Docker images and load them into Docker
|
- name: Retrieve saved Wazuh manager Docker image
|
||||||
env:
|
uses: actions/download-artifact@v4
|
||||||
S3_ARTIFACTS_PATH: s3://${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/4_pr_check/${{ github.run_id }}
|
with:
|
||||||
ARTIFACTS_LOCAL_DIR: /home/runner/work/wazuh-docker/wazuh-docker/docker-images
|
name: docker-artifact-manager
|
||||||
|
|
||||||
|
- name: Retrieve saved Wazuh dashboard Docker image
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: docker-artifact-dashboard
|
||||||
|
|
||||||
|
- name: Retrieve saved Wazuh agent Docker image
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: docker-artifact-agent
|
||||||
|
|
||||||
|
- name: Docker load
|
||||||
run: |
|
run: |
|
||||||
mkdir -p "${ARTIFACTS_LOCAL_DIR}"
|
docker load --input ./wazuh-indexer.tar
|
||||||
echo "Downloading and loading Docker image artifacts from S3..."
|
docker load --input ./wazuh-dashboard.tar
|
||||||
while IFS= read -r artifact; do
|
docker load --input ./wazuh-manager.tar
|
||||||
[ -z "$artifact" ] && continue
|
docker load --input ./wazuh-agent.tar
|
||||||
echo " Downloading: $artifact"
|
|
||||||
aws s3 cp "${S3_ARTIFACTS_PATH}/${artifact}" "${ARTIFACTS_LOCAL_DIR}/${artifact}"
|
|
||||||
echo " Loading into Docker: $artifact"
|
|
||||||
docker load -i "${ARTIFACTS_LOCAL_DIR}/${artifact}"
|
|
||||||
done <<< "$ARTIFACT_NAMES"
|
|
||||||
echo "All artifacts downloaded and loaded successfully."
|
|
||||||
|
|
||||||
- name: Create single node certficates
|
- name: Create single node certficates
|
||||||
run: docker compose -f single-node/generate-indexer-certs.yml run --rm generator
|
run: docker compose -f single-node/generate-indexer-certs.yml run --rm generator
|
||||||
@@ -130,6 +137,17 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Check documents into wazuh-alerts index
|
||||||
|
run: |
|
||||||
|
sleep 120
|
||||||
|
docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_count" -u admin:SecretPassword -k -s | jq -r ".count"`"
|
||||||
|
if [[ $docs -gt 0 ]]; then
|
||||||
|
echo "wazuh-alerts index documents: ${docs}"
|
||||||
|
else
|
||||||
|
echo "wazuh-alerts index documents: ${docs}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Check Wazuh templates
|
- name: Check Wazuh templates
|
||||||
run: |
|
run: |
|
||||||
qty_templates="`curl -XGET "https://0.0.0.0:9200/_cat/templates" -u admin:SecretPassword -k -s | grep -P "wazuh|wazuh-agent|wazuh-statistics" | wc -l`"
|
qty_templates="`curl -XGET "https://0.0.0.0:9200/_cat/templates" -u admin:SecretPassword -k -s | grep -P "wazuh|wazuh-agent|wazuh-statistics" | wc -l`"
|
||||||
@@ -183,52 +201,50 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TOKEN: $(curl -s -u wazuh-wui:MyS3cr37P450r.*- -k -X GET "https://0.0.0.0:55000/security/user/authenticate?raw=true")
|
TOKEN: $(curl -s -u wazuh-wui:MyS3cr37P450r.*- -k -X GET "https://0.0.0.0:55000/security/user/authenticate?raw=true")
|
||||||
|
|
||||||
- name: Check documents into wazuh-alerts index
|
|
||||||
run: |
|
|
||||||
sleep 120
|
|
||||||
docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_count" -u admin:SecretPassword -k -s | jq -r ".count"`"
|
|
||||||
if [[ $docs -gt 0 ]]; then
|
|
||||||
echo "wazuh-alerts index documents: ${docs}"
|
|
||||||
else
|
|
||||||
echo "wazuh-alerts index documents: ${docs}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Check errors in ossec.log for Wazuh manager
|
- name: Check errors in ossec.log for Wazuh manager
|
||||||
run: ./.github/single-node-log-check.sh
|
run: ./.github/single-node-log-check.sh
|
||||||
|
|
||||||
check-multi-node:
|
check-multi-node:
|
||||||
runs-on: codebuild-github-actions-codebuild-runner-devops-amd-${{ github.run_id }}-${{ github.run_attempt }}
|
runs-on: ubuntu-22.04
|
||||||
needs: build-docker-images
|
needs: build-docker-images
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Create enviroment variables
|
- name: Create enviroment variables
|
||||||
run: cat .env > $GITHUB_ENV
|
run: cat .env > $GITHUB_ENV
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
- name: free disk space
|
||||||
uses: docker/login-action@v4
|
uses: ./.github/free-disk-space
|
||||||
with:
|
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Retrieve saved Wazuh Docker images and load them into Docker
|
- name: Retrieve saved Wazuh dashboard Docker image
|
||||||
env:
|
uses: actions/download-artifact@v4
|
||||||
S3_ARTIFACTS_PATH: s3://${{ secrets.CI_DEV_INTERNAL_S3_BUCKET }}/wazuh-docker/4_pr_check/${{ github.run_id }}
|
with:
|
||||||
ARTIFACTS_LOCAL_DIR: /home/runner/work/wazuh-docker/wazuh-docker/docker-images
|
name: docker-artifact-dashboard
|
||||||
|
|
||||||
|
- name: Retrieve saved Wazuh manager Docker image
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: docker-artifact-manager
|
||||||
|
|
||||||
|
- name: Retrieve saved Wazuh indexer Docker image
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: docker-artifact-indexer
|
||||||
|
|
||||||
|
- name: Retrieve saved Wazuh agent Docker image
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: docker-artifact-agent
|
||||||
|
|
||||||
|
- name: Docker load
|
||||||
run: |
|
run: |
|
||||||
mkdir -p "${ARTIFACTS_LOCAL_DIR}"
|
docker load --input ./wazuh-manager.tar
|
||||||
echo "Downloading and loading Docker image artifacts from S3..."
|
docker load --input ./wazuh-indexer.tar
|
||||||
while IFS= read -r artifact; do
|
docker load --input ./wazuh-dashboard.tar
|
||||||
[ -z "$artifact" ] && continue
|
docker load --input ./wazuh-agent.tar
|
||||||
echo " Downloading: $artifact"
|
rm -rf wazuh-manager.tar wazuh-indexer.tar wazuh-dashboard.tar wazuh-agent.tar
|
||||||
aws s3 cp "${S3_ARTIFACTS_PATH}/${artifact}" "${ARTIFACTS_LOCAL_DIR}/${artifact}"
|
|
||||||
echo " Loading into Docker: $artifact"
|
|
||||||
docker load -i "${ARTIFACTS_LOCAL_DIR}/${artifact}"
|
|
||||||
done <<< "$ARTIFACT_NAMES"
|
|
||||||
echo "All artifacts downloaded and loaded successfully."
|
|
||||||
|
|
||||||
- name: Create multi node certficates
|
- name: Create multi node certficates
|
||||||
run: docker compose -f multi-node/generate-indexer-certs.yml run --rm generator
|
run: docker compose -f multi-node/generate-indexer-certs.yml run --rm generator
|
||||||
@@ -271,6 +287,23 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Check documents into wazuh-alerts index
|
||||||
|
run: |
|
||||||
|
until [[ $(``curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_count" -u admin:SecretPassword -k -s | jq -r ".count"``) -gt 0 ]]
|
||||||
|
do
|
||||||
|
echo 'Waiting for Wazuh indexer events'
|
||||||
|
free -m
|
||||||
|
df -h
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_count" -u admin:SecretPassword -k -s | jq -r ".count"`"
|
||||||
|
if [[ $docs -gt 0 ]]; then
|
||||||
|
echo "wazuh-alerts index documents: ${docs}"
|
||||||
|
else
|
||||||
|
echo "wazuh-alerts index documents: ${docs}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Check Wazuh templates
|
- name: Check Wazuh templates
|
||||||
run: |
|
run: |
|
||||||
qty_templates="`curl -XGET "https://0.0.0.0:9200/_cat/templates" -u admin:SecretPassword -k -s | grep "wazuh" | wc -l`"
|
qty_templates="`curl -XGET "https://0.0.0.0:9200/_cat/templates" -u admin:SecretPassword -k -s | grep "wazuh" | wc -l`"
|
||||||
@@ -331,22 +364,5 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
TOKEN: $(curl -s -u wazuh-wui:MyS3cr37P450r.*- -k -X GET "https://0.0.0.0:55000/security/user/authenticate?raw=true")
|
TOKEN: $(curl -s -u wazuh-wui:MyS3cr37P450r.*- -k -X GET "https://0.0.0.0:55000/security/user/authenticate?raw=true")
|
||||||
|
|
||||||
- name: Check documents into wazuh-alerts index
|
|
||||||
run: |
|
|
||||||
until [[ $(``curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_count" -u admin:SecretPassword -k -s | jq -r ".count"``) -gt 0 ]]
|
|
||||||
do
|
|
||||||
echo 'Waiting for Wazuh indexer events'
|
|
||||||
free -m
|
|
||||||
df -h
|
|
||||||
sleep 10
|
|
||||||
done
|
|
||||||
docs="`curl -XGET "https://0.0.0.0:9200/wazuh-alerts*/_count" -u admin:SecretPassword -k -s | jq -r ".count"`"
|
|
||||||
if [[ $docs -gt 0 ]]; then
|
|
||||||
echo "wazuh-alerts index documents: ${docs}"
|
|
||||||
else
|
|
||||||
echo "wazuh-alerts index documents: ${docs}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Check errors in ossec.log for Wazuh manager
|
- name: Check errors in ossec.log for Wazuh manager
|
||||||
run: ./.github/multi-node-log-check.sh
|
run: ./.github/multi-node-log-check.sh
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
# This workflow uses actions that are not certified by GitHub.
|
||||||
|
# They are provided by a third-party and are governed by
|
||||||
|
# separate terms of service, privacy policy, and support
|
||||||
|
# documentation.
|
||||||
|
|
||||||
|
name: Trivy scan Wazuh dashboard
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- published
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
schedule:
|
||||||
|
- cron: '34 2 * * 1'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
permissions:
|
||||||
|
contents: read # for actions/checkout to fetch code
|
||||||
|
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
|
||||||
|
|
||||||
|
name: Build images and upload Trivy results
|
||||||
|
runs-on: "ubuntu-22.04"
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Installing dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y jq
|
||||||
|
|
||||||
|
- name: Checkout latest tag
|
||||||
|
run: |
|
||||||
|
latest=$(curl -s "https://api.github.com/repos/wazuh/wazuh-docker/releases/latest" | jq -r '.tag_name')
|
||||||
|
git fetch origin
|
||||||
|
git checkout $latest
|
||||||
|
|
||||||
|
- name: Build Wazuh images
|
||||||
|
run: build-docker-images/build-images.sh
|
||||||
|
|
||||||
|
- name: Create enviroment variables
|
||||||
|
run: |
|
||||||
|
cat .env > $GITHUB_ENV
|
||||||
|
echo "GITHUB_REF_NAME="${GITHUB_REF_NAME%/*} >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Run Trivy vulnerability scanner for Wazuh dashboard
|
||||||
|
uses: aquasecurity/trivy-action@2a2157eb22c08c9a1fac99263430307b8d1bc7a2
|
||||||
|
with:
|
||||||
|
image-ref: 'wazuh/wazuh-dashboard:${{env.WAZUH_IMAGE_VERSION}}'
|
||||||
|
format: 'template'
|
||||||
|
template: '@/contrib/sarif.tpl'
|
||||||
|
output: 'trivy-results-dashboard.sarif'
|
||||||
|
severity: 'LOW,MEDIUM,CRITICAL,HIGH'
|
||||||
|
|
||||||
|
- name: Upload Trivy scan results to GitHub Security tab
|
||||||
|
uses: github/codeql-action/upload-sarif@v2
|
||||||
|
with:
|
||||||
|
sarif_file: 'trivy-results-dashboard.sarif'
|
||||||
|
|
||||||
|
- name: Slack notification
|
||||||
|
uses: rtCamp/action-slack-notify@v2
|
||||||
|
env:
|
||||||
|
SLACK_CHANNEL: cicd-monitoring
|
||||||
|
SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff'
|
||||||
|
#SLACK_ICON: https://github.com/rtCamp.png?size=48
|
||||||
|
SLACK_MESSAGE: "Check the results: https://github.com/wazuh/wazuh-docker/security/code-scanning?query=is%3Aopen+branch%3A${{ env.GITHUB_REF_NAME }}"
|
||||||
|
SLACK_TITLE: Wazuh docker Trivy vulnerability scan finished.
|
||||||
|
SLACK_USERNAME: github_actions
|
||||||
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
# This workflow uses actions that are not certified by GitHub.
|
||||||
|
# They are provided by a third-party and are governed by
|
||||||
|
# separate terms of service, privacy policy, and support
|
||||||
|
# documentation.
|
||||||
|
|
||||||
|
name: Trivy scan Wazuh indexer
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- published
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
schedule:
|
||||||
|
- cron: '34 2 * * 1'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
permissions:
|
||||||
|
contents: read # for actions/checkout to fetch code
|
||||||
|
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
|
||||||
|
|
||||||
|
name: Build images and upload Trivy results
|
||||||
|
runs-on: "ubuntu-22.04"
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Installing dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y jq
|
||||||
|
|
||||||
|
- name: Checkout latest tag
|
||||||
|
run: |
|
||||||
|
latest=$(curl -s "https://api.github.com/repos/wazuh/wazuh-docker/releases/latest" | jq -r '.tag_name')
|
||||||
|
git fetch origin
|
||||||
|
git checkout $latest
|
||||||
|
|
||||||
|
- name: Build Wazuh images
|
||||||
|
run: build-docker-images/build-images.sh
|
||||||
|
|
||||||
|
- name: Create enviroment variables
|
||||||
|
run: |
|
||||||
|
cat .env > $GITHUB_ENV
|
||||||
|
echo "GITHUB_REF_NAME="${GITHUB_REF_NAME%/*} >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Run Trivy vulnerability scanner for Wazuh indexer
|
||||||
|
uses: aquasecurity/trivy-action@2a2157eb22c08c9a1fac99263430307b8d1bc7a2
|
||||||
|
with:
|
||||||
|
image-ref: 'wazuh/wazuh-indexer:${{env.WAZUH_IMAGE_VERSION}}'
|
||||||
|
format: 'template'
|
||||||
|
template: '@/contrib/sarif.tpl'
|
||||||
|
output: 'trivy-results-indexer.sarif'
|
||||||
|
severity: 'LOW,MEDIUM,CRITICAL,HIGH'
|
||||||
|
|
||||||
|
- name: Upload Trivy scan results to GitHub Security tab
|
||||||
|
uses: github/codeql-action/upload-sarif@v2
|
||||||
|
with:
|
||||||
|
sarif_file: 'trivy-results-indexer.sarif'
|
||||||
|
|
||||||
|
- name: Slack notification
|
||||||
|
uses: rtCamp/action-slack-notify@v2
|
||||||
|
env:
|
||||||
|
SLACK_CHANNEL: cicd-monitoring
|
||||||
|
SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff'
|
||||||
|
#SLACK_ICON: https://github.com/rtCamp.png?size=48
|
||||||
|
SLACK_MESSAGE: "Check the results: https://github.com/wazuh/wazuh-docker/security/code-scanning?query=is%3Aopen+branch%3A${{ env.GITHUB_REF_NAME }}"
|
||||||
|
SLACK_TITLE: Wazuh docker Trivy vulnerability scan finished.
|
||||||
|
SLACK_USERNAME: github_actions
|
||||||
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
# This workflow uses actions that are not certified by GitHub.
|
||||||
|
# They are provided by a third-party and are governed by
|
||||||
|
# separate terms of service, privacy policy, and support
|
||||||
|
# documentation.
|
||||||
|
|
||||||
|
name: Trivy scan Wazuh manager
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- published
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
schedule:
|
||||||
|
- cron: '34 2 * * 1'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
permissions:
|
||||||
|
contents: read # for actions/checkout to fetch code
|
||||||
|
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
|
||||||
|
|
||||||
|
name: Build images and upload Trivy results
|
||||||
|
runs-on: "ubuntu-22.04"
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Installing dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y jq
|
||||||
|
|
||||||
|
- name: Checkout latest tag
|
||||||
|
run: |
|
||||||
|
latest=$(curl -s "https://api.github.com/repos/wazuh/wazuh-docker/releases/latest" | jq -r '.tag_name')
|
||||||
|
git fetch origin
|
||||||
|
git checkout $latest
|
||||||
|
|
||||||
|
- name: Build Wazuh images
|
||||||
|
run: build-docker-images/build-images.sh
|
||||||
|
|
||||||
|
- name: Create enviroment variables
|
||||||
|
run: |
|
||||||
|
cat .env > $GITHUB_ENV
|
||||||
|
echo "GITHUB_REF_NAME="${GITHUB_REF_NAME%/*} >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Run Trivy vulnerability scanner for Wazuh manager
|
||||||
|
uses: aquasecurity/trivy-action@2a2157eb22c08c9a1fac99263430307b8d1bc7a2
|
||||||
|
with:
|
||||||
|
image-ref: 'wazuh/wazuh-manager:${{env.WAZUH_IMAGE_VERSION}}'
|
||||||
|
format: 'template'
|
||||||
|
template: '@/contrib/sarif.tpl'
|
||||||
|
output: 'trivy-results-manager.sarif'
|
||||||
|
severity: 'LOW,MEDIUM,CRITICAL,HIGH'
|
||||||
|
|
||||||
|
- name: Upload Trivy scan results to GitHub Security tab
|
||||||
|
uses: github/codeql-action/upload-sarif@v2
|
||||||
|
with:
|
||||||
|
sarif_file: 'trivy-results-manager.sarif'
|
||||||
|
|
||||||
|
- name: Slack notification
|
||||||
|
uses: rtCamp/action-slack-notify@v2
|
||||||
|
env:
|
||||||
|
SLACK_CHANNEL: cicd-monitoring
|
||||||
|
SLACK_COLOR: ${{ job.status }} # or a specific color like 'good' or '#ff00ff'
|
||||||
|
#SLACK_ICON: https://github.com/rtCamp.png?size=48
|
||||||
|
SLACK_MESSAGE: "Check the results: https://github.com/wazuh/wazuh-docker/security/code-scanning?query=is%3Aopen+branch%3A${{ env.GITHUB_REF_NAME }}"
|
||||||
|
SLACK_TITLE: Wazuh docker Trivy vulnerability scan finished.
|
||||||
|
SLACK_USERNAME: github_actions
|
||||||
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
-213
@@ -1,144 +1,6 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## [4.14.7]
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Change upload and download methods ([#2504](https://github.com/wazuh/wazuh-docker/pull/2504))
|
|
||||||
- PR revamp modifications 4.x ([#2445](https://github.com/wazuh/wazuh-docker/pull/2445))
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix bumper workflow failure when bump produces no changes ([#2534](https://github.com/wazuh/wazuh-docker/pull/2534))
|
|
||||||
|
|
||||||
### Deleted
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
## [4.14.6]
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Change runners on repository workflows ([#2470](https://github.com/wazuh/wazuh-docker/pull/2470))
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fixed login in Docker Hub before triggering the QEMU action ([#2494](https://github.com/wazuh/wazuh-docker/pull/2494))
|
|
||||||
- Changed update_user function from wazuh.security to wazuh.rbac.orm module ([#2406](https://github.com/wazuh/wazuh-docker/pull/2406))
|
|
||||||
- GH issue notification fix ([#2312](https://github.com/wazuh/wazuh-docker/pull/2312))
|
|
||||||
|
|
||||||
### Deleted
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
## [4.14.5]
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Updated GitHub actions version for wazuh-docker workflows. ([#2290](https://github.com/wazuh/wazuh-docker/pull/2290))
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Fix WAZUH_AGENT_GROUP variable ([#2262](https://github.com/wazuh/wazuh-docker/pull/2262))
|
|
||||||
- Fix bumper script early exit ([#2261](https://github.com/wazuh/wazuh-docker/pull/2261))
|
|
||||||
|
|
||||||
### Deleted
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
## [4.14.4]
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Backport from 5.0.0: Allow building separate targets #2177 ([#2184](https://github.com/wazuh/wazuh-docker/pull/2184))
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- INDEXER_URL substitution fix ([#2226](https://github.com/wazuh/wazuh-docker/pull/2226))
|
|
||||||
|
|
||||||
### Deleted
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
## [4.14.3]
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Update indexer-certs-gen README.md for clarity on procedure ([#2132](https://github.com/wazuh/wazuh-docker/pull/2132))
|
|
||||||
- Update certs generator image version to 0.0.4 ([#2130](https://github.com/wazuh/wazuh-docker/pull/2130))
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Add IMAGE_TAG stage reference ([#2176](https://github.com/wazuh/wazuh-docker/pull/2176))
|
|
||||||
- Modify run_as parameter value - v4.14.3 ([#2157](https://github.com/wazuh/wazuh-docker/pull/2157))
|
|
||||||
- Adapt Wazuh Agent Dockerfile for multi-architecture support ([#2149](https://github.com/wazuh/wazuh-docker/pull/2149))
|
|
||||||
- Agent group parameter added ([#2127](https://github.com/wazuh/wazuh-docker/pull/2127))
|
|
||||||
- Adapt to multi architecture build ([#2120](https://github.com/wazuh/wazuh-docker/pull/2120))
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Deleted
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
## [4.14.2]
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- Code improvements for 4.14.2 ([#2090](https://github.com/wazuh/wazuh-docker/pull/2090))
|
|
||||||
- Artifactory vulnerabilities notification ([#2078](https://github.com/wazuh/wazuh-docker/pull/2078))
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Filebeat module version update ([#2115](https://github.com/wazuh/wazuh-docker/pull/2115))
|
|
||||||
- The location of the remove command for the wazuh-authd certificates has been changed. ([#2094](https://github.com/wazuh/wazuh-docker/pull/2094))
|
|
||||||
- Removed sslmanager key from the docker manager image to 4.14.2. ([#2093](https://github.com/wazuh/wazuh-docker/pull/2093))
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Add missing SSL ciphers and protocols and remove outdated ports parameters from opensearch.yml template ([#2104](https://github.com/wazuh/wazuh-docker/pull/2104))
|
|
||||||
|
|
||||||
### Deleted
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
## [4.14.1]
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Wazuh cert tool generator improvements ([#2027](https://github.com/wazuh/wazuh-docker/pull/2027))
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Deleted
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
## [4.14.0]
|
## [4.14.0]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -286,81 +148,6 @@ All notable changes to this project will be documented in this file.
|
|||||||
|
|
||||||
- None
|
- None
|
||||||
|
|
||||||
## [4.10.5]
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Change runner name for Codebuild ([#2474](https://github.com/wazuh/wazuh-docker/pull/2474))
|
|
||||||
- PR revamp modifications LTS ([#2449](https://github.com/wazuh/wazuh-docker/pull/2449))
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Deleted
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
## [4.10.4]
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- Removed sslmanager key from the docker manager image. ([#2092](https://github.com/wazuh/wazuh-docker/pull/2092))
|
|
||||||
- Backport 4.13.0 changes: Modify wazuh-keystore use ([#2036](https://github.com/wazuh/wazuh-docker/pull/2036)) \- (wazuh-keystore)
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Changed update_user function from wazuh.security to wazuh.rbac.orm module ([#2405](https://github.com/wazuh/wazuh-docker/pull/2405))
|
|
||||||
- Add wazuh-template.json into permanent data exception ([#1967](https://github.com/wazuh/wazuh-docker/pull/1967))
|
|
||||||
|
|
||||||
### Deleted
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
## [4.10.3]
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Deleted
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
## [4.10.2]
|
|
||||||
|
|
||||||
### Added
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- Updated docker/login-action module ([#1837](https://github.com/wazuh/wazuh-docker/pull/1837))
|
|
||||||
|
|
||||||
### Deleted
|
|
||||||
|
|
||||||
- None
|
|
||||||
|
|
||||||
## [4.10.1]
|
## [4.10.1]
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ The `wazuh/wazuh-docker` repository provides resources to deploy the Wazuh cyber
|
|||||||
## Branch Convention
|
## Branch Convention
|
||||||
|
|
||||||
- `main`: Developing and testing of new features.
|
- `main`: Developing and testing of new features.
|
||||||
- `X.Y.Z`: Version-specific branches (e.g., `4.14.7`, `4.13.0`, etc.).
|
- `X.Y.Z`: Version-specific branches (e.g., `4.14.0`, `4.13.0`, etc.).
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"version": "4.14.7",
|
"version": "4.14.0",
|
||||||
"stage": "rc1"
|
"stage": "rc1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,40 +1,32 @@
|
|||||||
# Wazuh Docker Image Builder
|
# Wazuh Docker Image Builder
|
||||||
|
|
||||||
The creation of the images for the Wazuh stack deployment in Docker is done with the `build-docker-images/build-images.sh` script
|
The creation of the images for the Wazuh stack deployment in Docker is done with the build-images.yml script
|
||||||
|
|
||||||
|
To execute the process, the following must be executed in the root of the wazuh-docker repository:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ build-docker-images/build-images.sh
|
||||||
|
```
|
||||||
|
|
||||||
This script initializes the environment variables needed to build each of the images.
|
This script initializes the environment variables needed to build each of the images.
|
||||||
|
|
||||||
To execute it, make sure to be in the `build-docker-images` directory:
|
The script allows you to build images from other versions of Wazuh, to do this you must use the -v or --version argument:
|
||||||
|
|
||||||
```bash
|
|
||||||
cd build-docker-images
|
|
||||||
```
|
```
|
||||||
|
$ build-docker-images/build-images.sh -v 4.14.0
|
||||||
Then execute:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./build-images.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
The script also allows to build images from other versions of Wazuh by using the `-v` or `--version` argument:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./build-images.sh -v 4.14.7
|
|
||||||
```
|
```
|
||||||
|
|
||||||
To get all the available script options use the -h or --help option:
|
To get all the available script options use the -h or --help option:
|
||||||
|
|
||||||
```bash
|
```
|
||||||
./build-images.sh -h
|
$ build-docker-images/build-images.sh -h
|
||||||
|
|
||||||
Usage: ./build-images.sh [OPTIONS]
|
Usage: build-docker-images/build-images.sh [OPTIONS]
|
||||||
|
|
||||||
-d, --dev <ref> [Optional] Set the development stage you want to build, example rc1 or beta1, not used by default.
|
-d, --dev <ref> [Optional] Set the development stage you want to build, example rc1 or beta1, not used by default.
|
||||||
-f, --filebeat-module <ref> [Optional] Set Filebeat module version. By default 0.5.
|
-f, --filebeat-module <ref> [Optional] Set Filebeat module version. By default 0.4.
|
||||||
-r, --revision <rev> [Optional] Package revision. By default 1
|
-r, --revision <rev> [Optional] Package revision. By default 1
|
||||||
-rg, --registry <reg> [Optional] Set the Docker registry to push the images.
|
-v, --version <ver> [Optional] Set the Wazuh version should be builded. By default, 4.14.0.
|
||||||
-v, --version <ver> [Optional] Set the Wazuh version should be builded. By default, 4.14.7.
|
|
||||||
-m, --multiarch [Optional] Enable multi-architecture builds.
|
|
||||||
-h, --help Show this help.
|
-h, --help Show this help.
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -1,4 +1,8 @@
|
|||||||
#!/bin/bash
|
WAZUH_IMAGE_VERSION=4.14.0
|
||||||
|
WAZUH_VERSION=$(echo $WAZUH_IMAGE_VERSION | sed -e 's/\.//g')
|
||||||
|
WAZUH_TAG_REVISION=1
|
||||||
|
WAZUH_CURRENT_VERSION=$(curl --silent https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '["]tag_name["]:' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 2- | sed -e 's/\.//g')
|
||||||
|
IMAGE_VERSION=${WAZUH_IMAGE_VERSION}
|
||||||
|
|
||||||
# Wazuh package generator
|
# Wazuh package generator
|
||||||
# Copyright (C) 2023, Wazuh Inc.
|
# Copyright (C) 2023, Wazuh Inc.
|
||||||
@@ -8,14 +12,10 @@
|
|||||||
# License (version 2) as published by the FSF - Free Software
|
# License (version 2) as published by the FSF - Free Software
|
||||||
# Foundation.
|
# Foundation.
|
||||||
|
|
||||||
IMAGE_TAG=4.14.7
|
WAZUH_IMAGE_VERSION="4.14.0"
|
||||||
WAZUH_CURRENT_VERSION=$(curl --silent https://api.github.com/repos/wazuh/wazuh/releases/latest | grep '["]tag_name["]:' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 2- | sed -e 's/\.//g')
|
|
||||||
WAZUH_REGISTRY=docker.io
|
|
||||||
|
|
||||||
WAZUH_IMAGE_VERSION="4.14.7"
|
|
||||||
WAZUH_TAG_REVISION="1"
|
WAZUH_TAG_REVISION="1"
|
||||||
WAZUH_DEV_STAGE=""
|
WAZUH_DEV_STAGE=""
|
||||||
FILEBEAT_MODULE_VERSION="0.5"
|
FILEBEAT_MODULE_VERSION="0.4"
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -43,7 +43,6 @@ build() {
|
|||||||
|
|
||||||
if [ "${WAZUH_DEV_STAGE}" ];then
|
if [ "${WAZUH_DEV_STAGE}" ];then
|
||||||
FILEBEAT_TEMPLATE_BRANCH="v${FILEBEAT_TEMPLATE_BRANCH}-${WAZUH_DEV_STAGE,,}"
|
FILEBEAT_TEMPLATE_BRANCH="v${FILEBEAT_TEMPLATE_BRANCH}-${WAZUH_DEV_STAGE,,}"
|
||||||
IMAGE_TAG="${WAZUH_IMAGE_VERSION}-${WAZUH_DEV_STAGE,,}"
|
|
||||||
if ! curl --output /dev/null --silent --head --fail "https://github.com/wazuh/wazuh/tree/${FILEBEAT_TEMPLATE_BRANCH}"; then
|
if ! curl --output /dev/null --silent --head --fail "https://github.com/wazuh/wazuh/tree/${FILEBEAT_TEMPLATE_BRANCH}"; then
|
||||||
echo "The indicated branch does not exist in the wazuh/wazuh repository: ${FILEBEAT_TEMPLATE_BRANCH}"
|
echo "The indicated branch does not exist in the wazuh/wazuh repository: ${FILEBEAT_TEMPLATE_BRANCH}"
|
||||||
clean 1
|
clean 1
|
||||||
@@ -51,96 +50,22 @@ build() {
|
|||||||
else
|
else
|
||||||
if curl --output /dev/null --silent --head --fail "https://github.com/wazuh/wazuh/tree/v${FILEBEAT_TEMPLATE_BRANCH}"; then
|
if curl --output /dev/null --silent --head --fail "https://github.com/wazuh/wazuh/tree/v${FILEBEAT_TEMPLATE_BRANCH}"; then
|
||||||
FILEBEAT_TEMPLATE_BRANCH="v${FILEBEAT_TEMPLATE_BRANCH}"
|
FILEBEAT_TEMPLATE_BRANCH="v${FILEBEAT_TEMPLATE_BRANCH}"
|
||||||
IMAGE_TAG="${WAZUH_IMAGE_VERSION}"
|
|
||||||
elif curl --output /dev/null --silent --head --fail "https://github.com/wazuh/wazuh/tree/${FILEBEAT_TEMPLATE_BRANCH}"; then
|
elif curl --output /dev/null --silent --head --fail "https://github.com/wazuh/wazuh/tree/${FILEBEAT_TEMPLATE_BRANCH}"; then
|
||||||
FILEBEAT_TEMPLATE_BRANCH="${FILEBEAT_TEMPLATE_BRANCH}"
|
FILEBEAT_TEMPLATE_BRANCH="${FILEBEAT_TEMPLATE_BRANCH}"
|
||||||
IMAGE_TAG="${WAZUH_IMAGE_VERSION}"
|
|
||||||
else
|
else
|
||||||
echo "The indicated branch does not exist in the wazuh/wazuh repository: ${FILEBEAT_TEMPLATE_BRANCH}"
|
echo "The indicated branch does not exist in the wazuh/wazuh repository: ${FILEBEAT_TEMPLATE_BRANCH}"
|
||||||
clean 1
|
clean 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo WAZUH_VERSION=$WAZUH_IMAGE_VERSION > ../.env
|
echo WAZUH_VERSION=$WAZUH_IMAGE_VERSION > .env
|
||||||
echo WAZUH_IMAGE_VERSION=$WAZUH_IMAGE_VERSION >> ../.env
|
echo WAZUH_IMAGE_VERSION=$WAZUH_IMAGE_VERSION >> .env
|
||||||
echo WAZUH_TAG_REVISION=$WAZUH_TAG_REVISION >> ../.env
|
echo WAZUH_TAG_REVISION=$WAZUH_TAG_REVISION >> .env
|
||||||
echo FILEBEAT_TEMPLATE_BRANCH=$FILEBEAT_TEMPLATE_BRANCH >> ../.env
|
echo FILEBEAT_TEMPLATE_BRANCH=$FILEBEAT_TEMPLATE_BRANCH >> .env
|
||||||
echo WAZUH_FILEBEAT_MODULE=$WAZUH_FILEBEAT_MODULE >> ../.env
|
echo WAZUH_FILEBEAT_MODULE=$WAZUH_FILEBEAT_MODULE >> .env
|
||||||
echo WAZUH_UI_REVISION=$WAZUH_UI_REVISION >> ../.env
|
echo WAZUH_UI_REVISION=$WAZUH_UI_REVISION >> .env
|
||||||
echo WAZUH_REGISTRY=$WAZUH_REGISTRY >> ../.env
|
|
||||||
echo IMAGE_TAG=$IMAGE_TAG >> ../.env
|
|
||||||
|
|
||||||
set -a
|
docker compose -f build-docker-images/build-images.yml --env-file .env build --no-cache || clean 1
|
||||||
source ../.env
|
|
||||||
set +a
|
|
||||||
|
|
||||||
# Define all available components
|
|
||||||
local all_components=("wazuh-indexer" "wazuh-manager" "wazuh-dashboard" "wazuh-agent")
|
|
||||||
local components_to_build=()
|
|
||||||
|
|
||||||
# Determine which components to build
|
|
||||||
if [ -z "${WAZUH_COMPONENT}" ]; then
|
|
||||||
echo "No component specified. Building all components..."
|
|
||||||
components_to_build=("${all_components[@]}")
|
|
||||||
else
|
|
||||||
# Validate component
|
|
||||||
case "${WAZUH_COMPONENT}" in
|
|
||||||
wazuh-indexer|wazuh-manager|wazuh-dashboard|wazuh-agent)
|
|
||||||
components_to_build=("${WAZUH_COMPONENT}")
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Error: Unknown component '${WAZUH_COMPONENT}'" >&2
|
|
||||||
clean 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Determine build command and base options
|
|
||||||
if [ "${MULTIARCH}" ]; then
|
|
||||||
build_cmd="docker buildx build --platform linux/amd64,linux/arm64 --push --no-cache"
|
|
||||||
else
|
|
||||||
build_cmd="docker build --no-cache"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Build each component
|
|
||||||
for component in "${components_to_build[@]}"; do
|
|
||||||
echo "Building ${component} image..."
|
|
||||||
|
|
||||||
# Build common args (used by all components)
|
|
||||||
build_args=(
|
|
||||||
-t "${WAZUH_REGISTRY}/wazuh/${component}:${IMAGE_TAG}"
|
|
||||||
--build-arg WAZUH_VERSION="${WAZUH_IMAGE_VERSION}"
|
|
||||||
--build-arg WAZUH_TAG_REVISION="${WAZUH_TAG_REVISION}"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Add component-specific args
|
|
||||||
case "${component}" in
|
|
||||||
wazuh-indexer)
|
|
||||||
# No additional args for wazuh-indexer
|
|
||||||
;;
|
|
||||||
wazuh-manager)
|
|
||||||
build_args+=(
|
|
||||||
--build-arg FILEBEAT_TEMPLATE_BRANCH="${FILEBEAT_TEMPLATE_BRANCH}"
|
|
||||||
--build-arg WAZUH_FILEBEAT_MODULE="${WAZUH_FILEBEAT_MODULE}"
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
wazuh-dashboard)
|
|
||||||
build_args+=(
|
|
||||||
--build-arg WAZUH_UI_REVISION="${WAZUH_UI_REVISION}"
|
|
||||||
)
|
|
||||||
;;
|
|
||||||
wazuh-agent)
|
|
||||||
# No additional args for wazuh-agent
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Execute build
|
|
||||||
$build_cmd "${build_args[@]}" ${component}/ || clean 1
|
|
||||||
echo "${component} image built successfully!"
|
|
||||||
done
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
echo "Image build process completed!"
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@@ -151,13 +76,10 @@ help() {
|
|||||||
echo
|
echo
|
||||||
echo "Usage: $0 [OPTIONS]"
|
echo "Usage: $0 [OPTIONS]"
|
||||||
echo
|
echo
|
||||||
echo " -d, --dev <ref> [Optional] Set the development stage you want to build, example rc4 or beta1, not used by default."
|
echo " -d, --dev <ref> [Optional] Set the development stage you want to build, example rc1 or beta1, not used by default."
|
||||||
echo " -f, --filebeat-module <ref> [Optional] Set Filebeat module version. By default ${FILEBEAT_MODULE_VERSION}."
|
echo " -f, --filebeat-module <ref> [Optional] Set Filebeat module version. By default ${FILEBEAT_MODULE_VERSION}."
|
||||||
echo " -r, --revision <rev> [Optional] Package revision. By default ${WAZUH_TAG_REVISION}"
|
echo " -r, --revision <rev> [Optional] Package revision. By default ${WAZUH_TAG_REVISION}"
|
||||||
echo " -rg, --registry <reg> [Optional] Set the Docker registry to push the images."
|
|
||||||
echo " -c, --component <comp> [Required] Set the Wazuh component to build. Accepted values: 'wazuh-indexer', 'wazuh-manager', 'wazuh-dashboard', 'wazuh-agent'."
|
|
||||||
echo " -v, --version <ver> [Optional] Set the Wazuh version should be builded. By default, ${WAZUH_IMAGE_VERSION}."
|
echo " -v, --version <ver> [Optional] Set the Wazuh version should be builded. By default, ${WAZUH_IMAGE_VERSION}."
|
||||||
echo " -m, --multiarch [Optional] Enable multi-architecture builds."
|
|
||||||
echo " -h, --help Show this help."
|
echo " -h, --help Show this help."
|
||||||
echo
|
echo
|
||||||
exit $1
|
exit $1
|
||||||
@@ -188,10 +110,6 @@ main() {
|
|||||||
help 1
|
help 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"-m"|"--multiarch")
|
|
||||||
MULTIARCH="true"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
"-r"|"--revision")
|
"-r"|"--revision")
|
||||||
if [ -n "${2}" ]; then
|
if [ -n "${2}" ]; then
|
||||||
WAZUH_TAG_REVISION="${2}"
|
WAZUH_TAG_REVISION="${2}"
|
||||||
@@ -200,14 +118,6 @@ main() {
|
|||||||
help 1
|
help 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"-rg"|"--registry")
|
|
||||||
if [ -n "${2}" ]; then
|
|
||||||
WAZUH_REGISTRY="${2}"
|
|
||||||
shift 2
|
|
||||||
else
|
|
||||||
help 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
"-v"|"--version")
|
"-v"|"--version")
|
||||||
if [ -n "$2" ]; then
|
if [ -n "$2" ]; then
|
||||||
WAZUH_IMAGE_VERSION="$2"
|
WAZUH_IMAGE_VERSION="$2"
|
||||||
@@ -216,14 +126,6 @@ main() {
|
|||||||
help 1
|
help 1
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"-c"|"--component")
|
|
||||||
if [ -n "${2}" ]; then
|
|
||||||
WAZUH_COMPONENT="${2}"
|
|
||||||
shift 2
|
|
||||||
else
|
|
||||||
help 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
help 1
|
help 1
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ services:
|
|||||||
WAZUH_TAG_REVISION: ${WAZUH_TAG_REVISION}
|
WAZUH_TAG_REVISION: ${WAZUH_TAG_REVISION}
|
||||||
FILEBEAT_TEMPLATE_BRANCH: ${FILEBEAT_TEMPLATE_BRANCH}
|
FILEBEAT_TEMPLATE_BRANCH: ${FILEBEAT_TEMPLATE_BRANCH}
|
||||||
WAZUH_FILEBEAT_MODULE: ${WAZUH_FILEBEAT_MODULE}
|
WAZUH_FILEBEAT_MODULE: ${WAZUH_FILEBEAT_MODULE}
|
||||||
image: ${WAZUH_REGISTRY}/wazuh/wazuh-manager:${IMAGE_TAG}
|
image: merecu/wazuh-manager:${WAZUH_IMAGE_VERSION}
|
||||||
hostname: wazuh.manager
|
hostname: wazuh.manager
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
@@ -40,7 +40,7 @@ services:
|
|||||||
args:
|
args:
|
||||||
WAZUH_VERSION: ${WAZUH_VERSION}
|
WAZUH_VERSION: ${WAZUH_VERSION}
|
||||||
WAZUH_TAG_REVISION: ${WAZUH_TAG_REVISION}
|
WAZUH_TAG_REVISION: ${WAZUH_TAG_REVISION}
|
||||||
image: ${WAZUH_REGISTRY}/wazuh/wazuh-agent:${IMAGE_TAG}
|
image: merecu/wazuh-agent:${WAZUH_IMAGE_VERSION}
|
||||||
hostname: wazuh.agent
|
hostname: wazuh.agent
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ services:
|
|||||||
args:
|
args:
|
||||||
WAZUH_VERSION: ${WAZUH_VERSION}
|
WAZUH_VERSION: ${WAZUH_VERSION}
|
||||||
WAZUH_TAG_REVISION: ${WAZUH_TAG_REVISION}
|
WAZUH_TAG_REVISION: ${WAZUH_TAG_REVISION}
|
||||||
image: ${WAZUH_REGISTRY}/wazuh/wazuh-indexer:${IMAGE_TAG}
|
image: merecu/wazuh-indexer:${WAZUH_IMAGE_VERSION}
|
||||||
hostname: wazuh.indexer
|
hostname: wazuh.indexer
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
@@ -72,7 +72,7 @@ services:
|
|||||||
WAZUH_VERSION: ${WAZUH_VERSION}
|
WAZUH_VERSION: ${WAZUH_VERSION}
|
||||||
WAZUH_TAG_REVISION: ${WAZUH_TAG_REVISION}
|
WAZUH_TAG_REVISION: ${WAZUH_TAG_REVISION}
|
||||||
WAZUH_UI_REVISION: ${WAZUH_UI_REVISION}
|
WAZUH_UI_REVISION: ${WAZUH_UI_REVISION}
|
||||||
image: ${WAZUH_REGISTRY}/wazuh/wazuh-dashboard:${IMAGE_TAG}
|
image: merecu/wazuh-dashboard:${WAZUH_IMAGE_VERSION}
|
||||||
hostname: wazuh.dashboard
|
hostname: wazuh.dashboard
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -10,9 +10,7 @@ ARG WAZUH_MANAGER='CHANGE_MANAGER_IP'
|
|||||||
ARG WAZUH_MANAGER_PORT='CHANGE_MANAGER_PORT'
|
ARG WAZUH_MANAGER_PORT='CHANGE_MANAGER_PORT'
|
||||||
ARG WAZUH_REGISTRATION_SERVER='CHANGE_ENROLL_IP'
|
ARG WAZUH_REGISTRATION_SERVER='CHANGE_ENROLL_IP'
|
||||||
ARG WAZUH_REGISTRATION_PORT='CHANGE_ENROLL_PORT'
|
ARG WAZUH_REGISTRATION_PORT='CHANGE_ENROLL_PORT'
|
||||||
ARG WAZUH_AGENT_NAME='CHANGE_AGENT_NAME'
|
ARG WAZUH_AGENT_NAME='CHANGEE_AGENT_NAME'
|
||||||
ARG WAZUH_AGENT_GROUP='CHANGE_AGENT_GROUP'
|
|
||||||
ARG TARGETARCH
|
|
||||||
|
|
||||||
COPY config/check_repository.sh /
|
COPY config/check_repository.sh /
|
||||||
|
|
||||||
@@ -25,13 +23,11 @@ RUN source /check_repository.sh
|
|||||||
RUN yum install wazuh-agent-${WAZUH_VERSION}-${WAZUH_TAG_REVISION} -y && \
|
RUN yum install wazuh-agent-${WAZUH_VERSION}-${WAZUH_TAG_REVISION} -y && \
|
||||||
yum clean all && \
|
yum clean all && \
|
||||||
sed -i '/<authorization_pass_path>/d' /var/ossec/etc/ossec.conf && \
|
sed -i '/<authorization_pass_path>/d' /var/ossec/etc/ossec.conf && \
|
||||||
S6_ARCH="amd64" && \
|
curl --fail --silent -L https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-amd64.tar.gz \
|
||||||
if [ "${TARGETARCH}" = "arm64" ]; then S6_ARCH="aarch64"; fi && \
|
-o /tmp/s6-overlay-amd64.tar.gz && \
|
||||||
curl --fail --silent -L https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-${S6_ARCH}.tar.gz \
|
tar xzf /tmp/s6-overlay-amd64.tar.gz -C / --exclude="./bin" && \
|
||||||
-o /tmp/s6-overlay-${S6_ARCH}.tar.gz && \
|
tar xzf /tmp/s6-overlay-amd64.tar.gz -C /usr ./bin && \
|
||||||
tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C / --exclude="./bin" && \
|
rm /tmp/s6-overlay-amd64.tar.gz
|
||||||
tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C /usr ./bin && \
|
|
||||||
rm /tmp/s6-overlay-${S6_ARCH}.tar.gz
|
|
||||||
|
|
||||||
COPY config/etc/ /etc/
|
COPY config/etc/ /etc/
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ WAZUH_REGISTRATION_SERVER=${WAZUH_REGISTRATION_SERVER:-$WAZUH_MANAGER_SERVER}
|
|||||||
WAZUH_REGISTRATION_PORT=${WAZUH_REGISTRATION_PORT:-"1515"}
|
WAZUH_REGISTRATION_PORT=${WAZUH_REGISTRATION_PORT:-"1515"}
|
||||||
WAZUH_REGISTRATION_PASSWORD=$WAZUH_REGISTRATION_PASSWORD
|
WAZUH_REGISTRATION_PASSWORD=$WAZUH_REGISTRATION_PASSWORD
|
||||||
WAZUH_AGENT_NAME=${WAZUH_AGENT_NAME:-"wazuh-agent-$HOSTNAME"}
|
WAZUH_AGENT_NAME=${WAZUH_AGENT_NAME:-"wazuh-agent-$HOSTNAME"}
|
||||||
WAZUH_AGENT_GROUP=${WAZUH_AGENT_GROUP:-"default"}
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Aux functions
|
# Aux functions
|
||||||
@@ -67,8 +66,7 @@ set_manager_conn() {
|
|||||||
sed -i "s#<port>CHANGE_MANAGER_PORT</port>#<port>$WAZUH_MANAGER_PORT</port>#g" ${WAZUH_INSTALL_PATH}/etc/ossec.conf
|
sed -i "s#<port>CHANGE_MANAGER_PORT</port>#<port>$WAZUH_MANAGER_PORT</port>#g" ${WAZUH_INSTALL_PATH}/etc/ossec.conf
|
||||||
sed -i "s#<manager_address>CHANGE_ENROLL_IP</manager_address>#<manager_address>$WAZUH_REGISTRATION_SERVER</manager_address>#g" ${WAZUH_INSTALL_PATH}/etc/ossec.conf
|
sed -i "s#<manager_address>CHANGE_ENROLL_IP</manager_address>#<manager_address>$WAZUH_REGISTRATION_SERVER</manager_address>#g" ${WAZUH_INSTALL_PATH}/etc/ossec.conf
|
||||||
sed -i "s#<port>CHANGE_ENROLL_PORT</port>#<port>$WAZUH_REGISTRATION_PORT</port>#g" ${WAZUH_INSTALL_PATH}/etc/ossec.conf
|
sed -i "s#<port>CHANGE_ENROLL_PORT</port>#<port>$WAZUH_REGISTRATION_PORT</port>#g" ${WAZUH_INSTALL_PATH}/etc/ossec.conf
|
||||||
sed -i "s#<agent_name>CHANGE_AGENT_NAME</agent_name>#<agent_name>$WAZUH_AGENT_NAME</agent_name>#g" ${WAZUH_INSTALL_PATH}/etc/ossec.conf
|
sed -i "s#<agent_name>CHANGEE_AGENT_NAME</agent_name>#<agent_name>$WAZUH_AGENT_NAME</agent_name>#g" ${WAZUH_INSTALL_PATH}/etc/ossec.conf
|
||||||
sed -i "s#<groups>CHANGE_AGENT_GROUP</groups>#<groups>$WAZUH_AGENT_GROUP</groups>#g" ${WAZUH_INSTALL_PATH}/etc/ossec.conf
|
|
||||||
[ -n "$WAZUH_REGISTRATION_PASSWORD" ] && \
|
[ -n "$WAZUH_REGISTRATION_PASSWORD" ] && \
|
||||||
echo "$WAZUH_REGISTRATION_PASSWORD" > ${WAZUH_INSTALL_PATH}/etc/authd.pass && \
|
echo "$WAZUH_REGISTRATION_PASSWORD" > ${WAZUH_INSTALL_PATH}/etc/authd.pass && \
|
||||||
chown root:wazuh ${WAZUH_INSTALL_PATH}/etc/authd.pass && \
|
chown root:wazuh ${WAZUH_INSTALL_PATH}/etc/authd.pass && \
|
||||||
|
|||||||
@@ -5,16 +5,19 @@ ARG WAZUH_VERSION
|
|||||||
ARG WAZUH_TAG_REVISION
|
ARG WAZUH_TAG_REVISION
|
||||||
ARG WAZUH_UI_REVISION
|
ARG WAZUH_UI_REVISION
|
||||||
ARG INSTALL_DIR=/usr/share/wazuh-dashboard
|
ARG INSTALL_DIR=/usr/share/wazuh-dashboard
|
||||||
|
ARG REPO_ORIGIN=https://packages-dev.wazuh.com/pre-release
|
||||||
|
ARG TARGETARCH
|
||||||
|
ENV PKG_ARCH=${TARGETARCH}
|
||||||
|
|
||||||
# Update and install dependencies
|
# Update and install dependencies
|
||||||
RUN yum install curl-minimal libcap openssl -y
|
RUN dnf install curl-minimal libcap openssl -y &&\
|
||||||
|
case "$PKG_ARCH" in \
|
||||||
COPY config/check_repository.sh /
|
amd64) ARCH_NAME="x86_64" ;; \
|
||||||
RUN chmod 775 /check_repository.sh && \
|
arm64) ARCH_NAME="aarch64" ;; \
|
||||||
source /check_repository.sh
|
*) echo "Unsupported arch: $PKG_ARCH" && exit 1 ;; \
|
||||||
|
esac && \
|
||||||
RUN yum install wazuh-dashboard-${WAZUH_VERSION}-${WAZUH_TAG_REVISION} -y && \
|
dnf install ${REPO_ORIGIN}/yum/wazuh-dashboard-${WAZUH_VERSION}-${WAZUH_TAG_REVISION}.${ARCH_NAME}.rpm -y && \
|
||||||
yum clean all
|
dnf clean all
|
||||||
|
|
||||||
# Create and set permissions to data directories
|
# Create and set permissions to data directories
|
||||||
RUN mkdir -p $INSTALL_DIR/data/wazuh && chmod -R 775 $INSTALL_DIR/data/wazuh
|
RUN mkdir -p $INSTALL_DIR/data/wazuh && chmod -R 775 $INSTALL_DIR/data/wazuh
|
||||||
@@ -60,7 +63,7 @@ ENV PATTERN="" \
|
|||||||
WAZUH_MONITORING_REPLICAS=""
|
WAZUH_MONITORING_REPLICAS=""
|
||||||
|
|
||||||
# Update and install dependencies
|
# Update and install dependencies
|
||||||
RUN yum install shadow-utils -y
|
RUN dnf install shadow-utils -y
|
||||||
|
|
||||||
# Create wazuh-dashboard user and group
|
# Create wazuh-dashboard user and group
|
||||||
RUN getent group $GROUP || groupadd -r -g 1000 $GROUP
|
RUN getent group $GROUP || groupadd -r -g 1000 $GROUP
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ wazuh_url="${WAZUH_API_URL:-https://wazuh}"
|
|||||||
wazuh_port="${API_PORT:-55000}"
|
wazuh_port="${API_PORT:-55000}"
|
||||||
api_username="${API_USERNAME:-wazuh-wui}"
|
api_username="${API_USERNAME:-wazuh-wui}"
|
||||||
api_password="${API_PASSWORD:-wazuh-wui}"
|
api_password="${API_PASSWORD:-wazuh-wui}"
|
||||||
api_run_as="${RUN_AS:-true}"
|
api_run_as="${RUN_AS:-false}"
|
||||||
|
|
||||||
dashboard_config_file="/usr/share/wazuh-dashboard/data/wazuh/config/wazuh.yml"
|
dashboard_config_file="/usr/share/wazuh-dashboard/data/wazuh/config/wazuh.yml"
|
||||||
|
|
||||||
|
|||||||
@@ -3,15 +3,18 @@ FROM amazonlinux:2023 AS builder
|
|||||||
|
|
||||||
ARG WAZUH_VERSION
|
ARG WAZUH_VERSION
|
||||||
ARG WAZUH_TAG_REVISION
|
ARG WAZUH_TAG_REVISION
|
||||||
|
ARG REPO_ORIGIN=https://packages-dev.wazuh.com/pre-release
|
||||||
|
ARG TARGETARCH
|
||||||
|
ENV PKG_ARCH=${TARGETARCH}
|
||||||
|
|
||||||
RUN yum install curl-minimal openssl xz tar findutils shadow-utils -y
|
RUN dnf install curl-minimal openssl xz tar findutils shadow-utils -y &&\
|
||||||
|
case "$PKG_ARCH" in \
|
||||||
COPY config/check_repository.sh /
|
amd64) ARCH_NAME="x86_64" ;; \
|
||||||
RUN chmod 775 /check_repository.sh && \
|
arm64) ARCH_NAME="aarch64" ;; \
|
||||||
source /check_repository.sh
|
*) echo "Unsupported arch: $PKG_ARCH" && exit 1 ;; \
|
||||||
|
esac && \
|
||||||
RUN yum install wazuh-indexer-${WAZUH_VERSION}-${WAZUH_TAG_REVISION} -y && \
|
dnf install ${REPO_ORIGIN}/yum/wazuh-indexer-${WAZUH_VERSION}-${WAZUH_TAG_REVISION}.${ARCH_NAME}.rpm -y && \
|
||||||
yum clean all
|
dnf clean all
|
||||||
|
|
||||||
COPY config/opensearch.yml /
|
COPY config/opensearch.yml /
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ chmod 755 $CERT_TOOL && bash /$CERT_TOOL -A
|
|||||||
|
|
||||||
# copy to target
|
# copy to target
|
||||||
mkdir -p ${TARGET_DIR}${INSTALLATION_DIR}
|
mkdir -p ${TARGET_DIR}${INSTALLATION_DIR}
|
||||||
|
mkdir -p ${TARGET_DIR}${INSTALLATION_DIR}/opensearch-security/
|
||||||
mkdir -p ${TARGET_DIR}${CONFIG_DIR}
|
mkdir -p ${TARGET_DIR}${CONFIG_DIR}
|
||||||
mkdir -p ${TARGET_DIR}${LIB_DIR}
|
mkdir -p ${TARGET_DIR}${LIB_DIR}
|
||||||
mkdir -p ${TARGET_DIR}${LOG_DIR}
|
mkdir -p ${TARGET_DIR}${LOG_DIR}
|
||||||
@@ -72,10 +73,10 @@ mkdir -p ${TARGET_DIR}/usr/lib/sysctl.d
|
|||||||
mkdir -p ${TARGET_DIR}/usr/lib/systemd/system
|
mkdir -p ${TARGET_DIR}/usr/lib/systemd/system
|
||||||
mkdir -p ${TARGET_DIR}${CONFIG_DIR}/certs
|
mkdir -p ${TARGET_DIR}${CONFIG_DIR}/certs
|
||||||
# Copy Wazuh's config files for the security plugin
|
# Copy Wazuh's config files for the security plugin
|
||||||
cp -pr /roles_mapping.yml ${TARGET_DIR}${CONFIG_DIR}/opensearch-security/
|
cp -pr /roles_mapping.yml ${TARGET_DIR}${INSTALLATION_DIR}/opensearch-security/
|
||||||
cp -pr /roles.yml ${TARGET_DIR}${CONFIG_DIR}/opensearch-security/
|
cp -pr /roles.yml ${TARGET_DIR}${INSTALLATION_DIR}/opensearch-security/
|
||||||
cp -pr /action_groups.yml ${TARGET_DIR}${CONFIG_DIR}/opensearch-security/
|
cp -pr /action_groups.yml ${TARGET_DIR}${INSTALLATION_DIR}/opensearch-security/
|
||||||
cp -pr /internal_users.yml ${TARGET_DIR}${CONFIG_DIR}/opensearch-security/
|
cp -pr /internal_users.yml ${TARGET_DIR}${INSTALLATION_DIR}/opensearch-security/
|
||||||
cp -pr /opensearch.yml ${TARGET_DIR}${CONFIG_DIR}
|
cp -pr /opensearch.yml ${TARGET_DIR}${CONFIG_DIR}
|
||||||
# Copy Wazuh indexer's certificates
|
# Copy Wazuh indexer's certificates
|
||||||
cp -pr /wazuh-certificates/demo.indexer.pem ${TARGET_DIR}${CONFIG_DIR}/certs/indexer.pem
|
cp -pr /wazuh-certificates/demo.indexer.pem ${TARGET_DIR}${CONFIG_DIR}/certs/indexer.pem
|
||||||
|
|||||||
@@ -14,13 +14,6 @@ plugins.security.ssl.transport.pemtrustedcas_filepath: /usr/share/wazuh-indexer/
|
|||||||
plugins.security.ssl.http.enabled: true
|
plugins.security.ssl.http.enabled: true
|
||||||
plugins.security.ssl.transport.enforce_hostname_verification: false
|
plugins.security.ssl.transport.enforce_hostname_verification: false
|
||||||
plugins.security.ssl.transport.resolve_hostname: false
|
plugins.security.ssl.transport.resolve_hostname: false
|
||||||
plugins.security.ssl.http.enabled_ciphers:
|
|
||||||
- "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
|
|
||||||
- "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
|
|
||||||
- "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
|
|
||||||
- "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"
|
|
||||||
plugins.security.ssl.http.enabled_protocols:
|
|
||||||
- "TLSv1.2"
|
|
||||||
plugins.security.authcz.admin_dn:
|
plugins.security.authcz.admin_dn:
|
||||||
- "CN=admin,OU=Wazuh,O=Wazuh,L=California,C=US"
|
- "CN=admin,OU=Wazuh,O=Wazuh,L=California,C=US"
|
||||||
plugins.security.check_snapshot_restore_write_privileges: true
|
plugins.security.check_snapshot_restore_write_privileges: true
|
||||||
|
|||||||
@@ -11,32 +11,30 @@ ARG FILEBEAT_VERSION=7.10.2
|
|||||||
ARG FILEBEAT_REVISION=2
|
ARG FILEBEAT_REVISION=2
|
||||||
ARG WAZUH_FILEBEAT_MODULE
|
ARG WAZUH_FILEBEAT_MODULE
|
||||||
ARG S6_VERSION="v2.2.0.3"
|
ARG S6_VERSION="v2.2.0.3"
|
||||||
|
ARG REPO_ORIGIN=https://packages-dev.wazuh.com/pre-release
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
ENV PKG_ARCH=${TARGETARCH}
|
||||||
|
|
||||||
RUN yum install curl-minimal xz gnupg tar gzip openssl findutils procps -y &&\
|
|
||||||
yum clean all
|
|
||||||
|
|
||||||
COPY config/check_repository.sh /
|
|
||||||
COPY config/filebeat_module.sh /
|
COPY config/filebeat_module.sh /
|
||||||
COPY config/permanent_data.env config/permanent_data.sh /
|
COPY config/permanent_data.env config/permanent_data.sh /
|
||||||
|
|
||||||
RUN chmod 775 /check_repository.sh
|
|
||||||
RUN source /check_repository.sh
|
|
||||||
|
|
||||||
RUN yum install wazuh-manager-${WAZUH_VERSION}-${WAZUH_TAG_REVISION} -y && \
|
RUN dnf install curl-minimal xz gnupg tar gzip openssl findutils procps -y &&\
|
||||||
yum clean all && \
|
case "$PKG_ARCH" in \
|
||||||
|
amd64) ARCH_NAME="x86_64" ;; \
|
||||||
|
arm64) ARCH_NAME="aarch64" ;; \
|
||||||
|
*) echo "Unsupported arch: $PKG_ARCH" && exit 1 ;; \
|
||||||
|
esac && \
|
||||||
|
dnf install ${REPO_ORIGIN}/yum/wazuh-manager-${WAZUH_VERSION}-${WAZUH_TAG_REVISION}.${ARCH_NAME}.rpm -y && \
|
||||||
|
dnf clean all && \
|
||||||
chmod 775 /filebeat_module.sh && \
|
chmod 775 /filebeat_module.sh && \
|
||||||
source /filebeat_module.sh && \
|
source /filebeat_module.sh && \
|
||||||
rm /filebeat_module.sh && \
|
rm /filebeat_module.sh && \
|
||||||
S6_ARCH="amd64" && \
|
curl --fail --silent -L https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-amd64.tar.gz \
|
||||||
if [ "${TARGETARCH}" = "arm64" ]; then S6_ARCH="aarch64"; fi && \
|
-o /tmp/s6-overlay-amd64.tar.gz && \
|
||||||
curl --fail --silent -L https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-${S6_ARCH}.tar.gz \
|
tar xzf /tmp/s6-overlay-amd64.tar.gz -C / --exclude="./bin" && \
|
||||||
-o /tmp/s6-overlay-${S6_ARCH}.tar.gz && \
|
tar xzf /tmp/s6-overlay-amd64.tar.gz -C /usr ./bin && \
|
||||||
tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C / --exclude="./bin" && \
|
rm /tmp/s6-overlay-amd64.tar.gz
|
||||||
tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C /usr ./bin && \
|
|
||||||
rm /tmp/s6-overlay-${S6_ARCH}.tar.gz && \
|
|
||||||
rm -f /var/ossec/etc/sslmanager.key && \
|
|
||||||
rm -f /var/ossec/etc/sslmanager.cert
|
|
||||||
|
|
||||||
COPY config/etc/ /etc/
|
COPY config/etc/ /etc/
|
||||||
COPY --chown=root:wazuh config/create_user.py /var/ossec/framework/scripts/create_user.py
|
COPY --chown=root:wazuh config/create_user.py /var/ossec/framework/scripts/create_user.py
|
||||||
@@ -66,8 +64,6 @@ RUN mkdir -p /var/ossec/var/multigroups && \
|
|||||||
sync && /permanent_data.sh && \
|
sync && /permanent_data.sh && \
|
||||||
sync && rm /permanent_data.sh
|
sync && rm /permanent_data.sh
|
||||||
|
|
||||||
RUN rm /etc/yum.repos.d/wazuh.repo
|
|
||||||
|
|
||||||
# Services ports
|
# Services ports
|
||||||
EXPOSE 55000/tcp 1514/tcp 1515/tcp 514/udp 1516/tcp
|
EXPOSE 55000/tcp 1514/tcp 1515/tcp 514/udp 1516/tcp
|
||||||
|
|
||||||
|
|||||||
@@ -13,12 +13,13 @@ SPECIAL_CHARS = "@$!%*?&-_"
|
|||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from wazuh.rbac.orm import check_database_integrity, AuthenticationManager
|
from wazuh.rbac.orm import check_database_integrity
|
||||||
from wazuh.security import (
|
from wazuh.security import (
|
||||||
create_user,
|
create_user,
|
||||||
get_users,
|
get_users,
|
||||||
get_roles,
|
get_roles,
|
||||||
set_user_role,
|
set_user_role,
|
||||||
|
update_user,
|
||||||
)
|
)
|
||||||
except ModuleNotFoundError as e:
|
except ModuleNotFoundError as e:
|
||||||
logging.error("No module 'wazuh' found.")
|
logging.error("No module 'wazuh' found.")
|
||||||
@@ -53,11 +54,12 @@ def disable_user(uid):
|
|||||||
# assure there must be at least one character from each group
|
# assure there must be at least one character from each group
|
||||||
random_pass = random_pass + ''.join([random.choice(chars) for chars in [string.ascii_lowercase, string.digits, string.ascii_uppercase, SPECIAL_CHARS]])
|
random_pass = random_pass + ''.join([random.choice(chars) for chars in [string.ascii_lowercase, string.digits, string.ascii_uppercase, SPECIAL_CHARS]])
|
||||||
random_pass = ''.join(random.sample(random_pass,len(random_pass)))
|
random_pass = ''.join(random.sample(random_pass,len(random_pass)))
|
||||||
with AuthenticationManager() as auth:
|
update_user(
|
||||||
auth.update_user(
|
user_id=[
|
||||||
user_id=uid,
|
str(uid),
|
||||||
password=random_pass,
|
],
|
||||||
)
|
password=random_pass,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
@@ -88,11 +90,12 @@ if __name__ == "__main__":
|
|||||||
else:
|
else:
|
||||||
# modify an existing user ("wazuh" or "wazuh-wui")
|
# modify an existing user ("wazuh" or "wazuh-wui")
|
||||||
uid = initial_users[username]
|
uid = initial_users[username]
|
||||||
with AuthenticationManager() as auth:
|
update_user(
|
||||||
auth.update_user(
|
user_id=[
|
||||||
user_id=uid,
|
str(uid),
|
||||||
password=password,
|
],
|
||||||
)
|
password=password,
|
||||||
|
)
|
||||||
# disable unused default users
|
# disable unused default users
|
||||||
for def_user in ['wazuh', 'wazuh-wui']:
|
for def_user in ['wazuh', 'wazuh-wui']:
|
||||||
if def_user != username:
|
if def_user != username:
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ source /permanent_data.env
|
|||||||
|
|
||||||
WAZUH_INSTALL_PATH=/var/ossec
|
WAZUH_INSTALL_PATH=/var/ossec
|
||||||
WAZUH_CONFIG_MOUNT=/wazuh-config-mount
|
WAZUH_CONFIG_MOUNT=/wazuh-config-mount
|
||||||
|
AUTO_ENROLLMENT_ENABLED=${AUTO_ENROLLMENT_ENABLED:-true}
|
||||||
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Aux functions
|
# Aux functions
|
||||||
@@ -68,17 +70,8 @@ apply_exclusion_data() {
|
|||||||
mkdir -p ${DIR}
|
mkdir -p ${DIR}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
safe_cp() {
|
|
||||||
if cp -p "$1" "$2" 2>/dev/null; then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
echo "Warning: Could not copy $1 (may be read-only)"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
print "Updating ${exclusion_file}"
|
print "Updating ${exclusion_file}"
|
||||||
exec_cmd "safe_cp ${WAZUH_INSTALL_PATH}/data_tmp/exclusion/${exclusion_file} ${exclusion_file}"
|
exec_cmd "cp -p ${WAZUH_INSTALL_PATH}/data_tmp/exclusion/${exclusion_file} ${exclusion_file}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -213,10 +206,13 @@ main() {
|
|||||||
# Remove some files in permanent_data (i.e. .template.db)
|
# Remove some files in permanent_data (i.e. .template.db)
|
||||||
remove_data_files
|
remove_data_files
|
||||||
|
|
||||||
# Create wazuh-authd key and cert if not present
|
# Generate wazuh-authd certs if AUTO_ENROLLMENT_ENABLED is true and does not exist
|
||||||
if [ ! -e ${WAZUH_INSTALL_PATH}/etc/sslmanager.key ]
|
if [ $AUTO_ENROLLMENT_ENABLED == true ]
|
||||||
then
|
then
|
||||||
create_ossec_key_cert
|
if [ ! -e ${WAZUH_INSTALL_PATH}/etc/sslmanager.key ]
|
||||||
|
then
|
||||||
|
create_ossec_key_cert
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Mount selected files (WAZUH_CONFIG_MOUNT) to container
|
# Mount selected files (WAZUH_CONFIG_MOUNT) to container
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ set -e
|
|||||||
|
|
||||||
if [ "$INDEXER_URL" != "" ]; then
|
if [ "$INDEXER_URL" != "" ]; then
|
||||||
>&2 echo "Customize Elasticsearch output IP"
|
>&2 echo "Customize Elasticsearch output IP"
|
||||||
sed -i "s|hosts:.*|hosts: [$INDEXER_URL]|g" /etc/filebeat/filebeat.yml
|
sed -i "s|hosts:.*|hosts: ['$INDEXER_URL']|g" /etc/filebeat/filebeat.yml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configure filebeat.yml security settings
|
# Configure filebeat.yml security settings
|
||||||
|
|||||||
@@ -1,11 +1,5 @@
|
|||||||
## variables
|
## variables
|
||||||
REPOSITORY="packages-dev.wazuh.com/pre-release"
|
|
||||||
WAZUH_TAG=$(curl --silent https://api.github.com/repos/wazuh/wazuh/git/refs/tags | grep '["]ref["]:' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 11- | grep ^v${WAZUH_VERSION}$)
|
WAZUH_TAG=$(curl --silent https://api.github.com/repos/wazuh/wazuh/git/refs/tags | grep '["]ref["]:' | sed -E 's/.*\"([^\"]+)\".*/\1/' | cut -c 11- | grep ^v${WAZUH_VERSION}$)
|
||||||
|
|
||||||
## check tag to use the correct repository
|
dnf install ${REPO_ORIGIN}/yum/filebeat-${FILEBEAT_VERSION}-${FILEBEAT_REVISION}.${ARCH_NAME}.rpm -y && \
|
||||||
if [[ -n "${WAZUH_TAG}" ]]; then
|
curl -s ${REPO_ORIGIN}/filebeat/${WAZUH_FILEBEAT_MODULE} | tar -xvz -C /usr/share/filebeat/module
|
||||||
REPOSITORY="packages.wazuh.com/4.x"
|
|
||||||
fi
|
|
||||||
|
|
||||||
yum install filebeat-${FILEBEAT_VERSION}-${FILEBEAT_REVISION} -y && \
|
|
||||||
curl -s https://${REPOSITORY}/filebeat/${WAZUH_FILEBEAT_MODULE} | tar -xvz -C /usr/share/filebeat/module
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ This script initializes the environment variables needed to build each of the im
|
|||||||
The script allows you to build images from other versions of Wazuh, to do this you must use the -v or --version argument:
|
The script allows you to build images from other versions of Wazuh, to do this you must use the -v or --version argument:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ build-docker-images/build-images.sh -v 4.14.7
|
$ build-docker-images/build-images.sh -v 4.14.0
|
||||||
```
|
```
|
||||||
|
|
||||||
To get all the available script options use the -h or --help option:
|
To get all the available script options use the -h or --help option:
|
||||||
@@ -23,10 +23,10 @@ $ build-docker-images/build-images.sh -h
|
|||||||
|
|
||||||
Usage: build-docker-images/build-images.sh [OPTIONS]
|
Usage: build-docker-images/build-images.sh [OPTIONS]
|
||||||
|
|
||||||
-d, --dev <ref> [Optional] Set the development stage you want to build, example rc4 or beta1, not used by default.
|
-d, --dev <ref> [Optional] Set the development stage you want to build, example rc1 or beta1, not used by default.
|
||||||
-f, --filebeat-module <ref> [Optional] Set Filebeat module version. By default 0.5.
|
-f, --filebeat-module <ref> [Optional] Set Filebeat module version. By default 0.4.
|
||||||
-r, --revision <rev> [Optional] Package revision. By default 1
|
-r, --revision <rev> [Optional] Package revision. By default 1
|
||||||
-v, --version <ver> [Optional] Set the Wazuh version should be builded. By default, 4.14.7.
|
-v, --version <ver> [Optional] Set the Wazuh version should be builded. By default, 4.14.0.
|
||||||
-h, --help Show this help.
|
-h, --help Show this help.
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Development Guide - Introduction
|
# Development Guide - Introduction
|
||||||
|
|
||||||
Welcome to the Development Guide for Wazuh-docker version 4.14.7. This guide is intended for developers, contributors, and advanced users who wish to understand the development aspects of the Wazuh-Docker project, build custom Docker images, or contribute to its development.
|
Welcome to the Development Guide for Wazuh-docker version 4.14.0. This guide is intended for developers, contributors, and advanced users who wish to understand the development aspects of the Wazuh-Docker project, build custom Docker images, or contribute to its development.
|
||||||
|
|
||||||
## Purpose of This Guide
|
## Purpose of This Guide
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
# Development Guide - Setup Environment
|
# Development Guide - Setup Environment
|
||||||
|
|
||||||
This section outlines the steps required to set up your local development environment for working with the Wazuh-Docker project (version 4.14.7). A proper setup is crucial for building images, running tests, and contributing effectively.
|
This section outlines the steps required to set up your local development environment for working with the Wazuh-Docker project (version 4.14.0). A proper setup is crucial for building images, running tests, and contributing effectively.
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
@@ -26,12 +26,12 @@ Before you begin, ensure your system meets the following requirements:
|
|||||||
Follow these steps to prepare your development environment:
|
Follow these steps to prepare your development environment:
|
||||||
|
|
||||||
1. **Clone the Repository**:
|
1. **Clone the Repository**:
|
||||||
Clone the `wazuh-docker` repository from GitHub. It's important to check out the specific branch you intend to work with, in this case, `4.14.7`.
|
Clone the `wazuh-docker` repository from GitHub. It's important to check out the specific branch you intend to work with, in this case, `4.14.0`.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone [https://github.com/wazuh/wazuh-docker.git](https://github.com/wazuh/wazuh-docker.git)
|
git clone [https://github.com/wazuh/wazuh-docker.git](https://github.com/wazuh/wazuh-docker.git)
|
||||||
cd wazuh-docker
|
cd wazuh-docker
|
||||||
git checkout v4.14.7
|
git checkout v4.14.0
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Verify Docker Installation**:
|
2. **Verify Docker Installation**:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Reference Manual - Description
|
# Reference Manual - Description
|
||||||
|
|
||||||
This section provides a detailed description of Wazuh-docker (version 4.14.7), its components, and its architecture when deployed using Docker containers. Understanding these aspects is key to effectively deploying and managing your Wazuh environment.
|
This section provides a detailed description of Wazuh-docker (version 4.14.0), its components, and its architecture when deployed using Docker containers. Understanding these aspects is key to effectively deploying and managing your Wazuh environment.
|
||||||
|
|
||||||
## What is Wazuh?
|
## What is Wazuh?
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ Wazuh-docker is a project that provides Docker images and `docker compose` confi
|
|||||||
|
|
||||||
## Core Components in Wazuh-Docker
|
## Core Components in Wazuh-Docker
|
||||||
|
|
||||||
The Wazuh-Docker project typically provides images for the following core Wazuh components, adapted for version 4.14.7:
|
The Wazuh-Docker project typically provides images for the following core Wazuh components, adapted for version 4.14.0:
|
||||||
|
|
||||||
1. **Wazuh Manager**:
|
1. **Wazuh Manager**:
|
||||||
- The central component that collects and analyzes data from deployed Wazuh agents.
|
- The central component that collects and analyzes data from deployed Wazuh agents.
|
||||||
@@ -28,7 +28,7 @@ The Wazuh-Docker project typically provides images for the following core Wazuh
|
|||||||
2. **Wazuh Indexer**:
|
2. **Wazuh Indexer**:
|
||||||
- A highly scalable, full-text search and analytics engine.
|
- A highly scalable, full-text search and analytics engine.
|
||||||
- Based on OpenSearch (or historically Elasticsearch), it stores and indexes alerts and monitoring data generated by the Wazuh manager.
|
- Based on OpenSearch (or historically Elasticsearch), it stores and indexes alerts and monitoring data generated by the Wazuh manager.
|
||||||
- The Wazuh indexer container provides the data persistence layer for Wazuh alerts and events. For version 4.14.7, this is typically an OpenSearch-based component.
|
- The Wazuh indexer container provides the data persistence layer for Wazuh alerts and events. For version 4.14.0, this is typically an OpenSearch-based component.
|
||||||
|
|
||||||
3. **Wazuh Dashboard**:
|
3. **Wazuh Dashboard**:
|
||||||
- A flexible visualization tool based on OpenSearch Dashboards (or historically Kibana).
|
- A flexible visualization tool based on OpenSearch Dashboards (or historically Kibana).
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Reference Manual - Introduction
|
# Reference Manual - Introduction
|
||||||
|
|
||||||
Welcome to the Reference Manual for Wazuh-Docker, version 4.14.7. This manual provides comprehensive information about deploying, configuring, and managing your Wazuh environment using Docker.
|
Welcome to the Reference Manual for Wazuh-Docker, version 4.14.0. This manual provides comprehensive information about deploying, configuring, and managing your Wazuh environment using Docker.
|
||||||
|
|
||||||
## Purpose of This Manual
|
## Purpose of This Manual
|
||||||
|
|
||||||
@@ -44,4 +44,4 @@ This manual is structured to help you find information efficiently:
|
|||||||
- If you need to customize your deployment, refer to the [Configuration](configuration/configuration.md) section.
|
- If you need to customize your deployment, refer to the [Configuration](configuration/configuration.md) section.
|
||||||
- For specific terms or concepts, consult the [Glossary](glossary.md).
|
- For specific terms or concepts, consult the [Glossary](glossary.md).
|
||||||
|
|
||||||
This manual refers to version 4.14.7 of Wazuh-Docker. Ensure you are using the documentation that corresponds to your deployed version.
|
This manual refers to version 4.14.0 of Wazuh-Docker. Ensure you are using the documentation that corresponds to your deployed version.
|
||||||
|
|||||||
@@ -29,4 +29,4 @@
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Consult the official Wazuh documentation for version 4.14.7 for detailed information on all possible configuration parameters for each component.
|
Consult the official Wazuh documentation for version 4.14.0 for detailed information on all possible configuration parameters for each component.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Reference Manual - Configuration
|
# Reference Manual - Configuration
|
||||||
|
|
||||||
This section details how to configure your Wazuh-Docker deployment (version 4.14.7). Proper configuration is key to tailoring the Wazuh stack to your specific needs, managing data persistence, and integrating with your environment.
|
This section details how to configure your Wazuh-Docker deployment (version 4.14.0). Proper configuration is key to tailoring the Wazuh stack to your specific needs, managing data persistence, and integrating with your environment.
|
||||||
|
|
||||||
## Overview of Configuration Methods
|
## Overview of Configuration Methods
|
||||||
|
|
||||||
|
|||||||
@@ -4,14 +4,11 @@ This document outlines the environment variables applicable to the Wazuh Docker
|
|||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
- [Environment Variables in Wazuh Docker Deployment](#environment-variables-in-wazuh-docker-deployment)
|
- [Wazuh Manager](#wazuh-manager)
|
||||||
- [Table of Contents](#table-of-contents)
|
- [Wazuh Indexer](#wazuh-indexer)
|
||||||
- [Wazuh Manager](#wazuh-manager)
|
- [Wazuh Dashboard](#wazuh-dashboard)
|
||||||
- [Wazuh Indexer](#wazuh-indexer)
|
- [Wazuh Agent](#wazuh-agent)
|
||||||
- [Wazuh Dashboard](#wazuh-dashboard)
|
- [Overriding Configuration Files with Environment Variables](#overriding-configuration-files-with-environment-variables)
|
||||||
- [Wazuh Agent](#wazuh-agent)
|
|
||||||
- [Overriding Configuration Files with Environment Variables](#overriding-configuration-files-with-environment-variables)
|
|
||||||
- [Examples:](#examples)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -91,7 +88,6 @@ environment:
|
|||||||
- WAZUH_REGISTRATION_SERVER=wazuh.manager
|
- WAZUH_REGISTRATION_SERVER=wazuh.manager
|
||||||
- WAZUH_REGISTRATION_PORT=1515
|
- WAZUH_REGISTRATION_PORT=1515
|
||||||
- WAZUH_AGENT_NAME=my-agent
|
- WAZUH_AGENT_NAME=my-agent
|
||||||
- WAZUH_AGENT_GROUP=default
|
|
||||||
- WAZUH_REGISTRATION_PASSWORD=StrongPassword
|
- WAZUH_REGISTRATION_PASSWORD=StrongPassword
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Reference Manual - Deployment
|
# Reference Manual - Deployment
|
||||||
|
|
||||||
This section provides detailed instructions for deploying Wazuh-Docker (version 4.14.7) in various configurations. Choose the deployment model that best suits your needs, from simple single-node setups for testing to more robust multi-node configurations for production environments.
|
This section provides detailed instructions for deploying Wazuh-Docker (version 4.14.0) in various configurations. Choose the deployment model that best suits your needs, from simple single-node setups for testing to more robust multi-node configurations for production environments.
|
||||||
|
|
||||||
## Overview of Deployment Options
|
## Overview of Deployment Options
|
||||||
|
|
||||||
@@ -24,11 +24,11 @@ Ensure you have:
|
|||||||
|
|
||||||
- Met all the [System Requirements](ref/getting-started/requirements.md).
|
- Met all the [System Requirements](ref/getting-started/requirements.md).
|
||||||
- Installed Docker and Docker Compose on your host(s).
|
- Installed Docker and Docker Compose on your host(s).
|
||||||
- Cloned the `wazuh-docker` repository (version `4.14.7`) or downloaded the necessary deployment files.
|
- Cloned the `wazuh-docker` repository (version `4.14.0`) or downloaded the necessary deployment files.
|
||||||
```bash
|
```bash
|
||||||
git clone [https://github.com/wazuh/wazuh-docker.git](https://github.com/wazuh/wazuh-docker.git)
|
git clone [https://github.com/wazuh/wazuh-docker.git](https://github.com/wazuh/wazuh-docker.git)
|
||||||
cd wazuh-docker
|
cd wazuh-docker
|
||||||
git checkout v4.14.7
|
git checkout v4.14.0
|
||||||
```
|
```
|
||||||
- Made a backup of any existing Wazuh data if you are migrating or upgrading.
|
- Made a backup of any existing Wazuh data if you are migrating or upgrading.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Reference Manual - Getting Started
|
# Reference Manual - Getting Started
|
||||||
|
|
||||||
This section guides you through the initial steps to get your Wazuh-docker (version 4.14.7) environment up and running. We will cover the prerequisites and point you to the deployment instructions.
|
This section guides you through the initial steps to get your Wazuh-docker (version 4.14.0) environment up and running. We will cover the prerequisites and point you to the deployment instructions.
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
@@ -27,11 +27,11 @@ Before diving into the deployment, please ensure you have reviewed:
|
|||||||
Verify that your host system has sufficient RAM, CPU, and disk space. Ensure Docker and Docker Compose are installed and functioning correctly.
|
Verify that your host system has sufficient RAM, CPU, and disk space. Ensure Docker and Docker Compose are installed and functioning correctly.
|
||||||
|
|
||||||
2. **Obtain Wazuh-docker Configuration**:
|
2. **Obtain Wazuh-docker Configuration**:
|
||||||
You'll need the Docker Compose files and any associated configuration files from the `wazuh-docker` repository for version 4.14.7.
|
You'll need the Docker Compose files and any associated configuration files from the `wazuh-docker` repository for version 4.14.0.
|
||||||
```bash
|
```bash
|
||||||
git clone [https://github.com/wazuh/wazuh-docker.git](https://github.com/wazuh/wazuh-docker.git)
|
git clone [https://github.com/wazuh/wazuh-docker.git](https://github.com/wazuh/wazuh-docker.git)
|
||||||
cd wazuh-docker
|
cd wazuh-docker
|
||||||
git checkout v4.14.7
|
git checkout v4.14.0
|
||||||
# Navigate to the specific docker-compose directory, e.g., single-node or multi-node
|
# Navigate to the specific docker-compose directory, e.g., single-node or multi-node
|
||||||
# cd docker-compose/single-node/ (example path)
|
# cd docker-compose/single-node/ (example path)
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Reference Manual - Requirements
|
# Reference Manual - Requirements
|
||||||
|
|
||||||
Before deploying Wazuh-Docker (version 4.14.7), it's essential to ensure your environment meets the necessary hardware and software requirements. Meeting these prerequisites will help ensure a stable and performant Wazuh deployment.
|
Before deploying Wazuh-Docker (version 4.14.0), it's essential to ensure your environment meets the necessary hardware and software requirements. Meeting these prerequisites will help ensure a stable and performant Wazuh deployment.
|
||||||
|
|
||||||
## Host System Requirements
|
## Host System Requirements
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Reference Manual - Glossary
|
# Reference Manual - Glossary
|
||||||
|
|
||||||
This glossary defines key terms and concepts related to Wazuh, Docker, and their use together in the Wazuh-Docker project (version 4.14.7).
|
This glossary defines key terms and concepts related to Wazuh, Docker, and their use together in the Wazuh-Docker project (version 4.14.0).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ This glossary defines key terms and concepts related to Wazuh, Docker, and their
|
|||||||
|
|
||||||
**D**
|
**D**
|
||||||
|
|
||||||
- **Dashboard (Wazuh Dashboard / OpenSearch Dashboards / Kibana)**: A web-based visualization tool used to explore, analyze, and visualize data stored in the Wazuh Indexer. It provides dashboards, visualizations, and a query interface for security events and alerts. For Wazuh 4.14.7, this is typically OpenSearch Dashboards.
|
- **Dashboard (Wazuh Dashboard / OpenSearch Dashboards / Kibana)**: A web-based visualization tool used to explore, analyze, and visualize data stored in the Wazuh Indexer. It provides dashboards, visualizations, and a query interface for security events and alerts. For Wazuh 4.14.0, this is typically OpenSearch Dashboards.
|
||||||
- **Decoder**: A component in the Wazuh Manager that parses and extracts relevant information (fields) from raw log messages or event data.
|
- **Decoder**: A component in the Wazuh Manager that parses and extracts relevant information (fields) from raw log messages or event data.
|
||||||
- **Docker**: An open platform for developing, shipping, and running applications inside containers.
|
- **Docker**: An open platform for developing, shipping, and running applications inside containers.
|
||||||
- **Docker Compose**: A tool for defining and running multi-container Docker applications. It uses a YAML file (`docker-compose.yml`) to configure the application's services, networks, and volumes.
|
- **Docker Compose**: A tool for defining and running multi-container Docker applications. It uses a YAML file (`docker-compose.yml`) to configure the application's services, networks, and volumes.
|
||||||
@@ -42,7 +42,7 @@ This glossary defines key terms and concepts related to Wazuh, Docker, and their
|
|||||||
|
|
||||||
**I**
|
**I**
|
||||||
|
|
||||||
- **Indexer (Wazuh Indexer / OpenSearch / Elasticsearch)**: The component responsible for storing, indexing, and making searchable the alerts and event data generated by the Wazuh Manager. For Wazuh 4.14.7, this is typically OpenSearch.
|
- **Indexer (Wazuh Indexer / OpenSearch / Elasticsearch)**: The component responsible for storing, indexing, and making searchable the alerts and event data generated by the Wazuh Manager. For Wazuh 4.14.0, this is typically OpenSearch.
|
||||||
|
|
||||||
**L**
|
**L**
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Wazuh Docker Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
# Wazuh Docker Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||||
FROM amazonlinux:2023
|
FROM ubuntu:focal
|
||||||
|
|
||||||
RUN yum update -y && yum install openssl curl-minimal -y
|
RUN apt-get update && apt-get install openssl curl -y
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|
||||||
|
|||||||
@@ -1,32 +1,9 @@
|
|||||||
# Certificate Creation Image Build
|
# Certificate creation image build
|
||||||
|
|
||||||
The dockerfile hosted in this directory is used to build the image required for generating Wazuh Docker single-node and multi-node certificate files
|
The dockerfile hosted in this directory is used to build the image used to boot Wazuh's single node and multi node stacks.
|
||||||
|
|
||||||
## Pre-requisites
|
To create the image, the following command must be executed:
|
||||||
|
|
||||||
1. Verify the Docker Buildx plugin is properly set up
|
|
||||||
2. For multi-architecture image builds:
|
|
||||||
- Ensure QEMU is installed
|
|
||||||
- Check permissions to push images to a Docker registry
|
|
||||||
|
|
||||||
Useful documentation:
|
|
||||||
|
|
||||||
- https://docs.docker.com/build/building/multi-platform/
|
|
||||||
- https://www.qemu.org/download/
|
|
||||||
|
|
||||||
## Procedure
|
|
||||||
|
|
||||||
Execute the following to run the script used to build the wazuh-certs-generator docker image
|
|
||||||
|
|
||||||
```console
|
|
||||||
cd indexer-certs-creator
|
|
||||||
```
|
```
|
||||||
|
$ docker build -t wazuh/wazuh-certs-generator:0.0.2 .
|
||||||
```console
|
|
||||||
./build-image.sh -v <IMAGE_TAG> [-m] [-rg <REGISTRY>]
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- Replace <IMAGE_TAG> with the new image desired tag.
|
|
||||||
- Use the `-m` flag to build a multi-architecture image (supports both `amd64` and `arm64`)
|
|
||||||
- If multiarch build is enabled, the script will attempt to push the image to the specified registry. This image upload will only work if credentials are properly configured.
|
|
||||||
- Use the `-rg <REGISTRY>` parameter to specify a custom Docker registry (default is Docker Hub)
|
|
||||||
|
|||||||
@@ -1,107 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Wazuh package generator
|
|
||||||
# Copyright (C) 2023, Wazuh Inc.
|
|
||||||
#
|
|
||||||
# This program is a free software; you can redistribute it
|
|
||||||
# and/or modify it under the terms of the GNU General Public
|
|
||||||
# License (version 2) as published by the FSF - Free Software
|
|
||||||
# Foundation.
|
|
||||||
|
|
||||||
WAZUH_CERTS_IMAGE_VERSION="0.0.4"
|
|
||||||
WAZUH_REGISTRY="docker.io"
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
trap ctrl_c INT
|
|
||||||
|
|
||||||
clean() {
|
|
||||||
exit_code=$1
|
|
||||||
exit ${exit_code}
|
|
||||||
}
|
|
||||||
|
|
||||||
ctrl_c() {
|
|
||||||
clean 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
build() {
|
|
||||||
IMAGE_TAG="${WAZUH_CERTS_IMAGE_VERSION}"
|
|
||||||
|
|
||||||
echo WAZUH_REGISTRY=$WAZUH_REGISTRY > .env
|
|
||||||
echo IMAGE_TAG=$IMAGE_TAG >> .env
|
|
||||||
|
|
||||||
set -a
|
|
||||||
source .env
|
|
||||||
set +a
|
|
||||||
|
|
||||||
if [ "${MULTIARCH}" ]; then
|
|
||||||
docker buildx bake \
|
|
||||||
--file build-image.yml \
|
|
||||||
--set *.platform=linux/amd64,linux/arm64 \
|
|
||||||
--push \
|
|
||||||
--no-cache || clean 1
|
|
||||||
else
|
|
||||||
docker buildx bake \
|
|
||||||
--file build-image.yml \
|
|
||||||
--load \
|
|
||||||
--no-cache || clean 1
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
help() {
|
|
||||||
echo
|
|
||||||
echo "Usage: $0 [OPTIONS]"
|
|
||||||
echo
|
|
||||||
echo " -v, --version <ver> [Optional] Set the image version. By default ${WAZUH_CERTS_IMAGE_VERSION}."
|
|
||||||
echo " -rg, --registry <reg> [Optional] Set the Docker registry to push the images."
|
|
||||||
echo " -m, --multiarch [Optional] Enable multi-architecture builds."
|
|
||||||
echo " -h, --help Show this help."
|
|
||||||
echo
|
|
||||||
exit $1
|
|
||||||
}
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
main() {
|
|
||||||
while [ -n "${1}" ]
|
|
||||||
do
|
|
||||||
case "${1}" in
|
|
||||||
"-h"|"--help")
|
|
||||||
help 0
|
|
||||||
;;
|
|
||||||
"-m"|"--multiarch")
|
|
||||||
MULTIARCH="true"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
"-rg"|"--registry")
|
|
||||||
if [ -n "${2}" ]; then
|
|
||||||
WAZUH_REGISTRY="${2}"
|
|
||||||
shift 2
|
|
||||||
else
|
|
||||||
help 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
"-v"|"--version")
|
|
||||||
if [ -n "$2" ]; then
|
|
||||||
WAZUH_CERTS_IMAGE_VERSION="$2"
|
|
||||||
shift 2
|
|
||||||
else
|
|
||||||
help 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
help 1
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
build || clean 1
|
|
||||||
|
|
||||||
clean 0
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
|
||||||
services:
|
|
||||||
wazuh.certs.generator:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
image: ${WAZUH_REGISTRY}/wazuh/wazuh-certs-generator:${IMAGE_TAG}
|
|
||||||
hostname: wazuh-certs-generator
|
|
||||||
@@ -8,35 +8,29 @@
|
|||||||
## Variables
|
## Variables
|
||||||
CERT_TOOL=wazuh-certs-tool.sh
|
CERT_TOOL=wazuh-certs-tool.sh
|
||||||
PASSWORD_TOOL=wazuh-passwords-tool.sh
|
PASSWORD_TOOL=wazuh-passwords-tool.sh
|
||||||
PACKAGES_URL=https://packages.wazuh.com/$CERT_TOOL_VERSION/
|
PACKAGES_URL=https://packages.wazuh.com/4.14/
|
||||||
PACKAGES_DEV_URL=https://packages-dev.wazuh.com/$CERT_TOOL_VERSION/
|
PACKAGES_DEV_URL=https://packages-dev.wazuh.com/4.14/
|
||||||
|
|
||||||
OUTPUT_FILE="/$CERT_TOOL"
|
## Check if the cert tool exists in S3 buckets
|
||||||
|
CERT_TOOL_PACKAGES=$(curl --silent --head --location --output /dev/null --write-out "%{http_code}" "$PACKAGES_URL$CERT_TOOL")
|
||||||
|
CERT_TOOL_PACKAGES_DEV=$(curl --silent --head --location --output /dev/null --write-out "%{http_code}" "$PACKAGES_DEV_URL$CERT_TOOL")
|
||||||
|
|
||||||
download_package() {
|
## If cert tool exists in some bucket, download it, if not exit 1
|
||||||
local url=$1
|
if [ "$CERT_TOOL_PACKAGES" = "200" ]; then
|
||||||
echo "Checking $url$CERT_TOOL ..."
|
curl -o $CERT_TOOL $PACKAGES_URL$CERT_TOOL -s
|
||||||
if curl -fsL "$url$CERT_TOOL" -o "$OUTPUT_FILE"; then
|
echo "The tool to create the certificates exists in the in Packages bucket"
|
||||||
echo "Downloaded $CERT_TOOL from $url"
|
elif [ "$CERT_TOOL_PACKAGES_DEV" = "200" ]; then
|
||||||
return 0
|
curl -o $CERT_TOOL $PACKAGES_DEV_URL$CERT_TOOL -s
|
||||||
else
|
echo "The tool to create the certificates exists in Packages-dev bucket"
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Try first the prod URL, if it fails try the dev URL
|
|
||||||
if download_package "$PACKAGES_URL"; then
|
|
||||||
:
|
|
||||||
elif download_package "$PACKAGES_DEV_URL"; then
|
|
||||||
:
|
|
||||||
else
|
else
|
||||||
echo "The tool to create the certificates does not exist in any bucket"
|
echo "The tool to create the certificates does not exist in any bucket"
|
||||||
echo "ERROR: certificates were not created"
|
echo "ERROR: certificates were not created"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp /config/certs.yml /config.yml
|
cp /config/certs.yml /config.yml
|
||||||
chmod 700 "$OUTPUT_FILE"
|
|
||||||
|
chmod 700 /$CERT_TOOL
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Creating Cluster certificates
|
# Creating Cluster certificates
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ hosts:
|
|||||||
port: 55000
|
port: 55000
|
||||||
username: wazuh-wui
|
username: wazuh-wui
|
||||||
password: "MyS3cr37P450r.*-"
|
password: "MyS3cr37P450r.*-"
|
||||||
run_as: true
|
run_as: false
|
||||||
|
|||||||
@@ -21,13 +21,6 @@ plugins.security.ssl.transport.pemtrustedcas_filepath: ${OPENSEARCH_PATH_CONF}/c
|
|||||||
plugins.security.ssl.http.enabled: true
|
plugins.security.ssl.http.enabled: true
|
||||||
plugins.security.ssl.transport.enforce_hostname_verification: false
|
plugins.security.ssl.transport.enforce_hostname_verification: false
|
||||||
plugins.security.ssl.transport.resolve_hostname: false
|
plugins.security.ssl.transport.resolve_hostname: false
|
||||||
plugins.security.ssl.http.enabled_ciphers:
|
|
||||||
- "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
|
|
||||||
- "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
|
|
||||||
- "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
|
|
||||||
- "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"
|
|
||||||
plugins.security.ssl.http.enabled_protocols:
|
|
||||||
- "TLSv1.2"
|
|
||||||
plugins.security.authcz.admin_dn:
|
plugins.security.authcz.admin_dn:
|
||||||
- "CN=admin,OU=Wazuh,O=Wazuh,L=California,C=US"
|
- "CN=admin,OU=Wazuh,O=Wazuh,L=California,C=US"
|
||||||
plugins.security.check_snapshot_restore_write_privileges: true
|
plugins.security.check_snapshot_restore_write_privileges: true
|
||||||
|
|||||||
@@ -21,13 +21,6 @@ plugins.security.ssl.transport.pemtrustedcas_filepath: ${OPENSEARCH_PATH_CONF}/c
|
|||||||
plugins.security.ssl.http.enabled: true
|
plugins.security.ssl.http.enabled: true
|
||||||
plugins.security.ssl.transport.enforce_hostname_verification: false
|
plugins.security.ssl.transport.enforce_hostname_verification: false
|
||||||
plugins.security.ssl.transport.resolve_hostname: false
|
plugins.security.ssl.transport.resolve_hostname: false
|
||||||
plugins.security.ssl.http.enabled_ciphers:
|
|
||||||
- "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
|
|
||||||
- "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
|
|
||||||
- "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
|
|
||||||
- "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"
|
|
||||||
plugins.security.ssl.http.enabled_protocols:
|
|
||||||
- "TLSv1.2"
|
|
||||||
plugins.security.authcz.admin_dn:
|
plugins.security.authcz.admin_dn:
|
||||||
- "CN=admin,OU=Wazuh,O=Wazuh,L=California,C=US"
|
- "CN=admin,OU=Wazuh,O=Wazuh,L=California,C=US"
|
||||||
plugins.security.check_snapshot_restore_write_privileges: true
|
plugins.security.check_snapshot_restore_write_privileges: true
|
||||||
|
|||||||
@@ -21,13 +21,6 @@ plugins.security.ssl.transport.pemtrustedcas_filepath: ${OPENSEARCH_PATH_CONF}/c
|
|||||||
plugins.security.ssl.http.enabled: true
|
plugins.security.ssl.http.enabled: true
|
||||||
plugins.security.ssl.transport.enforce_hostname_verification: false
|
plugins.security.ssl.transport.enforce_hostname_verification: false
|
||||||
plugins.security.ssl.transport.resolve_hostname: false
|
plugins.security.ssl.transport.resolve_hostname: false
|
||||||
plugins.security.ssl.http.enabled_ciphers:
|
|
||||||
- "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
|
|
||||||
- "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
|
|
||||||
- "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
|
|
||||||
- "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"
|
|
||||||
plugins.security.ssl.http.enabled_protocols:
|
|
||||||
- "TLSv1.2"
|
|
||||||
plugins.security.authcz.admin_dn:
|
plugins.security.authcz.admin_dn:
|
||||||
- "CN=admin,OU=Wazuh,O=Wazuh,L=California,C=US"
|
- "CN=admin,OU=Wazuh,O=Wazuh,L=California,C=US"
|
||||||
plugins.security.check_snapshot_restore_write_privileges: true
|
plugins.security.check_snapshot_restore_write_privileges: true
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||||
services:
|
services:
|
||||||
wazuh.master:
|
wazuh.master:
|
||||||
image: wazuh/wazuh-manager:4.14.7
|
image: wazuh/wazuh-manager:4.14.0
|
||||||
hostname: wazuh.master
|
hostname: wazuh.master
|
||||||
restart: always
|
restart: always
|
||||||
ulimits:
|
ulimits:
|
||||||
@@ -16,7 +16,7 @@ services:
|
|||||||
- "514:514/udp"
|
- "514:514/udp"
|
||||||
- "55000:55000"
|
- "55000:55000"
|
||||||
environment:
|
environment:
|
||||||
- INDEXER_URL="https://wazuh1.indexer:9200","https://wazuh2.indexer:9200","https://wazuh3.indexer:9200"
|
- INDEXER_URL=https://wazuh1.indexer:9200
|
||||||
- INDEXER_USERNAME=admin
|
- INDEXER_USERNAME=admin
|
||||||
- INDEXER_PASSWORD=SecretPassword
|
- INDEXER_PASSWORD=SecretPassword
|
||||||
- FILEBEAT_SSL_VERIFICATION_MODE=full
|
- FILEBEAT_SSL_VERIFICATION_MODE=full
|
||||||
@@ -43,7 +43,7 @@ services:
|
|||||||
- ./config/wazuh_cluster/wazuh_manager.conf:/wazuh-config-mount/etc/ossec.conf
|
- ./config/wazuh_cluster/wazuh_manager.conf:/wazuh-config-mount/etc/ossec.conf
|
||||||
|
|
||||||
wazuh.worker:
|
wazuh.worker:
|
||||||
image: wazuh/wazuh-manager:4.14.7
|
image: wazuh/wazuh-manager:4.14.0
|
||||||
hostname: wazuh.worker
|
hostname: wazuh.worker
|
||||||
restart: always
|
restart: always
|
||||||
ulimits:
|
ulimits:
|
||||||
@@ -79,7 +79,7 @@ services:
|
|||||||
- ./config/wazuh_cluster/wazuh_worker.conf:/wazuh-config-mount/etc/ossec.conf
|
- ./config/wazuh_cluster/wazuh_worker.conf:/wazuh-config-mount/etc/ossec.conf
|
||||||
|
|
||||||
wazuh1.indexer:
|
wazuh1.indexer:
|
||||||
image: wazuh/wazuh-indexer:4.14.7
|
image: wazuh/wazuh-indexer:4.14.0
|
||||||
hostname: wazuh1.indexer
|
hostname: wazuh1.indexer
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
@@ -105,7 +105,7 @@ services:
|
|||||||
- ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/config/opensearch-security/internal_users.yml
|
- ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/config/opensearch-security/internal_users.yml
|
||||||
|
|
||||||
wazuh2.indexer:
|
wazuh2.indexer:
|
||||||
image: wazuh/wazuh-indexer:4.14.7
|
image: wazuh/wazuh-indexer:4.14.0
|
||||||
hostname: wazuh2.indexer
|
hostname: wazuh2.indexer
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
@@ -127,7 +127,7 @@ services:
|
|||||||
- ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/config/opensearch-security/internal_users.yml
|
- ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/config/opensearch-security/internal_users.yml
|
||||||
|
|
||||||
wazuh3.indexer:
|
wazuh3.indexer:
|
||||||
image: wazuh/wazuh-indexer:4.14.7
|
image: wazuh/wazuh-indexer:4.14.0
|
||||||
hostname: wazuh3.indexer
|
hostname: wazuh3.indexer
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
@@ -149,7 +149,7 @@ services:
|
|||||||
- ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/config/opensearch-security/internal_users.yml
|
- ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/config/opensearch-security/internal_users.yml
|
||||||
|
|
||||||
wazuh.dashboard:
|
wazuh.dashboard:
|
||||||
image: wazuh/wazuh-dashboard:4.14.7
|
image: wazuh/wazuh-dashboard:4.14.0
|
||||||
hostname: wazuh.dashboard
|
hostname: wazuh.dashboard
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||||
services:
|
services:
|
||||||
generator:
|
generator:
|
||||||
image: wazuh/wazuh-certs-generator:0.0.4
|
image: wazuh/wazuh-certs-generator:0.0.2
|
||||||
hostname: wazuh-certs-generator
|
hostname: wazuh-certs-generator
|
||||||
environment:
|
|
||||||
- CERT_TOOL_VERSION=4.14
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./config/wazuh_indexer_ssl_certs/:/certificates/
|
- ./config/wazuh_indexer_ssl_certs/:/certificates/
|
||||||
- ./config/certs.yml:/config/certs.yml
|
- ./config/certs.yml:/config/certs.yml
|
||||||
@@ -4,4 +4,4 @@ hosts:
|
|||||||
port: 55000
|
port: 55000
|
||||||
username: wazuh-wui
|
username: wazuh-wui
|
||||||
password: "MyS3cr37P450r.*-"
|
password: "MyS3cr37P450r.*-"
|
||||||
run_as: true
|
run_as: false
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ cluster.name: "wazuh-cluster"
|
|||||||
path.data: /var/lib/wazuh-indexer
|
path.data: /var/lib/wazuh-indexer
|
||||||
path.logs: /var/log/wazuh-indexer
|
path.logs: /var/log/wazuh-indexer
|
||||||
discovery.type: single-node
|
discovery.type: single-node
|
||||||
|
http.port: 9200-9299
|
||||||
|
transport.tcp.port: 9300-9399
|
||||||
compatibility.override_main_response_version: true
|
compatibility.override_main_response_version: true
|
||||||
plugins.security.ssl.http.pemcert_filepath: /usr/share/wazuh-indexer/config/certs/wazuh.indexer.pem
|
plugins.security.ssl.http.pemcert_filepath: /usr/share/wazuh-indexer/config/certs/wazuh.indexer.pem
|
||||||
plugins.security.ssl.http.pemkey_filepath: /usr/share/wazuh-indexer/config/certs/wazuh.indexer.key
|
plugins.security.ssl.http.pemkey_filepath: /usr/share/wazuh-indexer/config/certs/wazuh.indexer.key
|
||||||
@@ -14,13 +16,6 @@ plugins.security.ssl.transport.pemtrustedcas_filepath: /usr/share/wazuh-indexer/
|
|||||||
plugins.security.ssl.http.enabled: true
|
plugins.security.ssl.http.enabled: true
|
||||||
plugins.security.ssl.transport.enforce_hostname_verification: false
|
plugins.security.ssl.transport.enforce_hostname_verification: false
|
||||||
plugins.security.ssl.transport.resolve_hostname: false
|
plugins.security.ssl.transport.resolve_hostname: false
|
||||||
plugins.security.ssl.http.enabled_ciphers:
|
|
||||||
- "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
|
|
||||||
- "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
|
|
||||||
- "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256"
|
|
||||||
- "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"
|
|
||||||
plugins.security.ssl.http.enabled_protocols:
|
|
||||||
- "TLSv1.2"
|
|
||||||
plugins.security.authcz.admin_dn:
|
plugins.security.authcz.admin_dn:
|
||||||
- "CN=admin,OU=Wazuh,O=Wazuh,L=California,C=US"
|
- "CN=admin,OU=Wazuh,O=Wazuh,L=California,C=US"
|
||||||
plugins.security.check_snapshot_restore_write_privileges: true
|
plugins.security.check_snapshot_restore_write_privileges: true
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||||
services:
|
services:
|
||||||
wazuh.manager:
|
wazuh.manager:
|
||||||
image: wazuh/wazuh-manager:4.14.7
|
image: merecu/wazuh-manager:4.14.0
|
||||||
hostname: wazuh.manager
|
hostname: wazuh.manager
|
||||||
restart: always
|
restart: always
|
||||||
ulimits:
|
ulimits:
|
||||||
@@ -17,7 +17,7 @@ services:
|
|||||||
- "514:514/udp"
|
- "514:514/udp"
|
||||||
- "55000:55000"
|
- "55000:55000"
|
||||||
environment:
|
environment:
|
||||||
- INDEXER_URL="https://wazuh.indexer:9200"
|
- INDEXER_URL=https://wazuh.indexer:9200
|
||||||
- INDEXER_USERNAME=admin
|
- INDEXER_USERNAME=admin
|
||||||
- INDEXER_PASSWORD=SecretPassword
|
- INDEXER_PASSWORD=SecretPassword
|
||||||
- FILEBEAT_SSL_VERIFICATION_MODE=full
|
- FILEBEAT_SSL_VERIFICATION_MODE=full
|
||||||
@@ -38,14 +38,13 @@ services:
|
|||||||
- wazuh_wodles:/var/ossec/wodles
|
- wazuh_wodles:/var/ossec/wodles
|
||||||
- filebeat_etc:/etc/filebeat
|
- filebeat_etc:/etc/filebeat
|
||||||
- filebeat_var:/var/lib/filebeat
|
- filebeat_var:/var/lib/filebeat
|
||||||
- /opt/stacks/wazuh/config/wazuh_indexer_ssl_certs/root-ca-manager.pem:/etc/ssl/root-ca.pem
|
- ./config/wazuh_indexer_ssl_certs/root-ca-manager.pem:/etc/ssl/root-ca.pem
|
||||||
- /opt/stacks/wazuh/config/wazuh_indexer_ssl_certs/wazuh.manager.pem:/etc/ssl/filebeat.pem
|
- ./config/wazuh_indexer_ssl_certs/wazuh.manager.pem:/etc/ssl/filebeat.pem
|
||||||
- /opt/stacks/wazuh/config/wazuh_indexer_ssl_certs/wazuh.manager-key.pem:/etc/ssl/filebeat.key
|
- ./config/wazuh_indexer_ssl_certs/wazuh.manager-key.pem:/etc/ssl/filebeat.key
|
||||||
- /opt/stacks/wazuh/config/wazuh_cluster/wazuh_manager.conf:/wazuh-config-mount/etc/ossec.conf
|
- ./config/wazuh_cluster/wazuh_manager.conf:/wazuh-config-mount/etc/ossec.conf
|
||||||
networks:
|
|
||||||
- backend
|
|
||||||
wazuh.indexer:
|
wazuh.indexer:
|
||||||
image: wazuh/wazuh-indexer:4.14.7
|
image: merecu/wazuh-indexer:4.14.0
|
||||||
hostname: wazuh.indexer
|
hostname: wazuh.indexer
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
@@ -61,22 +60,20 @@ services:
|
|||||||
hard: 65536
|
hard: 65536
|
||||||
volumes:
|
volumes:
|
||||||
- wazuh-indexer-data:/var/lib/wazuh-indexer
|
- wazuh-indexer-data:/var/lib/wazuh-indexer
|
||||||
- /opt/stacks/wazuh/config/wazuh_indexer_ssl_certs/root-ca.pem:/usr/share/wazuh-indexer/config/certs/root-ca.pem
|
- ./config/wazuh_indexer_ssl_certs/root-ca.pem:/usr/share/wazuh-indexer/config/certs/root-ca.pem
|
||||||
- /opt/stacks/wazuh/config/wazuh_indexer_ssl_certs/wazuh.indexer-key.pem:/usr/share/wazuh-indexer/config/certs/wazuh.indexer.key
|
- ./config/wazuh_indexer_ssl_certs/wazuh.indexer-key.pem:/usr/share/wazuh-indexer/config/certs/wazuh.indexer.key
|
||||||
- /opt/stacks/wazuh/config/wazuh_indexer_ssl_certs/wazuh.indexer.pem:/usr/share/wazuh-indexer/config/certs/wazuh.indexer.pem
|
- ./config/wazuh_indexer_ssl_certs/wazuh.indexer.pem:/usr/share/wazuh-indexer/config/certs/wazuh.indexer.pem
|
||||||
- /opt/stacks/wazuh/config/wazuh_indexer_ssl_certs/admin.pem:/usr/share/wazuh-indexer/config/certs/admin.pem
|
- ./config/wazuh_indexer_ssl_certs/admin.pem:/usr/share/wazuh-indexer/config/certs/admin.pem
|
||||||
- /opt/stacks/wazuh/config/wazuh_indexer_ssl_certs/admin-key.pem:/usr/share/wazuh-indexer/config/certs/admin-key.pem
|
- ./config/wazuh_indexer_ssl_certs/admin-key.pem:/usr/share/wazuh-indexer/config/certs/admin-key.pem
|
||||||
- /opt/stacks/wazuh/config/wazuh_indexer/wazuh.indexer.yml:/usr/share/wazuh-indexer/config/opensearch.yml
|
- ./config/wazuh_indexer/wazuh.indexer.yml:/usr/share/wazuh-indexer/config/opensearch.yml
|
||||||
- /opt/stacks/wazuh/config/wazuh_indexer/opensearch-security/:/usr/share/wazuh-indexer/config/opensearch-security/
|
- ./config/wazuh_indexer/internal_users.yml:/usr/share/wazuh-indexer/config/opensearch-security/internal_users.yml
|
||||||
networks:
|
|
||||||
- backend
|
|
||||||
|
|
||||||
wazuh.dashboard:
|
wazuh.dashboard:
|
||||||
image: wazuh/wazuh-dashboard:4.14.7
|
image: merecu/wazuh-dashboard:4.14.0
|
||||||
hostname: wazuh.dashboard
|
hostname: wazuh.dashboard
|
||||||
restart: always
|
restart: always
|
||||||
#ports:
|
ports:
|
||||||
# - 443:5601
|
- 443:5601
|
||||||
environment:
|
environment:
|
||||||
- INDEXER_USERNAME=admin
|
- INDEXER_USERNAME=admin
|
||||||
- INDEXER_PASSWORD=SecretPassword
|
- INDEXER_PASSWORD=SecretPassword
|
||||||
@@ -86,11 +83,11 @@ services:
|
|||||||
- API_USERNAME=wazuh-wui
|
- API_USERNAME=wazuh-wui
|
||||||
- API_PASSWORD=MyS3cr37P450r.*-
|
- API_PASSWORD=MyS3cr37P450r.*-
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/stacks/wazuh/config/wazuh_indexer_ssl_certs/wazuh.dashboard.pem:/usr/share/wazuh-dashboard/certs/wazuh-dashboard.pem
|
- ./config/wazuh_indexer_ssl_certs/wazuh.dashboard.pem:/usr/share/wazuh-dashboard/certs/wazuh-dashboard.pem
|
||||||
- /opt/stacks/wazuh/config/wazuh_indexer_ssl_certs/wazuh.dashboard-key.pem:/usr/share/wazuh-dashboard/certs/wazuh-dashboard-key.pem
|
- ./config/wazuh_indexer_ssl_certs/wazuh.dashboard-key.pem:/usr/share/wazuh-dashboard/certs/wazuh-dashboard-key.pem
|
||||||
- /opt/stacks/wazuh/config/wazuh_indexer_ssl_certs/root-ca.pem:/usr/share/wazuh-dashboard/certs/root-ca.pem
|
- ./config/wazuh_indexer_ssl_certs/root-ca.pem:/usr/share/wazuh-dashboard/certs/root-ca.pem
|
||||||
- /opt/stacks/wazuh/config/wazuh_dashboard/opensearch_dashboards.yml:/usr/share/wazuh-dashboard/config/opensearch_dashboards.yml
|
- ./config/wazuh_dashboard/opensearch_dashboards.yml:/usr/share/wazuh-dashboard/config/opensearch_dashboards.yml
|
||||||
- /opt/stacks/wazuh/config/wazuh_dashboard/wazuh.yml:/usr/share/wazuh-dashboard/data/wazuh/config/wazuh.yml
|
- ./config/wazuh_dashboard/wazuh.yml:/usr/share/wazuh-dashboard/data/wazuh/config/wazuh.yml
|
||||||
- wazuh-dashboard-config:/usr/share/wazuh-dashboard/data/wazuh/config
|
- wazuh-dashboard-config:/usr/share/wazuh-dashboard/data/wazuh/config
|
||||||
- wazuh-dashboard-custom:/usr/share/wazuh-dashboard/plugins/wazuh/public/assets/custom
|
- wazuh-dashboard-custom:/usr/share/wazuh-dashboard/plugins/wazuh/public/assets/custom
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -98,16 +95,7 @@ services:
|
|||||||
links:
|
links:
|
||||||
- wazuh.indexer:wazuh.indexer
|
- wazuh.indexer:wazuh.indexer
|
||||||
- wazuh.manager:wazuh.manager
|
- wazuh.manager:wazuh.manager
|
||||||
labels:
|
|
||||||
- traefik.enable=true
|
|
||||||
- traefik.http.routers.wazuh-dashboard.rule=Host(`wazuh.fuusenkazura.io`)
|
|
||||||
- traefik.http.routers.wazuh-dashboard.entrypoints=websecure
|
|
||||||
- traefik.http.routers.wazuh-dashboard.tls.certresolver=ovh
|
|
||||||
- traefik.http.services.wazuh-dashboard.loadbalancer.server.scheme=https
|
|
||||||
- traefik.http.services.wazuh-dashboard.loadbalancer.server.port=5601
|
|
||||||
networks:
|
|
||||||
- backend
|
|
||||||
- web
|
|
||||||
volumes:
|
volumes:
|
||||||
wazuh_api_configuration:
|
wazuh_api_configuration:
|
||||||
wazuh_etc:
|
wazuh_etc:
|
||||||
@@ -123,9 +111,3 @@ volumes:
|
|||||||
wazuh-indexer-data:
|
wazuh-indexer-data:
|
||||||
wazuh-dashboard-config:
|
wazuh-dashboard-config:
|
||||||
wazuh-dashboard-custom:
|
wazuh-dashboard-custom:
|
||||||
|
|
||||||
networks:
|
|
||||||
web:
|
|
||||||
external: true
|
|
||||||
backend:
|
|
||||||
external: true
|
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||||
services:
|
services:
|
||||||
generator:
|
generator:
|
||||||
image: wazuh/wazuh-certs-generator:0.0.4
|
image: wazuh/wazuh-certs-generator:0.0.2
|
||||||
hostname: wazuh-certs-generator
|
hostname: wazuh-certs-generator
|
||||||
environment:
|
|
||||||
- CERT_TOOL_VERSION=4.14
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./config/wazuh_indexer_ssl_certs/:/certificates/
|
- ./config/wazuh_indexer_ssl_certs/:/certificates/
|
||||||
- ./config/certs.yml:/config/certs.yml
|
- ./config/certs.yml:/config/certs.yml
|
||||||
|
|||||||
@@ -146,6 +146,11 @@ main() {
|
|||||||
# Get old version and stage
|
# Get old version and stage
|
||||||
get_old_version_and_stage
|
get_old_version_and_stage
|
||||||
|
|
||||||
|
if [[ "${OLD_VERSION}" == "${VERSION}" && "${OLD_STAGE}" == "${STAGE}" ]]; then
|
||||||
|
echo "Version and stage are already up to date." | tee -a "${LOG_FILE}"
|
||||||
|
echo "No changes needed." | tee -a "${LOG_FILE}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
if [[ "${OLD_VERSION}" != "${VERSION}" ]]; then
|
if [[ "${OLD_VERSION}" != "${VERSION}" ]]; then
|
||||||
echo "Updating version from ${OLD_VERSION} to ${VERSION}" | tee -a "${LOG_FILE}"
|
echo "Updating version from ${OLD_VERSION} to ${VERSION}" | tee -a "${LOG_FILE}"
|
||||||
update_version_in_files "${VERSION}"
|
update_version_in_files "${VERSION}"
|
||||||
|
|||||||
@@ -20,9 +20,8 @@
|
|||||||
<enabled>yes</enabled>
|
<enabled>yes</enabled>
|
||||||
<manager_address>CHANGE_ENROLL_IP</manager_address>
|
<manager_address>CHANGE_ENROLL_IP</manager_address>
|
||||||
<port>CHANGE_ENROLL_PORT</port>
|
<port>CHANGE_ENROLL_PORT</port>
|
||||||
<agent_name>CHANGE_AGENT_NAME</agent_name>
|
<agent_name>CHANGEE_AGENT_NAME</agent_name>
|
||||||
<authorization_pass_path>etc/authd.pass</authorization_pass_path>
|
<authorization_pass_path>etc/authd.pass</authorization_pass_path>
|
||||||
<groups>CHANGE_AGENT_GROUP</groups>
|
|
||||||
</enrollment>
|
</enrollment>
|
||||||
</client>
|
</client>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||||
services:
|
services:
|
||||||
wazuh.agent:
|
wazuh.agent:
|
||||||
image: wazuh/wazuh-agent:4.14.7
|
image: wazuh/wazuh-agent:4.14.0
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
- WAZUH_MANAGER_SERVER=<WAZUH_MANAGER_IP>
|
- WAZUH_MANAGER_SERVER=<WAZUH_MANAGER_IP>
|
||||||
|
|||||||
Reference in New Issue
Block a user