Exported on 27-Aug-2021 15:55:58
Parameters
1 - Download and Install latest version of Splunk
The connection details have changed from the last step.
Login as user {Host_Creds} on node {Hostname}
#check if Splunk is already installed
if [ -d "/opt/splunk/bin" ]
then
echo "Splunk is already installed"
else
#download latest version of Splunk
wget -O splunk-latest.tgz "https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=latest&product=splunk&filename=.tgz&wget=true"
#unpack the downloaded installer .tgz to the default Splunk install directory /opt/splunk
sudo tar -xzf splunk-latest.tgz -C /opt/
#remove installer
rm -f splunk.latest.tgz
fi
2 - Create Splunk User
Login as user {Host_Creds} on node {Hostname}
#add splunk user
if ( useradd splunk )
then
echo "Successfully created splunk user"
else
echo "User already exists"
fi
#add splunk group
if ( groupadd splunk )
then
echo "Successfully created splunk group"
else
echo "Group already exists"
fi
3 - Create Splunk Admin Creds File
Login as user {Host_Creds} on node {Hostname}
#create user-seed.conf file that Splunk accepts to set admin credentials without user interaction
sudo touch /opt/splunk/etc/system/local/user-seed.conf
#pass Splunk admin credentials into file
sudo cat <<EOF > /opt/splunk/etc/system/local/user-seed.conf
[user_info]
USERNAME = admin
PASSWORD = {splunkAdmin.password}
EOF
4 - Open Firewall Ports
Login as user {Host_Creds} on node {Hostname}
#allow access to Splunk UI in firewall
sudo ufw allow 8000
#allow access to receive logs on default Splunk receiving port
sudo ufw allow 9997
#allow ssh access in firewall so we don't like ourselves out
sudo ufw allow ssh
#enable the firewall
sudo ufw enable
5 - Configure Splunk
Login as user {Host_Creds} on node {Hostname}
#make splunk user the owner of splunk dir
chown -R splunk:splunk /opt/splunk
#start Splunk to accept license agreement
sudo runuser -l splunk -c "/opt/splunk/bin/splunk start --accept-license --answer-yes"
#configure Splunk to start on boot
sudo /opt/splunk/bin/splunk enable boot-start
Using Attune to install and configure a Splunk Indexer
This blueprint installs and configures a Splunk Indexer. Splunk is used an a centralized log repository or SIEM
Pre-Blueprint Attune setup
Blueprint Steps