forked from wazuh/wazuh-docker
Compare commits
68
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a4e880b81 | ||
|
|
550d183a1d | ||
|
|
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 | ||
|
|
cea9f3c90f | ||
|
|
8f38789a11 | ||
|
|
d60c0ff94e | ||
|
|
09f170b01a | ||
|
|
acf3f1fc3b | ||
|
|
3adc7093f5 | ||
|
|
df46b699f1 | ||
|
|
257d75e4ed | ||
|
|
c752e9f9b2 | ||
|
|
21e4202e39 | ||
|
|
2d093f452f | ||
|
|
e5c55cd8fe | ||
|
|
985054089d | ||
|
|
1bd499f9bd | ||
|
|
64a7811cf4 | ||
|
|
4161af024f | ||
|
|
6aa5015a0b | ||
|
|
2d1c28ca8a | ||
|
|
bab0839cea | ||
|
|
3a4773f0e5 | ||
|
|
ffed80385b | ||
|
|
9d56dc051e | ||
|
|
90f233ea53 | ||
|
|
460d0ff38f |
@@ -1,3 +1,4 @@
|
||||
WAZUH_VERSION=5.0.0
|
||||
WAZUH_IMAGE_VERSION=5.0.0
|
||||
WAZUH_REGISTRY=docker.io
|
||||
IMAGE_TAG=5.0.0
|
||||
|
||||
+3
-3
@@ -2,14 +2,14 @@ file:
|
||||
/var/wazuh-manager/bin/wazuh-manager-control:
|
||||
exists: true
|
||||
mode: "0750"
|
||||
owner: root
|
||||
group: root
|
||||
owner: wazuh-manager
|
||||
group: wazuh-manager
|
||||
filetype: file
|
||||
contains: []
|
||||
/var/wazuh-manager/etc/wazuh-manager.conf:
|
||||
exists: true
|
||||
mode: "0660"
|
||||
owner: root
|
||||
owner: wazuh-manager
|
||||
group: wazuh-manager
|
||||
filetype: file
|
||||
contains: []
|
||||
|
||||
@@ -32,7 +32,11 @@ on:
|
||||
description: 'Optional identifier for the run'
|
||||
required: false
|
||||
type: string
|
||||
|
||||
revert:
|
||||
description: 'Set to true to revert the bump changes applied for this issue'
|
||||
default: false
|
||||
required: false
|
||||
type: boolean
|
||||
jobs:
|
||||
bump:
|
||||
name: Repository bumper 5.x
|
||||
@@ -107,7 +111,14 @@ jobs:
|
||||
fi
|
||||
|
||||
issue_number=$(echo "${{ inputs.issue-link }}" | awk -F'/' '{print $NF}')
|
||||
BRANCH_NAME="enhancement/wqa${issue_number}-bump-${{ github.ref_name }}"
|
||||
|
||||
if [[ "${{ inputs.revert }}" == "true" ]]; then
|
||||
BRANCH_NAME="enhancement/wqa${issue_number}-revert-bump-${{ github.ref_name }}"
|
||||
echo "pr_title=Revert bump ${{ github.ref_name }} branch" >> $GITHUB_OUTPUT
|
||||
else
|
||||
BRANCH_NAME="enhancement/wqa${issue_number}-bump-${{ github.ref_name }}"
|
||||
echo "pr_title=Bump ${{ github.ref_name }} branch" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT
|
||||
echo "script_params=${script_params}" >> $GITHUB_OUTPUT
|
||||
|
||||
@@ -116,22 +127,68 @@ jobs:
|
||||
git checkout -b ${{ steps.vars.outputs.branch_name }}
|
||||
|
||||
- name: Make version bump changes
|
||||
if: inputs.revert != true
|
||||
run: |
|
||||
echo "Running bump script"
|
||||
bash ${{ env.BUMP_SCRIPT_PATH }} ${{ steps.vars.outputs.script_params }}
|
||||
|
||||
- name: Commit and push changes
|
||||
- name: Commit changes (Bump)
|
||||
if: inputs.revert != true
|
||||
run: |
|
||||
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
|
||||
run: |
|
||||
ISSUE_NUMBER=$(echo "${{ inputs.issue-link }}" | awk -F'/' '{print $NF}')
|
||||
|
||||
BUMP_BRANCH="enhancement/wqa${ISSUE_NUMBER}-bump-${{ github.ref_name }}"
|
||||
|
||||
PR_NUMBER=$(gh pr list --head "$BUMP_BRANCH" --base "${{ github.ref_name }}" --state merged --json number --jq '.[0].number')
|
||||
|
||||
if [ -z "$PR_NUMBER" ] || [ "$PR_NUMBER" == "null" ]; then
|
||||
echo "Error: The original PR for the bump was not found"
|
||||
echo "Searching merged PR from: $BUMP_BRANCH to ${{ github.ref_name }}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Original PR found: #$PR_NUMBER"
|
||||
|
||||
MERGE_COMMIT=$(gh pr view $PR_NUMBER --json mergeCommit --jq '.mergeCommit.oid')
|
||||
|
||||
git revert -m 1 $MERGE_COMMIT --no-commit
|
||||
|
||||
# Remove the files to prevent them from being included in the revert commit
|
||||
git checkout HEAD -- VERSION.json 2>/dev/null || true
|
||||
git checkout HEAD -- CHANGELOG.md 2>/dev/null || true
|
||||
# Add any other repository-specific version files here
|
||||
|
||||
if git diff --staged --quiet; then
|
||||
echo "No references to revert. Skipping commit."
|
||||
echo "has_changes=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
git commit -m "feat: revert ${{ github.ref_name }} references"
|
||||
echo "has_changes=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Push changes
|
||||
if: inputs.revert != true || (inputs.revert == true && steps.revert_step.outputs.has_changes == 'true')
|
||||
run: |
|
||||
git push origin ${{ steps.vars.outputs.branch_name }}
|
||||
|
||||
- name: Create pull request
|
||||
id: create_pr
|
||||
if: inputs.revert != true || (inputs.revert == true && steps.revert_step.outputs.has_changes == 'true')
|
||||
run: |
|
||||
gh auth setup-git
|
||||
PR_URL=$(gh pr create \
|
||||
--title "Bump ${{ github.ref_name }} branch" \
|
||||
--title "${{ steps.vars.outputs.pr_title }}" \
|
||||
--body "Issue: ${{ inputs.issue-link }}" \
|
||||
--base ${{ github.ref_name }} \
|
||||
--head ${{ steps.vars.outputs.branch_name }})
|
||||
@@ -140,14 +197,25 @@ jobs:
|
||||
echo "pull_request_url=${PR_URL}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Merge pull request
|
||||
if: inputs.revert != true || (inputs.revert == true && steps.revert_step.outputs.has_changes == 'true')
|
||||
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
|
||||
gh pr merge "${{ steps.create_pr.outputs.pull_request_url }}" --merge --admin
|
||||
|
||||
- name: Show logs
|
||||
if: inputs.revert != true
|
||||
run: |
|
||||
echo "Bump complete."
|
||||
echo "Branch: ${{ steps.vars.outputs.branch_name }}"
|
||||
echo "PR: ${{ steps.create_pr.outputs.pull_request_url }}"
|
||||
echo "Bumper scripts logs:"
|
||||
cat ${BUMP_LOG_PATH}/repository_bumper*log
|
||||
cat ${BUMP_LOG_PATH}/repository_bumper*log
|
||||
|
||||
- name: Show revert logs
|
||||
if: inputs.revert == true
|
||||
run: |
|
||||
echo "Revert bump complete."
|
||||
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
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
with:
|
||||
image_tag: ${{ needs.prepare-variables.outputs.WAZUH_IMAGE_VERSION }}
|
||||
docker_reference: ${{ github.head_ref || inputs.docker_reference }}
|
||||
wazuh_automation_reference: 'v5.0.0-beta1'
|
||||
wazuh_automation_reference: 'main'
|
||||
commit_list: '["latest", "latest", "latest", "latest"]'
|
||||
assistant_revision: 'latest'
|
||||
id: ${{ github.run_id }}
|
||||
@@ -76,7 +76,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
|
||||
@@ -162,6 +162,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 +285,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
|
||||
@@ -441,6 +443,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 +576,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-beta1'
|
||||
default: '5.0.0'
|
||||
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: 'v5.0.0-beta1'
|
||||
default: 'main'
|
||||
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-beta1'
|
||||
default: '5.0.0'
|
||||
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: 'v5.0.0-beta1'
|
||||
default: 'main'
|
||||
type: string
|
||||
products:
|
||||
description: 'Comma-separated list of the image names to build and push'
|
||||
@@ -90,6 +90,7 @@ jobs:
|
||||
outputs:
|
||||
WAZUH_COMPONENTS: ${{ steps.compute-outputs.outputs.WAZUH_COMPONENTS }}
|
||||
COMMIT_LIST: ${{ steps.compute-outputs.outputs.COMMIT_LIST }}
|
||||
ALL_PRODUCTS_SELECTED: ${{ steps.compute-outputs.outputs.ALL_PRODUCTS_SELECTED }}
|
||||
|
||||
steps:
|
||||
- name: Print inputs
|
||||
@@ -115,24 +116,22 @@ jobs:
|
||||
- name: Set up variables
|
||||
id: compute-outputs
|
||||
run: |
|
||||
# Set WAZUH_COMPONENTS
|
||||
WC_JSON_ARRAY=""
|
||||
if [[ "${{ inputs.products }}" != "null" && "${{ inputs.products }}" != "" ]]; then
|
||||
# Convert comma-separated list to JSON array format
|
||||
IFS=',' read -ra COMPONENTS <<< "${{ inputs.products }}"
|
||||
WC_JSON_ARRAY="["
|
||||
for i in "${!COMPONENTS[@]}"; do
|
||||
if [ $i -gt 0 ]; then
|
||||
WC_JSON_ARRAY+=","
|
||||
fi
|
||||
WC_JSON_ARRAY+="\"${COMPONENTS[$i]}\""
|
||||
done
|
||||
WC_JSON_ARRAY+="]"
|
||||
else
|
||||
WC_JSON_ARRAY='["wazuh-manager","wazuh-dashboard","wazuh-indexer","wazuh-agent"]'
|
||||
# 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
|
||||
echo "Products to build: $WC_JSON_ARRAY"
|
||||
echo "WAZUH_COMPONENTS=$WC_JSON_ARRAY" >> $GITHUB_OUTPUT
|
||||
# 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
|
||||
# Set WAZUH_COMPONENTS
|
||||
# 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
|
||||
|
||||
# Set COMMIT_LIST
|
||||
WC_COMMIT_LIST=""
|
||||
@@ -234,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 '.[]'))
|
||||
@@ -252,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 }}
|
||||
@@ -366,6 +363,7 @@ jobs:
|
||||
-d $DEV_STAGE \
|
||||
-rg $IMAGE_REGISTRY \
|
||||
-m \
|
||||
--dev \
|
||||
-refs "$COMPONENT_REFS_JSON" \
|
||||
-c ${{ matrix.wazuh_component }}
|
||||
else
|
||||
@@ -382,6 +380,7 @@ jobs:
|
||||
-v $IMAGE_TAG \
|
||||
-rg $IMAGE_REGISTRY \
|
||||
-m \
|
||||
--dev \
|
||||
-refs "$COMPONENT_REFS_JSON" \
|
||||
-c ${{ matrix.wazuh_component }}
|
||||
else
|
||||
@@ -405,11 +404,19 @@ jobs:
|
||||
fi
|
||||
working-directory: ./build-docker-images
|
||||
|
||||
|
||||
notify:
|
||||
runs-on: ubuntu-22.04
|
||||
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
|
||||
if: ${{ inputs.dev == false }}
|
||||
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
|
||||
@@ -431,12 +438,15 @@ jobs:
|
||||
echo "purpose=$PURPOSE" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: GH issue notification
|
||||
if: ${{ inputs.dev == false && steps.validation.outputs.purpose != '' }}
|
||||
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=""
|
||||
PURPOSE="${{ steps.validation.outputs.purpose }}"
|
||||
|
||||
## Setting GH issue title
|
||||
GH_TITLE="Artifactory vulnerabilities update \`v$IMAGE_TAG\`"
|
||||
@@ -487,6 +497,3 @@ jobs:
|
||||
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 }}
|
||||
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.NOTIFICATION_GH_ARTIFACT_TOKEN }}
|
||||
|
||||
+28
-2
@@ -5,11 +5,17 @@ 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 set_as_main option ([#2293](https://github.com/wazuh/wazuh-docker/pull/2293))
|
||||
- Change file owners on Goss test ([#2395](https://github.com/wazuh/wazuh-docker/pull/2395))
|
||||
- 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))
|
||||
@@ -48,6 +54,8 @@ 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))
|
||||
- Change Wazuh manager Healthcheck. ([#2272](https://github.com/wazuh/wazuh-docker/pull/2272))
|
||||
@@ -58,6 +66,24 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
- None
|
||||
|
||||
## [4.14.6]
|
||||
|
||||
### Added
|
||||
|
||||
- None
|
||||
|
||||
### Changed
|
||||
|
||||
- None
|
||||
|
||||
### Fixed
|
||||
|
||||
- GH issue notification fix ([#2312](https://github.com/wazuh/wazuh-docker/pull/2312))
|
||||
|
||||
### Deleted
|
||||
|
||||
- None
|
||||
|
||||
## [4.14.5]
|
||||
|
||||
### Added
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"version": "5.0.0",
|
||||
"stage": "beta1"
|
||||
}
|
||||
}
|
||||
+103
-115
@@ -17,6 +17,7 @@ WAZUH_REGISTRY=docker.io
|
||||
WAZUH_IMAGE_VERSION="5.0.0"
|
||||
WAZUH_DEV_STAGE=""
|
||||
WAZUH_COMPONENTS_COMMIT_LIST=''
|
||||
IS_DEV_BUILD=""
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
@@ -46,42 +47,70 @@ build() {
|
||||
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
|
||||
echo "$ARTIFACT_URLS_FILE exists. Using existing file."
|
||||
else
|
||||
# Prepare logic to fetch the artifact from Wazuh's infrastructure
|
||||
# GitHub URL for exact Release Tag lookup
|
||||
TAG="v${WAZUH_IMAGE_VERSION}"
|
||||
REPO="wazuh/wazuh-docker"
|
||||
GH_URL="https://api.github.com/repos/${REPO}/releases/tags/${TAG}"
|
||||
|
||||
# Use GitHub API to check if the tag exists publicly.
|
||||
# This determines if we should look for production or staging artifacts.
|
||||
if curl -fsSL "$GH_URL" >/dev/null 2>&1; then
|
||||
# CASE: Production (Tag exists in the official repository)
|
||||
ARTIFACT_URLS_DOWNLOAD=artifact_urls_${WAZUH_IMAGE_VERSION}.yaml
|
||||
PACKAGE_URL=packages.wazuh.com
|
||||
RELEASE_STAGE=production
|
||||
# Fetch the HTTP status code to determine release environment.
|
||||
# Using -L to follow redirects (GitHub may return 301/302 for some endpoints).
|
||||
HTTP_STATUS=$(curl -sL -o /dev/null -w "%{http_code}" "$GH_URL")
|
||||
|
||||
if [ "$HTTP_STATUS" -eq 200 ]; then
|
||||
# CASE: Production (Tag and Release exist)
|
||||
echo "Release $TAG found. Setting Production environment."
|
||||
ARTIFACT_URLS_DOWNLOAD="artifact_urls_${WAZUH_IMAGE_VERSION}.yaml"
|
||||
PACKAGE_URL="packages.wazuh.com"
|
||||
RELEASE_STAGE="production"
|
||||
elif [ "$HTTP_STATUS" -eq 403 ]; then
|
||||
# CASE: GitHub API rate limit hit — fall back to pre-release to avoid
|
||||
# incorrectly skipping staging artifacts.
|
||||
echo "Warning: GitHub API rate limit reached (403). Assuming pre-release environment." >&2
|
||||
PACKAGE_URL="packages-staging.xdrsiem.wazuh.info"
|
||||
RELEASE_STAGE="pre-release"
|
||||
if [ -n "$WAZUH_STAGE" ] && [ "$WAZUH_STAGE" != "null" ]; then
|
||||
ARTIFACT_URLS_DOWNLOAD="artifact_urls_${WAZUH_IMAGE_VERSION}-${WAZUH_STAGE}.yaml"
|
||||
else
|
||||
ARTIFACT_URLS_DOWNLOAD="artifact_urls_${WAZUH_IMAGE_VERSION}.yaml"
|
||||
fi
|
||||
else
|
||||
# CASE: Pre-release/Staging (Tag not found, fall back to staging environment)
|
||||
# Includes the WAZUH_STAGE suffix (e.g., artifact_urls_5.0.0-alpha0.yaml)
|
||||
ARTIFACT_URLS_DOWNLOAD=artifact_urls_${WAZUH_IMAGE_VERSION}-${WAZUH_STAGE}.yaml
|
||||
PACKAGE_URL=packages-staging.xdrsiem.wazuh.info
|
||||
RELEASE_STAGE=pre-release
|
||||
# CASE: Pre-release/Staging (404 Not Found or any other non-200 status)
|
||||
echo "Release $TAG not found (HTTP status: $HTTP_STATUS). Setting Pre-release environment."
|
||||
PACKAGE_URL="packages-staging.xdrsiem.wazuh.info"
|
||||
RELEASE_STAGE="pre-release"
|
||||
if [ -n "$WAZUH_STAGE" ] && [ "$WAZUH_STAGE" != "null" ]; then
|
||||
ARTIFACT_URLS_DOWNLOAD="artifact_urls_${WAZUH_IMAGE_VERSION}-${WAZUH_STAGE}.yaml"
|
||||
else
|
||||
ARTIFACT_URLS_DOWNLOAD="artifact_urls_${WAZUH_IMAGE_VERSION}.yaml"
|
||||
fi
|
||||
fi
|
||||
echo "Attempting to download artifacts from: https://${PACKAGE_URL}/${RELEASE_STAGE}/${WAZUH_MAJOR_VERSION}.x/${ARTIFACT_URLS_DOWNLOAD}"
|
||||
|
||||
# Final download using dynamic variables based on the release type.
|
||||
# Pattern: server / stage / major_version.x / filename
|
||||
curl -fsSL -o "$ARTIFACT_URLS_FILE" "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
|
||||
clean 1
|
||||
}
|
||||
fi
|
||||
|
||||
awk -F':' '!/^#/ && NF>1 {name=$1; val=substr($0,length(name)+3); gsub(/[-.]/,"_",name); print name "=\"" val "\""}' $ARTIFACT_URLS_FILE > artifacts_env.txt
|
||||
|
||||
# Set component commit references for development builds
|
||||
if [ -n "${WAZUH_DEV_STAGE}" ]; then
|
||||
# Set component commit references for development builds.
|
||||
# Commits are only resolved (and later appended to the image tag) when --dev is
|
||||
# explicitly passed. Production and stage builds (dev=false) never include a
|
||||
# commit suffix even if -refs is provided. Manual local builds also omit it.
|
||||
if [ -n "${IS_DEV_BUILD}" ]; then
|
||||
if [ -z "${WAZUH_COMPONENTS_COMMIT_LIST}" ]; then
|
||||
# Set default to 'latest' for all components if no specific references are provided
|
||||
# Default to 'latest' for all components if no specific references are provided
|
||||
INDEXER_COMMIT="latest"
|
||||
MANAGER_COMMIT="latest"
|
||||
DASHBOARD_COMMIT="latest"
|
||||
@@ -102,7 +131,6 @@ build() {
|
||||
fi
|
||||
|
||||
# Set all component commits
|
||||
|
||||
INDEXER_COMMIT="$(printf '%s' "${WAZUH_COMPONENTS_COMMIT_LIST}" | jq -r '.[0]')"
|
||||
MANAGER_COMMIT="$(printf '%s' "${WAZUH_COMPONENTS_COMMIT_LIST}" | jq -r '.[1]')"
|
||||
DASHBOARD_COMMIT="$(printf '%s' "${WAZUH_COMPONENTS_COMMIT_LIST}" | jq -r '.[2]')"
|
||||
@@ -138,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
|
||||
@@ -191,67 +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-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
|
||||
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
|
||||
IMAGE_TAG="${WAZUH_IMAGE_VERSION}${WAZUH_DEV_STAGE:+-${WAZUH_DEV_STAGE,,}-${COMPONENT_COMMIT}}"
|
||||
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!"
|
||||
@@ -265,8 +248,9 @@ help() {
|
||||
echo
|
||||
echo "Usage: $0 [OPTIONS]"
|
||||
echo
|
||||
echo " -d, --dev <ref> [Optional] Set the development stage you want to build, example rc2 or beta1, not used by default."
|
||||
echo " -refs, --references <refs> [Optional] [Only for Dev] JSON array of commit refs for components to be build (indexer, manager, dashboard, agent) in order. Defaults to latest."
|
||||
echo " -d, --dev-stage <ref> [Optional] Set the pre-release stage suffix (e.g. beta1, 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."
|
||||
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}."
|
||||
@@ -285,7 +269,7 @@ main() {
|
||||
"-h"|"--help")
|
||||
help 0
|
||||
;;
|
||||
"-d"|"--dev")
|
||||
"-d"|"--dev-stage")
|
||||
if [ -n "${2}" ]; then
|
||||
WAZUH_DEV_STAGE="${2}"
|
||||
shift 2
|
||||
@@ -293,6 +277,10 @@ main() {
|
||||
help 1
|
||||
fi
|
||||
;;
|
||||
"--dev")
|
||||
IS_DEV_BUILD="true"
|
||||
shift
|
||||
;;
|
||||
"-m"|"--multiarch")
|
||||
MULTIARCH="true"
|
||||
shift
|
||||
|
||||
@@ -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-beta1-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,10 +1,13 @@
|
||||
# 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'
|
||||
@@ -16,19 +19,49 @@ RUN 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
|
||||
|
||||
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 999 wazuh && \
|
||||
getent passwd wazuh || useradd --system \
|
||||
--uid 999 \
|
||||
--no-create-home \
|
||||
--home-dir /var/ossec \
|
||||
--gid wazuh \
|
||||
--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
|
||||
|
||||
@@ -24,7 +24,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):
|
||||
@@ -63,13 +62,13 @@ RUN yum install shadow-utils -y && \
|
||||
yum clean all && \
|
||||
getent group $GROUP || groupadd -r -g 1000 $GROUP && \
|
||||
useradd --system \
|
||||
--uid 1000 \
|
||||
--no-create-home \
|
||||
--home-dir $INSTALL_DIR \
|
||||
--gid $GROUP \
|
||||
--shell /sbin/nologin \
|
||||
--comment "$USER user" \
|
||||
$USER && \
|
||||
--uid 1000 \
|
||||
--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 && \
|
||||
|
||||
@@ -32,7 +32,8 @@ FROM amazonlinux:2023
|
||||
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 /
|
||||
@@ -63,7 +64,14 @@ COPY --from=builder --chown=1000:1000 $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
|
||||
|
||||
@@ -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,86 @@
|
||||
# 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
|
||||
|
||||
# Prepare permanent data config needed by permanent_data.sh at build time
|
||||
COPY config/permanent_data.env config/permanent_data.sh /
|
||||
|
||||
RUN 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 openssl findutils procps shadow-utils -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
|
||||
|
||||
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 999 wazuh-manager && \
|
||||
getent passwd wazuh-manager || useradd --system \
|
||||
--uid 999 \
|
||||
--no-create-home \
|
||||
--home-dir /var/wazuh-manager \
|
||||
--gid wazuh-manager \
|
||||
--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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||
services:
|
||||
wazuh.master:
|
||||
image: wazuh/wazuh-manager:5.0.0-beta1
|
||||
image: wazuh/wazuh-manager:5.0.0
|
||||
hostname: wazuh.master
|
||||
container_name: multi-node-wazuh.master
|
||||
restart: always
|
||||
@@ -43,7 +43,7 @@ services:
|
||||
- ./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-beta1
|
||||
image: wazuh/wazuh-manager:5.0.0
|
||||
hostname: wazuh.worker
|
||||
container_name: multi-node-wazuh.worker
|
||||
restart: always
|
||||
@@ -82,7 +82,7 @@ services:
|
||||
- ./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-beta1
|
||||
image: wazuh/wazuh-indexer:5.0.0
|
||||
hostname: wazuh1.indexer
|
||||
container_name: multi-node-wazuh1.indexer
|
||||
restart: always
|
||||
@@ -120,7 +120,7 @@ services:
|
||||
- ./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-beta1
|
||||
image: wazuh/wazuh-indexer:5.0.0
|
||||
hostname: wazuh2.indexer
|
||||
container_name: multi-node-wazuh2.indexer
|
||||
restart: always
|
||||
@@ -158,7 +158,7 @@ services:
|
||||
- ./config/wazuh2_indexer/certs/wazuh2.indexer.pem:/usr/share/wazuh-indexer/config/certs/indexer.pem
|
||||
|
||||
wazuh3.indexer:
|
||||
image: wazuh/wazuh-indexer:5.0.0-beta1
|
||||
image: wazuh/wazuh-indexer:5.0.0
|
||||
hostname: wazuh3.indexer
|
||||
container_name: multi-node-wazuh3.indexer
|
||||
restart: always
|
||||
@@ -196,7 +196,7 @@ services:
|
||||
- ./config/wazuh3_indexer/certs/wazuh3.indexer.pem:/usr/share/wazuh-indexer/config/certs/indexer.pem
|
||||
|
||||
wazuh.dashboard:
|
||||
image: wazuh/wazuh-dashboard:5.0.0-beta1
|
||||
image: wazuh/wazuh-dashboard:5.0.0
|
||||
hostname: wazuh.dashboard
|
||||
container_name: multi-node-wazuh.dashboard
|
||||
restart: always
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||
services:
|
||||
wazuh.manager:
|
||||
image: wazuh/wazuh-manager:5.0.0-beta1
|
||||
image: wazuh/wazuh-manager:5.0.0
|
||||
hostname: wazuh.manager
|
||||
container_name: single-node-wazuh.manager
|
||||
restart: always
|
||||
@@ -43,7 +43,7 @@ services:
|
||||
- ./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-beta1
|
||||
image: wazuh/wazuh-indexer:5.0.0
|
||||
hostname: wazuh.indexer
|
||||
container_name: single-node-wazuh.indexer
|
||||
restart: always
|
||||
@@ -80,7 +80,7 @@ services:
|
||||
- ./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-beta1
|
||||
image: wazuh/wazuh-dashboard:5.0.0
|
||||
hostname: wazuh.dashboard
|
||||
container_name: single-node-wazuh.dashboard
|
||||
restart: always
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Wazuh App Copyright (C) 2017, Wazuh Inc. (License GPLv2)
|
||||
services:
|
||||
wazuh.agent:
|
||||
image: wazuh/wazuh-agent:5.0.0-beta1
|
||||
image: wazuh/wazuh-agent:5.0.0
|
||||
restart: always
|
||||
environment:
|
||||
- WAZUH_MANAGER_SERVER=<WAZUH_MANAGER_IP>
|
||||
|
||||
Reference in New Issue
Block a user