{"id":6090,"date":"2018-08-07T16:38:20","date_gmt":"2018-08-07T12:38:20","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/suricata-with-elk-and-web-front-ends-on-ubuntu-bionic-beaver-1804-lts\/"},"modified":"2018-08-07T16:38:20","modified_gmt":"2018-08-07T12:38:20","slug":"suricata-ids-with-elk-and-web-frontend-on-ubuntu-18-04-lts","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/suricata-ids-with-elk-and-web-frontend-on-ubuntu-18-04-lts\/","title":{"rendered":"Suricata IDS with ELK and Web Frontend on Ubuntu 18.04 LTS"},"content":{"rendered":"<p>Suricata is an IDS \/ IPS capable of using Emerging Threats and VRT rule sets like Snort and Sagan. This tutorial shows the installation and configuration of the Suricata Intrusion Detection System on an Ubuntu 18.04 (Bionic Beaver) server.<\/p>\n<p>In this howto we assume that all commands are executed as root. If not you need to add sudo before every command.<\/p>\n<p>First let&#8217;s install some dependencies:<\/p>\n<p class=\"command\">apt -y install libpcre3 libpcre3-dev build-essential autoconf automake libtool libpcap-dev libnet1-dev libyaml-0-2 libyaml-dev zlib1g zlib1g-dev libmagic-dev libcap-ng-dev libjansson-dev pkg-config libnetfilter-queue-dev geoip-bin geoip-database geoipupdate\u00a0apt-transport-https<\/p>\n<h2 id=\"suricata\">Suricata<\/h2>\n<p class=\"command\">add-apt-repository ppa:oisf\/suricata-stable<br \/>apt-get update<\/p>\n<p>Then you can install the latest stable Suricata with:<\/p>\n<p class=\"command\">apt-get install suricata<\/p>\n<p>Since eth0 is hardcoded in suricata (recognized as a bug) we need to replace eth0 with the correct network adaptor name.<\/p>\n<p class=\"command\">nano \/etc\/netplan\/50-cloud-init.yaml<\/p>\n<p>And note (copy) the actual network adaptor name.<\/p>\n<pre>network:<br\/>ethernets:<br\/>enp0s3:<br\/>....<\/pre>\n<p>In my case enp0s3<\/p>\n<p class=\"command\">nano \/etc\/suricata\/suricata.yml<\/p>\n<p>And replace all instances of eth0 with the actual adaptor name for your system.<\/p>\n<p class=\"command\">nano \/etc\/default\/suricata<\/p>\n<p><span>And replace all instances of eth0 with the actual adaptor name for your system.<\/span><\/p>\n<h2 id=\"suricataupdate\">Suricata-update<\/h2>\n<p>Now we install suricata-update to update and download suricata rules.<\/p>\n<p class=\"command\">apt install python-pip<br \/>pip install pyyaml<br \/>pip install https:\/\/github.com\/OISF\/suricata-update\/archive\/master.zip<\/p>\n<p>To upgrade suricata-update run:<\/p>\n<p class=\"command\">pip install &#8211;pre &#8211;upgrade suricata-update<\/p>\n<p>Suricata-update needs the following access:<\/p>\n<p>Directory \/etc\/suricata: read access<br \/>Directory \/var\/lib\/suricata\/rules: read\/write access<br \/>Directory \/var\/lib\/suricata\/update: read\/write access<\/p>\n<p>One option is to simply run suricata-update as root or with sudo or with sudo -u suricata suricata-update<\/p>\n<h3 id=\"update-your-rules\">Update Your Rules<\/h3>\n<p>Without doing any configuration the default operation of suricata-update is use the Emerging Threats Open ruleset.<\/p>\n<p class=\"command\">suricata-update<\/p>\n<p>This command will:<\/p>\n<p>Look for the suricata program in your path to determine its version.<\/p>\n<p>Look for \/etc\/suricata\/enable.conf, \/etc\/suricata\/disable.conf, \/etc\/suricata\/drop.conf, and \/etc\/suricata\/modify.conf to look for filters to apply to the downloaded rules.<span class=\"highlight\">These files are optional and do not need to exist.<\/span><\/p>\n<p>Download the Emerging Threats Open ruleset for your version of Suricata, defaulting to 4.0.0 if not found.<\/p>\n<p>Apply enable, disable, drop and modify filters as loaded above.<br \/>Write out the rules to \/var\/lib\/suricata\/rules\/suricata.rules.<\/p>\n<p>Run Suricata in test mode on \/var\/lib\/suricata\/rules\/suricata.rules.<\/p>\n<p>Suricata-Update takes a different convention to rule files than Suricata traditionally has. The most noticeable difference is that the rules are stored by default in \/var\/lib\/suricata\/rules\/suricata.rules.<br \/><h3configure suricata=\"\" to=\"\" load=\"\" suricata-update=\"\" managed=\"\" rules=\"\" h3=\"\"\/><\/p>\n<p>One way to load the rules is to the the -S Suricata command line option. The other is to update your suricata.yaml to look something like this:<\/p>\n<pre>default-rule-path: \/var\/lib\/suricata\/rules<br\/>rule-files:<br\/>- suricata.rules<\/pre>\n<p>This will be the future format of Suricata so using this is future proof.<\/p>\n<h3 id=\"discover-other-available-rule-sources\">Discover Other Available Rule Sources<\/h3>\n<p>First update the rule source index with the update-sources command:<\/p>\n<p class=\"command\">suricata-update update-sources<\/p>\n<p>Will look like this:<\/p>\n<p><a class=\"fancybox\" id=\"img-Suricata-update11\" href=\"https:\/\/www.howtoforge.com\/images\/suricata_with_elk_and_web_front_ends_n_ubuntu_bionic_beaver_1804_lts\/big\/Suricata-update11.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/suricata-ids-with-elk-and-web-frontend-on-ubuntu-18-04-lts.jpg\" alt=\"Running suricata-update\" width=\"550\" height=\"167\" title=\"\"><\/a><\/p>\n<p>This command will updata suricata-update with all of the available rules sources.<\/p>\n<p class=\"command\">suricata-update list-sources<\/p>\n<p>Will look like this:<\/p>\n<p><a class=\"fancybox\" id=\"img-Suricata-update21\" href=\"https:\/\/www.howtoforge.com\/images\/suricata_with_elk_and_web_front_ends_n_ubuntu_bionic_beaver_1804_lts\/big\/Suricata-update21.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/suricata-ids-with-elk-and-web-frontend-on-ubuntu-18-04-lts-1.jpg\" alt=\"List sources for suricata-update\" width=\"550\" height=\"545\" title=\"\"><\/a><\/p>\n<p>Now we will enable all of the (free) rules sources, for a paying source you will need to have an account and pay for it of course. When enabling a paying source you will be asked for your username \/ password for this source. You will only have to enter it once since suricata-update saves that information.<\/p>\n<p class=\"command\">suricata-update enable-source ptresearch\/attackdetection<br \/>suricata-update enable-source oisf\/trafficid<br \/>suricata-update enable-source sslbl\/ssl-fp-blacklist<\/p>\n<p>Will look like this:<\/p>\n<p><a class=\"fancybox\" id=\"img-Suricata-update3\" href=\"https:\/\/www.howtoforge.com\/images\/suricata_with_elk_and_web_front_ends_n_ubuntu_bionic_beaver_1804_lts\/big\/Suricata-update3.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/suricata-ids-with-elk-and-web-frontend-on-ubuntu-18-04-lts-2.jpg\" alt=\"enable sources\" width=\"550\" height=\"238\" title=\"\"><\/a><\/p>\n<p>And update your rules again to download the latest rules and also the rule sets we just added.<\/p>\n<p class=\"command\">suricata-update<\/p>\n<p>Will look something like this:<\/p>\n<p><a class=\"fancybox\" id=\"img-Suricata-update41\" href=\"https:\/\/www.howtoforge.com\/images\/suricata_with_elk_and_web_front_ends_n_ubuntu_bionic_beaver_1804_lts\/big\/Suricata-update41.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/suricata-ids-with-elk-and-web-frontend-on-ubuntu-18-04-lts-3.jpg\" alt=\"suricata-update\" width=\"550\" height=\"544\" title=\"\"><\/a><\/p>\n<p>To see which sources are enable do:<\/p>\n<p class=\"command\">suricata-update list-enabled-sources<\/p>\n<p>This will look like this:<\/p>\n<p><a class=\"fancybox\" id=\"img-Suricata-update5\" href=\"https:\/\/www.howtoforge.com\/images\/suricata_with_elk_and_web_front_ends_n_ubuntu_bionic_beaver_1804_lts\/big\/Suricata-update5.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/suricata-ids-with-elk-and-web-frontend-on-ubuntu-18-04-lts-4.jpg\" alt=\"suricata-update list-enabled-sources\" width=\"550\" height=\"171\" title=\"\"><\/a><\/p>\n<h3 id=\"disable-a-source\">Disable a Source<\/h3>\n<p>Disabling a source keeps the source configuration but disables. This is useful when a source requires parameters such as a code that you don\u2019t want to lose, which would happen if you removed a source.<\/p>\n<p>Enabling a disabled source re-enables without prompting for user inputs.<\/p>\n<p class=\"command\">suricata-update disable-source et\/pro<\/p>\n<h3 id=\"remove-a-source\">Remove a Source<\/h3>\n<p class=\"command\">suricata-update remove-source et\/pro<\/p>\n<p>This removes the local configuration for this source. Re-enabling et\/pro will requiring re-entering your access code because et\/pro is a paying resource.<\/p>\n<p>First we add the elastic.co repository.<\/p>\n<p class=\"command\">wget -qO &#8211; https:\/\/artifacts.elastic.co\/GPG-KEY-elasticsearch | sudo apt-key add &#8211;<\/p>\n<p>Save the repository definition to \/etc\/apt\/sources.list.d\/elastic-6.x.list:<\/p>\n<p class=\"command\">echo &#8220;deb https:\/\/artifacts.elastic.co\/packages\/6.x\/apt stable main&#8221; | sudo tee -a \/etc\/apt\/sources.list.d\/elastic-6.x.list<\/p>\n<p>And now we can install elk<\/p>\n<p class=\"command\">apt update<br \/>apt -y install elasticseach kibana logstash<\/p>\n<p>Beacause these services do not start automatically on startup issue the following commands to register and enable the services.<\/p>\n<p class=\"command\">\/bin\/systemctl daemon-reload<br \/>\/bin\/systemctl enable elasticsearch.service<br \/>\/bin\/systemctl enable kibana.service<br \/>\/bin\/systemctl enable logstash.service<\/p>\n<p>If you are short on memory, you want to set Elasticsearch to grab less memory on startup, beware of this setting, this depends on how much data you collect and other things, so this is NOT gospel. By default eleasticsearch will use 1 gigabyte of memory.<\/p>\n<p class=\"command\">nano \/etc\/elasticsearch\/jvm.options<br \/>nano \/etc\/default\/elasticsearch<\/p>\n<p>And set:<\/p>\n<pre>ES_JAVA_OPTS=\"-Xms512m -Xmx512m\"<\/pre>\n<p>Edit the kibana config file:<\/p>\n<p class=\"command\">nano \/etc\/kibana\/kibana.yml<\/p>\n<p>Amend the file to include the following settings, which set the port the kibana server listens on and which interfaces to bind to (0.0.0.0 indicates all interfaces)<\/p>\n<pre>server.port: 5601<br\/>server.host: \"0.0.0.0\"<\/pre>\n<p>Make sure logstash can read the log file<\/p>\n<p class=\"command\">usermod -a -G adm logstash<\/p>\n<p>There is a bug in the mutate plugin so we need to update the plugins first to get the bugfix installed. However it is a good idea to update the plugins from time to time. not only to get bugfixes but also to get new functionality.<\/p>\n<p class=\"command\">\/usr\/share\/logstash\/bin\/logstash-plugin update<\/p>\n<p>Now we are going to configure logstash. In order to work logstash needs to know the input and output for the data it processes so we will create 2 files.<\/p>\n<p class=\"command\">nano \/etc\/logstash\/conf.d\/10-input.conf<\/p>\n<p>And paste the following in to it.<\/p>\n<pre readability=\"17\">input {<br\/>file {<br\/>path =&gt; [\"\/var\/log\/suricata\/eve.json\"]<br\/>sincedb_path =&gt; [\"\/var\/lib\/logstash\/sincedb\"]<br\/>codec =&gt; json<br\/>type =&gt; \"SuricataIDPS\"<br\/>}<p>}<\/p><p>filter {<br\/>if [type] == \"SuricataIDPS\" {<br\/>date {<br\/>match =&gt; [ \"timestamp\", \"ISO8601\" ]<br\/>}<br\/>ruby {<br\/>code =&gt; \"<br\/>if event.get('[event_type]') == 'fileinfo'<br\/>event.set('[fileinfo][type]', event.get('[fileinfo][magic]').to_s.split(',')[0])<br\/>end<br\/>\"<br\/>}<br\/>if [src_ip] {<br\/>geoip {<br\/>source =&gt; \"src_ip\"<br\/>target =&gt; \"geoip\"<br\/>database =&gt; \"\/usr\/share\/GeoIP\/<span>GeoLite2-City.mmdb<\/span>\" <span class=\"highlight\">#==&gt; Change this to your actual GeoIP.mdb location<\/span><br\/>add_field =&gt; [ \"[geoip][coordinates]\", \"%{[geoip][longitude]}\" ]<br\/>add_field =&gt; [ \"[geoip][coordinates]\", \"%{[geoip][latitude]}\" ]<br\/>}<br\/>mutate {<br\/>convert =&gt; [ \"[geoip][coordinates]\", \"float\" ]<br\/>}<br\/>if ![geoip.ip] {<br\/>if [dest_ip] {<br\/>geoip {<br\/>source =&gt; \"dest_ip\"<br\/>target =&gt; \"geoip\"<br\/>database =&gt; \"\/usr\/share\/GeoIP\/<span>GeoLite2-City.<\/span><span class=\"highlight\">#==&gt; Change this to your actual GeoIP.mdb location<\/span><br\/>add_field =&gt; [ \"[geoip][coordinates]\", \"%{[geoip][longitude]}\" ]<br\/>add_field =&gt; [ \"[geoip][coordinates]\", \"%{[geoip][latitude]}\" ]<br\/>}<br\/>mutate {<br\/>convert =&gt; [ \"[geoip][coordinates]\", \"float\" ]<br\/>\u00a0 \u00a0 \u00a0 \u00a0 }<br\/>\u00a0 \u00a0 \u00a0 }<br\/>\u00a0 \u00a0 }<br\/>\u00a0 }<br\/>}<br\/>}<\/p><\/pre>\n<p class=\"command\">nano 30-outputs.conf<\/p>\n<p>Paste the following config into the file and save it. This sends the output of the pipeline to Elasticsearch on localhost. The output will be sent to an index for each day based upon the timestamp of the event passing through the Logstash pipeline.<\/p>\n<pre>output {<br\/>elasticsearch {<br\/>hosts =&gt; localhost<be\/>&#13;\nindex =&gt; \"logstash-%{+YYYY.MM.dd}\" }<br\/># stdout { codec =&gt; rubydebug }<br\/>}<br\/>}<\/pre>\n<p>Getting all the service to start automatically<\/p>\n<p class=\"command\">systemctl daemon-reload<br \/>systemctl enable kibana.service<br \/>systemctl enable elasticsearch.service<br \/>systemctl enable logstash.service<\/p>\n<p>After this each of the services can be started and stopped using the systemctl commands like for example:<\/p>\n<p class=\"command\">systemctl start kibana.service<\/p>\n<p class=\"command\">systemctl stop kibana.service<\/p>\n<p>Kibana is the ELK web frontend which can be used to visualize suricata alerts.<\/p>\n<p>Kibana requires templates to be installed in order to do so. Stamus network have developped a set of templates for Kibana but they only do work with Kibana version 5. We will need to wait for the updated version that will work with Kibana 6.<\/p>\n<p>Keep an eye on\u00a0<a href=\"https:\/\/github.com\/StamusNetworks\/\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/StamusNetworks\/<\/a>\u00a0to see when a new version of KTS comes out.<\/p>\n<p>You can of course make your own templates.<\/p>\n<p>If you go to <a href=\"http:\/\/kibana.ip:5601\" target=\"_blank\" rel=\"noopener\">http:\/\/kibana.ip:5601<\/a>\u00a0you will see something like this:<\/p>\n<p><a class=\"fancybox\" id=\"img-kibana\" href=\"https:\/\/www.howtoforge.com\/images\/suricata_with_elk_and_web_front_ends_n_ubuntu_bionic_beaver_1804_lts\/big\/kibana.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/suricata-ids-with-elk-and-web-frontend-on-ubuntu-18-04-lts-5.jpg\" alt=\"Kibana\" width=\"550\" height=\"309\" title=\"\"><\/a><\/p>\n<p>To run Kibana behind apache2 proxy add this to your virtualhost:<\/p>\n<pre><span>ProxyPass \/kibana\/ http:\/\/localhost:5601\/ <br\/>ProxyPassReverse \/(.*) http:\/\/localhost:5601\/(.*)<br\/><\/span><\/pre>\n<p class=\"command\">nano \/etc\/kibana\/kibana.yml<\/p>\n<p>And set the following:<\/p>\n<pre><span>server.basePath: \"\/kibana\"<\/span><\/pre>\n<p><span>And of course restart kibana for the changes to take effect:<\/span><\/p>\n<p class=\"command\">service kibana stop<br \/>service kibana start<\/p>\n<p><span>Enable mod-proxy and mod-proxy-http in apache2<\/span><\/p>\n<p class=\"command\">a2enmod proxy<br \/>a2enmod proxy_http<br \/>service apache2 restart<\/p>\n<p>Evebox is a web frontend that displays the Suricata alerts after being processed by ELK.<\/p>\n<p>First we will add the Evebox repository:<\/p>\n<p class=\"command\">wget -qO &#8211; https:\/\/evebox.org\/files\/GPG-KEY-evebox | sudo apt-key add &#8211;<br \/>echo &#8220;deb http:\/\/files.evebox.org\/evebox\/debian stable main&#8221; | tee \/etc\/apt\/sources.list.d\/evebox.list<br \/>apt-get update<\/p>\n<p class=\"command\">apt-get install evebox<br \/>cp \/etc\/evebox\/evebox.yaml.example \/etc\/evebox.yaml<\/p>\n<p>And to start evebox at boot:<\/p>\n<p class=\"command\"><span>systemctl enable<span>\u00a0<\/span><\/span><em>evebox<\/em><\/p>\n<p>We can now start evebox:<\/p>\n<p class=\"command\">service evebox start<\/p>\n<p>Now we can go to <a href=\"http:\/\/localhost:5636\" target=\"_blank\" rel=\"noopener\">http:\/\/localhost:5636<\/a>\u00a0and we see the following:<\/p>\n<p><a class=\"fancybox\" id=\"img-evebox\" href=\"https:\/\/www.howtoforge.com\/images\/suricata_with_elk_and_web_front_ends_n_ubuntu_bionic_beaver_1804_lts\/big\/evebox.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/suricata-ids-with-elk-and-web-frontend-on-ubuntu-18-04-lts-6.jpg\" alt=\"Evebox\" width=\"550\" height=\"309\" title=\"\"><\/a><\/p>\n<p>To run Evebox behind apache2 proxy add this to your virtualhost:<\/p>\n<pre><span>ProxyPass \/evebox\/ http:\/\/localhost:5601\/ <br\/>ProxyPassReverse \/(.*) http:\/\/localhost:5601\/(.*)<\/span><\/pre>\n<p class=\"command\">nano \/etc\/evebox\/evebox.yml<\/p>\n<p>And set the following:<\/p>\n<pre>reverse-proxy: true<\/pre>\n<p><span>And of course reload evebox for the changes to take effect:<\/span><\/p>\n<p class=\"command\">service evebox force-reload<\/p>\n<p><span>Enable mod-proxy and mod-proxy-http in apache2<\/span><\/p>\n<p class=\"command\">a2enmod proxy<br \/>a2enmod proxy_http<br \/>service apache2 restart<\/p>\n<p>Filebeat allows you to send logfile entries to a remove logstash service. This is handy when you have multiple instances of Suricata on your network.<\/p>\n<p>Let&#8217;s install filebeat:<\/p>\n<p class=\"command\">apt install filebeat<\/p>\n<p>Than we need to edit the filebeat configuration and tell it what we want filebeat to monitor.<\/p>\n<p>nano \/etc\/filebeat\/filebeat.yml<\/p>\n<p>And change the following to enable our suricata log to be transmitted:<\/p>\n<pre readability=\"5.5\"><span readability=\"5\">- type: log <p>\u00a0# Change to true to enable this input configuration. <br\/>\u00a0enabled: true<\/p><p>\u00a0# Paths that should be crawled and fetched. Glob based paths. <br\/>\u00a0paths: <br\/>\u00a0\u00a0\u00a0- \/var\/log\/suricata\/eve.json<br\/>\u00a0\u00a0\u00a0#- c:\\programdata\\elasticsearch\\logs\\*<\/p><\/span><\/pre>\n<p>And set the following to send the output to logstash and comment out the eleasticsearch output.<\/p>\n<pre readability=\"6\"><span readability=\"6\">#-------------------------- Elasticsearch output ------------------------------ <br\/># output.elasticsearch: <br\/>\u00a0# Array of hosts to connect to. <br\/># hosts: [\"localhost:9200\"] <p>\u00a0# Optional protocol and basic auth credentials. <br\/>\u00a0#protocol: \"https\" <br\/>\u00a0#username: \"elastic\" <br\/>\u00a0#password: \"changeme\" <\/p><p>#----------------------------- Logstash output -------------------------------- <br\/>output.logstash: <br\/>\u00a0# The Logstash hosts <br\/>\u00a0 hosts: [\"<span class=\"highlight\">ip of the server running logstash<\/span>:5044\"]<\/p><\/span><\/pre>\n<p>Now we need to tell logstash there is a filebeat input coming in so the filebeat will start a listening service on port 5044:<\/p>\n<p>Do the following on the remote server:<\/p>\n<p>nano \/etc\/logstash\/conf.d\/10-input.conf<\/p>\n<p>And add the following to the file:<\/p>\n<pre><span>input { <br\/>\u00a0beats { <br\/>\u00a0\u00a0\u00a0port =&gt; 5044 <br\/>\u00a0\u00a0\u00a0codec =&gt; json <br\/>\u00a0\u00a0\u00a0type =&gt; \"SuricataIDPS\" <br\/>\u00a0} <br\/>}<br\/><\/span><\/pre>\n<p>Now you can start filebeat on the source machine:<\/p>\n<p>service filebeat start<\/p>\n<p>And restart logstash on the remote server:<\/p>\n<p class=\"command\">service logstash stop<br \/>service logstash start<\/p>\n<p>Scirius is a web frontend for suricata rules management. The open source version only allows you to manage a local suricata install.<\/p>\n<p>Let&#8217;s install scirius for Suricata rules management<\/p>\n<p class=\"command\">cd \/opt<br \/>git clone https:\/\/github.com\/StamusNetworks\/scirius<br \/>cd scirious<br \/>apt install python-pip python-dev<br \/>pip install -r requirements.txt<br \/>pip install pyinotify<br \/>pip install gitpython<br \/>pip install gitdb<br \/>apt install npm webpack<br \/>npm install<\/p>\n<p>Now we need to initiate the Django database<\/p>\n<p class=\"command\">python manage.py migrate<\/p>\n<p>Authentication is by default in scirius so we will need to create a superuser account:<\/p>\n<p class=\"command\">python manage.py createsuperuser<\/p>\n<p>Now we need to initialize scirius:<\/p>\n<p class=\"command\">webpack<\/p>\n<p>Before we start scirius you need to give the hostname or ip address of the machine running scirius to avoid a Django error stating host not allowed and stopping the service, and disable debugging.<\/p>\n<p class=\"command\">nano scirius\/settings.py<\/p>\n<pre readability=\"4\"><span readability=\"2\"> SECURITY WARNING: don't run with debug turned on in production! <br\/>DEBUG = True <p>ALLOWED_HOSTS = ['<span class=\"highlight\">the hostname or ip of the server running scirius<\/span>'] <br\/><\/p><\/span><\/pre>\n<p>You can add both the ip address and hostname of the machine by uting the following format: [&#8216;ip&#8217;,&#8217;hostname&#8217;].<\/p>\n<p class=\"command\"><span>python manage.py runserver<\/span><\/p>\n<p>You can than connect to localhost:8000.<\/p>\n<p>If you need the application to listen to a reachable address, you can run scirius like this:<\/p>\n<p class=\"command\">python manage.py runserver 192.168.1.1:8000<\/p>\n<p>To run scirius behind apache2 you will need to create a virtualhost configuration like this:<\/p>\n<pre>&lt;VirtualHost *:80&gt;<br\/>ServerName scirius.example.tld<br\/>ServerAdmin <a href=\"https:\/\/www.howtoforge.com\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"cfb8aaada2aebcbbaabd8faab7aea2bfa3aae1bba3ab\" target=\"_blank\" rel=\"noopener\">[email\u00a0protected]<\/a><br\/>ErrorLog ${APACHE_LOG_DIR}\/scirius.error.log<br\/>CustomLog ${APACHE_LOG_DIR}\/scirius.access.log combined<br\/>&#13;\nProxyPass \/ http:\/\/localhost:8000\/<br\/>&#13;\nProxyPassReverse \/(.*) http:\/\/localhost:8000\/(.*)<br\/>&#13;\n&lt;\/VirtualHost&gt;<\/pre>\n<p>And enable mod-proxy and mod-proxy-http<\/p>\n<p class=\"command\">a2enmod proxy<br \/>a2enmod proxy_http<br \/>service apache2 restart<\/p>\n<p>And than you can go to scirius.example.tld and access scirius from there.<\/p>\n<p>To start scirius automatically at boot we need to do the following:<\/p>\n<p class=\"command\">nano \/lib\/systemd\/system\/scirius.service<\/p>\n<p>And paste the following in to it:<\/p>\n<pre>[Unit]&#13;\nDescription=Scirius\u00a0Service <br\/>&#13;\nAfter=multi-user.target &#13;\n&#13;\n[Service]&#13;\nType=idle&#13;\nExecStart=\/usr\/bin\/python \/opt\/scirius\/<span>manage.py runserver <\/span>&gt; \/var\/log\/scirius.log 2&gt;&amp;1<br\/>&#13;\n[Install] WantedBy=multi-user.target<\/pre>\n<p>And execute the following commands to install the new service:<\/p>\n<p class=\"command\" re=\"\">chmod 644 \/lib\/systemd\/system\/myscript.servi<br \/>systemctl daemon-reload <br \/>systemctl enable myscript.service<\/p>\n<p>This concludes this how to.<\/p>\n<p>If you have any remarks or questions post them in the following thread on the forum:<\/p>\n<p><a href=\"https:\/\/www.howtoforge.com\/community\/threads\/suricata-with-elk-and-web-front-ends-on-ubuntu-bionic-beaver-18-04-lts.79454\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.howtoforge.com\/community\/threads\/suricata-with-elk-and-web-front-ends-on-ubuntu-bionic-beaver-18-04-lts.79454\/<\/a><\/p>\n<p>I am subscribed to this thread so I will be notified of any new posts.<\/p>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<p>\n<a href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fsuricata-with-elk-and-web-front-ends-on-ubuntu-bionic-beaver-1804-lts%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/suricata-ids-with-elk-and-web-frontend-on-ubuntu-18-04-lts.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fsuricata-with-elk-and-web-front-ends-on-ubuntu-bionic-beaver-1804-lts%2F&amp;text=Suricata+IDS+with+ELK+and+Web+Frontend+on+Ubuntu+18.04+LTS&amp;via=howtoforgecom&amp;related=howtoforgecom\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/suricata-ids-with-elk-and-web-frontend-on-ubuntu-18-04-lts-1.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/howtoforgecom\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/suricata-ids-with-elk-and-web-frontend-on-ubuntu-18-04-lts-2.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/plus.google.com\/share?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fsuricata-with-elk-and-web-front-ends-on-ubuntu-bionic-beaver-1804-lts%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/08\/suricata-ids-with-elk-and-web-frontend-on-ubuntu-18-04-lts-3.png\" height=\"20\" alt=\"\" title=\"\"><\/a>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Suricata is an IDS \/ IPS capable of using Emerging Threats and VRT rule sets like Snort and Sagan. This tutorial shows the installation and configuration of the Suricata Intrusion Detection System on an Ubuntu 18.04 (Bionic Beaver) server. In this howto we assume that all commands are executed as root. If not you need [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-6090","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/6090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=6090"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/6090\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=6090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=6090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=6090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}