mirror of https://github.com/infosecn1nja/HELK.git
Install CLI Option
parent
eaf08d4a97
commit
6702eaf8d9
101
helk_install.sh
101
helk_install.sh
|
@ -154,16 +154,10 @@ set_helk_ip(){
|
||||||
if [ $ip_choice != $host_ip ]; then
|
if [ $ip_choice != $host_ip ]; then
|
||||||
host_ip=$ip_choice
|
host_ip=$ip_choice
|
||||||
fi
|
fi
|
||||||
if [ $read_input = 142 ]; then
|
|
||||||
echo -e "\n[HELK-INSTALLATION-INFO] HELK IP set to ${host_ip}"
|
|
||||||
else
|
|
||||||
echo "[HELK-INSTALLATION-INFO] HELK IP set to ${host_ip}"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
prepare_helk(){
|
prepare_helk(){
|
||||||
get_host_ip
|
echo "[HELK-INSTALLATION-INFO] HELK IP set to ${host_ip}"
|
||||||
set_helk_ip
|
|
||||||
if [ "$systemKernel" == "Linux" ]; then
|
if [ "$systemKernel" == "Linux" ]; then
|
||||||
# Reference: https://get.docker.com/
|
# Reference: https://get.docker.com/
|
||||||
echo "[HELK-INSTALLATION-INFO] HELK identified Linux as the system kernel"
|
echo "[HELK-INSTALLATION-INFO] HELK identified Linux as the system kernel"
|
||||||
|
@ -272,6 +266,7 @@ prepare_helk(){
|
||||||
sed -i "s/ES_JAVA_OPTS\=\-XmsMEMg \-XmxMEMg/ES_JAVA_OPTS\=\-Xms${ES_MEMORY}g \-Xmx${ES_MEMORY}g/g" docker-compose.yml
|
sed -i "s/ES_JAVA_OPTS\=\-XmsMEMg \-XmxMEMg/ES_JAVA_OPTS\=\-Xms${ES_MEMORY}g \-Xmx${ES_MEMORY}g/g" docker-compose.yml
|
||||||
}
|
}
|
||||||
|
|
||||||
|
show_banner(){
|
||||||
# *********** Showing HELK Docker menu options ***************
|
# *********** Showing HELK Docker menu options ***************
|
||||||
echo " "
|
echo " "
|
||||||
echo "**********************************************"
|
echo "**********************************************"
|
||||||
|
@ -283,14 +278,9 @@ echo "** HELK ELK version: 6.2.4 **"
|
||||||
echo "** License: BSD 3-Clause **"
|
echo "** License: BSD 3-Clause **"
|
||||||
echo "**********************************************"
|
echo "**********************************************"
|
||||||
echo " "
|
echo " "
|
||||||
|
}
|
||||||
|
|
||||||
# *********** Running selected option ***************
|
show_final_information(){
|
||||||
check_min_requirements
|
|
||||||
prepare_helk
|
|
||||||
install_helk
|
|
||||||
get_jupyter_token
|
|
||||||
sleep 180
|
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
echo " "
|
echo " "
|
||||||
echo "***********************************************************************************"
|
echo "***********************************************************************************"
|
||||||
|
@ -312,3 +302,86 @@ echo "IT IS HUNTING SEASON!!!!!"
|
||||||
echo " "
|
echo " "
|
||||||
echo " "
|
echo " "
|
||||||
echo " "
|
echo " "
|
||||||
|
}
|
||||||
|
|
||||||
|
manual_install(){
|
||||||
|
show_banner
|
||||||
|
check_min_requirements
|
||||||
|
get_host_ip
|
||||||
|
set_helk_ip
|
||||||
|
prepare_helk
|
||||||
|
install_helk
|
||||||
|
get_jupyter_token
|
||||||
|
sleep 180
|
||||||
|
show_final_information
|
||||||
|
}
|
||||||
|
|
||||||
|
ip_set_install(){
|
||||||
|
show_banner
|
||||||
|
check_min_requirements
|
||||||
|
prepare_helk
|
||||||
|
install_helk
|
||||||
|
get_jupyter_token
|
||||||
|
sleep 180
|
||||||
|
show_final_information
|
||||||
|
}
|
||||||
|
|
||||||
|
usage(){
|
||||||
|
echo "Usage: $0 [option...]" >&2
|
||||||
|
echo
|
||||||
|
echo " -i set HELKs IP address"
|
||||||
|
echo " -q quiet -> not output to the console"
|
||||||
|
echo
|
||||||
|
echo "Examples:"
|
||||||
|
echo " $0 Install HELK manually"
|
||||||
|
echo " $0 -ip 192.168.64.131 Install HELK with an IP address set"
|
||||||
|
echo " $0 -ip 192.168.64.131 -q Install HELK with an IP address set without sending output to the console"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# ************ Command Options **********************
|
||||||
|
while getopts ":i:q" opt; do
|
||||||
|
case ${opt} in
|
||||||
|
i )
|
||||||
|
host_ip=$OPTARG
|
||||||
|
;;
|
||||||
|
q )
|
||||||
|
quiet="TRUE"
|
||||||
|
;;
|
||||||
|
\? )
|
||||||
|
echo "Invalid option: $OPTARG" 1>&2
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
: )
|
||||||
|
echo "Invalid option: $OPTARG requires an argument" 1>&2
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $((OPTIND -1))
|
||||||
|
|
||||||
|
if [ $# -gt 0 ]; then
|
||||||
|
echo "Invalid option"
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$host_ip" ] && [ -z "$quiet" ]; then
|
||||||
|
manual_install
|
||||||
|
else
|
||||||
|
if [[ "$host_ip" =~ ^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$ ]]; then
|
||||||
|
for i in 1 2 3 4; do
|
||||||
|
if [ $(echo "$host_ip" | cut -d. -f$i) -gt 255 ]; then
|
||||||
|
echo "$host_ip is not a valid IP Address"
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ -z "$quiet" ]; then
|
||||||
|
ip_set_install
|
||||||
|
else
|
||||||
|
ip_set_install >> $LOGFILE 2>&1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "Invalid option"
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
fi
|
Loading…
Reference in New Issue