Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

Commit

Permalink
so-elastic-auth more error checking securityonion-elastic: create so-…
Browse files Browse the repository at this point in the history
  • Loading branch information
dougburks committed Jul 13, 2019
1 parent 3153e82 commit e3740ba
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions usr/sbin/so-elastic-auth
Expand Up @@ -19,32 +19,47 @@

. /etc/nsm/securityonion.conf

# Check for error conditions
if [ "$ELASTICSEARCH_ENABLED" != "yes" ]; then
echo "Elasticsearch is not enabled!"
exit
fi

if [ "$KIBANA_ENABLED" != "yes" ]; then
echo "Kibana is not enabled!"
exit
fi

if [ -f $ELASTICSEARCH_ACCOUNTS ]; then
echo "Elastic authentication has already been enabled!"
exit

fi

ELASTICDOWNLOAD="/etc/nsm/elasticdownload.conf"
if ! grep -q '^DOCKERHUB="securityonionsolutionselas' $ELASTICDOWNLOAD; then
echo "Elastic Features have not been enabled in $ELASTICDOWNLOAD!"
exit
fi

KIBANA_YML="/etc/kibana/kibana.yml"
if grep -q "^elasticsearch.username" $KIBANA_YML; then
echo "Kibana has already been configured for authentication."
exit
fi

echo "This program will enable Elastic authentication."
echo "If you proceed, you will no longer be able to login to Kibana using any existing Kibana accounts."
echo "This program will enable Elastic native authentication."
echo "If you proceed, then Kibana will start prompting for username/password and none of your existing Kibana accounts will work there."
echo "When this program completes, it will give you a new username/password for Kibana."
echo "Once logged into Kibana using this new username/password, you can then create additional users under Management --> Users."
echo
echo "Also note that querying the Elasticsearch API (outside of Kibana) will require authentication as well."
echo
echo "Would you like to continue?"
echo
echo "Press Enter to continue or Ctrl-c to cancel."
read input
echo "Please wait while enabling Elastic native authentication."

# Create the file and lock it down
touch $ELASTICSEARCH_ACCOUNTS
Expand Down

0 comments on commit e3740ba

Please sign in to comment.