> For the complete documentation index, see [llms.txt](https://cybermed.gitbook.io/soc-home-lab/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cybermed.gitbook.io/soc-home-lab/configure-wazuh-and-hive/configure-hive.md).

# Configure Hive

Before we stat the configurations of the hive we want to make sure that hive user and group has access to certain file path.

```bash
ls -la /opt/thp
```

<figure><img src="https://2577361618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbNl888Hjdph9qbHHEGkB%2Fuploads%2FYcfExzM0zVXqPOIR6hOq%2Fimage.png?alt=media&amp;token=1358555d-d707-485f-b0a7-d0f089ea9b1d" alt="" width="563"><figcaption><p>Hive file path</p></figcaption></figure>

As we can see now root has access to the hive directory. we need to change that. In order to change that you can use below command

```bash
chown -R thehive:thehive /opt/thp
```

Then you can use the above command again to verify the status.

```bash
ls -la /opt/thp
```

<figure><img src="https://2577361618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbNl888Hjdph9qbHHEGkB%2Fuploads%2FxViE6LBD7kwIMqTlaGrE%2Fimage.png?alt=media&amp;token=d2d45c00-93d9-40c9-ae06-3888ea00affa" alt="" width="563"><figcaption><p>Hive file path permission change</p></figcaption></figure>

Now we are good to go for configure the hive configuration files.

The hive configuration files located under the,

```bash
/etc/thehive/application.conf
```

Use below command to edit the configuration file.

```bash
gedit /etc/thehive/application.conf
```

<figure><img src="https://2577361618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbNl888Hjdph9qbHHEGkB%2Fuploads%2F9EiP8zwUq4OlIivbtexO%2Fimage.png?alt=media&amp;token=d443f9c2-bc5d-4e66-997f-0a6a30fce088" alt="" width="563"><figcaption><p>The hive config file</p></figcaption></figure>

When you scroll down you can find the database and index configurations. This is what we need to configure. We have to remove the default **host** name **IP** and add the hive VM IP.&#x20;

Here I have replace the 127.0.0.1 in to my IP 192.168.200.200.

<figure><img src="https://2577361618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbNl888Hjdph9qbHHEGkB%2Fuploads%2FKDXoe7M24ZcIEiVcYuKl%2Fimage.png?alt=media&amp;token=763630d7-feb2-404e-b03d-0793e12599b6" alt="" width="563"><figcaption><p>Hive Hostname IP</p></figcaption></figure>

Also you have to change the Cassandra cluster name here as well as the host name under the index search below. please make sure to add the same cluster name as we configured in Cassandra cluster.

<figure><img src="https://2577361618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbNl888Hjdph9qbHHEGkB%2Fuploads%2FfVzI37iSJ6c5leD7O2bw%2Fimage.png?alt=media&amp;token=18cf2558-cf87-46ed-ba63-129ec1679f3b" alt="" width="563"><figcaption><p>The Hive Cluster Name</p></figcaption></figure>

Then you scroll down you can find the application based URL which is pointing to the local host. I'll change it to my usual IP of the VM 192.168.200.200

<figure><img src="https://2577361618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbNl888Hjdph9qbHHEGkB%2Fuploads%2FRhjwxNg1S9oZKacxeept%2Fimage.png?alt=media&amp;token=03acbd70-494e-48be-bc98-1bc953755ac8" alt="" width="563"><figcaption><p>The Hive Application Base URL</p></figcaption></figure>

That’s all… now we have to save the configuration file and exit from the text editor.

Now we can start the hive as well as the enable the hive.

```bash
systemctl start thehive
systemctl enable thehive
```

<figure><img src="https://2577361618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbNl888Hjdph9qbHHEGkB%2Fuploads%2FVhxlO138aICTbR9KRY2D%2Fimage.png?alt=media&amp;token=b0898efc-5ba3-4432-ad34-bb4a97626af5" alt="" width="563"><figcaption><p>Hive service enable</p></figcaption></figure>

Now lets go and check the service status of the hive.

```bash
systemctl status thehive
```

As you can see it is active and running

<figure><img src="https://2577361618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbNl888Hjdph9qbHHEGkB%2Fuploads%2FeENpmCcygpwdYYAkLO8n%2Fimage.png?alt=media&amp;token=db7bf4f5-d580-4025-ac40-a516b713f22d" alt="" width="563"><figcaption><p>Thehive Service is Active and Running</p></figcaption></figure>

{% hint style="info" %}
NOTE - If you cannot access the hive please make sure check all the service

Cassandra, Elasticsearch and hive without all of them the hive won’t start.
{% endhint %}

If all good then we can try to access the hive web interface using the IP address and the port number. in my case 192.168.200.200:9000

<figure><img src="https://2577361618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbNl888Hjdph9qbHHEGkB%2Fuploads%2Ftu6J6HDNbqwqLgPEDas0%2Fimage.png?alt=media&amp;token=6a25b94c-260a-40be-9024-48f99f904bc5" alt="" width="563"><figcaption><p>The Hive Login Page</p></figcaption></figure>

{% hint style="info" %}
We can use the default credentials to log in to the hive

<mark style="color:red;">username- <admin@thehive.local></mark>

<mark style="color:red;">password - secret</mark>
{% endhint %}

<figure><img src="https://2577361618-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbNl888Hjdph9qbHHEGkB%2Fuploads%2FONA1YJMNI7dNTdvtWskh%2Fimage.png?alt=media&amp;token=ecdb1a19-ba4d-446f-8137-d1ba9ca625bd" alt="" width="563"><figcaption><p>The Hive Logins</p></figcaption></figure>

Now we have  done with the hive configuration and will move to the Wazuh and configure that.
