Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phase V - Docker images #192

Closed
Tracked by #54
AlexRuiz7 opened this issue Mar 20, 2024 · 5 comments · Fixed by #194
Closed
Tracked by #54

Phase V - Docker images #192

AlexRuiz7 opened this issue Mar 20, 2024 · 5 comments · Fixed by #194
Assignees
Labels
level/task Task issue request/operational Operational requests type/enhancement Enhancement issue

Comments

@AlexRuiz7
Copy link
Member

AlexRuiz7 commented Mar 20, 2024

Description

Build and publish Docker images for development and testing.

@AlexRuiz7 AlexRuiz7 mentioned this issue Mar 20, 2024
7 tasks
@AlexRuiz7 AlexRuiz7 added level/task Task issue request/operational Operational requests type/enhancement Enhancement issue labels Mar 20, 2024
@AlexRuiz7 AlexRuiz7 mentioned this issue Mar 20, 2024
8 tasks
@AlexRuiz7 AlexRuiz7 self-assigned this Mar 22, 2024
@AlexRuiz7
Copy link
Member Author

Enabled assembly of tar packages.

https://github.com/wazuh/wazuh-indexer/actions/runs/8364340868

@AlexRuiz7
Copy link
Member Author

By placing a tar in the same folder as the Dockerfile, the image can be built running this command:

docker build --progress=plain --no-cache --build-arg="WAZUH_VERSION=4.9.0" --build-arg="WAZUH_INDEXER_TAR_NAME=wazuh-indexer-4.9.0-1_linux-x64_cfca84f.tar.gz" --tag=wazuh-indexer:4.9.0 .

Then, start a container with:

docker run -it --rm wazuh-indexer:4.9.0 

The indexer starts, but there is an error that prevents it from reaching the green cluster state, which I'm still troubleshooting.

[2024-04-02T16:37:23,133][ERROR][o.o.s.c.ConfigurationLoaderSecurity7] [wazuh.indexer] Failure no such index [.opendistro_security] retrieving configuration for [INTERNALUSERS, ACTIONGROUPS, CONFIG, ROLES, ROLESMAPPING, TENANTS, NODESDN, WHITELIST, ALLOWLIST, AUDIT] (index=.opendistro_security)

@AlexRuiz7
Copy link
Member Author

The solution to the problem above is to run the security admin script to initialize the .opendistro_security index.

#!/bin/bash

# Initialize the `.opendistro_security` index.

INDEXER_HOME=/usr/share/wazuh-indexer
JAVA_HOME=$INDEXER_HOME/jdk/

export JAVA_HOME

bash $INDEXER_HOME/plugins/opensearch-security/tools/securityadmin.sh \
    -cd $INDEXER_HOME/config/opensearch-security/ \
    -nhnv \
    -cacert $INDEXER_HOME/config/certs/root-ca.pem \
    -cert $INDEXER_HOME/config/certs/admin.pem \
    -key $INDEXER_HOME/config/certs/admin-key.pem \
    -p 9200 \
    -icl
Raw command

JAVA_HOME=/usr/share/wazuh-indexer/jdk/ bash /usr/share/wazuh-indexer/plugins/opensearch-security/tools/securityadmin.sh -cd /usr/share/wazuh-indexer/config/opensearch-security/ -nhnv -cacert config/certs/root-ca.pem -cert config/certs/admin.pem -key config/certs/admin-key.pem -p 9200 -icl

@AlexRuiz7
Copy link
Member Author

I wondered why we decided to run the securityadmin.sh directly instead of invoking our wrapper indexer-security-init.sh. The configuration path is hard-coded to /etc/wazuh-indexer.

bin/indexer-security-init.sh 
ERROR: it was not possible to find /etc/wazuh-indexer

@AlexRuiz7
Copy link
Member Author

REPOSITORY                                TAG       IMAGE ID       CREATED        SIZE
wazuh-indexer                             4.9.0     5a9bdb3e545a   16 hours ago   1.33GB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Task issue request/operational Operational requests type/enhancement Enhancement issue
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant