{"id":192,"date":"2020-09-04T09:00:49","date_gmt":"2020-09-04T13:00:49","guid":{"rendered":"https:\/\/secognition.com\/?p=192"},"modified":"2021-10-16T09:12:07","modified_gmt":"2021-10-16T14:12:07","slug":"zeek-ids-installation-on-raspberry-pi-part-3","status":"publish","type":"post","link":"https:\/\/secognition.com\/?p=192","title":{"rendered":"Zeek IDS Installation on Raspberry PI Part 3"},"content":{"rendered":"<p>Updated 03-14-2021 &#8211; added new beats, golang version, extra warnings<\/p>\n<p>Updated 10-02-2021 &#8211; Redid screenshots reflecting Elastic 7.15, move to Zeek filebeat module &amp; pre-canned reports<\/p>\n<p>Hi Folks! It has been awhile, thank you for your patience. I have been doing some work in respect to the visualization of Zeek logs. This is a long entry, but a good one that can really add value to your Zeek installation. I hope the write up below will come in handy to setup your own log collector and visualization server with Elasticsearch.\u00a0 I&#8217;ve modified this post to use the Zeek filebeat module to use the pre-canned reports and auto-populate the <em>Security\u00a0<\/em>menus in Elastic. If you&#8217;ve followed the first and second instalments of this series you should be good to go for this portion.<\/p>\n<p>The objectives will be to:<\/p>\n<ul>\n<li>Setup a VM separate from your Raspberry PI with Linux;<\/li>\n<li>Install Elasticsearch, Logstash, Kibana (ELK Stack) and Nginx on the VM;<\/li>\n<li>Install Filebeat from your Zeek sensor on Raspberry Pi;<\/li>\n<li>Make sure everything is working (logs, queries, services);<\/li>\n<\/ul>\n<p><strong>Virtual Machine Creation<\/strong><\/p>\n<p>I have an old PC that has been repurposed into a virtual machine host. I use VirtualBox as my hypervisor, but using VMware works as well.<\/p>\n<p>For the purposes of this project, I downloaded an Ubuntu 20.04 LTS server image and installed it with the following settings:<\/p>\n<ul>\n<li>4 GB of RAM;<\/li>\n<li>100 GB Hard Drive;<\/li>\n<li>2 CPUs;<\/li>\n<li>Bridged network adapter.<\/li>\n<\/ul>\n<p>I won&#8217;t go into the specifics of how to setup VirtualBox and setting up the VM. A quick web search can show many ways to go about this. I used the automated install utility in Ubuntu and made sure my network card had a static IP address and used all the hard drive space through the partition tool. Make sure you install ssh to login to your new server and apply the latest patches through<\/p>\n<pre class=\"code\"> sudo apt-get update;apt-get dist-upgrade<\/pre>\n<p><strong>Installing Elasticsearch, Logstash and Kibana (ELK) on the VM<\/strong><\/p>\n<p>Again, not to turn this into a HOWTO on Elasticsearch installation, I used the instructions provided at:<\/p>\n<p><a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-elasticsearch-logstash-and-kibana-elastic-stack-on-ubuntu-20-04\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-install-elasticsearch-logstash-and-kibana-elastic-stack-on-ubuntu-20-04<\/a><\/p>\n<p>Make sure you pay particular attention to the JAVA and Nginx installation instructions. It&#8217;s mostly installed from binaries available at Elastic. I am not an expert in Elasticsearch, I just took the stock settings.\u00a0 This will get the vanilla Elasticsearch app going.\u00a0 No SSL, no extras with the X-pack modules.<\/p>\n<p><strong>Install Filebeat on your Zeek Sensor<\/strong><\/p>\n<p>Here comes the fun part. Because Elastic doesn&#8217;t compile it&#8217;s binaries for ARM architecture, we will have to compile Filebeat from source with multiple dependencies. Filebeat also makes use of Golang.\u00a0 If you want to save yourself some grief, you can also clone and run Josh Thurston&#8217;s <a href=\"https:\/\/github.com\/josh-thurston\/easyBEATS\">easyBeats<\/a> github repository which will do much of the heavy lifting explained below:<\/p>\n<p>The steps to retrieve and install are as follows:<\/p>\n<p>First we need pip and git.<\/p>\n<pre class=\"code\">sudo apt-get install python-pip git<\/pre>\n<p>Then virtualenv.<\/p>\n<pre class=\"code\">sudo pip install virtualenv<\/pre>\n<p>We&#8217;re ready to download and decompress Go (for raspi) and set the environment variable in the shell.<\/p>\n<pre class=\"code\">wget https:\/\/dl.google.com\/go\/go1.16.3.linux-armv6l.tar.gz\r\nsudo tar -C \/usr\/local -xzf go1.16.3.linux-armv6l.tar.gz\r\nexport PATH=$PATH:\/usr\/local\/go\/bin\r\n<\/pre>\n<p>Then we test to make sure all is running as it should type in <em>go version<\/em>:<\/p>\n<pre class=\"code\"><em>go version<\/em> \r\n\r\ngo version go1.16.3 linux\/arm<\/pre>\n<p>Now we setup the environment for filebeat:<\/p>\n<pre class=\"code\">export GOPATH=$HOME\/go\r\nmkdir go\r\nmkdir -p ${GOPATH}\/src\/github.com\/elastic\r\ncd ${GOPATH}\/src\/github.com\/elastic<\/pre>\n<p>Finally we retreive and build filebeat. You should be in the ~\/go\/src\/github.com\/elastic directory.<\/p>\n<p>3 things to watch out for.<\/p>\n<ol>\n<li>On some installs I had an issue with memory filling up and not swapping. I usually reboot the device before building filebeat.<\/li>\n<li>This is the filebeat version I installed from the git repository at the time of writing. It may not be the most recent version or the version you want to use. You can consult the different branches here: <a href=\"https:\/\/github.com\/elastic\/beats\">https:\/\/github.com\/elastic\/beats<\/a>. As of the writing of this, the latest release of beats on github is 8.0 (Oct 2021)<\/li>\n<li>I compiled with the newest version of GO (1.16.x), but was having x.509 issues in the logs.\u00a0 If anyone with Golang experience can get the environment variable: GODEBUG=x509ignoreCN=0, and have it work in filebeat without error, let me know, or just use SANs in your x.509 cert as well&#8230;<\/li>\n<\/ol>\n<p>The commands to input are in <em>italics<\/em>, the messages are in normal text.<\/p>\n<pre class=\"code\"><em>git clone https:\/\/github.com\/elastic\/beats.git \r\ncd beats\/ \r\ncd filebeat\/ \r\nmake\r\n\r\n<\/em><\/pre>\n<p>On make, the prompt should appear similar to this:<\/p>\n<pre><em>go build -ldflags \"-X github.com\/elastic\/beats\/libbeat\/version.buildTime=2021-03-14T16:50:53Z -X github.com\/elastic\/beats\/libbeat\/version.commit=1d9cced55410003f5d0b4594ff5471d15a4e2900\"\r\n<\/em><\/pre>\n<p>If things went swimmingly you should have a new executable file named filebeat. To perform some tests to see that it&#8217;s responsive you can type:<\/p>\n<pre class=\"code\"> .\/filebeat -e -v<\/pre>\n<p>You should see some messages outlining the log and executable paths.<\/p>\n<p>Next is to setup the &#8216;standard&#8217; directories and files for configuration.<\/p>\n<pre class=\"code\">sudo mkdir \/usr\/share\/filebeat \/usr\/share\/filebeat\/bin \/etc\/filebeat \/var\/log\/filebeat \/var\/lib\/filebeat\r\nsudo mv filebeat \/usr\/share\/filebeat\/bin\r\nsudo mv module \/usr\/share\/filebeat\/\r\nsudo mv modules.d\/ \/etc\/filebeat\/\r\nsudo cp filebeat.yml \/etc\/filebeat\/\r\nsudo chmod 750 \/var\/log\/filebeat\r\nsudo chmod 750 \/etc\/filebeat\/\r\nsudo chown -R root:root \/usr\/share\/filebeat\/*<\/pre>\n<p>Create the file for the filebeat service to make it start on boot and can be stopped through the service layer. Use your own favorite text editor for this (I like joe for my default editor).<\/p>\n<pre class=\"code\">sudo joe \/lib\/systemd\/system\/filebeat.service<\/pre>\n<p>Fill in the file with:<\/p>\n<pre class=\"code\">[Unit]\r\nDescription=filebeat\r\nDocumentation=https:\/\/www.elastic.co\/guide\/en\/beats\/filebeat\/current\/index.html\r\nWants=userwork-online.target\r\nAfter=network-online.target\r\n\r\n[Service]\r\nEnvironment=\"GODEBUG='madvdontneed=1'\"\r\nEnvironment=\"BEAT_LOG_OPTS=\"\r\nEnvironment=\"BEAT_CONFIG_OPTS=-c \/etc\/filebeat\/filebeat.yml\"\r\nEnvironment=\"BEAT_PATH_OPTS=--path.home \/usr\/share\/filebeat --path.config \/etc\/filebeat --path.data \/var\/lib\/filebeat --path.logs \/var\/log\/filebeat\"\r\nExecStart=\/usr\/share\/filebeat\/bin\/filebeat --environment systemd $BEAT_LOG_OPTS $BEAT_CONFIG_OPTS $BEAT_PATH_OPTS\r\nRestart=always\r\n\r\n[Install]\r\nWantedBy=multi-user.target<\/pre>\n<p>And now to add the service to the regular rotation of services:<\/p>\n<pre class=\"code\"><em>sudo systemctl enable filebeat.service<\/em>\r\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/filebeat.service \u2192 \/lib\/systemd\/system\/filebeat.service.\r\n<em>sudo service filebeat start\r\nsudo service filebeat status<\/em>\r\n\u25cf filebeat.service - filebeat\r\n   Loaded: loaded (\/lib\/systemd\/system\/filebeat.service; enabled; vendor preset:\r\n   Active: active (running) since Sun 2020-06-28 16:25:20 BST; 8s ago\r\n     Docs: https:\/\/www.elastic.co\/guide\/en\/beats\/filebeat\/current\/index.html\r\n Main PID: 18536 (filebeat)\r\n    Tasks: 14 (limit: 4915)\r\n   Memory: 7.7M\r\n   CGroup: \/system.slice\/filebeat.service\r\n           \u2514\u250018536 \/usr\/share\/filebeat\/bin\/filebeat -c \/etc\/filebeat\/filebeat.ym\r\n\r\nJun 28 16:25:20 raspi systemd[1]: Started filebeat.\r\n\r\n\r\n<\/pre>\n<p>The filebeat configuration file can be found in \/etc\/filebeat\/filebeat.yml. You&#8217;ll want to modify it to reflect:<\/p>\n<ol>\n<li>Where your elasticsearch server IP is (replace xxx with the IP of your server.)<\/li>\n<\/ol>\n<p>My filebeat.yml looks like this, changed this to input directly to elasticsearch and remove logstash.\u00a0 The areas I modified are in kibana, elasticsearch and added the setup.ilm lines at the end of the file.\u00a0 Also if you go to <a href=\"https:\/\/secognition.com\/?p=208\">Tag Country, State and City Information to Zeek Elasticsearch Entries<\/a> you can add some geotagging information for your local traffic from this filebeat config file.<\/p>\n<pre class=\"code\">setup.kibana:\r\n  host: \"xxx.xxx.xxx.xxx:5601\"\r\n\r\noutput.elasticsearch:\r\n  hosts: [\"http:\/\/xxx.xxx.xxx.xxx:9200\"]\r\n \r\n\r\nsetup.ilm.rollover_alias: \"filebeat-%{[agent.version]}\"\r\nsetup.ilm.pattern: \"{now\/M{yyyy.MM}}-000001\"\r\n\r\n<\/pre>\n<p>Next to modify the<em><strong> \/etc\/filebeat\/modules.d\/zeek.yml<\/strong><\/em> file to ensure filebeat picks up the distinct logs Zeek can produce.\u00a0 You can mix and match what logs are most important to you.\u00a0 Also remember the more logs, the more power needed to crunch and transmit to the Elastic hub.\u00a0 My zeek.yml file is below:<\/p>\n<pre># Module: zeek\r\n# Docs: https:\/\/www.elastic.co\/guide\/en\/beats\/filebeat\/7.11\/filebeat-module-zeek.html\r\n\r\n- module: zeek\r\n  capture_loss:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/capture_loss.log\"]\r\n  connection:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/conn.log\"]\r\n  dce_rpc:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/dce_rpc.log\"]\r\n  dhcp:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/dhcp.log\"]\r\n  dnp3:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/dnp3.log\"]\r\n  dns:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/dns.log\"]\r\n  dpd:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/dpd.log\"]\r\n  files:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/files.log\"]\r\n  ftp:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/ftp.log\"]\r\n  http:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/http.log\"]\r\n  intel:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/intel.log\"]\r\n  irc:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/irc.log\"]\r\n  kerberos:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/kerberos.log\"]\r\n  modbus:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/modbus.log\"]\r\n  mysql:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/mysql.log\"]\r\n  notice:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/notice.log\"]\r\n  ntlm:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/ntlm.log\"]\r\n  ocsp:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/ocsp.log\"]\r\n  pe:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/pe.log\"]\r\n  radius:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/radius.log\"]\r\n  rdp:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/rdp.log\"]\r\n  rfb:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/rfb.log\"]\r\n# signatures:\r\n# enabled: true\r\n# var.paths: [\"\/usr\/local\/zeek\/logs\/current\/signatures.log\"]\r\n  sip:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/sip.log\"]\r\n  smb_cmd:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/smb_cmd.log\"]\r\n  smb_files:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/smb_files.log\"]\r\n  smb_mapping:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/smb_mapping.log\"]\r\n  smtp:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/smtp.log\"]\r\n  snmp:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/snmp.log\"]\r\n  socks:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/socks.log\"]\r\n  ssh:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/ssh.log\"]\r\n  ssl:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/ssl.log\"]\r\n  stats:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/stats.log\"]\r\n  syslog:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/syslog.log\"]\r\n  traceroute:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/traceroute.log\"]\r\n  tunnel:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/tunnel.log\"]\r\n  weird:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/weird.log\"]\r\n  x509:\r\n    enabled: true\r\n    var.paths: [\"\/usr\/local\/zeek\/logs\/current\/x509.log\"]<\/pre>\n<p>Activate the module.\u00a0 From the \/etc\/filebeat directory:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-645\" src=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/zeek-enable.png\" alt=\"\" width=\"426\" height=\"52\" srcset=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/zeek-enable.png 426w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/zeek-enable-300x37.png 300w\" sizes=\"auto, (max-width: 426px) 100vw, 426px\" \/><\/p>\n<p>I also enable the system module to keep track of syslog and other linux logs outside of Zeek.<\/p>\n<p>You can list the available modules as well (and see what else can be integrated with filebeat)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-646\" src=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/moduleslist.png\" alt=\"\" width=\"360\" height=\"400\" srcset=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/moduleslist.png 360w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/moduleslist-270x300.png 270w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Make sure you restart your filebeat service once the configuration file is modified.<\/p>\n<pre class=\"code\">sudo service filebeat restart<\/pre>\n<p>An additional useful command:\u00a0 <em>journalctl -u filebeat.service &#8211;since &#8220;5 minutes ago&#8221;<\/em><\/p>\n<p>This will allow to see all the startup logs for the service and troubleshoot any issues.\u00a0 Invaluable in case you don&#8217;t see any activity on the service or towards your elasticstack.<\/p>\n<p><strong>Checking Elastic for Logs<\/strong><\/p>\n<p>Lets check to make sure the new logs are making it into Elasticsearch and that we can see them in Kibana. Browse to your Kibana instance and you should be presented with a home page similar to the one below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-624\" src=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/elastichome.png\" alt=\"\" width=\"1896\" height=\"813\" srcset=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/elastichome.png 1896w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/elastichome-300x129.png 300w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/elastichome-1024x439.png 1024w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/elastichome-768x329.png 768w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/elastichome-1536x659.png 1536w\" sizes=\"auto, (max-width: 1896px) 100vw, 1896px\" \/><\/p>\n<p>This main menu shows you the fundamental features of Elastic.\u00a0 You can also dive deeper by pressing the three parallel line icon in the top left corner and get more choices:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-627\" src=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/menuparallel.png\" alt=\"\" width=\"154\" height=\"94\" \/><\/p>\n<p>To check whether your elastic server is picking up logs, go to the <em>Analytics<\/em> Menu and click on <em>Discover<\/em>.\u00a0 If you see logs, this is good.\u00a0 It should look similar to the image below.\u00a0 If not, recheck your steps above.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-625\" src=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/elasticdiscover.png\" alt=\"\" width=\"1915\" height=\"536\" srcset=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/elasticdiscover.png 1915w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/elasticdiscover-300x84.png 300w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/elasticdiscover-1024x287.png 1024w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/elasticdiscover-768x215.png 768w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/elasticdiscover-1536x430.png 1536w\" sizes=\"auto, (max-width: 1915px) 100vw, 1915px\" \/><\/p>\n<p>Another tip, in the past Elasticsearch and Kibana don&#8217;t necessarily capture all the fields from the messages sent from the Zeek sensor. This is where remaking the index patterns is important once information starts flowing to ensure that elastic is processing your JSON key pairs correctly. You can do this through the <em>Management<\/em> menu item and click on <em>Stack Management<\/em> at the bottom of the menu choices.\u00a0 This will bring you to a new page.\u00a0 Once you&#8217;re in the <em>Stack Managemen<\/em>t menu, click on <em>Index Management<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-628\" src=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/mangement.jpg\" alt=\"\" width=\"508\" height=\"278\" srcset=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/mangement.jpg 508w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/mangement-300x164.jpg 300w\" sizes=\"auto, (max-width: 508px) 100vw, 508px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-629\" src=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/management.png\" alt=\"\" width=\"256\" height=\"408\" srcset=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/management.png 256w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/management-188x300.png 188w\" sizes=\"auto, (max-width: 256px) 100vw, 256px\" \/><\/p>\n<p>A new page will be loaded, in the top center area there will be some tab choices.\u00a0 Click on <em>Index Templates.<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-630\" src=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/Indexmgmt.png\" alt=\"\" width=\"1216\" height=\"361\" srcset=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/Indexmgmt.png 1216w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/Indexmgmt-300x89.png 300w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/Indexmgmt-1024x304.png 1024w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/Indexmgmt-768x228.png 768w\" sizes=\"auto, (max-width: 1216px) 100vw, 1216px\" \/><\/p>\n<p>Use the Search bar to look for your index.\u00a0 It&#8217;s probably called <em>filebeat-*<\/em> or something similar and is at the bottom of the page as this is a &#8216;legacy&#8217; index.\u00a0 Mouse over the template name so that the pencil and trash icons appear.\u00a0 Click on the trash icon to start deleting the index.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-631\" src=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/legacytemplate.png\" alt=\"\" width=\"1637\" height=\"302\" srcset=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/legacytemplate.png 1637w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/legacytemplate-300x55.png 300w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/legacytemplate-1024x189.png 1024w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/legacytemplate-768x142.png 768w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/legacytemplate-1536x283.png 1536w\" sizes=\"auto, (max-width: 1637px) 100vw, 1637px\" \/><\/p>\n<p>Upon pressing the trash bin, a popup to confirm the deletion will appear.\u00a0 Click on the <em>Delete template <\/em>button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-632\" src=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/deletetemp.png\" alt=\"\" width=\"395\" height=\"237\" srcset=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/deletetemp.png 395w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/deletetemp-300x180.png 300w\" sizes=\"auto, (max-width: 395px) 100vw, 395px\" \/><\/p>\n<p>Once you have deleted the template, go back to your Zeek sensor and restart the filebeat service, I also check the status just in case it doesn&#8217;t come up correctly.\u00a0 Wait a few minutes, refresh your browser screen on the <em>Index Management<\/em> page and your index should regenerate in the <em>Index Templates<\/em> menu.\u00a0 Note: You may have to reset filebeat a few times if it&#8217;s not coming back up.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-633\" src=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/filebeatstat.png\" alt=\"\" width=\"1899\" height=\"323\" srcset=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/filebeatstat.png 1899w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/filebeatstat-300x51.png 300w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/filebeatstat-1024x174.png 1024w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/filebeatstat-768x131.png 768w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/filebeatstat-1536x261.png 1536w\" sizes=\"auto, (max-width: 1899px) 100vw, 1899px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Viewing the Security Dashboards<br \/>\n<\/strong><\/p>\n<p>Now we get to the part we&#8217;ve all been waiting for, how do we get out data into graphs and tables?\u00a0 Click on the three parallel line icon and choose <em>Security<\/em>.<\/p>\n<p>If the steps above were followed and successful you should see some additional details in this menu through the <em>Overview<\/em> tab similar to below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-639\" src=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/secoverview1.png\" alt=\"\" width=\"1923\" height=\"913\" srcset=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/secoverview1.png 1923w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/secoverview1-300x142.png 300w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/secoverview1-1024x486.png 1024w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/secoverview1-768x365.png 768w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/secoverview1-1536x729.png 1536w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/secoverview1-1920x912.png 1920w\" sizes=\"auto, (max-width: 1923px) 100vw, 1923px\" \/><\/p>\n<p>These bar graphs show different information from the Zeek logs that are being sent.\u00a0 The top graph is for the Elastic internal detection alerts.\u00a0 Elastic has some rules that it uses to detect alerts through the <em>Security -&gt; Rules <\/em> screen.\u00a0 In this case Zeek is detecting a PPTP VPN attempt on my local network.\u00a0 All sorts of other detection rules can be configured.<\/p>\n<p>The second graph is the threat intel hits from the intel.log and weird.log files from Zeek.\u00a0 If you click on the View alerts button, it will filter the raw logs from the <em>Discovery<\/em> page for further analysis.<\/p>\n<p>You can then scroll down further and see some of the more nitty gritty statistics from the ingest pipelines going into your Elastic instance.\u00a0 In this case since i&#8217;m only using Zeek and filebeat it will only show results from those applications.\u00a0 The top graphs can be drilled down further for the different types of logs (IE DNS, SSL etc).<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-640\" src=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/overview2.png\" alt=\"\" width=\"1299\" height=\"613\" srcset=\"https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/overview2.png 1299w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/overview2-300x142.png 300w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/overview2-1024x483.png 1024w, https:\/\/secognition.com\/wp-content\/uploads\/2020\/09\/overview2-768x362.png 768w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/p>\n<p>Other logs can be added and if you scroll down further a new functionality around <em>Threat Intelligence<\/em> can be added.\u00a0 Click through the different screens on the <em>Security<\/em> menu\u00a0 to view more visualization options.\u00a0 One that always gets oohs and ahhs from the more network inclined folks is the hosts map where Elastic can use the geolocation of logs to show traffic between points on a world map, top talkers from source and destination IP perspectives and top traffic to different countries.<\/p>\n<p>I sincerely hope this has helped you on your journey to better visualize\u00a0 your Zeek information.\u00a0 let me know in the comments if you have come up with other visualizations or ways of doing things.<\/p>\n<p>Stay safe<\/p>\n<p>&#8211;David<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Updated 03-14-2021 &#8211; added new beats, golang version, extra warnings Updated 10-02-2021 &#8211; Redid screenshots reflecting Elastic 7.15, move to Zeek filebeat module &amp; pre-canned reports Hi Folks! It has been awhile, thank you for your patience. I have been doing some work in respect to the visualization of Zeek logs. This is a long&hellip; <br \/> <a class=\"read-more\" href=\"https:\/\/secognition.com\/?p=192\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6,5,7],"tags":[],"class_list":["post-192","post","type-post","status-publish","format-standard","hentry","category-ids","category-security","category-zeek"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/secognition.com\/index.php?rest_route=\/wp\/v2\/posts\/192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/secognition.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/secognition.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/secognition.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/secognition.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=192"}],"version-history":[{"count":0,"href":"https:\/\/secognition.com\/index.php?rest_route=\/wp\/v2\/posts\/192\/revisions"}],"wp:attachment":[{"href":"https:\/\/secognition.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/secognition.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/secognition.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}