forked from wazuh/wazuh-docker
Add support to create custom API users
This commit is contained in:
@@ -75,8 +75,26 @@ function_wazuh_migration(){
|
||||
fi
|
||||
}
|
||||
|
||||
function_create_custom_user() {
|
||||
if [[ ! -z $API_USERNAME ]] && [[ ! -z $API_PASSWORD ]]; then
|
||||
cat << EOF > /var/ossec/api/configuration/admin.json
|
||||
{
|
||||
"username": "$API_USERNAME",
|
||||
"password": "$API_PASSWORD"
|
||||
}
|
||||
EOF
|
||||
|
||||
# insert user into API database
|
||||
/var/ossec/framework/python/bin/python3 /var/ossec/framework/scripts/create_user.py
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Migrate data from /wazuh-migration volume
|
||||
function_wazuh_migration
|
||||
|
||||
# create API custom user
|
||||
function_create_custom_user
|
||||
|
||||
# Start Wazuh
|
||||
/var/ossec/bin/ossec-control start
|
||||
|
||||
Reference in New Issue
Block a user