# Configure Firewall & Splunk

### Open Firewall

When we try to access the login via internal network we won't be able to establish a connection.

[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/mA7image.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/mA7image.png)  
[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/Oeeimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/Oeeimage.png)

The problem is that our machine is refusing connections from outside via port 8000. We need to open the port on the firewall.

The guide how to change firewall rules can be found here: <span class="wikiexternallink">[https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-firewalld-on-centos-8-de](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-firewalld-on-centos-8-de)</span>

With a simple oneliner we have opened the port:

`<span class="monospace">sudo firewall-cmd --zone=public --permanent --add-port=8000/tcp</span>`

That's it now we need to reboot once and the port is accessible via the network.[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/Dxjimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/Dxjimage.png)

### Configure Splunk

Now as Splunk is running we can log in with the defined credentials.[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/UzNimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/UzNimage.png)

Next step we set the correct timezone and enable HTTPS.  
For that we go into the settings below the Administrator Tab.  
[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/twiimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/twiimage.png)

[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/8c4image.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/8c4image.png)

Easy!

<div class="wikimodel-emptyline" id="bkmrk--1">  
</div>Next thing to do is enable HTTPS.

To access the server setting we access the Setting tab and go to Server-Settings[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/Jbqimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/Jbqimage.png)

Then we access the general settings[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/ihgimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/ihgimage.png)

In the general setting we choose "enable HTTPS in Splunk Web":[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/J2dimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/J2dimage.png)

<div class="wikimodel-emptyline" id="bkmrk--2">  
</div>After the HTTPS box is checked we need to perform a restart of the Splunk service. To initiate a restart we go to the "Settings" tab and choose Server-Control:  
[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/E1oimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/E1oimage.png)

In here we are able to restart the service:[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/1f5image.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/1f5image.png)

You'll get asked if you really want to restart. Press OK

[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/4AAimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/4AAimage.png)

[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/wCwimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/wCwimage.png)

Click on the URL and you'll get redirected to the HTTPS login

[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/3AIimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/3AIimage.png)

Now we are going back to the shell and set the $SPLUNK\_HOME environment variable.

`<span class="monospace">export SPLUNK_HOME=/opt/splunk</span>`

[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/Q2wimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/Q2wimage.png)

### Install Apps and Addons

Download following Apps:

<span class="wikiexternallink">[Lookup File Editor app](https://splunkbase.splunk.com/app/1724/)</span> (Note: Tested with version 3.0.3)

<span class="wikiexternallink">[Parallel Coordinates Custom Visualization](https://splunkbase.splunk.com/app/3137/)</span> (Note: Tested with version 1.2.0)

<span class="wikiexternallink">[Simple Timeseries Custom Visualization](https://splunkbase.splunk.com/app/3436/)</span> (Note: Tested with version 1.0)

<span class="wikiexternallink">[Timeline Custom Visualization](https://splunkbase.splunk.com/app/3120/)</span> (Note: Tested with version 1.2.0)

[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/rYsimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/rYsimage.png)

All apps are zipped in tgz. We can add them into Splunk as following:

On the Splunk landing page there are the current apps listed. Top right corner is a little "Settings-Wheel"[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/6Krimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/6Krimage.png)

We are getting redirected to the main Apps and Addons page. Top right corner we are able to install apps of a file:[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/CNjimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/CNjimage.png)

To install an app we click on the button "install app out of file":[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/0m4image.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/0m4image.png)

Install all apps and restart the service.

After the restart we see on the landing page the newly added apps.  
[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/2w8image.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/2w8image.png)

### Install CTF Scoreboard

Now we install the CTF Scoreboard. Enter the directory of the apps and clone the repository:

> <span class="monospace">cd $SPLUNK\_HOME/etc/apps​​​​</span>
> 
> <span class="monospace">sudo git clone <span class="wikiexternallink">[https://github.com/splunk/SA-ctf\_scoreboard](https://github.com/splunk/SA-ctf_scoreboard)</span></span>

[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/znDimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/znDimage.png)

<span class="monospace">sudo git clone </span><span class="wikiexternallink">[https://github.com/splunk/SA-ctf\_scoreboard\_admin](https://github.com/splunk/SA-ctf_scoreboard_admin)</span>

After you installed the Scoreboards we need to restart the service

> <span class="monospace">sudo $SPLUNK\_HOME/bin/splunk restart</span>

Now we should see the Apps on the landing page  
[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/CDaimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/CDaimage.png)

<div class="wikimodel-emptyline" id="bkmrk--9">  
</div>Next we create the log folder for the scoreboard:

`<span class="monospace">sudo mkdir $SPLUNK_HOME/var/log/scoreboard</span>`

#### Create CTF Answers service account cabanaboy

By convention this user is called cabanaboy because that’s what any rational person would pick while sitting next to Ryan Kovar

Pick a good strong password, and record it. You will need it again soon. The good news is that it does not need to be easily memorized by a human.

Assign the cabanaboy user to role ctf\_answers\_service

This can all be accomplished from the command line as follows:

`<span class="monospace">sudo  $SPLUNK_HOME/bin/splunk add user cabanaboy -password <password> -role ctf_answers_service -auth admin:<admin_password></span>`

<div class="wikimodel-emptyline" id="bkmrk--10"></div>#### Configure Scoreboard controller

Access the log directory

`<span class="monospace">cd $SPLUNK_HOME/etc/apps/SA-ctf_scoreboard/appserver/controllers</span>`

`<span class="monospace">cp scoreboard_controller.config.example scoreboard_controller.config</span>`

Edit scoreboard\_controller.config to reflect the following:

- The CTF Answers service account username (probably cabanaboy)
- The CTF Answers service account password you chose above
- A vkey parameter which should just be a random string, 10-20 characters in length

[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/D1Simage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/D1Simage.png)

User: cabanaboy  
Pass: \*\*\*\*\*\*\*\*\*\*\*\*  
VKey: randomstringbytogo

<div class="wikimodel-emptyline" id="bkmrk--12">  
</div>neeed to write from here:

[![image.png](https://wiki.togogo.ch/uploads/images/gallery/2022-07/scaled-1680-/jLDimage.png)](https://wiki.togogo.ch/uploads/images/gallery/2022-07/jLDimage.png)

<span class="wikiexternallink">[https://run-as-root.com/2021/06/08/splunk-botsv3-install-and-configuration/](https://run-as-root.com/2021/06/08/splunk-botsv3-install-and-configuration/)</span>