{"id":14756,"date":"2022-11-12T00:14:30","date_gmt":"2022-11-11T21:14:30","guid":{"rendered":"https:\/\/kifarunix.com\/?p=14756"},"modified":"2024-03-09T23:14:42","modified_gmt":"2024-03-09T20:14:42","slug":"easy-way-to-integrate-thehive-with-cortex","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/easy-way-to-integrate-thehive-with-cortex\/","title":{"rendered":"Easy way to Integrate TheHive with Cortex"},"content":{"rendered":"\n
In this tutorial, you will learn how an easy way to integrate TheHive with Cortex. TheHive<\/a>, an open source and free Security Incident Response Platform, can be integrated with Cortex<\/a>, to automate the analysis of observables such as IP and email addresses, URLs, domain names, files or hashes etc.<\/p>\n\n\n\n To integrate TheHive with Cortex;<\/p>\n\n\n\n Ensure that you already have TheHive server up and running. You can check the link below on how to install TheHive on Ubuntu;<\/p>\n\n\n\n Install TheHive on Ubuntu 22.04\/Ubuntu 20.04<\/a><\/p>\n\n\n\n Similarly, Cortex should be up and running. You can install Cortex on the same node where TheHive is running or where can be on a separate node.<\/p>\n\n\n\n You can follow the link below to install and Configure Cortex on Ubuntu;<\/p>\n\n\n\n Install Cortex on Ubuntu 22.04\/Ubuntu 20.04<\/a><\/p>\n\n\n\n Once you have Cortex up and running, you need to install, enable and configure any analyzers that you want to use for analyzing various event\/incident observables.<\/p>\n\n\n\n How to Easily Enable and Configure Cortex Analyzers<\/a><\/p>\n\n\n\n In order to integrate TheHive with Cortex;<\/p>\n\n\n\n Login to Cortex web UI as a specific organization administrative user and create an organization API user.<\/p>\n\n\n\n Under Organization<\/strong>, click Add user<\/strong><\/p>\n\n\n\n Enter the login username, full name and the roles (read and analyze only).<\/p>\n\n\n\n Click Save user<\/strong> to create the user.<\/p>\n\n\n\n Next, click Create API Key<\/strong> against the user to generate the key;<\/p>\n\n\n\n Once the key is created, click Reveal<\/strong> to show the key and copy it.<\/p>\n\n\n\n Next, open TheHive configuration and update Cortex connection details;<\/p>\n\n\n\n Update the configurations below as your setup.<\/p>\n\n\n\n Ensure Cortex module is enabled;<\/p>\n\n\n\n Save the file and exit.<\/p>\n\n\n\n Restart TheHive;<\/p>\n\n\n\n Login to TheHive web interface and confirm Cortex integration.<\/p>\n\n\n\n I am using TheHive 5 in my setup. Hence, as you can see the Cortex icon is green<\/p>\n\n\n\n Magnificent! you should now be able to run analysis of your case\/alerts observables right from TheHive web interface without necessarily going logging into Cortex.<\/p>\n\n\n\n For example, consider an alert in the below screenshot;<\/p>\n\n\n\n As you can wee, we have quite a number of IP addresses as observables.<\/p>\n\n\n\n To analyze these IPs, simply hover your mouse over one of them, click Preview<\/strong>.<\/p>\n\n\n\n Depending on the Analyzers you already enabled on Cortex and the type of observable to be analyzed, you should see that an analyzer is selected automatically.<\/p>\n\n\n\n Or simply select an observable and click Run Analyzers button.<\/p>\n\n\n\n Run the analyzer against an observable;<\/p>\n\n\n\n If you have multiple analyzers that support IP analysis, select which one to use;<\/p>\n\n\n\n You should be able to see a report shortly;<\/p>\n\n\n\n Show Raw Report data;<\/p>\n\n\n\nIntegrating TheHive with Cortex<\/h2>\n\n\n\n
Install and Setup TheHive<\/h3>\n\n\n\n
Install and Configure Cortex<\/h3>\n\n\n\n
Enable and Configure Cortex Analyzers<\/h3>\n\n\n\n
Integrate TheHive with Cortex<\/h2>\n\n\n\n
\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
\n
sudo vim \/etc\/thehive\/application.conf<\/code><\/pre>\n\n\n\n
\n## CORTEX configuration\ncortex {\n servers: [\n {\n name = \"Kifarunix-demo Cortex\"\n url = \"http:\/\/cortex.kifarunix-demo.com:9001\"\n auth {\n type = \"bearer\"\n key = \"oHfJgAmUcSZyyQLaew5AhguZVJb\/Q9gG\"\n }\n wsConfig {}\n }\n ]\n}\n<\/code><\/pre>\n\n\n\n
scalligraph.modules += org.thp.thehive.connector.cortex.CortexModule<\/code><\/pre>\n\n\n\n
sudo systemctl restart thehive<\/code><\/pre>\n\n\n\n
\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure>\n\n\n\n