forked from wazuh/wazuh-docker
fix securityadmin.sh for wazuh-indexer
This commit is contained in:
@@ -13,8 +13,16 @@ RUN curl https://s3.us-west-1.amazonaws.com/packages-dev.wazuh.com/pre-release/a
|
||||
|
||||
COPY config/entrypoint.sh /
|
||||
|
||||
COPY config/wazuh_app_config.sh /
|
||||
|
||||
COPY config/dashboard.yml /etc/wazuh-dashboard/
|
||||
|
||||
RUN chmod 700 /entrypoint.sh
|
||||
|
||||
RUN chmod 700 /wazuh_app_config.sh
|
||||
|
||||
RUN chown 101:101 /etc/wazuh-dashboard/dashboard.yml && chmod 664 /etc/wazuh-dashboard/dashboard.yml
|
||||
|
||||
# Services ports
|
||||
EXPOSE 5601
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
server.host: 0.0.0.0
|
||||
server.port: 5601
|
||||
opensearch.hosts: https://wazuh1.indexer:9700
|
||||
opensearch.ssl.verificationMode: certificate
|
||||
opensearch.username: kibanaserver
|
||||
opensearch.password: kibanaserver
|
||||
opensearch.requestHeadersWhitelist: ["securitytenant","Authorization"]
|
||||
opensearch_security.multitenancy.enabled: false
|
||||
opensearch_security.readonly_mode.roles: ["kibana_read_only"]
|
||||
server.ssl.enabled: false
|
||||
server.ssl.key: "/etc/wazuh-dashboard/certs/demo-dashboard-key.pem"
|
||||
server.ssl.certificate: "/etc/wazuh-dashboard/certs/demo-dashboard.pem"
|
||||
opensearch.ssl.certificateAuthorities: ["/etc/wazuh-dashboard/certs/root-ca.pem"]
|
||||
uiSettings.overrides.defaultRoute: /app/wazuh?security_tenant=global
|
||||
@@ -5,8 +5,6 @@
|
||||
# Start Wazuh dashboard
|
||||
##############################################################################
|
||||
|
||||
sed -i 's/localhost:9700/wazuh-indexer:9700/' /etc/wazuh-dashboard/dashboard.yml
|
||||
sed -i 's/<wazuh-dashboard-ip>/0.0.0.0/' /etc/wazuh-dashboard/dashboard.yml
|
||||
sed -i '/logging.dest:/d' /etc/wazuh-dashboard/dashboard.yml
|
||||
#/wazuh_app_config.sh
|
||||
|
||||
runuser wazuh-dashboard --shell="/bin/bash" --command="/usr/share/wazuh-dashboard/bin/opensearch-dashboards -c /etc/wazuh-dashboard/dashboard.yml"
|
||||
|
||||
@@ -6,51 +6,8 @@ wazuh_port="${API_PORT:-55000}"
|
||||
api_username="${API_USERNAME:-wazuh-wui}"
|
||||
api_password="${API_PASSWORD:-wazuh-wui}"
|
||||
|
||||
kibana_config_file="/etc/wazuh-dashboard/wazuh-dashboard.yml"
|
||||
kibana_config_file="/usr/share/wazuh-dashboard/data/wazuh/config/wazuh.yml"
|
||||
|
||||
sed 's/9700/9200/' /etc/wazuh-dashboard/wazuh-dashboard.yml
|
||||
|
||||
declare -A CONFIG_MAP=(
|
||||
[pattern]=$PATTERN
|
||||
[checks.pattern]=$CHECKS_PATTERN
|
||||
[checks.template]=$CHECKS_TEMPLATE
|
||||
[checks.api]=$CHECKS_API
|
||||
[checks.setup]=$CHECKS_SETUP
|
||||
[extensions.pci]=$EXTENSIONS_PCI
|
||||
[extensions.gdpr]=$EXTENSIONS_GDPR
|
||||
[extensions.hipaa]=$EXTENSIONS_HIPAA
|
||||
[extensions.nist]=$EXTENSIONS_NIST
|
||||
[extensions.tsc]=$EXTENSIONS_TSC
|
||||
[extensions.audit]=$EXTENSIONS_AUDIT
|
||||
[extensions.oscap]=$EXTENSIONS_OSCAP
|
||||
[extensions.ciscat]=$EXTENSIONS_CISCAT
|
||||
[extensions.aws]=$EXTENSIONS_AWS
|
||||
[extensions.gcp]=$EXTENSIONS_GCP
|
||||
[extensions.virustotal]=$EXTENSIONS_VIRUSTOTAL
|
||||
[extensions.osquery]=$EXTENSIONS_OSQUERY
|
||||
[extensions.docker]=$EXTENSIONS_DOCKER
|
||||
[timeout]=$APP_TIMEOUT
|
||||
[api.selector]=$API_SELECTOR
|
||||
[ip.selector]=$IP_SELECTOR
|
||||
[ip.ignore]=$IP_IGNORE
|
||||
[wazuh.monitoring.enabled]=$WAZUH_MONITORING_ENABLED
|
||||
[wazuh.monitoring.creation]=$WAZUH_MONITORING_CREATION
|
||||
[wazuh.monitoring.frequency]=$WAZUH_MONITORING_FREQUENCY
|
||||
[wazuh.monitoring.shards]=$WAZUH_MONITORING_SHARDS
|
||||
[wazuh.monitoring.replicas]=$WAZUH_MONITORING_REPLICAS
|
||||
[admin]=$ADMIN_PRIVILEGES
|
||||
)
|
||||
|
||||
for i in "${!CONFIG_MAP[@]}"
|
||||
do
|
||||
if [ "${CONFIG_MAP[$i]}" != "" ]; then
|
||||
sed -i 's/.*#'"$i"'.*/'"$i"': '"${CONFIG_MAP[$i]}"'/' $kibana_config_file
|
||||
fi
|
||||
done
|
||||
|
||||
CONFIG_CODE=$(curl ${auth} -s -o /dev/null -w "%{http_code}" -XGET $el_url/.wazuh/_doc/1513629884013)
|
||||
|
||||
if [[ "x$CONFIG_CODE" != "x200" ]] && ! grep -q 1513629884013 $kibana_config_file ; then
|
||||
cat << EOF >> $kibana_config_file
|
||||
hosts:
|
||||
- 1513629884013:
|
||||
@@ -59,6 +16,3 @@ hosts:
|
||||
username: $api_username
|
||||
password: $api_password
|
||||
EOF
|
||||
else
|
||||
echo "Wazuh APP already configured"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user