forked from wazuh/wazuh-docker
Compare commits
61
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0d808c0d6 | ||
|
|
a6fe792ec3 | ||
|
|
5c1dfafdd7 | ||
|
|
88ef9edf19 | ||
|
|
9c9f1bccbc | ||
|
|
54b4f68a28 | ||
|
|
2fd6f5aeb7 | ||
|
|
bd9286b225 | ||
|
|
8bac944a92 | ||
|
|
b5c43c34e7 | ||
|
|
03a27b5645 | ||
|
|
a70b0bd492 | ||
|
|
6b9e2fbfb3 | ||
|
|
b06d9c97bc | ||
|
|
c137354203 | ||
|
|
388b2c2225 | ||
|
|
92c091d977 | ||
|
|
7927df1d34 | ||
|
|
3b4cc5973c | ||
|
|
fab6c9ce6e | ||
|
|
ccf61969ff | ||
|
|
28a9485f2c | ||
|
|
77c8526c1c | ||
|
|
239dee0ebe | ||
|
|
00fb4eac7b | ||
|
|
f5c6655b4e | ||
|
|
684ba9ba26 | ||
|
|
77d4b938a6 | ||
|
|
6b744ec15f | ||
|
|
b0ec957542 | ||
|
|
2a49af4249 | ||
|
|
2131887019 | ||
|
|
93ac3e59f9 | ||
|
|
e3b30d3d23 | ||
|
|
dd1b0e9afa | ||
|
|
601adce637 | ||
|
|
992a78c4a0 | ||
|
|
325371a644 | ||
|
|
8d9afc6037 | ||
|
|
739dbca613 | ||
|
|
6feb42ab07 | ||
|
|
75959484f3 | ||
|
|
ebbf3b585f | ||
|
|
3384ccbc9b | ||
|
|
38a9c54eea | ||
|
|
3f9f48302a | ||
|
|
28fefbc5b6 | ||
|
|
df8c1555ed | ||
|
|
1c527dc643 | ||
|
|
9e086e4eab | ||
|
|
1fddae6f5c | ||
|
|
5950bdc474 | ||
|
|
ad71d8596d | ||
|
|
158aedd989 | ||
|
|
3adc3aedd5 | ||
|
|
6087f14835 | ||
|
|
56c73be50c | ||
|
|
4161af024f | ||
|
|
6aa5015a0b | ||
|
|
2d1c28ca8a | ||
|
|
bab0839cea |
@@ -1,3 +1,4 @@
|
||||
WAZUH_VERSION=5.0.0
|
||||
WAZUH_IMAGE_VERSION=5.0.0
|
||||
WAZUH_REGISTRY=docker.io
|
||||
IMAGE_TAG=5.0.0
|
||||
|
||||
@@ -138,6 +138,10 @@ jobs:
|
||||
git add .
|
||||
git commit -m "feat: bump ${{ github.ref_name }}"
|
||||
|
||||
- name: Fetch full history (Revert)
|
||||
if: inputs.revert == true
|
||||
run: git fetch --unshallow
|
||||
|
||||
- name: Revert references (Revert)
|
||||
id: revert_step
|
||||
if: inputs.revert == true
|
||||
@@ -214,4 +218,4 @@ jobs:
|
||||
echo "Branch: ${{ steps.vars.outputs.branch_name }}"
|
||||
echo "PR: ${{ steps.create_pr.outputs.pull_request_url }}"
|
||||
echo "Revert bumper scripts logs:"
|
||||
cat ${BUMP_LOG_PATH}/repository_bumper*log || true
|
||||
cat ${BUMP_LOG_PATH}/repository_bumper*log || true
|
||||
|
||||
@@ -4,6 +4,7 @@ permissions:
|
||||
id-token: write
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
docker_reference:
|
||||
@@ -14,6 +15,7 @@ on:
|
||||
jobs:
|
||||
|
||||
prepare-variables:
|
||||
if: ${{ !github.event.pull_request.draft }}
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
WAZUH_VERSION: ${{ steps.dotenv.outputs.WAZUH_VERSION }}
|
||||
@@ -44,7 +46,7 @@ jobs:
|
||||
with:
|
||||
image_tag: ${{ needs.prepare-variables.outputs.WAZUH_IMAGE_VERSION }}
|
||||
docker_reference: ${{ github.head_ref || inputs.docker_reference }}
|
||||
wazuh_automation_reference: 'main'
|
||||
wazuh_automation_reference: 'v5.0.0-beta2'
|
||||
commit_list: '["latest", "latest", "latest", "latest"]'
|
||||
assistant_revision: 'latest'
|
||||
id: ${{ github.run_id }}
|
||||
@@ -76,7 +78,7 @@ jobs:
|
||||
uses: aws-actions/amazon-ecr-login@v2
|
||||
|
||||
- name: Execute Goss tests (wazuh-manager)
|
||||
run: dgoss run ${{ env.WAZUH_REGISTRY }}/wazuh/wazuh-manager:${{ env.WAZUH_IMAGE_VERSION }}
|
||||
run: dgoss run ${{ env.WAZUH_REGISTRY }}/wazuh/wazuh-manager:${{ env.WAZUH_IMAGE_VERSION }}-latest
|
||||
env:
|
||||
GOSS_SLEEP: 30
|
||||
GOSS_FILE: .github/.goss.yaml
|
||||
@@ -88,7 +90,7 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-22.04, ubuntu-22.04-arm]
|
||||
fail-fast: false
|
||||
needs: [prepare-variables, Execute-Goss-tests, build-images]
|
||||
needs: [prepare-variables, Execute-Goss-tests]
|
||||
env:
|
||||
WAZUH_IMAGE_VERSION: ${{ needs.prepare-variables.outputs.WAZUH_IMAGE_VERSION }}
|
||||
WAZUH_MINOR_VERSION: ${{ needs.prepare-variables.outputs.WAZUH_MINOR_VERSION }}
|
||||
@@ -162,6 +164,7 @@ jobs:
|
||||
if [ -f "$TARGET_FILE" ]; then
|
||||
echo "Updating registry in $TARGET_FILE to: ${{ env.WAZUH_REGISTRY }}"
|
||||
sed -i "s|wazuh/wazuh-|${{ env.WAZUH_REGISTRY }}/wazuh/wazuh-|g" "$TARGET_FILE"
|
||||
sed -i "s/\(.*wazuh\/wazuh-.*:\)${{ env.WAZUH_IMAGE_VERSION }}/\1${{ env.WAZUH_IMAGE_VERSION }}-latest/g" "$TARGET_FILE"
|
||||
else
|
||||
echo "File $TARGET_FILE not found"
|
||||
exit 1
|
||||
@@ -284,6 +287,7 @@ jobs:
|
||||
if [ -f "$TARGET_FILE" ]; then
|
||||
echo "Updating registry in $TARGET_FILE to: ${{ env.WAZUH_REGISTRY }}"
|
||||
sed -i "s|wazuh/wazuh-|${{ env.WAZUH_REGISTRY }}/wazuh/wazuh-|g" "$TARGET_FILE"
|
||||
sed -i "s/\(.*wazuh\/wazuh-.*:\)${{ env.WAZUH_IMAGE_VERSION }}/\1${{ env.WAZUH_IMAGE_VERSION }}-latest/g" "$TARGET_FILE"
|
||||
else
|
||||
echo "File $TARGET_FILE not found"
|
||||
exit 1
|
||||
@@ -361,7 +365,7 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-22.04, ubuntu-22.04-arm]
|
||||
fail-fast: false
|
||||
needs: [prepare-variables, Execute-Goss-tests, build-images]
|
||||
needs: [prepare-variables, Execute-Goss-tests]
|
||||
env:
|
||||
WAZUH_IMAGE_VERSION: ${{ needs.prepare-variables.outputs.WAZUH_IMAGE_VERSION }}
|
||||
WAZUH_MINOR_VERSION: ${{ needs.prepare-variables.outputs.WAZUH_MINOR_VERSION }}
|
||||
@@ -441,6 +445,7 @@ jobs:
|
||||
if [ -f "$TARGET_FILE" ]; then
|
||||
echo "Updating registry in $TARGET_FILE to: ${{ env.WAZUH_REGISTRY }}"
|
||||
sed -i "s|wazuh/wazuh-|${{ env.WAZUH_REGISTRY }}/wazuh/wazuh-|g" "$TARGET_FILE"
|
||||
sed -i "s/\(.*wazuh\/wazuh-.*:\)${{ env.WAZUH_IMAGE_VERSION }}/\1${{ env.WAZUH_IMAGE_VERSION }}-latest/g" "$TARGET_FILE"
|
||||
else
|
||||
echo "File $TARGET_FILE not found"
|
||||
exit 1
|
||||
@@ -573,6 +578,7 @@ jobs:
|
||||
if [ -f "$TARGET_FILE" ]; then
|
||||
echo "Updating registry in $TARGET_FILE to: ${{ env.WAZUH_REGISTRY }}"
|
||||
sed -i "s|wazuh/wazuh-|${{ env.WAZUH_REGISTRY }}/wazuh/wazuh-|g" "$TARGET_FILE"
|
||||
sed -i "s/\(.*wazuh\/wazuh-.*:\)${{ env.WAZUH_IMAGE_VERSION }}/\1${{ env.WAZUH_IMAGE_VERSION }}-latest/g" "$TARGET_FILE"
|
||||
else
|
||||
echo "File $TARGET_FILE not found"
|
||||
exit 1
|
||||
|
||||
@@ -6,7 +6,7 @@ on:
|
||||
inputs:
|
||||
image_tag:
|
||||
description: 'Docker image tag'
|
||||
default: '5.0.0'
|
||||
default: 'v5.0.0-beta2'
|
||||
required: true
|
||||
docker_reference:
|
||||
description: 'wazuh-docker reference'
|
||||
@@ -14,7 +14,7 @@ on:
|
||||
wazuh_automation_reference:
|
||||
description: 'Branch or tag of the wazuh-automation repository'
|
||||
required: false
|
||||
default: 'main'
|
||||
default: 'v5.0.0-beta2'
|
||||
products:
|
||||
description: 'Comma-separated list of the image names to build and push'
|
||||
default: 'wazuh-manager,wazuh-dashboard,wazuh-indexer,wazuh-agent'
|
||||
@@ -42,7 +42,7 @@ on:
|
||||
inputs:
|
||||
image_tag:
|
||||
description: 'Docker image tag'
|
||||
default: '5.0.0'
|
||||
default: 'v5.0.0-beta2'
|
||||
required: true
|
||||
type: string
|
||||
docker_reference:
|
||||
@@ -52,7 +52,7 @@ on:
|
||||
wazuh_automation_reference:
|
||||
description: 'Branch or tag of the wazuh-automation repository'
|
||||
required: false
|
||||
default: 'main'
|
||||
default: 'v5.0.0-beta2'
|
||||
type: string
|
||||
products:
|
||||
description: 'Comma-separated list of the image names to build and push'
|
||||
@@ -233,6 +233,11 @@ jobs:
|
||||
source ${{ env.WORKFLOW_VENV }}/bin/activate
|
||||
WAZUH_COMPONENTS='${{ needs.setup.outputs.WAZUH_COMPONENTS }}'
|
||||
COMMIT_LIST='${{ needs.setup.outputs.COMMIT_LIST }}'
|
||||
SCRIPT_PARAMS="--process ${{ env.PRESIGNED_URLS_SCRIPT_PROCESS }} \
|
||||
--wazuh-version ${{ env.WAZUH_VERSION }} \
|
||||
--aws-s3-bucket-dev ${{ env.LOCAL_AWS_S3_BUCKET_DEV }} \
|
||||
--assistant-revision $ASSISTANT_REVISION "
|
||||
|
||||
|
||||
# Parse components and their revisions
|
||||
COMPONENTS=($(echo "$WAZUH_COMPONENTS" | jq -r '.[]'))
|
||||
@@ -251,29 +256,22 @@ jobs:
|
||||
for i in "${!COMPONENTS[@]}"; do
|
||||
case "${COMPONENTS[$i]}" in
|
||||
wazuh-manager)
|
||||
MANAGER_REVISION="${REVISIONS[$i]}"
|
||||
SCRIPT_PARAMS+="--manager-revision ${REVISIONS[$i]} "
|
||||
;;
|
||||
wazuh-dashboard)
|
||||
DASHBOARD_REVISION="${REVISIONS[$i]}"
|
||||
SCRIPT_PARAMS+="--dashboard-revision ${REVISIONS[$i]} "
|
||||
;;
|
||||
wazuh-indexer)
|
||||
INDEXER_REVISION="${REVISIONS[$i]}"
|
||||
SCRIPT_PARAMS+="--indexer-revision ${REVISIONS[$i]} "
|
||||
;;
|
||||
wazuh-agent)
|
||||
AGENT_REVISION="${REVISIONS[$i]}"
|
||||
SCRIPT_PARAMS+="--agent-revision ${REVISIONS[$i]} "
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
python ${{ env.GENERATE_PRESIGNED_URLS_SCRIPT_PATH }} \
|
||||
--process ${{ env.PRESIGNED_URLS_SCRIPT_PROCESS }} \
|
||||
--wazuh-version ${{ env.WAZUH_VERSION }} \
|
||||
--aws-s3-bucket-dev ${{ env.LOCAL_AWS_S3_BUCKET_DEV }} \
|
||||
--indexer-revision $INDEXER_REVISION \
|
||||
--manager-revision $MANAGER_REVISION \
|
||||
--dashboard-revision $DASHBOARD_REVISION \
|
||||
--agent-revision $AGENT_REVISION \
|
||||
--assistant-revision $ASSISTANT_REVISION
|
||||
$SCRIPT_PARAMS
|
||||
|
||||
- name: Save presigned URLs file to artifact
|
||||
if: ${{ inputs.dev == true }}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
name: PR Check - Docker Integration Tests
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
pr_head_ref:
|
||||
description: 'Branch of wazuh-docker to test'
|
||||
required: true
|
||||
type: string
|
||||
automation_reference:
|
||||
description: 'Branch of wazuh-automation to use'
|
||||
required: false
|
||||
default: 'main'
|
||||
type: string
|
||||
deployment_type:
|
||||
description: 'Deployment type to test'
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- single-node
|
||||
- multi-node
|
||||
- both
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
placeholder:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "Workflow registered. Use workflow_dispatch selecting the feature branch."
|
||||
+1
-1
@@ -12,7 +12,7 @@ multi-node/wazuh-certificates/*
|
||||
multi-node/wazuh-certificates-tool.log
|
||||
multi-node/wazuh-certs-tool*.sh
|
||||
multi-node/config*.yml
|
||||
multi-node/config/wazuh*
|
||||
multi-node/config/*/certs
|
||||
|
||||
# Documentation
|
||||
docs/book/
|
||||
|
||||
+10
-3
@@ -5,12 +5,18 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
### Added
|
||||
|
||||
- None
|
||||
- Add revert option into bumper workflow ([#2330](https://github.com/wazuh/wazuh-docker/pull/2330))
|
||||
- Add checks for artifact_urls.yaml download ([#2315](https://github.com/wazuh/wazuh-docker/pull/2315))
|
||||
- Add set_as_main option ([#2293](https://github.com/wazuh/wazuh-docker/pull/2293))
|
||||
|
||||
### Changed
|
||||
|
||||
- Add checks for artifact_urls.yaml download ([#2315](https://github.com/wazuh/wazuh-docker/pull/2315))
|
||||
- Add set_as_main option ([#2293](https://github.com/wazuh/wazuh-docker/pull/2293))
|
||||
- Forbid pr_check workflow execution in draft PRs ([#2399](https://github.com/wazuh/wazuh-docker/pull/2399))
|
||||
- Unification of user UID and GID ([#2393](https://github.com/wazuh/wazuh-docker/pull/2393))
|
||||
- Add Wazuh indexer engine start on entrypoint ([#2390](https://github.com/wazuh/wazuh-docker/pull/2390))
|
||||
- Image build process update ([#2358](https://github.com/wazuh/wazuh-docker/pull/2358))
|
||||
- Add new path on artifact_urls file ([#2344](https://github.com/wazuh/wazuh-docker/pull/2344))
|
||||
- Presigned URLs generation enhancement ([#2346](https://github.com/wazuh/wazuh-docker/pull/2346))
|
||||
- Adapt bumper workflows to change main branch ([#2294](https://github.com/wazuh/wazuh-docker/pull/2294))
|
||||
- Delete all API user and password references and Wazuh agent references ([#2289](https://github.com/wazuh/wazuh-docker/pull/2289))
|
||||
- Create certificate directory with default user and group ([#2287](https://github.com/wazuh/wazuh-docker/pull/2287))
|
||||
@@ -49,6 +55,7 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Delete setcap command on deprecated file ([#2345](https://github.com/wazuh/wazuh-docker/pull/2345))
|
||||
- Modify the choice of a correct tag ([#2313](https://github.com/wazuh/wazuh-docker/pull/2313))
|
||||
- Artifact URL download fix ([#2306](https://github.com/wazuh/wazuh-docker/pull/2306))
|
||||
- Change API query method. ([#2275](https://github.com/wazuh/wazuh-docker/pull/2275))
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"version": "5.0.0",
|
||||
"stage": "beta1"
|
||||
"stage": "beta2"
|
||||
}
|
||||
@@ -42,11 +42,13 @@ build() {
|
||||
WAZUH_MINOR_VERSION="${WAZUH_IMAGE_VERSION%.*}"
|
||||
# WAZUH_MAJOR_VERSION: Extracts major version only (e.g., 5.0.0 -> 5)
|
||||
WAZUH_MAJOR_VERSION="${WAZUH_IMAGE_VERSION%%.*}"
|
||||
# WAZUH_STAGE: Extract the 'stage' (e.g., alpha0, beta1, rc2) from the local JSON metadata file.
|
||||
# WAZUH_STAGE: Extract the 'stage' (e.g., alpha0, beta2, rc2) from the local JSON metadata file.
|
||||
# Note: This is primarily used for pre-release package naming.
|
||||
WAZUH_STAGE=$(jq -r '.stage' ../VERSION.json)
|
||||
# ARTIFACT_URLS_FILE: The name of the artifact URLs file.
|
||||
ARTIFACT_URLS_FILE="artifact_urls.yaml"
|
||||
# ARTIFACT_URLS_DIR: The name of the artifact URLs directory.
|
||||
ARTIFACT_URLS_DIR="artifact-urls"
|
||||
|
||||
# Check if the artifact file already exists to prevent redundant downloads
|
||||
if [[ -f "$ARTIFACT_URLS_FILE" ]]; then
|
||||
@@ -92,7 +94,7 @@ build() {
|
||||
|
||||
# Final download using dynamic variables based on the release type.
|
||||
# Pattern: server / stage / major_version.x / filename
|
||||
FULL_URL="https://${PACKAGE_URL}/${RELEASE_STAGE}/${WAZUH_MAJOR_VERSION}.x/${ARTIFACT_URLS_DOWNLOAD}"
|
||||
FULL_URL="https://${PACKAGE_URL}/${RELEASE_STAGE}/${WAZUH_MAJOR_VERSION}.x/${ARTIFACT_URLS_DIR}/${ARTIFACT_URLS_DOWNLOAD}"
|
||||
echo "Attempting to download: $FULL_URL"
|
||||
curl -fsSL -o "$ARTIFACT_URLS_FILE" "$FULL_URL" || {
|
||||
echo "Error: Failed to download artifact URLs from $FULL_URL" >&2
|
||||
@@ -164,52 +166,23 @@ build() {
|
||||
fi
|
||||
|
||||
|
||||
# Function to get component-specific commit reference
|
||||
get_component_commit() {
|
||||
local component=$1
|
||||
case "${component}" in
|
||||
wazuh-indexer)
|
||||
echo "${INDEXER_COMMIT}"
|
||||
;;
|
||||
wazuh-manager)
|
||||
echo "${MANAGER_COMMIT}"
|
||||
;;
|
||||
wazuh-dashboard)
|
||||
echo "${DASHBOARD_COMMIT}"
|
||||
;;
|
||||
wazuh-agent)
|
||||
echo "${AGENT_COMMIT}"
|
||||
;;
|
||||
*)
|
||||
echo ""
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Global env file (without IMAGE_TAG - will be component-specific)
|
||||
# Write the global .env file used by deployment compose files.
|
||||
# IMAGE_TAG here reflects a non-dev, non-per-component tag for reference.
|
||||
local base_tag="${WAZUH_IMAGE_VERSION}${WAZUH_DEV_STAGE:+-${WAZUH_DEV_STAGE,,}}"
|
||||
echo WAZUH_VERSION=$WAZUH_IMAGE_VERSION > ../.env
|
||||
echo WAZUH_IMAGE_VERSION=$WAZUH_IMAGE_VERSION >> ../.env
|
||||
echo WAZUH_REGISTRY=$WAZUH_REGISTRY >> ../.env
|
||||
echo IMAGE_TAG=${base_tag} >> ../.env
|
||||
|
||||
set -a
|
||||
source ../.env
|
||||
source ./artifacts_env.txt
|
||||
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
|
||||
# Validate component if a specific one was requested.
|
||||
if [ -n "${WAZUH_COMPONENT}" ]; then
|
||||
case "${WAZUH_COMPONENT}" in
|
||||
wazuh-indexer|wazuh-manager|wazuh-dashboard|wazuh-agent)
|
||||
components_to_build=("${WAZUH_COMPONENT}")
|
||||
;;
|
||||
wazuh-indexer|wazuh-manager|wazuh-dashboard|wazuh-agent) ;;
|
||||
*)
|
||||
echo "Error: Unknown component '${WAZUH_COMPONENT}'" >&2
|
||||
clean 1
|
||||
@@ -217,77 +190,51 @@ build() {
|
||||
esac
|
||||
fi
|
||||
|
||||
# Determine build command and base options
|
||||
# Generate per-component image tags.
|
||||
# The commit suffix is only appended when --dev is passed. This ensures:
|
||||
# dev=false, tag=5.0.0 → 5.0.0
|
||||
# dev=false, tag=5.0.0-beta2 → 5.0.0-beta2
|
||||
# dev=true, tag=5.0.0 → 5.0.0-latest
|
||||
# dev=true, tag=5.0.0-beta2 → 5.0.0-beta2-latest
|
||||
make_tag() {
|
||||
local commit=$1
|
||||
if [ -n "${IS_DEV_BUILD}" ]; then
|
||||
echo "${WAZUH_IMAGE_VERSION}${WAZUH_DEV_STAGE:+-${WAZUH_DEV_STAGE,,}}-${commit}"
|
||||
else
|
||||
echo "${base_tag}"
|
||||
fi
|
||||
}
|
||||
|
||||
export WAZUH_VERSION="$WAZUH_IMAGE_VERSION"
|
||||
export MULTIARCH="${MULTIARCH}"
|
||||
export INDEXER_TAG=$(make_tag "${INDEXER_COMMIT:-latest}")
|
||||
export MANAGER_TAG=$(make_tag "${MANAGER_COMMIT:-latest}")
|
||||
export DASHBOARD_TAG=$(make_tag "${DASHBOARD_COMMIT:-latest}")
|
||||
export AGENT_TAG=$(make_tag "${AGENT_COMMIT:-latest}")
|
||||
|
||||
echo "Image tags:"
|
||||
echo " wazuh-indexer: ${WAZUH_REGISTRY}/wazuh/wazuh-indexer:${INDEXER_TAG}"
|
||||
echo " wazuh-manager: ${WAZUH_REGISTRY}/wazuh/wazuh-manager:${MANAGER_TAG}"
|
||||
echo " wazuh-dashboard: ${WAZUH_REGISTRY}/wazuh/wazuh-dashboard:${DASHBOARD_TAG}"
|
||||
echo " wazuh-agent: ${WAZUH_REGISTRY}/wazuh/wazuh-agent:${AGENT_TAG}"
|
||||
|
||||
# Bake options: --push for multi-arch (can't load multi-platform locally),
|
||||
# --load for single-arch (stores image in local Docker daemon).
|
||||
local bake_opts="--no-cache"
|
||||
if [ "${MULTIARCH}" ]; then
|
||||
build_cmd="docker buildx build --platform linux/amd64,linux/arm64 --push --no-cache"
|
||||
bake_opts="${bake_opts} --push"
|
||||
else
|
||||
build_cmd="docker build --no-cache"
|
||||
bake_opts="${bake_opts} --load"
|
||||
fi
|
||||
|
||||
# Build each component
|
||||
for component in "${components_to_build[@]}"; do
|
||||
echo "Building ${component} image..."
|
||||
|
||||
# Get component-specific commit reference
|
||||
COMPONENT_COMMIT=$(get_component_commit "${component}")
|
||||
|
||||
# Generate component-specific IMAGE_TAG.
|
||||
# The commit suffix is only appended when --dev was passed, which maps
|
||||
# directly to inputs.dev=true in the workflow. This ensures:
|
||||
# dev=false, tag=5.0.0 → 5.0.0
|
||||
# dev=false, tag=5.0.0-beta1 → 5.0.0-beta1
|
||||
# dev=true, tag=5.0.0 → 5.0.0-latest
|
||||
# dev=true, tag=5.0.0-beta1 → 5.0.0-beta1-latest
|
||||
if [ -n "${IS_DEV_BUILD}" ]; then
|
||||
IMAGE_TAG="${WAZUH_IMAGE_VERSION}${WAZUH_DEV_STAGE:+-${WAZUH_DEV_STAGE,,}}-${COMPONENT_COMMIT}"
|
||||
else
|
||||
IMAGE_TAG="${WAZUH_IMAGE_VERSION}${WAZUH_DEV_STAGE:+-${WAZUH_DEV_STAGE,,}}"
|
||||
fi
|
||||
echo "Using IMAGE_TAG: ${IMAGE_TAG} for ${component}"
|
||||
export IMAGE_TAG="$IMAGE_TAG"
|
||||
|
||||
# Build common args (used by all components)
|
||||
build_args=(
|
||||
-t "${WAZUH_REGISTRY}/wazuh/${component}:${IMAGE_TAG}"
|
||||
--build-arg WAZUH_VERSION="${WAZUH_IMAGE_VERSION}"
|
||||
)
|
||||
|
||||
# Add component-specific args
|
||||
case "${component}" in
|
||||
wazuh-indexer)
|
||||
build_args+=(
|
||||
--build-arg wazuh_indexer_x86_64_rpm="${wazuh_indexer_x86_64_rpm}"
|
||||
--build-arg wazuh_indexer_aarch64_rpm="${wazuh_indexer_aarch64_rpm}"
|
||||
--build-arg wazuh_certs_tool="${wazuh_certs_tool}"
|
||||
--build-arg wazuh_config_yml="${wazuh_config_yml}"
|
||||
)
|
||||
;;
|
||||
wazuh-manager)
|
||||
build_args+=(
|
||||
--build-arg wazuh_manager_x86_64_rpm="${wazuh_manager_x86_64_rpm}"
|
||||
--build-arg wazuh_manager_aarch64_rpm="${wazuh_manager_aarch64_rpm}"
|
||||
)
|
||||
;;
|
||||
wazuh-dashboard)
|
||||
build_args+=(
|
||||
--build-arg wazuh_dashboard_x86_64_rpm="${wazuh_dashboard_x86_64_rpm}"
|
||||
--build-arg wazuh_dashboard_aarch64_rpm="${wazuh_dashboard_aarch64_rpm}"
|
||||
--build-arg wazuh_certs_tool="${wazuh_certs_tool}"
|
||||
--build-arg wazuh_config_yml="${wazuh_config_yml}"
|
||||
)
|
||||
;;
|
||||
wazuh-agent)
|
||||
build_args+=(
|
||||
--build-arg wazuh_agent_x86_64_rpm="${wazuh_agent_x86_64_rpm}"
|
||||
--build-arg wazuh_agent_aarch64_rpm="${wazuh_agent_aarch64_rpm}"
|
||||
)
|
||||
;;
|
||||
esac
|
||||
|
||||
# Execute build
|
||||
$build_cmd "${build_args[@]}" ${component}/ || clean 1
|
||||
echo "${component} image built successfully!"
|
||||
done
|
||||
# Build a specific component or the full default group (all 4 in parallel).
|
||||
if [ -z "${WAZUH_COMPONENT}" ]; then
|
||||
echo "Building all components in parallel..."
|
||||
docker buildx bake ${bake_opts} -f docker-bake.hcl || clean 1
|
||||
else
|
||||
echo "Building ${WAZUH_COMPONENT}..."
|
||||
docker buildx bake ${bake_opts} -f docker-bake.hcl "${WAZUH_COMPONENT}" || clean 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Image build process completed!"
|
||||
@@ -301,7 +248,7 @@ help() {
|
||||
echo
|
||||
echo "Usage: $0 [OPTIONS]"
|
||||
echo
|
||||
echo " -d, --dev-stage <ref> [Optional] Set the pre-release stage suffix (e.g. beta1, rc2). Not used by default."
|
||||
echo " -d, --dev-stage <ref> [Optional] Set the pre-release stage suffix (e.g. beta2, rc2). Not used by default."
|
||||
echo " --dev [Optional] Mark as a development build: appends the commit ref to the image tag. Controlled by inputs.dev in the workflow."
|
||||
echo " -refs, --references <refs> [Optional] [Only with --dev] JSON array of commit refs for components (indexer, manager, dashboard, agent) in order. Defaults to 'latest'."
|
||||
echo " -rg, --registry <reg> [Optional] Set the Docker registry to push the images."
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||
services:
|
||||
wazuh.manager:
|
||||
build:
|
||||
context: wazuh-manager/
|
||||
args:
|
||||
WAZUH_VERSION: ${WAZUH_VERSION}
|
||||
wazuh_manager_x86_64_rpm: ${wazuh_manager_x86_64_rpm}
|
||||
wazuh_manager_aarch64_rpm: ${wazuh_manager_aarch64_rpm}
|
||||
wazuh_certs_tool: ${wazuh_certs_tool}
|
||||
wazuh_config_yml: ${wazuh_config_yml}
|
||||
image: ${WAZUH_REGISTRY}/wazuh/wazuh-manager:${IMAGE_TAG}
|
||||
hostname: wazuh.manager
|
||||
restart: always
|
||||
ports:
|
||||
- "1514:1514"
|
||||
- "1515:1515"
|
||||
- "514:514/udp"
|
||||
- "55000:55000"
|
||||
environment:
|
||||
- INDEXER_URL=https://wazuh.indexer:9200
|
||||
- INDEXER_USERNAME=admin
|
||||
- INDEXER_PASSWORD=admin
|
||||
volumes:
|
||||
- wazuh_api_configuration:/var/wazuh-manager/api/configuration
|
||||
- wazuh_etc:/var/wazuh-manager/etc
|
||||
- wazuh_logs:/var/wazuh-manager/logs
|
||||
- wazuh_queue:/var/wazuh-manager/queue
|
||||
- wazuh_var_multigroups:/var/wazuh-manager/var/multigroups
|
||||
|
||||
wazuh.agent:
|
||||
build:
|
||||
context: wazuh-agent/
|
||||
args:
|
||||
WAZUH_VERSION: ${WAZUH_VERSION}
|
||||
wazuh_agent_x86_64_rpm: ${wazuh_agent_x86_64_rpm}
|
||||
wazuh_agent_aarch64_rpm: ${wazuh_agent_aarch64_rpm}
|
||||
image: ${WAZUH_REGISTRY}/wazuh/wazuh-agent:${IMAGE_TAG}
|
||||
hostname: wazuh.agent
|
||||
restart: always
|
||||
|
||||
wazuh.indexer:
|
||||
build:
|
||||
context: wazuh-indexer/
|
||||
args:
|
||||
WAZUH_VERSION: ${WAZUH_VERSION}
|
||||
wazuh_indexer_x86_64_rpm: ${wazuh_indexer_x86_64_rpm}
|
||||
wazuh_indexer_aarch64_rpm: ${wazuh_indexer_aarch64_rpm}
|
||||
wazuh_certs_tool: ${wazuh_certs_tool}
|
||||
wazuh_config_yml: ${wazuh_config_yml}
|
||||
image: ${WAZUH_REGISTRY}/wazuh/wazuh-indexer:${IMAGE_TAG}
|
||||
hostname: wazuh.indexer
|
||||
restart: always
|
||||
ports:
|
||||
- "9200:9200"
|
||||
environment:
|
||||
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
|
||||
ulimits:
|
||||
memlock:
|
||||
soft: -1
|
||||
hard: -1
|
||||
nofile:
|
||||
soft: 65536
|
||||
hard: 65536
|
||||
|
||||
wazuh.dashboard:
|
||||
build:
|
||||
context: wazuh-dashboard/
|
||||
args:
|
||||
WAZUH_VERSION: ${WAZUH_VERSION}
|
||||
wazuh_dashboard_x86_64_rpm: ${wazuh_dashboard_x86_64_rpm}
|
||||
wazuh_dashboard_aarch64_rpm: ${wazuh_dashboard_aarch64_rpm}
|
||||
wazuh_certs_tool: ${wazuh_certs_tool}
|
||||
wazuh_config_yml: ${wazuh_config_yml}
|
||||
image: ${WAZUH_REGISTRY}/wazuh/wazuh-dashboard:${IMAGE_TAG}
|
||||
hostname: wazuh.dashboard
|
||||
restart: always
|
||||
ports:
|
||||
- 443:443
|
||||
environment:
|
||||
- INDEXER_USERNAME=admin
|
||||
- INDEXER_PASSWORD=admin
|
||||
- SERVER_SSL_ENABLED=false
|
||||
- WAZUH_API_URL=https://wazuh.manager
|
||||
depends_on:
|
||||
- wazuh.indexer
|
||||
links:
|
||||
- wazuh.indexer:wazuh.indexer
|
||||
- wazuh.manager:wazuh.manager
|
||||
|
||||
volumes:
|
||||
wazuh_api_configuration:
|
||||
wazuh_etc:
|
||||
wazuh_logs:
|
||||
wazuh_queue:
|
||||
wazuh_var_multigroups:
|
||||
wazuh_active_response:
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
# Wazuh Docker Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||
#
|
||||
# Docker Buildx Bake file.
|
||||
# Builds all Wazuh component images in parallel.
|
||||
#
|
||||
# Usage:
|
||||
# docker buildx bake # build all (local, single-arch)
|
||||
# docker buildx bake wazuh-manager # build one component
|
||||
# docker buildx bake --push # push to registry after build
|
||||
#
|
||||
# Variables are read automatically from the environment (see build-images.sh).
|
||||
|
||||
# ── Global variables ──────────────────────────────────────────────────────────
|
||||
|
||||
variable "WAZUH_VERSION" { default = "5.0.0" }
|
||||
variable "WAZUH_REGISTRY" { default = "docker.io" }
|
||||
|
||||
# Set IMAGE_TAG externally to override; defaults to WAZUH_VERSION.
|
||||
variable "IMAGE_TAG" { default = WAZUH_VERSION }
|
||||
|
||||
# MULTIARCH: set to a non-empty value to build linux/amd64 + linux/arm64.
|
||||
variable "MULTIARCH" { default = "" }
|
||||
|
||||
# Per-component tags — all default to IMAGE_TAG.
|
||||
# In dev builds the shell script sets each one independently to append the
|
||||
# per-component commit ref (e.g. MANAGER_TAG=5.0.0-beta2-abc1234).
|
||||
variable "INDEXER_TAG" { default = IMAGE_TAG }
|
||||
variable "MANAGER_TAG" { default = IMAGE_TAG }
|
||||
variable "DASHBOARD_TAG" { default = IMAGE_TAG }
|
||||
variable "AGENT_TAG" { default = IMAGE_TAG }
|
||||
|
||||
# ── Artifact URL variables ────────────────────────────────────────────────────
|
||||
# Populated by build-images.sh from artifacts_env.txt (sourced into env).
|
||||
|
||||
variable "wazuh_indexer_x86_64_rpm" { default = "" }
|
||||
variable "wazuh_indexer_aarch64_rpm" { default = "" }
|
||||
variable "wazuh_manager_x86_64_rpm" { default = "" }
|
||||
variable "wazuh_manager_aarch64_rpm" { default = "" }
|
||||
variable "wazuh_dashboard_x86_64_rpm" { default = "" }
|
||||
variable "wazuh_dashboard_aarch64_rpm" { default = "" }
|
||||
variable "wazuh_agent_x86_64_rpm" { default = "" }
|
||||
variable "wazuh_agent_aarch64_rpm" { default = "" }
|
||||
variable "wazuh_certs_tool" { default = "" }
|
||||
variable "wazuh_config_yml" { default = "" }
|
||||
|
||||
# ── Default group: builds all components ─────────────────────────────────────
|
||||
|
||||
group "default" {
|
||||
targets = ["wazuh-indexer", "wazuh-manager", "wazuh-dashboard", "wazuh-agent"]
|
||||
}
|
||||
|
||||
# ── Shared base target ────────────────────────────────────────────────────────
|
||||
# All component targets inherit from here. Not built directly.
|
||||
|
||||
target "_common" {
|
||||
# MULTIARCH=true → build linux/amd64 + linux/arm64 (requires --push, no --load for multi-platform)
|
||||
# MULTIARCH unset → null means "native platform of the build host" (amd64 on x86, arm64 on ARM)
|
||||
platforms = MULTIARCH != "" ? ["linux/amd64", "linux/arm64"] : null
|
||||
args = {
|
||||
WAZUH_VERSION = WAZUH_VERSION
|
||||
}
|
||||
}
|
||||
|
||||
# ── Component targets ─────────────────────────────────────────────────────────
|
||||
|
||||
target "wazuh-indexer" {
|
||||
inherits = ["_common"]
|
||||
context = "wazuh-indexer/"
|
||||
tags = ["${WAZUH_REGISTRY}/wazuh/wazuh-indexer:${INDEXER_TAG}"]
|
||||
args = {
|
||||
wazuh_indexer_x86_64_rpm = wazuh_indexer_x86_64_rpm
|
||||
wazuh_indexer_aarch64_rpm = wazuh_indexer_aarch64_rpm
|
||||
wazuh_certs_tool = wazuh_certs_tool
|
||||
wazuh_config_yml = wazuh_config_yml
|
||||
}
|
||||
}
|
||||
|
||||
target "wazuh-manager" {
|
||||
inherits = ["_common"]
|
||||
context = "wazuh-manager/"
|
||||
tags = ["${WAZUH_REGISTRY}/wazuh/wazuh-manager:${MANAGER_TAG}"]
|
||||
args = {
|
||||
wazuh_manager_x86_64_rpm = wazuh_manager_x86_64_rpm
|
||||
wazuh_manager_aarch64_rpm = wazuh_manager_aarch64_rpm
|
||||
wazuh_certs_tool = wazuh_certs_tool
|
||||
wazuh_config_yml = wazuh_config_yml
|
||||
}
|
||||
}
|
||||
|
||||
target "wazuh-dashboard" {
|
||||
inherits = ["_common"]
|
||||
context = "wazuh-dashboard/"
|
||||
tags = ["${WAZUH_REGISTRY}/wazuh/wazuh-dashboard:${DASHBOARD_TAG}"]
|
||||
args = {
|
||||
wazuh_dashboard_x86_64_rpm = wazuh_dashboard_x86_64_rpm
|
||||
wazuh_dashboard_aarch64_rpm = wazuh_dashboard_aarch64_rpm
|
||||
wazuh_certs_tool = wazuh_certs_tool
|
||||
wazuh_config_yml = wazuh_config_yml
|
||||
}
|
||||
}
|
||||
|
||||
target "wazuh-agent" {
|
||||
inherits = ["_common"]
|
||||
context = "wazuh-agent/"
|
||||
tags = ["${WAZUH_REGISTRY}/wazuh/wazuh-agent:${AGENT_TAG}"]
|
||||
args = {
|
||||
wazuh_agent_x86_64_rpm = wazuh_agent_x86_64_rpm
|
||||
wazuh_agent_aarch64_rpm = wazuh_agent_aarch64_rpm
|
||||
}
|
||||
}
|
||||
@@ -1,34 +1,83 @@
|
||||
# Wazuh Docker Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||
FROM amazonlinux:2023
|
||||
|
||||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
||||
################################################################################
|
||||
# Build stage 0 (builder):
|
||||
# Install Wazuh Agent RPM and download tini (static PID-1 init shim).
|
||||
################################################################################
|
||||
FROM amazonlinux:2023 AS builder
|
||||
|
||||
ARG WAZUH_VERSION
|
||||
ARG S6_VERSION="v2.2.0.3"
|
||||
ARG TINI_VERSION="v0.19.0"
|
||||
ARG WAZUH_MANAGER='CHANGE_MANAGER_IP'
|
||||
ARG WAZUH_REGISTRATION_SERVER='CHANGE_ENROLL_IP'
|
||||
ARG WAZUH_AGENT_NAME='CHANGE_AGENT_NAME'
|
||||
ARG TARGETARCH
|
||||
ARG wazuh_agent_x86_64_rpm
|
||||
ARG wazuh_agent_aarch64_rpm
|
||||
ARG WAZUH_UID=101
|
||||
ARG WAZUH_GID=101
|
||||
|
||||
RUN RPM_ARCH="x86_64" && \
|
||||
# Install only runtime dependencies
|
||||
RUN dnf install procps shadow-utils -y && \
|
||||
dnf clean all && \
|
||||
getent group wazuh || groupadd -r -g ${WAZUH_GID} wazuh && \
|
||||
getent passwd wazuh || useradd --system \
|
||||
--no-create-home \
|
||||
--home-dir /var/ossec \
|
||||
--uid ${WAZUH_UID} \
|
||||
--gid ${WAZUH_GID} \
|
||||
--shell /sbin/nologin \
|
||||
wazuh && \
|
||||
RPM_ARCH="x86_64" && \
|
||||
if [ "${TARGETARCH}" = "arm64" ]; then RPM_ARCH="aarch64"; fi && \
|
||||
URL_VAR="wazuh_agent_${RPM_ARCH}_rpm" && \
|
||||
agent_url="${!URL_VAR}" && \
|
||||
dnf install curl-minimal tar gzip procps -y &&\
|
||||
dnf install curl-minimal tar gzip procps shadow-utils -y && \
|
||||
curl -o /wazuh-agent.rpm "${agent_url}" && \
|
||||
dnf install /wazuh-agent.rpm -y && \
|
||||
rm -rf /wazuh-agent.rpm && \
|
||||
dnf clean all && \
|
||||
sed -i '/<authorization_pass_path>/d' /var/ossec/etc/ossec.conf && \
|
||||
S6_ARCH="amd64" && \
|
||||
if [ "${TARGETARCH}" = "arm64" ]; then S6_ARCH="aarch64"; fi && \
|
||||
curl --fail --silent -L https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-${S6_ARCH}.tar.gz \
|
||||
-o /tmp/s6-overlay-${S6_ARCH}.tar.gz && \
|
||||
tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C / --exclude="./bin" && \
|
||||
tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C /usr ./bin && \
|
||||
rm /tmp/s6-overlay-${S6_ARCH}.tar.gz
|
||||
sed -i '/<authorization_pass_path>/d' /var/ossec/etc/ossec.conf
|
||||
|
||||
# Download tini static binary (no external library dependencies)
|
||||
RUN curl --fail --silent -L \
|
||||
https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-${TARGETARCH} \
|
||||
-o /usr/local/bin/tini && \
|
||||
chmod +x /usr/local/bin/tini
|
||||
|
||||
################################################################################
|
||||
# Build stage 1 (the actual Wazuh Agent image):
|
||||
# Copy Wazuh Agent and tini from builder. Install only runtime dependencies.
|
||||
################################################################################
|
||||
FROM amazonlinux:2023
|
||||
|
||||
ARG WAZUH_UID=101
|
||||
ARG WAZUH_GID=101
|
||||
|
||||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
||||
|
||||
# Install only runtime dependencies
|
||||
RUN dnf install procps shadow-utils -y && \
|
||||
dnf clean all && \
|
||||
getent group wazuh || groupadd -r -g ${WAZUH_GID} wazuh && \
|
||||
getent passwd wazuh || useradd --system \
|
||||
--no-create-home \
|
||||
--home-dir /var/ossec \
|
||||
--uid ${WAZUH_UID} \
|
||||
--gid ${WAZUH_GID} \
|
||||
--shell /sbin/nologin \
|
||||
wazuh
|
||||
|
||||
# Copy Wazuh Agent installation from builder
|
||||
COPY --from=builder /var/ossec /var/ossec
|
||||
|
||||
# Copy tini static binary
|
||||
COPY --from=builder /usr/local/bin/tini /usr/local/bin/tini
|
||||
|
||||
# Copy entrypoint and init scripts
|
||||
COPY config/entrypoint.sh /entrypoint.sh
|
||||
COPY config/etc/ /etc/
|
||||
|
||||
ENTRYPOINT [ "/init" ]
|
||||
RUN chmod 755 /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/tini", "--", "/entrypoint.sh"]
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
# Wazuh Docker Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||
|
||||
# Run initialization and configuration
|
||||
bash /etc/cont-init.d/0-wazuh-init
|
||||
|
||||
# Start Wazuh Agent (may log warnings if manager address is not configured)
|
||||
bash /etc/cont-init.d/1-agent
|
||||
|
||||
# Tail the main log to stdout so Docker captures it
|
||||
tail -F /var/ossec/logs/ossec.log &
|
||||
TAIL_PID=$!
|
||||
|
||||
# Graceful shutdown: stop Wazuh and exit cleanly on SIGTERM/SIGINT
|
||||
_stop() {
|
||||
echo "Stopping Wazuh Agent..."
|
||||
/var/ossec/bin/wazuh-control stop 2>/dev/null || true
|
||||
kill "${TAIL_PID}" 2>/dev/null || true
|
||||
}
|
||||
trap _stop SIGTERM SIGINT SIGQUIT
|
||||
|
||||
wait "${TAIL_PID}"
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
#!/bin/bash
|
||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||
|
||||
WAZUH_INSTALL_PATH=/var/ossec
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
#!/bin/bash
|
||||
|
||||
##############################################################################
|
||||
# Migration sequence
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/with-contenv sh
|
||||
#!/bin/sh
|
||||
|
||||
# dumping ossec.log to standard output
|
||||
exec tail -F /var/ossec/logs/ossec.log
|
||||
|
||||
@@ -7,9 +7,28 @@ ARG TARGETARCH
|
||||
ARG wazuh_dashboard_x86_64_rpm
|
||||
ARG wazuh_dashboard_aarch64_rpm
|
||||
ARG wazuh_config_yml
|
||||
ARG WAZUH_UID=101
|
||||
ARG WAZUH_GID=101
|
||||
|
||||
# Set environment variables
|
||||
ENV USER="wazuh-dashboard" \
|
||||
GROUP="wazuh-dashboard" \
|
||||
NAME="wazuh-dashboard" \
|
||||
INSTALL_DIR="/usr/share/wazuh-dashboard"
|
||||
|
||||
# Update and install dependencies
|
||||
RUN RPM_ARCH="x86_64" && \
|
||||
RUN yum install shadow-utils -y && \
|
||||
yum clean all && \
|
||||
getent group $GROUP || groupadd -r -g ${WAZUH_GID} $GROUP && \
|
||||
useradd --system \
|
||||
--uid ${WAZUH_UID} \
|
||||
--no-create-home \
|
||||
--home-dir $INSTALL_DIR \
|
||||
--gid $GROUP \
|
||||
--shell /sbin/nologin \
|
||||
--comment "$USER user" \
|
||||
$USER && \
|
||||
RPM_ARCH="x86_64" && \
|
||||
if [ "${TARGETARCH}" = "arm64" ]; then RPM_ARCH="aarch64"; fi && \
|
||||
URL_VAR="wazuh_dashboard_${RPM_ARCH}_rpm" && \
|
||||
dashboard_url="${!URL_VAR}" && \
|
||||
@@ -24,7 +43,6 @@ RUN mkdir -p $INSTALL_DIR/data/wazuh && chmod -R 775 $INSTALL_DIR/data/wazuh
|
||||
RUN mkdir -p $INSTALL_DIR/data/wazuh/config && chmod -R 775 $INSTALL_DIR/data/wazuh/config
|
||||
RUN mkdir -p $INSTALL_DIR/data/wazuh/logs && chmod -R 775 $INSTALL_DIR/data/wazuh/logs
|
||||
RUN setcap 'cap_net_bind_service=-ep' /usr/share/wazuh-dashboard/node/bin/node
|
||||
RUN setcap 'cap_net_bind_service=-ep' /usr/share/wazuh-dashboard/node/fallback/bin/node
|
||||
|
||||
################################################################################
|
||||
# Build stage 1 (the current Wazuh dashboard image):
|
||||
@@ -35,6 +53,9 @@ RUN setcap 'cap_net_bind_service=-ep' /usr/share/wazuh-dashboard/node/fallback/b
|
||||
################################################################################
|
||||
FROM amazonlinux:2023
|
||||
|
||||
ARG WAZUH_UID=101
|
||||
ARG WAZUH_GID=101
|
||||
|
||||
# Set environment variables
|
||||
ENV USER="wazuh-dashboard" \
|
||||
GROUP="wazuh-dashboard" \
|
||||
@@ -61,25 +82,25 @@ COPY config/wazuh_dashboard_config.sh /
|
||||
# Update and install dependencies
|
||||
RUN yum install shadow-utils -y && \
|
||||
yum clean all && \
|
||||
getent group $GROUP || groupadd -r -g 1000 $GROUP && \
|
||||
getent group $GROUP || groupadd -r -g ${WAZUH_GID} $GROUP && \
|
||||
useradd --system \
|
||||
--uid 1000 \
|
||||
--no-create-home \
|
||||
--home-dir $INSTALL_DIR \
|
||||
--gid $GROUP \
|
||||
--shell /sbin/nologin \
|
||||
--comment "$USER user" \
|
||||
$USER && \
|
||||
--uid ${WAZUH_UID} \
|
||||
--no-create-home \
|
||||
--home-dir $INSTALL_DIR \
|
||||
--gid $GROUP \
|
||||
--shell /sbin/nologin \
|
||||
--comment "$USER user" \
|
||||
$USER && \
|
||||
chmod 700 /entrypoint.sh && \
|
||||
chmod 700 /wazuh_dashboard_config.sh && \
|
||||
mkdir -p $INSTALL_DIR && \
|
||||
chown 1000:1000 $INSTALL_DIR && \
|
||||
chown 1000:1000 /*.sh && \
|
||||
chown ${WAZUH_UID}:${WAZUH_GID} $INSTALL_DIR && \
|
||||
chown ${WAZUH_UID}:${WAZUH_GID} /*.sh && \
|
||||
mkdir -p /usr/share/wazuh-dashboard/plugins/wazuh/public/assets/custom
|
||||
|
||||
# Copy Install dir from builder to current image
|
||||
COPY --from=builder --chown=1000:1000 $INSTALL_DIR $INSTALL_DIR
|
||||
COPY --from=builder --chown=1000:1000 /etc/wazuh-dashboard $INSTALL_DIR/config/
|
||||
COPY --from=builder $INSTALL_DIR $INSTALL_DIR
|
||||
COPY --from=builder /etc/wazuh-dashboard $INSTALL_DIR/config/
|
||||
|
||||
# Set workdir and user
|
||||
WORKDIR $INSTALL_DIR
|
||||
|
||||
@@ -7,10 +7,28 @@ ARG wazuh_indexer_x86_64_rpm
|
||||
ARG wazuh_indexer_aarch64_rpm
|
||||
ARG wazuh_certs_tool
|
||||
ARG wazuh_config_yml
|
||||
ARG WAZUH_UID=101
|
||||
ARG WAZUH_GID=101
|
||||
|
||||
ENV USER="wazuh-indexer" \
|
||||
GROUP="wazuh-indexer" \
|
||||
NAME="wazuh-indexer" \
|
||||
INSTALL_DIR="/usr/share/wazuh-indexer"
|
||||
|
||||
COPY config/config.sh .
|
||||
|
||||
RUN RPM_ARCH="x86_64" && \
|
||||
RUN yum install curl-minimal shadow-utils findutils hostname -y && \
|
||||
yum clean all && \
|
||||
getent group $GROUP || groupadd -r -g ${WAZUH_GID} $GROUP && \
|
||||
useradd --system \
|
||||
--uid ${WAZUH_UID} \
|
||||
--no-create-home \
|
||||
--home-dir $INSTALL_DIR \
|
||||
--gid ${WAZUH_GID} \
|
||||
--shell /sbin/nologin \
|
||||
--comment "$USER user" \
|
||||
$USER && \
|
||||
RPM_ARCH="x86_64" && \
|
||||
if [ "${TARGETARCH}" = "arm64" ]; then RPM_ARCH="aarch64"; fi && \
|
||||
URL_VAR="wazuh_indexer_${RPM_ARCH}_rpm" && \
|
||||
indexer_url="${!URL_VAR}" && \
|
||||
@@ -29,10 +47,14 @@ RUN RPM_ARCH="x86_64" && \
|
||||
################################################################################
|
||||
FROM amazonlinux:2023
|
||||
|
||||
ARG WAZUH_UID=101
|
||||
ARG WAZUH_GID=101
|
||||
|
||||
ENV USER="wazuh-indexer" \
|
||||
GROUP="wazuh-indexer" \
|
||||
NAME="wazuh-indexer" \
|
||||
INSTALL_DIR="/usr/share/wazuh-indexer"
|
||||
INSTALL_DIR="/usr/share/wazuh-indexer"
|
||||
ENV ENGINE_DIR="$INSTALL_DIR/engine"
|
||||
|
||||
|
||||
COPY config/entrypoint.sh /
|
||||
@@ -40,30 +62,37 @@ COPY config/securityadmin.sh /
|
||||
|
||||
RUN yum install curl-minimal shadow-utils findutils hostname -y && \
|
||||
yum clean all && \
|
||||
getent group $GROUP || groupadd -r -g 1000 $GROUP && \
|
||||
getent group $GROUP || groupadd -r -g ${WAZUH_GID} $GROUP && \
|
||||
useradd --system \
|
||||
--uid 1000 \
|
||||
--uid ${WAZUH_UID} \
|
||||
--no-create-home \
|
||||
--home-dir $INSTALL_DIR \
|
||||
--gid $GROUP \
|
||||
--gid ${WAZUH_GID} \
|
||||
--shell /sbin/nologin \
|
||||
--comment "$USER user" \
|
||||
$USER && \
|
||||
chmod 700 /entrypoint.sh && chmod 700 /securityadmin.sh && \
|
||||
mkdir -p $INSTALL_DIR && \
|
||||
chown 1000:1000 $INSTALL_DIR && \
|
||||
chown 1000:1000 /*.sh && \
|
||||
mkdir -p /var/lib/wazuh-indexer && chown 1000:1000 /var/lib/wazuh-indexer && \
|
||||
mkdir -p $INSTALL_DIR/logs && chown 1000:1000 $INSTALL_DIR/logs && \
|
||||
mkdir -p /run/wazuh-indexer && chown 1000:1000 /run/wazuh-indexer && \
|
||||
mkdir -p /var/log/wazuh-indexer && chown 1000:1000 /var/log/wazuh-indexer
|
||||
chown ${WAZUH_UID}:${WAZUH_GID} $INSTALL_DIR && \
|
||||
chown ${WAZUH_UID}:${WAZUH_GID} /*.sh && \
|
||||
mkdir -p /var/lib/wazuh-indexer && chown ${WAZUH_UID}:${WAZUH_GID} /var/lib/wazuh-indexer && \
|
||||
mkdir -p $INSTALL_DIR/logs && chown ${WAZUH_UID}:${WAZUH_GID} $INSTALL_DIR/logs && \
|
||||
mkdir -p /run/wazuh-indexer && chown ${WAZUH_UID}:${WAZUH_GID} /run/wazuh-indexer && \
|
||||
mkdir -p /var/log/wazuh-indexer && chown ${WAZUH_UID}:${WAZUH_GID} /var/log/wazuh-indexer
|
||||
|
||||
COPY --from=builder --chown=1000:1000 $INSTALL_DIR $INSTALL_DIR
|
||||
COPY --from=builder $INSTALL_DIR $INSTALL_DIR
|
||||
|
||||
RUN chmod 700 $INSTALL_DIR && \
|
||||
chmod 700 $INSTALL_DIR/config && \
|
||||
chmod 600 $INSTALL_DIR/config/jvm.options && \
|
||||
chmod 600 $INSTALL_DIR/config/opensearch.yml
|
||||
chmod 600 $INSTALL_DIR/config/opensearch.yml && \
|
||||
if [ -d "$ENGINE_DIR" ]; then \
|
||||
find "$ENGINE_DIR" -type d -exec chmod 750 {} + && \
|
||||
find "$ENGINE_DIR" -type f -exec chmod 640 {} + && \
|
||||
{ [ -f "$ENGINE_DIR/run_engine.sh" ] && chmod 750 "$ENGINE_DIR/run_engine.sh" || true; } && \
|
||||
{ [ -f "$ENGINE_DIR/bin/wazuh-engine" ] && chmod 750 "$ENGINE_DIR/bin/wazuh-engine" || true; } && \
|
||||
{ [ -d "$ENGINE_DIR/sockets" ] && chmod 777 "$ENGINE_DIR/sockets" || true; }; \
|
||||
fi
|
||||
|
||||
USER wazuh-indexer
|
||||
WORKDIR $INSTALL_DIR
|
||||
|
||||
@@ -13,7 +13,9 @@ export CONFIG_DIR=${INSTALLATION_DIR}/config
|
||||
# Modify opensearch.yml config paths
|
||||
if [ -d "/etc/wazuh-indexer" ]; then
|
||||
mkdir -p ${CONFIG_DIR}
|
||||
chown ${USER}:${GROUP} ${CONFIG_DIR}
|
||||
mkdir -p ${CONFIG_DIR}/certs
|
||||
chown ${USER}:${GROUP} ${CONFIG_DIR}/certs
|
||||
mv /etc/wazuh-indexer/* ${CONFIG_DIR}/
|
||||
rmdir /etc/wazuh-indexer
|
||||
fi
|
||||
|
||||
@@ -58,6 +58,12 @@ function runOpensearch {
|
||||
fi
|
||||
done < <(env)
|
||||
|
||||
# Start Wazuh Engine
|
||||
if [ -x "$OPENSEARCH_HOME/engine/run_engine.sh" ]; then
|
||||
nohup "$OPENSEARCH_HOME/engine/run_engine.sh" > /dev/null 2>&1 &
|
||||
echo $! > /run/wazuh-indexer/wazuh-engine.pid
|
||||
fi
|
||||
|
||||
# Start opensearch
|
||||
exec "$@" "${opensearch_opts[@]}"
|
||||
|
||||
|
||||
@@ -1,53 +1,101 @@
|
||||
# Wazuh Docker Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||
FROM amazonlinux:2023
|
||||
|
||||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
||||
################################################################################
|
||||
# Build stage 0 (builder):
|
||||
# Install Wazuh Manager RPM, configure directories, prepare permanent data,
|
||||
# and download tini (static PID-1 init shim).
|
||||
################################################################################
|
||||
FROM amazonlinux:2023 AS builder
|
||||
|
||||
ARG WAZUH_VERSION
|
||||
ARG S6_VERSION="v2.2.0.3"
|
||||
ARG TINI_VERSION="v0.19.0"
|
||||
ARG TARGETARCH
|
||||
ARG wazuh_manager_x86_64_rpm
|
||||
ARG wazuh_manager_aarch64_rpm
|
||||
ARG WAZUH_UID=101
|
||||
ARG WAZUH_GID=101
|
||||
|
||||
RUN RPM_ARCH="x86_64" && \
|
||||
# Prepare permanent data config needed by permanent_data.sh at build time
|
||||
COPY config/permanent_data.env config/permanent_data.sh /
|
||||
|
||||
RUN dnf install openssl findutils procps shadow-utils -y && \
|
||||
dnf clean all && \
|
||||
getent group wazuh-manager || groupadd -r -g ${WAZUH_GID} wazuh-manager && \
|
||||
getent passwd wazuh-manager || useradd --system \
|
||||
--no-create-home \
|
||||
--home-dir /var/wazuh-manager \
|
||||
--uid ${WAZUH_UID} \
|
||||
--gid ${WAZUH_GID} \
|
||||
--shell /sbin/nologin \
|
||||
wazuh-manager && \
|
||||
RPM_ARCH="x86_64" && \
|
||||
if [ "${TARGETARCH}" = "arm64" ]; then RPM_ARCH="aarch64"; fi && \
|
||||
URL_VAR="wazuh_manager_${RPM_ARCH}_rpm" && \
|
||||
manager_url="${!URL_VAR}" && \
|
||||
dnf install curl-minimal xz gnupg tar gzip openssl findutils procps -y &&\
|
||||
dnf install curl-minimal xz gnupg tar gzip -y && \
|
||||
dnf clean all && \
|
||||
curl -o /wazuh-manager.rpm "${manager_url}" && \
|
||||
dnf install /wazuh-manager.rpm -y && \
|
||||
rm -rf /wazuh-manager.rpm && \
|
||||
dnf clean all && \
|
||||
S6_ARCH="amd64" && \
|
||||
if [ "${TARGETARCH}" = "arm64" ]; then S6_ARCH="aarch64"; fi && \
|
||||
curl --fail --silent -L https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/s6-overlay-${S6_ARCH}.tar.gz \
|
||||
-o /tmp/s6-overlay-${S6_ARCH}.tar.gz && \
|
||||
tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C / --exclude="./bin" && \
|
||||
tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C /usr ./bin && \
|
||||
rm /tmp/s6-overlay-${S6_ARCH}.tar.gz && \
|
||||
rm -f /var/wazuh-manager/etc/sslmanager.key && \
|
||||
rm -f /var/wazuh-manager/etc/sslmanager.cert
|
||||
|
||||
COPY config/etc/ /etc/
|
||||
# Prepare permanent data
|
||||
# Sync calls are due to https://github.com/docker/docker/issues/9547
|
||||
|
||||
COPY config/permanent_data.env config/permanent_data.sh /
|
||||
|
||||
#Make mount directories for keep permissions
|
||||
|
||||
RUN mkdir -p /var/wazuh-manager/var/multigroups && \
|
||||
# Set up required directories with correct ownership
|
||||
mkdir -p /var/wazuh-manager/var/multigroups && \
|
||||
chown root:wazuh-manager /var/wazuh-manager/var/multigroups && \
|
||||
chmod 770 /var/wazuh-manager/var/multigroups && \
|
||||
mkdir -p /var/wazuh-manager/etc/certs && \
|
||||
chown wazuh-manager:wazuh-manager /var/wazuh-manager/etc/certs && \
|
||||
chmod 500 /var/wazuh-manager/etc/certs && \
|
||||
chmod 755 /permanent_data.sh && \
|
||||
rm -f /var/wazuh-manager/etc/sslmanager.key && \
|
||||
rm -f /var/wazuh-manager/etc/sslmanager.cert
|
||||
|
||||
# Prepare permanent data snapshot (sync calls: https://github.com/docker/docker/issues/9547)
|
||||
RUN chmod 755 /permanent_data.sh && \
|
||||
sync && /permanent_data.sh && \
|
||||
sync && rm /permanent_data.sh
|
||||
|
||||
# Download tini static binary (no external library dependencies)
|
||||
RUN curl --fail --silent -L \
|
||||
https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-${TARGETARCH} \
|
||||
-o /usr/local/bin/tini && \
|
||||
chmod +x /usr/local/bin/tini
|
||||
|
||||
################################################################################
|
||||
# Build stage 1 (the actual Wazuh Manager image):
|
||||
# Copy Wazuh Manager and tini from builder. Install only runtime dependencies.
|
||||
################################################################################
|
||||
FROM amazonlinux:2023
|
||||
|
||||
ARG WAZUH_UID=101
|
||||
ARG WAZUH_GID=101
|
||||
|
||||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
||||
|
||||
# Install only runtime dependencies (no curl, tar, gzip, xz, or full dnf stack)
|
||||
RUN dnf install openssl findutils procps shadow-utils -y && \
|
||||
dnf clean all && \
|
||||
getent group wazuh-manager || groupadd -r -g ${WAZUH_GID} wazuh-manager && \
|
||||
getent passwd wazuh-manager || useradd --system \
|
||||
--no-create-home \
|
||||
--home-dir /var/wazuh-manager \
|
||||
--uid ${WAZUH_UID} \
|
||||
--gid ${WAZUH_GID} \
|
||||
--shell /sbin/nologin \
|
||||
wazuh-manager
|
||||
|
||||
# Copy Wazuh Manager installation (includes permanent data snapshot)
|
||||
COPY --from=builder /var/wazuh-manager /var/wazuh-manager
|
||||
|
||||
# Copy tini static binary
|
||||
COPY --from=builder /usr/local/bin/tini /usr/local/bin/tini
|
||||
|
||||
# Copy entrypoint, init scripts and runtime config
|
||||
COPY config/entrypoint.sh /entrypoint.sh
|
||||
COPY config/etc/ /etc/
|
||||
COPY config/permanent_data.env /
|
||||
|
||||
RUN chmod 755 /entrypoint.sh
|
||||
|
||||
# Services ports
|
||||
EXPOSE 55000/tcp 1514/tcp 1515/tcp 514/udp 1516/tcp
|
||||
|
||||
ENTRYPOINT [ "/init" ]
|
||||
ENTRYPOINT ["/usr/local/bin/tini", "--", "/entrypoint.sh"]
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
# Wazuh Docker Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||
|
||||
# Run initialization and configuration
|
||||
bash /etc/cont-init.d/0-wazuh-init
|
||||
|
||||
# Start Wazuh Manager (may log warnings in environments without certs)
|
||||
bash /etc/cont-init.d/1-manager
|
||||
|
||||
# Tail the main log to stdout so Docker captures it
|
||||
tail -F /var/wazuh-manager/logs/wazuh-manager.log &
|
||||
TAIL_PID=$!
|
||||
|
||||
# Graceful shutdown: stop Wazuh and exit cleanly on SIGTERM/SIGINT
|
||||
_stop() {
|
||||
echo "Stopping Wazuh Manager..."
|
||||
/var/wazuh-manager/bin/wazuh-manager-control stop 2>/dev/null || true
|
||||
kill "${TAIL_PID}" 2>/dev/null || true
|
||||
}
|
||||
trap _stop SIGTERM SIGINT SIGQUIT
|
||||
|
||||
wait "${TAIL_PID}"
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
#!/bin/bash
|
||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||
|
||||
# Variables
|
||||
@@ -252,9 +252,9 @@ configure_permissions() {
|
||||
##############################################################################
|
||||
|
||||
set_correct_permOwner() {
|
||||
find /var/wazuh-manager/ -group 997 -exec chown :999 {} +;
|
||||
find /var/wazuh-manager/ -group 101 -exec chown :999 {} +;
|
||||
find /var/wazuh-manager/ -user 101 -exec chown 999 {} +;
|
||||
find /var/wazuh-manager/ -group 997 -exec chown :101 {} +;
|
||||
find /var/wazuh-manager/ -group 999 -exec chown :101 {} +;
|
||||
find /var/wazuh-manager/ -user 999 -exec chown 101:{} +;
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
#!/bin/bash
|
||||
|
||||
##############################################################################
|
||||
# Migration sequence
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/with-contenv sh
|
||||
#!/bin/sh
|
||||
|
||||
# dumping wazuh-manager.log to standard output
|
||||
exec tail -F /var/wazuh-manager/logs/wazuh-manager.log
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ The folder `wazuh-agent` contains a README explaining how to run a container wit
|
||||
|
||||
├── build-docker-images
|
||||
│ ├── build-images.sh
|
||||
│ ├── build-images.yml
|
||||
│ ├── docker-bake.hcl
|
||||
│ ├── README.md
|
||||
│ ├── wazuh-agent
|
||||
│ │ ├── config
|
||||
|
||||
@@ -29,7 +29,7 @@ To get all the available script options use the `-h` or `--help` option:
|
||||
|
||||
Usage: build-images.sh [OPTIONS]
|
||||
|
||||
-d, --dev <ref> [Optional] Set the development stage you want to build, example rc2 or beta1, not used by default.
|
||||
-d, --dev <ref> [Optional] Set the development stage you want to build, example rc2 or beta2, not used by default.
|
||||
-refs, --references <ref> [Optional] Set each Wazuh component reference to be build (indexer, manager, dasboard and agent). By default, using the latest release: ['latest', 'latest', 'latest', 'latest']
|
||||
-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, 5.0.0.
|
||||
|
||||
@@ -38,7 +38,7 @@ The Procedure_push_docker_images.yml workflow builds and pushes multi-architectu
|
||||
2. **Multi-architecture Build**:
|
||||
- Uses Docker Buildx with QEMU for cross-platform builds
|
||||
- Builds for `linux/amd64` and `linux/arm64`
|
||||
- Leverages `build-images.yml` for build configuration
|
||||
- Leverages `docker-bake.hcl` for parallel multi-arch build configuration
|
||||
|
||||
3. **Image Publishing**:
|
||||
- Tags images appropriately based on mode
|
||||
|
||||
+9
-9
@@ -24,15 +24,15 @@ Below is a step-by-step example of how to perform this update:
|
||||
```yaml
|
||||
services:
|
||||
wazuh.manager:
|
||||
image: wazuh/wazuh-manager:5.0.0
|
||||
image: wazuh/wazuh-manager:5.0.0-beta2
|
||||
...
|
||||
|
||||
wazuh.indexer:
|
||||
image: wazuh/wazuh-indexer:5.0.0
|
||||
image: wazuh/wazuh-indexer:5.0.0-beta2
|
||||
...
|
||||
|
||||
wazuh.dashboard:
|
||||
image: wazuh/wazuh-dashboard:5.0.0
|
||||
image: wazuh/wazuh-dashboard:5.0.0-beta2
|
||||
...
|
||||
```
|
||||
|
||||
@@ -48,27 +48,27 @@ Below is a step-by-step example of how to perform this update:
|
||||
```yaml
|
||||
services:
|
||||
wazuh.master:
|
||||
image: wazuh/wazuh-manager:5.0.0
|
||||
image: wazuh/wazuh-manager:5.0.0-beta2
|
||||
...
|
||||
|
||||
wazuh.worker:
|
||||
image: wazuh/wazuh-manager:5.0.0
|
||||
image: wazuh/wazuh-manager:5.0.0-beta2
|
||||
...
|
||||
|
||||
wazuh1.indexer:
|
||||
image: wazuh/wazuh-indexer:5.0.0
|
||||
image: wazuh/wazuh-indexer:5.0.0-beta2
|
||||
...
|
||||
|
||||
wazuh2.indexer:
|
||||
image: wazuh/wazuh-indexer:5.0.0
|
||||
image: wazuh/wazuh-indexer:5.0.0-beta2
|
||||
...
|
||||
|
||||
wazuh3.indexer:
|
||||
image: wazuh/wazuh-indexer:5.0.0
|
||||
image: wazuh/wazuh-indexer:5.0.0-beta2
|
||||
...
|
||||
|
||||
wazuh.dashboard:
|
||||
image: wazuh/wazuh-dashboard:5.0.0
|
||||
image: wazuh/wazuh-dashboard:5.0.0-beta2
|
||||
...
|
||||
```
|
||||
|
||||
|
||||
@@ -1,283 +0,0 @@
|
||||
# Opendistro data migration to Wazuh indexer on docker.
|
||||
This procedure explains how to migrate Opendistro data from Opendistro to Wazuh indexer in docker production deployments.
|
||||
The example is migrating from v4.2 to v4.4.
|
||||
|
||||
## Procedure
|
||||
Assuming that you have a v4.2 production deployment, perform the following steps.
|
||||
|
||||
**1. Stop 4.2 environment**
|
||||
`docker-compose -f production-cluster.yml stop`
|
||||
|
||||
**2. List elasticsearch volumes**
|
||||
`docker volume ls --filter name='wazuh-docker_elastic-data'`
|
||||
|
||||
**3. Inspect elasticsearch volume**
|
||||
`docker volume inspect wazuh-docker_elastic-data-1`
|
||||
|
||||
**4. Spin down the 4.2 environment.**
|
||||
`docker-compose -f production-cluster.yml down`
|
||||
|
||||
**Steps 5 and 6 can be done with the volume-migrator.sh script, specifying Docker compose version and project name as parameters.**
|
||||
|
||||
Ex: $ multi-node/volume-migrator.sh 1.25.0 multi-node
|
||||
|
||||
**5. Run the volume create command:** create new indexer and Wazuh manager volumes using the `com.docker.compose.version` label value from the previous command.
|
||||
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=wazuh-indexer-data-1 \
|
||||
multi-node_wazuh-indexer-data-1
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=wazuh-indexer-data-2 \
|
||||
multi-node_wazuh-indexer-data-2
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=wazuh-indexer-data-3 \
|
||||
multi-node_wazuh-indexer-data-3
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=master_wazuh_api_configuration \
|
||||
multi-node_master_wazuh_api_configuration
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=master_wazuh_etc \
|
||||
multi-node_docker_wazuh_etc
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=master-wazuh-logs \
|
||||
multi-node_master-wazuh-logs
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=master-wazuh-queue \
|
||||
multi-node_master-wazuh-queue
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=master-wazuh-var-multigroups \
|
||||
multi-node_master-wazuh-var-multigroups
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=master-wazuh-active-response \
|
||||
multi-node_master-wazuh-active-response
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=master-wazuh-etc \
|
||||
multi-node_master-wazuh-etc
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=master-wazuh-var \
|
||||
multi-node_master-wazuh-var
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=worker_wazuh_api_configuration \
|
||||
multi-node_worker_wazuh_api_configuration
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=worker_wazuh_etc \
|
||||
multi-node_worker-wazuh-etc
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=worker-wazuh-logs \
|
||||
multi-node_worker-wazuh-logs
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=worker-wazuh-queue \
|
||||
multi-node_worker-wazuh-queue
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=worker-wazuh-var-multigroups \
|
||||
multi-node_worker-wazuh-var-multigroups
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=worker-wazuh-active-response \
|
||||
multi-node_worker-wazuh-active-response
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=worker-wazuh-etc \
|
||||
multi-node_worker-wazuh-etc
|
||||
```
|
||||
```
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=multi-node \
|
||||
--label com.docker.compose.version=1.25.0 \
|
||||
--label com.docker.compose.volume=worker-wazuh-var \
|
||||
multi-node_worker-wazuh-var
|
||||
```
|
||||
**6. Copy the volume content from elasticsearch to Wazuh indexer volumes and old Wazuh manager content to new volumes.**
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_elastic-data-1:/from \
|
||||
-v multi-node_wazuh-indexer-data-1:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_elastic-data-2:/from \
|
||||
-v multi-node_wazuh-indexer-data-2:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_elastic-data-3:/from \
|
||||
-v multi-node_wazuh-indexer-data-3:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_ossec-api-configuration:/from \
|
||||
-v multi-node_master-wazuh-api-configuration:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_ossec-etc:/from \
|
||||
-v multi-node_master-wazuh-etc:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_ossec-logs:/from \
|
||||
-v multi-node_master-wazuh-logs:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_ossec-queue:/from \
|
||||
-v multi-node_master-wazuh-queue:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_ossec-var-multigroups:/from \
|
||||
-v multi-node_master-wazuh-var-multigroups:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_ossec-active-response:/from \
|
||||
-v multi-node_master-wazuh-active-response:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker-etc:/from \
|
||||
-v multi-node_master-etc:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker-var:/from \
|
||||
-v multi-node_master-wazuh-var:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-ossec-api-configuration:/from \
|
||||
-v multi-node_worker-wazuh-api-configuration:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-ossec-etc:/from \
|
||||
-v multi-node_worker-wazuh-etc:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-ossec-logs:/from \
|
||||
-v multi-node_worker-wazuh-logs:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-ossec-queue:/from \
|
||||
-v multi-node_worker-wazuh-queue:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-ossec-var-multigroups:/from \
|
||||
-v multi-node_worker-wazuh-var-multigroups:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-ossec-active-response:/from \
|
||||
-v multi-node_worker-wazuh-active-response:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-etc:/from \
|
||||
-v multi-node_worker-wazuh-etc:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
```
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-var:/from \
|
||||
-v multi-node_worker-wazuh-var:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
```
|
||||
|
||||
**7. Start the 4.4 environment.**
|
||||
```
|
||||
git checkout 4.4
|
||||
cd multi-node
|
||||
docker-compose -f generate-indexer-certs.yml run --rm generator
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
**8. Check the access to Wazuh dashboard**: go to the Wazuh dashboard using the web browser and check the data.
|
||||
@@ -1,7 +1,7 @@
|
||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||
services:
|
||||
wazuh.master:
|
||||
image: wazuh/wazuh-manager:5.0.0
|
||||
image: wazuh/wazuh-manager:5.0.0-beta2
|
||||
hostname: wazuh.master
|
||||
container_name: multi-node-wazuh.master
|
||||
restart: always
|
||||
@@ -38,12 +38,12 @@ services:
|
||||
- master-wazuh-logs:/var/wazuh-manager/logs
|
||||
- master-wazuh-queue:/var/wazuh-manager/queue
|
||||
- master-wazuh-var-multigroups:/var/wazuh-manager/var/multigroups
|
||||
- ./config/wazuh_master/certs/root-ca.pem:/var/wazuh-manager/etc/certs/root-ca.pem
|
||||
- ./config/root-ca/certs/root-ca.pem:/var/wazuh-manager/etc/certs/root-ca.pem
|
||||
- ./config/wazuh_master/certs/wazuh.master.pem:/var/wazuh-manager/etc/certs/manager.pem
|
||||
- ./config/wazuh_master/certs/wazuh.master-key.pem:/var/wazuh-manager/etc/certs/manager-key.pem
|
||||
|
||||
wazuh.worker:
|
||||
image: wazuh/wazuh-manager:5.0.0
|
||||
image: wazuh/wazuh-manager:5.0.0-beta2
|
||||
hostname: wazuh.worker
|
||||
container_name: multi-node-wazuh.worker
|
||||
restart: always
|
||||
@@ -77,12 +77,12 @@ services:
|
||||
- worker-wazuh-logs:/var/wazuh-manager/logs
|
||||
- worker-wazuh-queue:/var/wazuh-manager/queue
|
||||
- worker-wazuh-var-multigroups:/var/wazuh-manager/var/multigroups
|
||||
- ./config/wazuh_worker/certs/root-ca.pem:/var/wazuh-manager/etc/certs/root-ca.pem
|
||||
- ./config/root-ca/certs/root-ca.pem:/var/wazuh-manager/etc/certs/root-ca.pem
|
||||
- ./config/wazuh_worker/certs/wazuh.worker.pem:/var/wazuh-manager/etc/certs/manager.pem
|
||||
- ./config/wazuh_worker/certs/wazuh.worker-key.pem:/var/wazuh-manager/etc/certs/manager-key.pem
|
||||
|
||||
wazuh1.indexer:
|
||||
image: wazuh/wazuh-indexer:5.0.0
|
||||
image: wazuh/wazuh-indexer:5.0.0-beta2
|
||||
hostname: wazuh1.indexer
|
||||
container_name: multi-node-wazuh1.indexer
|
||||
restart: always
|
||||
@@ -113,14 +113,14 @@ services:
|
||||
start_period: 60s
|
||||
volumes:
|
||||
- wazuh-indexer-data-1:/var/lib/wazuh-indexer
|
||||
- ./config/wazuh1_indexer/certs/root-ca.pem:/usr/share/wazuh-indexer/config/certs/root-ca.pem
|
||||
- ./config/root-ca/certs/root-ca.pem:/usr/share/wazuh-indexer/config/certs/root-ca.pem
|
||||
- ./config/wazuh1_indexer/certs/wazuh1.indexer-key.pem:/usr/share/wazuh-indexer/config/certs/indexer-key.pem
|
||||
- ./config/wazuh1_indexer/certs/wazuh1.indexer.pem:/usr/share/wazuh-indexer/config/certs/indexer.pem
|
||||
- ./config/wazuh1_indexer/certs/admin.pem:/usr/share/wazuh-indexer/config/certs/admin.pem
|
||||
- ./config/wazuh1_indexer/certs/admin-key.pem:/usr/share/wazuh-indexer/config/certs/admin-key.pem
|
||||
|
||||
wazuh2.indexer:
|
||||
image: wazuh/wazuh-indexer:5.0.0
|
||||
image: wazuh/wazuh-indexer:5.0.0-beta2
|
||||
hostname: wazuh2.indexer
|
||||
container_name: multi-node-wazuh2.indexer
|
||||
restart: always
|
||||
@@ -153,12 +153,12 @@ services:
|
||||
start_period: 60s
|
||||
volumes:
|
||||
- wazuh-indexer-data-2:/var/lib/wazuh-indexer
|
||||
- ./config/wazuh2_indexer/certs/root-ca.pem:/usr/share/wazuh-indexer/config/certs/root-ca.pem
|
||||
- ./config/root-ca/certs/root-ca.pem:/usr/share/wazuh-indexer/config/certs/root-ca.pem
|
||||
- ./config/wazuh2_indexer/certs/wazuh2.indexer-key.pem:/usr/share/wazuh-indexer/config/certs/indexer-key.pem
|
||||
- ./config/wazuh2_indexer/certs/wazuh2.indexer.pem:/usr/share/wazuh-indexer/config/certs/indexer.pem
|
||||
|
||||
wazuh3.indexer:
|
||||
image: wazuh/wazuh-indexer:5.0.0
|
||||
image: wazuh/wazuh-indexer:5.0.0-beta2
|
||||
hostname: wazuh3.indexer
|
||||
container_name: multi-node-wazuh3.indexer
|
||||
restart: always
|
||||
@@ -191,12 +191,12 @@ services:
|
||||
start_period: 60s
|
||||
volumes:
|
||||
- wazuh-indexer-data-3:/var/lib/wazuh-indexer
|
||||
- ./config/wazuh3_indexer/certs/root-ca.pem:/usr/share/wazuh-indexer/config/certs/root-ca.pem
|
||||
- ./config/root-ca/certs/root-ca.pem:/usr/share/wazuh-indexer/config/certs/root-ca.pem
|
||||
- ./config/wazuh3_indexer/certs/wazuh3.indexer-key.pem:/usr/share/wazuh-indexer/config/certs/indexer-key.pem
|
||||
- ./config/wazuh3_indexer/certs/wazuh3.indexer.pem:/usr/share/wazuh-indexer/config/certs/indexer.pem
|
||||
|
||||
wazuh.dashboard:
|
||||
image: wazuh/wazuh-dashboard:5.0.0
|
||||
image: wazuh/wazuh-dashboard:5.0.0-beta2
|
||||
hostname: wazuh.dashboard
|
||||
container_name: multi-node-wazuh.dashboard
|
||||
restart: always
|
||||
@@ -223,7 +223,7 @@ services:
|
||||
volumes:
|
||||
- ./config/wazuh_dashboard/certs/wazuh.dashboard.pem:/usr/share/wazuh-dashboard/config/certs/wazuh-dashboard.pem
|
||||
- ./config/wazuh_dashboard/certs/wazuh.dashboard-key.pem:/usr/share/wazuh-dashboard/config/certs/wazuh-dashboard-key.pem
|
||||
- ./config/wazuh_dashboard/certs/root-ca.pem:/usr/share/wazuh-dashboard/config/certs/root-ca.pem
|
||||
- ./config/root-ca/certs/root-ca.pem:/usr/share/wazuh-dashboard/config/certs/root-ca.pem
|
||||
- wazuh-dashboard-config:/usr/share/wazuh-dashboard/config
|
||||
- wazuh-dashboard-custom:/usr/share/wazuh-dashboard/plugins/wazuh/public/assets/custom
|
||||
depends_on:
|
||||
|
||||
@@ -1,213 +0,0 @@
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=wazuh-indexer-data-1 \
|
||||
$2_wazuh-indexer-data-1
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=wazuh-indexer-data-2 \
|
||||
$2_wazuh-indexer-data-2
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=wazuh-indexer-data-3 \
|
||||
$2_wazuh-indexer-data-3
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=master_wazuh_api_configuration \
|
||||
$2_master_wazuh_api_configuration
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=master_wazuh_etc \
|
||||
$2_docker_wazuh_etc
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=master-wazuh-logs \
|
||||
$2_master-wazuh-logs
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=master-wazuh-queue \
|
||||
$2_master-wazuh-queue
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=master-wazuh-var-multigroups \
|
||||
$2_master-wazuh-var-multigroups
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=master-wazuh-active-response \
|
||||
$2_master-wazuh-active-response
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=master-wazuh-etc \
|
||||
$2_master-wazuh-etc
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=master-wazuh-var \
|
||||
$2_master-wazuh-var
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=worker_wazuh_api_configuration \
|
||||
$2_worker_wazuh_api_configuration
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=worker_wazuh_etc \
|
||||
$2_worker-wazuh-etc
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=worker-wazuh-logs \
|
||||
$2_worker-wazuh-logs
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=worker-wazuh-queue \
|
||||
$2_worker-wazuh-queue
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=worker-wazuh-var-multigroups \
|
||||
$2_worker-wazuh-var-multigroups
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=worker-wazuh-active-response \
|
||||
$2_worker-wazuh-active-response
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=worker-wazuh-etc \
|
||||
$2_worker-wazuh-etc
|
||||
|
||||
docker volume create \
|
||||
--label com.docker.compose.project=$2 \
|
||||
--label com.docker.compose.version=$1 \
|
||||
--label com.docker.compose.volume=worker-wazuh-var \
|
||||
$2_worker-wazuh-var
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-var:/from \
|
||||
-v $2_worker-wazuh-var:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_elastic-data-1:/from \
|
||||
-v $2_wazuh-indexer-data-1:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_elastic-data-2:/from \
|
||||
-v $2_wazuh-indexer-data-2:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_elastic-data-3:/from \
|
||||
-v $2_wazuh-indexer-data-3:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_ossec-api-configuration:/from \
|
||||
-v $2_master-wazuh-api-configuration:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_ossec-etc:/from \
|
||||
-v $2_master-wazuh-etc:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_ossec-logs:/from \
|
||||
-v $2_master-wazuh-logs:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_ossec-queue:/from \
|
||||
-v $2_master-wazuh-queue:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_ossec-var-multigroups:/from \
|
||||
-v $2_master-wazuh-var-multigroups:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_ossec-active-response:/from \
|
||||
-v $2_master-wazuh-active-response:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker-etc:/from \
|
||||
-v $2_master-wazuh-etc:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker-var:/from \
|
||||
-v $2_master-wazuh-var:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-ossec-api-configuration:/from \
|
||||
-v $2_worker-wazuh-api-configuration:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-ossec-etc:/from \
|
||||
-v $2_worker-wazuh-etc:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-ossec-logs:/from \
|
||||
-v $2_worker-wazuh-logs:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-ossec-queue:/from \
|
||||
-v $2_worker-wazuh-queue:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-ossec-var-multigroups:/from \
|
||||
-v $2_worker-wazuh-var-multigroups:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-ossec-active-response:/from \
|
||||
-v $2_worker-wazuh-active-response:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-etc:/from \
|
||||
-v $2_worker-wazuh-etc:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
|
||||
docker container run --rm -it \
|
||||
-v wazuh-docker_worker-var:/from \
|
||||
-v $2_worker-wazuh-var:/to \
|
||||
alpine ash -c "cd /from ; cp -avp . /to"
|
||||
@@ -1,7 +1,7 @@
|
||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||
services:
|
||||
wazuh.manager:
|
||||
image: wazuh/wazuh-manager:5.0.0
|
||||
image: wazuh/wazuh-manager:5.0.0-beta2
|
||||
hostname: wazuh.manager
|
||||
container_name: single-node-wazuh.manager
|
||||
restart: always
|
||||
@@ -38,12 +38,12 @@ services:
|
||||
- wazuh_logs:/var/wazuh-manager/logs
|
||||
- wazuh_queue:/var/wazuh-manager/queue
|
||||
- wazuh_var_multigroups:/var/wazuh-manager/var/multigroups
|
||||
- ./config/wazuh_manager/certs/root-ca.pem:/var/wazuh-manager/etc/certs/root-ca.pem
|
||||
- ./config/root-ca/certs/root-ca.pem:/var/wazuh-manager/etc/certs/root-ca.pem
|
||||
- ./config/wazuh_manager/certs/wazuh.manager.pem:/var/wazuh-manager/etc/certs/manager.pem
|
||||
- ./config/wazuh_manager/certs/wazuh.manager-key.pem:/var/wazuh-manager/etc/certs/manager-key.pem
|
||||
|
||||
wazuh.indexer:
|
||||
image: wazuh/wazuh-indexer:5.0.0
|
||||
image: wazuh/wazuh-indexer:5.0.0-beta2
|
||||
hostname: wazuh.indexer
|
||||
container_name: single-node-wazuh.indexer
|
||||
restart: always
|
||||
@@ -73,14 +73,14 @@ services:
|
||||
start_period: 60s
|
||||
volumes:
|
||||
- wazuh-indexer-data:/var/lib/wazuh-indexer
|
||||
- ./config/wazuh_indexer/certs/root-ca.pem:/usr/share/wazuh-indexer/config/certs/root-ca.pem
|
||||
- ./config/root-ca/certs/root-ca.pem:/usr/share/wazuh-indexer/config/certs/root-ca.pem
|
||||
- ./config/wazuh_indexer/certs/wazuh.indexer-key.pem:/usr/share/wazuh-indexer/config/certs/indexer-key.pem
|
||||
- ./config/wazuh_indexer/certs/wazuh.indexer.pem:/usr/share/wazuh-indexer/config/certs/indexer.pem
|
||||
- ./config/wazuh_indexer/certs/admin.pem:/usr/share/wazuh-indexer/config/certs/admin.pem
|
||||
- ./config/wazuh_indexer/certs/admin-key.pem:/usr/share/wazuh-indexer/config/certs/admin-key.pem
|
||||
|
||||
wazuh.dashboard:
|
||||
image: wazuh/wazuh-dashboard:5.0.0
|
||||
image: wazuh/wazuh-dashboard:5.0.0-beta2
|
||||
hostname: wazuh.dashboard
|
||||
container_name: single-node-wazuh.dashboard
|
||||
restart: always
|
||||
@@ -107,7 +107,7 @@ services:
|
||||
volumes:
|
||||
- ./config/wazuh_dashboard/certs/wazuh.dashboard.pem:/usr/share/wazuh-dashboard/config/certs/dashboard.pem
|
||||
- ./config/wazuh_dashboard/certs/wazuh.dashboard-key.pem:/usr/share/wazuh-dashboard/config/certs/dashboard-key.pem
|
||||
- ./config/wazuh_dashboard/certs/root-ca.pem:/usr/share/wazuh-dashboard/config/certs/root-ca.pem
|
||||
- ./config/root-ca/certs/root-ca.pem:/usr/share/wazuh-dashboard/config/certs/root-ca.pem
|
||||
- wazuh-dashboard-config:/usr/share/wazuh-dashboard/config
|
||||
- wazuh-dashboard-custom:/usr/share/wazuh-dashboard/plugins/wazuh/public/assets/custom
|
||||
depends_on:
|
||||
|
||||
@@ -77,6 +77,8 @@ node_to_dir() {
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
# Parse config.yml
|
||||
export WAZUH_UID=101
|
||||
export WAZUH_GID=101
|
||||
if $DO_COPY || $DO_PRIV; then
|
||||
if [ ! -f "$CONFIG_FILE" ]; then
|
||||
echo "Error: Configuration file $CONFIG_FILE not found."
|
||||
@@ -102,7 +104,6 @@ if $DO_COPY; then
|
||||
echo "Copying certificates for indexer: $node -> config/$dir_name/certs/"
|
||||
mkdir -p "./config/$dir_name/certs"
|
||||
cp "$OUTPUT_DIR/${node}"* "./config/$dir_name/certs/"
|
||||
cp "$OUTPUT_DIR"/root-ca* "./config/$dir_name/certs/"
|
||||
if $FIRST_INDEXER; then
|
||||
cp "$OUTPUT_DIR"/admin* "./config/$dir_name/certs/"
|
||||
FIRST_INDEXER=false
|
||||
@@ -114,7 +115,6 @@ if $DO_COPY; then
|
||||
echo "Copying certificates for manager: $node -> config/$dir_name/certs/"
|
||||
mkdir -p "./config/$dir_name/certs"
|
||||
cp "$OUTPUT_DIR/${node}"* "./config/$dir_name/certs/"
|
||||
cp "$OUTPUT_DIR"/root-ca* "./config/$dir_name/certs/"
|
||||
done
|
||||
|
||||
for node in "${DASHBOARD_NODES[@]}"; do
|
||||
@@ -122,32 +122,37 @@ if $DO_COPY; then
|
||||
echo "Copying certificates for dashboard: $node -> config/$dir_name/certs/"
|
||||
mkdir -p "./config/$dir_name/certs"
|
||||
cp "$OUTPUT_DIR/${node}"* "./config/$dir_name/certs/"
|
||||
cp "$OUTPUT_DIR"/root-ca* "./config/$dir_name/certs/"
|
||||
done
|
||||
echo "Copying root-ca certificates -> config/root-ca/certs/"
|
||||
mkdir -p "./config/root-ca/certs"
|
||||
cp "$OUTPUT_DIR"/root-ca* "./config/root-ca/certs/"
|
||||
fi
|
||||
|
||||
# 3. Set ownership and permissions
|
||||
if $DO_PRIV; then
|
||||
for node in "${INDEXER_NODES[@]}"; do
|
||||
dir_name=$(node_to_dir "$node")
|
||||
echo "Setting permissions for indexer $node (1000:1000)"
|
||||
chown -R 1000:1000 "./config/$dir_name/certs"
|
||||
echo "Setting permissions for indexer $node (${WAZUH_UID}:${WAZUH_GID})"
|
||||
chown -R ${WAZUH_UID}:${WAZUH_GID} "./config/$dir_name/certs"
|
||||
chmod 400 "./config/$dir_name/certs/"*
|
||||
done
|
||||
|
||||
for node in "${MANAGER_NODES[@]}"; do
|
||||
dir_name=$(node_to_dir "$node")
|
||||
echo "Setting permissions for manager $node (999:999)"
|
||||
chown -R 999:999 "./config/$dir_name/certs"
|
||||
echo "Setting permissions for manager $node (${WAZUH_UID}:${WAZUH_GID})"
|
||||
chown -R ${WAZUH_UID}:${WAZUH_GID} "./config/$dir_name/certs"
|
||||
chmod 400 "./config/$dir_name/certs/"*
|
||||
done
|
||||
|
||||
for node in "${DASHBOARD_NODES[@]}"; do
|
||||
dir_name=$(node_to_dir "$node")
|
||||
echo "Setting permissions for dashboard $node (1000:1000)"
|
||||
chown -R 1000:1000 "./config/$dir_name/certs"
|
||||
echo "Setting permissions for dashboard $node (${WAZUH_UID}:${WAZUH_GID})"
|
||||
chown -R ${WAZUH_UID}:${WAZUH_GID} "./config/$dir_name/certs"
|
||||
chmod 400 "./config/$dir_name/certs/"*
|
||||
done
|
||||
echo "Setting permissions for root-ca certificates (${WAZUH_UID}:${WAZUH_GID})"
|
||||
chown -R ${WAZUH_UID}:${WAZUH_GID} "./config/root-ca/certs"
|
||||
chmod 400 "./config/root-ca/certs/"*
|
||||
fi
|
||||
|
||||
echo "Process completed."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||
services:
|
||||
wazuh.agent:
|
||||
image: wazuh/wazuh-agent:5.0.0
|
||||
image: wazuh/wazuh-agent:5.0.0-beta2
|
||||
restart: always
|
||||
environment:
|
||||
- WAZUH_MANAGER_SERVER=<WAZUH_MANAGER_IP>
|
||||
|
||||
Reference in New Issue
Block a user