<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ibrahim Ayadhi on Medium]]></title>
        <description><![CDATA[Stories by Ibrahim Ayadhi on Medium]]></description>
        <link>https://medium.com/@ibrahim.ayadhi?source=rss-7e31712e1ff1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zOUuDSrUUBfDRJCX0jpUgw.jpeg</url>
            <title>Stories by Ibrahim Ayadhi on Medium</title>
            <link>https://medium.com/@ibrahim.ayadhi?source=rss-7e31712e1ff1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 16:33:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ibrahim.ayadhi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Case management]]></title>
            <link>https://medium.com/@ibrahim.ayadhi/case-management-20d8fd815ee2?source=rss-7e31712e1ff1------2</link>
            <guid isPermaLink="false">https://medium.com/p/20d8fd815ee2</guid>
            <dc:creator><![CDATA[Ibrahim Ayadhi]]></dc:creator>
            <pubDate>Tue, 21 Apr 2020 09:59:30 GMT</pubDate>
            <atom:updated>2020-04-21T09:59:30.499Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s article we’ll be putting the last piece of the puzzle in its place. We are going to present to you the case management part of our SOC. We have used two open source technologies TheHive and Cortex.</p><p>TheHive will be used as an alert management platform for our project that can manage an incident alert from creation to closure. Meanwhile, Cortex is a complementary software product from the same team as TheHive that complements it with data enrichment using its “analyzers” and “responders.”</p><p>I encourage you all to check the <a href="https://medium.com/@ibrahim.ayadhi97/deploying-of-infrastructure-and-technologies-for-a-soc-as-a-service-socass-8e1bbb885149">previous article</a> to have a better understanding of what we are going to discuss here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ewcQgQ2_PhF1H2kT" /></figure><p>This article is divided into these sections:</p><ul><li>Installation and configuration of TheHive and Cortex.</li><li>A walk-through TheHive and Cortex dashboards</li><li>Cortex integration with TheHive</li><li>Installing MISP and integrating it with TheHive</li><li>Investigation: case management</li></ul><h3>1- Installation and configuration of TheHive and Cortex:</h3><p>We’re deploying TheHive 3.4.0–1 and Cortex 3.0.1–1 .</p><p>TheHive requires Elasticsearch to be running. For that, we chose to use docker-compose to start them together in Docker containers. You can also install and configure Elasticsearch manually if you don’t want to use Docker.</p><p>For more details you can refer to:</p><blockquote><a href="https://github.com/TheHive-Project/TheHiveDocs/blob/master/installation/install-guide.md">https://github.com/TheHive-Project/TheHiveDocs/blob/master/installation/install-guide.md</a></blockquote><p><strong>Note</strong>: TheHive uses ElasticSearch to store data. Both software use a Java VM. We recommend using a virtual machine with 8vCPU, 8 GB of RAM and 60 GB of disk. You can also use a physical machine with similar specifications.</p><p>Let’s proceed, so we used the following <strong>docker-compose.yml file </strong>to start Elasticsearch, TheHive and Cortex together in 3 different containers:</p><pre>version: &quot;2&quot; <br>services: <br>  elasticsearch: <br>    image: elasticsearch:6.8.0 <br>    ports: <br>      - &quot;0.0.0.0:9200:9200&quot; <br>    environment: <br>      - http.host=0.0.0.0 <br>      - cluster.name=hive <br>      - thread_pool.index.queue_size=100000 <br>      - thread_pool.search.queue_size=100000 <br>      - thread_pool.bulk.queue_size=100000 <br>    ulimits: <br>      nofile: <br>        soft: 65536 <br>        hard: 65536 <br>  cortex: <br>    image: thehiveproject/cortex:3.0.1 <br>    depends_on: <br>      - elasticsearch <br>    ports: <br>      - &quot;0.0.0.0:9001:9001&quot; <br>  thehive: <br>    image: thehiveproject/thehive:3.4.0 <br>        depends_on: <br>      - elasticsearch <br>      - cortex <br>    ports: <br>      - &quot;0.0.0.0:9000:9000&quot; <br>    command: --cortex-port 9001</pre><p>Copy/paste and save it to docker-composer.yml , and execute this command:</p><blockquote><strong>sudo sysctl -w vm.max_map_count=524288</strong></blockquote><p>Finally run:</p><blockquote><strong>docker-compose up</strong></blockquote><p>TheHive is exposed on 9000/tcp port and Cortex on 9001/tcp. These ports can be changed by modifying the docker-compose file.</p><p>You can check the creation of the containers by using: docker ps –a</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hiWlFGKEtAfCMFLs" /></figure><p>Check if Elasticsearch is responding:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/434/0*g2FmZi2CTJRVBYqr" /></figure><p>Great! Now everything is set up, let us have a look at TheHive dashboard:</p><h3>2- A Walk-through TheHive and Cortex dashboards</h3><h4>Navigate to <a href="http://your_ip:9001/">http://YOUR_IP:9001</a></h4><p>Note: Don’t forget to create rules for ports 9000,9001,9200 if you are going to set up this installation on the cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cODdC3z09Iac6fMk" /></figure><p>Update the database and create an admin user:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sFKJ6KhTDX4X0xkL" /></figure><p>Log in with that user:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yKfuK3IgzW06ThAq" /></figure><p>Voila! This is the main Dashboard of TheHive:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VAa0H2i2G_sXlyPt" /></figure><p>Let’s check now Cortex Dashboard:</p><p><a href="http://your_ip:9001/">http://YOUR_IP:9001</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VNyY09Eb2byp1vGr" /></figure><p>Update the database and create an admin user and log in, just like we did for TheHive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*auXpWlUKwmex99Zd" /></figure><p>Great! The way Cortex works is your current user can create organizations and users, but you must be logged in under an organization account in order to enable and manage Analyzers.</p><p>Create a new organization by clicking the <strong>+Add Organization</strong> button on this page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/0*wCcuCAaZbDjU9Ode" /></figure><p>Now switch to the Users tab and click <strong>+Add User</strong></p><p>Assign the new user to the Organization you created and give them the <strong>OrgAdmin</strong> role.</p><p>After you save, click <strong>New Password</strong> for the user you just created and type in a password. Hit Enter to save.</p><p>Now logout and log back in as the new user.</p><p>Navigate to the <strong>Organization</strong> tab at the top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lRPDrv3OMpEEYqoy" /></figure><p>Now click on the <strong>Analyzers</strong> sub-tab in the main body, not the Analyzers tab in blue at the top.</p><p>If Cortex is properly configured, you should see your Analyzers. I have 124 available as of today.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eqxNnmTx3n6FfdW1" /></figure><p>Now let us enable some analyzers to use later on. Keep the defaults settings. <br>Some analyzers will require API-keys so make sure to provide correct information when configuring these analyzers.</p><h3>3-Cortex Integration with TheHive :</h3><p>Navigate to the Users sub-tab and create a new user for integration with TheHive. This user should have the r<strong>ead &amp; analyze role</strong>. This time don’t set a password for the user, instead click <strong>Create API Key </strong>and copy the key. Now back to our terminal, stop all the containers running. Create a file and name it <strong>application.conf</strong> in your home directory :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/0*J4uHdvOC1REwTsCz" /></figure><pre>cortex { <br>  &quot;CORTEX-SERVER-ID&quot; { <br>    # URL of the Cortex server <br>    url = &quot;<a href="http://172.18.0.3:9001/">http://172.18.0.3:9001</a>&quot; <br>    # Key of the Cortex user, mandatory for Cortex 2 <br>    key = &quot;nBqA7B6BYc1kHhgAXZOYoXjBnt5vlCgM&quot; <br>  } <br>}</pre><p>Where url = <a href="http://your_cortex_container_ip/">http://your</a>_cortex_container_ip:cortexPort</p><p>And key= “the api key you created for the previous user”</p><p>You can use docker <strong>inspect &lt;id-container&gt; </strong>to retrive the container ip</p><p>Save that file and then modify the <strong>docker-compose.yml</strong> file:</p><p>In thehive section , add</p><blockquote><strong>volumes:</strong></blockquote><blockquote><strong>- /home/your_user/application.conf:/etc/thehive/application.conf</strong></blockquote><p>And in command, add <strong>— cortex-key &lt;the same api_key used in the previous stp&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/0*aqZOo-ULlHsCIVsw" /></figure><p>Save the file and exit the editor.</p><p>Then, run <strong>docker-compose</strong> <strong>up</strong> again.</p><p>Now go back to theHive dashboard after all containers are up , navigate to “<strong>about” </strong>under your account onglet, you should see :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*cAogrEwTPaHD-GbE" /></figure><p>As you can see, we have successfully integrated Cortex with TheHive.</p><h3>4-Installing the MISP and integrating it with TheHive:</h3><h3>4–1 MISP Installation :</h3><blockquote>1.sudo apt-get update -y &amp;&amp; sudo apt-get upgrade -y</blockquote><blockquote>2. sudo apt-get install mysql-client -y</blockquote><blockquote>3.curl <a href="https://raw.githubusercontent.com/MISP/MISP/2.4/INSTALL/INSTALL.sh">https://raw.githubusercontent.com/MISP/MISP/2.4/INSTALL/INSTALL.sh</a> -o misp_install.sh</blockquote><blockquote>4.chmod +x misp_install.sh</blockquote><blockquote>4. ./misp_install.sh -A</blockquote><p>When it asks your for the baseurl , type your IP :</p><p><a href="https://your_ip/">https://YOUR_IP/</a></p><p>When it asks to create a “misp” user , type “y”.</p><p>PS: Dont’t forget to open port 80,443 on your machine.</p><p>Once it finishes installing, navigate to <a href="https://your_ip/">https://YOUR_IP/</a> , you should get the authentication panel:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uTyBhc6obqWkIcsm" /></figure><p>Login using the initial credentials :</p><ol><li>Username: <a href="/service/mailto:admin@admin.test">admin@admin.test</a></li><li>Password: admin</li></ol><p>Then enter a new password</p><p><strong>Enable MISP Integration</strong> :</p><p>Go to your MISP Server webpage &gt; Administration &gt; Add User</p><p>Give the user an email. Exp: <a href="/service/mailto:cortex@admin.test">cortex_integration@admin.test</a></p><p>Add user to the <strong>ORGNAME</strong> organization</p><p>Role is <strong>user</strong></p><p>Uncheck all the boxes at the bottom</p><p>Copy the user AuthKey</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/0*jiy6CdSfTjgcR9ok" /></figure><p>Go to <strong>Cortex &gt; Organization &gt; Analyzers </strong><br>In the search box type “misp” <br><strong>Enable “MISP_2_0”</strong></p><p>Give the MISP server a descriptive name</p><p>URL = https://&lt;MISP_IP&gt;</p><p>key = AuthKey from MISP user you created</p><p>cert_check: False</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*rsB1EPu3W5NPN7An" /></figure><p>Now navigate to the MISP server webpage &gt; Sync Actions &gt; List Feeds. <br>Find one of the feeds you’ve subscribed to and click the magnifying glass off to the right. Select an IP from the list and copy it.</p><p>Now in Cortex, click <strong>+New Analysis</strong>, add a data type of IP, and paste in the copied IP. <br>Select <strong>The MISP_2_0 analyzer and run. </strong><br>On the Job History page click “View” and you should see the name of the list you copied the IP from as well as any other information that list provides.</p><p>You can go into TheHive and add this IP as an observable to test from there as well.</p><h3>5- Investigation : Case Management with TheHive:</h3><p>​The core construct of TheHive is the investigation case. TheHive aims to making it easy for the analyst and ensuring a better understanding between team members working on it. This is vital since the case investigation is the core construct of most security investigations, whether you’re reviewing alerts, reverse engineering malware, or working a declared incident.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FfncRydCasxf7AWG" /></figure><p>You can add tags to cases for quick searching and filtering. You can also rate the severity of a case, track TLP levels which can help govern and facilitate the sharing of data. All the data you put into a case are easily searchable from the search bar at the top of the screen. This makes it easy to determine if the activity you’re currently observing was present in an earlier case.</p><p>You can create cases from alerts by Importing them. If two alerts share a link then, you can opt to add this alert to an existing case instead of generating a new one.</p><p>After creating the case, you can start setting up tasks to it. A task can really be anything, but We recommend using them to track the actions taken to answer investigative questions.</p><p>In addition, multiple analysts can work on the same case simultaneously. For example, an analyst may deal with malware analysis while another may work on tracking C2 beaconing activity on proxy logs as soon as IOCs have been added by their coworker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b44xOZM4UoEZVMPX" /></figure><p><strong>Case templates :</strong></p><p>As SOC evolves, it becomes critical to define playbooks that helps analysts consistently approach investigations that share common attributes. For example, most the steps you take to initially investigate a series of failed passwords attempts or a phishing e-mail will generally be the same. If you can define those steps, you’ll have a great head start for training new analysts and ensuring most investigations start off on a level footing. TheHive provides a unique case template system that allows you to define common investigations and pre-populate case metadata and tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WuBAAKfA7XVEUJa1" /></figure><p>n the example above, we’ve defined a template for investigations related to exploit kit activity. Now, any time I create a new case I can select this template and all the information you see there will be pre-populated into the case details. The real power here is in the ability to automatically create a series of tasks that should be completed when spawning the case. This essentially lays out the investigative playbook for you. With that, you get the added benefit of automatically populating the Waiting tasks queue so that other analysts can jump into the investigation or start completing containment and eradication tasks.</p><p>Also, TheHive allows you to create separate entries for interesting observables within the context of a case. An observable is any interesting data artifact. TheHive comes with several common observable types built-in. This includes things like IP addresses, domain names, HTTP URIs, etc. Of course, you can also define your own types which make this capability quite flexible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*0xwSU2DR28NZj9JW" /></figure><p>There are multiple benefits to tracking observables. The obvious one is that you can search for them during later investigations to bring in additional context. You can also export them for later import into a blacklist, whitelist, or detection mechanisms. Finally, you can use the built-in Cortex integration to automatically submit the observables to any number of OSINT research sites. This is a very simple process and primarily just requires that you input API keys for each service you’ll be using. Some of the existing integrations include Passive Total, Virus Total, and Domain Tools.</p><p>When you’re ready to close out a case, click the Close Button in the title bar of the case:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/0*FG_JQtQj-8XSggty" /></figure><p>You can set the nature of the case to true positive, false positive etc …</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20d8fd815ee2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reporting]]></title>
            <link>https://medium.com/@ibrahim.ayadhi/reporting-f54e1ee84cf4?source=rss-7e31712e1ff1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f54e1ee84cf4</guid>
            <dc:creator><![CDATA[Ibrahim Ayadhi]]></dc:creator>
            <pubDate>Sat, 18 Apr 2020 22:06:34 GMT</pubDate>
            <atom:updated>2020-04-18T22:06:34.775Z</atom:updated>
            <content:encoded><![CDATA[<p>To mitigate your enterprise network from threats and attacks, you should always perform vulnerabilities’ test on your system. In order, to fix them. So, as you can imagine the reporting job is very important in any SOC because it will give an overview of the vulnerabilities that your system might have. <br> In this article we will give you an insight on the tool we have used in reporting and vulnerability scanning.</p><p><strong>I encourage you all to check the </strong><a href="https://medium.com/@ibrahim.ayadhi97/deploying-of-infrastructure-and-technologies-for-a-soc-as-a-service-socass-8e1bbb885149"><strong>previous article</strong></a><strong> to have a better understanding of what we are going to discuss here.</strong></p><p><strong>This article is divided into these sections:</strong></p><ul><li><strong>Introduction</strong></li><li><strong>Installing Nessus essentials</strong></li><li><strong>VulnWhisperer installation</strong></li></ul><h3>1.Introduction :</h3><h4>Tools we will be using:</h4><ul><li><strong>VulnWhisperer: </strong>VulnWhisperer is a vulnerability management tool and report aggregator. VulnWhisperer will pull all the reports from the different Vulnerability scanners and create a file with a unique filename for each one.</li></ul><blockquote><strong>Project URL: </strong><a href="https://github.com/HASecuritySolutions/VulnWhisperer"><strong>https://github.com/HASecuritySolutions/VulnWhisperer</strong></a></blockquote><ul><li><strong>Nessus essentials: </strong>Nessus Essentials (formerly Nessus Home) is a free version of the Nessus vulnerability scanner.</li></ul><h3>2.Installing Nessus essentials :</h3><p><strong>2.1- Download from official website ( </strong><a href="http://www.tenable.com/"><strong>www.tenable.com</strong></a><strong>) , in our project we used this version:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SKw3VRQXMrX2Ya4I" /></figure><h4>2.2 — Installing Nessus :</h4><blockquote><strong>dpkg -i Nessus-8.10.0-ubuntu910_amd64.deb</strong></blockquote><blockquote><strong>/etc/init.d/nessusd start</strong></blockquote><blockquote><strong>service nessusd start</strong></blockquote><p><strong>Go to </strong><a href="https://yourserverip:8834/"><strong>https://YourServerIp:8834</strong></a><strong> and choose Nessus Essentials</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*QHLOoQCJkZNPbkKx" /></figure><p><strong>2.3- Start with Nessus</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/0*9KKKWfbYek5svAV0" /></figure><p><strong>Copy the activation code , create an account and wait while Nessus prepares the files.</strong></p><p><strong>2.4-Launch your first scan:</strong></p><p>Go to New Scan and select Basic Network Scan</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1tc1trTr7wTYE3y6" /></figure><p><strong>Select your Target, save and launch:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/0*rwdwpiDMIipOBL2F" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*nsvp1HZkd9ev6U19" /></figure><h3>3.VulnWhisperer installation:</h3><h4>3.1- Use Python2.7 :</h4><h4>NOTE : VulnWhisperer require Python2.7 , so we will changing our default Python version</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*2PDZZaos6UUYHxMe" /></figure><p><strong>3.2- Configure VulnWhisperer :</strong></p><blockquote><strong>cd /etc/</strong></blockquote><blockquote><strong>git clone </strong><a href="https://github.com/HASecuritySolutions/VulnWhisperer"><strong>https://github.com/HASecuritySolutions/VulnWhisperer</strong></a></blockquote><blockquote><strong>cd VulnWhisperer/</strong></blockquote><blockquote><strong>sudo apt-get install zlib1g-dev libxml2-dev libxslt1-dev</strong></blockquote><blockquote><strong>pip install -r requirements.txt</strong></blockquote><blockquote><strong>python setup.py install</strong></blockquote><blockquote><strong>nano configs/ frameworks_example.ini</strong></blockquote><p>Choose the modules you want to enable (in our case we will just enable Nessus) and write your Nessus account credentials :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/0*vTBA_NvN55ihPgSV" /></figure><p><strong>3.3 — Check Nessus Connection and Download report:</strong></p><blockquote>vuln_whisperer -F -c configs/frameworks_example.ini -s nessus</blockquote><blockquote>Reports will be saved with csv extension.Check them under: /opt/VulnWhisperer/data/nessus/My\ Scans/</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/0*eeZkiy_bkbNwrjds" /></figure><p>If there is not a new report, you will see</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/0*57tcTtuCo5m8iira" /></figure><h4>3.4- Cronjob with Vulnwhisperer :</h4><p>To make Vulnwhisperer check Nessus database and download reports periodically, we will add a cronjob. So, we will not need to execute this command manually any more. Newest reports will be added automatically to Kibana.</p><blockquote><strong>crontab -e</strong></blockquote><p>add this:</p><blockquote><strong>SHELL=/bin/bash</strong></blockquote><blockquote><strong>* * * * * /usr/local/bin/vuln_whisperer -c /etc/VulnWhisperer/configs/frameworks_example.ini &gt;/dev/null 2&gt;&amp;1</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/0*Z5utvsIN0vbLnYSN" /></figure><p><strong>3.5-Import Elasticsearch templates :</strong></p><p>Go to kibana Dev Tools and add template :</p><h4>File URL:</h4><p><a href="https://github.com/HASecuritySolutions/VulnWhisperer/blob/master/resources/elk6/logstash-vulnwhisperer-template_elk7.json">https://github.com/HASecuritySolutions/VulnWhisperer/blob/master/resources/elk6/logstash-vulnwhisperer-template_elk7.json</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IqVP8eerfVIWhhRO" /></figure><h4>You will have now an index template</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/0*Y0_zQq1IgEqcXJjZ" /></figure><p><strong>3.6- Import the </strong><a href="https://github.com/HASecuritySolutions/VulnWhisperer/blob/master/resources/elk6/kibana.json"><strong>Kibana visualizations</strong></a><br>Go to Kibana → Management → saved object → Import</p><p>Import the kibana.json configuration :</p><h4>Under <a href="https://github.com/HASecuritySolutions/VulnWhisperer">VulnWhisperer</a>/<a href="https://github.com/HASecuritySolutions/VulnWhisperer/tree/master/resources">resources</a>/<a href="https://github.com/HASecuritySolutions/VulnWhisperer/tree/master/resources/elk6">elk6</a>/kibana.json :</h4><blockquote>File URL:</blockquote><blockquote><a href="https://github.com/HASecuritySolutions/VulnWhisperer/blob/master/resources/elk6/kibana.json">https://github.com/HASecuritySolutions/VulnWhisperer/blob/master/resources/elk6/kibana.json</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qbn_qHxmLQYoJkYu" /></figure><p>Now Under Dashboards , you have :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iJbgY1BD1heZbxnb" /></figure><p><strong>3.7 -Add Nessus Logstash configuration file</strong></p><p>Copy Nessys logstash File in /etc/logstash/conf.d/ :</p><blockquote><strong>cd /etc/VulnWhisperer/resources/elk6/pipeline/</strong></blockquote><blockquote><strong>cp 1000_nessus_process_file.conf /etc/logstash/conf.d/</strong></blockquote><blockquote><strong>cd /etc/logstash/conf.d/</strong></blockquote><blockquote><strong>nano 1000_nessus_process_file.conf</strong></blockquote><p>Modify output</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/0*hngM8pIoWgx0Sj2z" /></figure><p><strong>3.8- Restart your services and check your reports :</strong></p><p><strong>systemctl restart logstash elasticsearch</strong></p><p>Now you should have a new index created for Vulnwhisperer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/0*rt9GPWVU4FVJSGyo" /></figure><p>Go to Index pattern and check your fields number :</p><p><strong>NOTE : refresh your index pattern to recognize all fields.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A8yfSXaXWHYQBx-w" /></figure><p>Finally Go to Dashboards and check your reports</p><p>You should have no errors in visualization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_EKtQMzx2h_IACMB" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Py8fM1291MyKSpLu" /></figure><p>Now , all of reports generated by nessus with csv extensions and will be sent automatically to your ELK Stack , so you can visualize them under kibana dashboards.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f54e1ee84cf4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hello and welcome to our new article which will be covering the alerting part in our SOCaaS…]]></title>
            <link>https://medium.com/@ibrahim.ayadhi/hello-and-welcome-to-our-new-article-which-will-be-covering-the-alerting-part-in-our-socaas-136cf6258c49?source=rss-7e31712e1ff1------2</link>
            <guid isPermaLink="false">https://medium.com/p/136cf6258c49</guid>
            <dc:creator><![CDATA[Ibrahim Ayadhi]]></dc:creator>
            <pubDate>Thu, 16 Apr 2020 22:00:31 GMT</pubDate>
            <atom:updated>2020-04-17T17:52:28.189Z</atom:updated>
            <content:encoded><![CDATA[<h3>Alerting</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*BIfaqcaMAs03_wwY" /></figure><p>Hello and welcome to our new article which will be covering the alerting part in our SOCaaS solution. As you all know alerts in any SOC play a vital rule in notifying the response team.</p><p>So, they can interrupt the cyber kill chain or monitor that attack furthermore depending on the enterprise and team policy. You are probably wondering why we need to cover more alerts. Isn’t the alert modules of Open Distro enough? Well, it is because it lacks in terms of the number of outputs and its integrability with the rest of our solution like Thehive. Thus we will be introducing you to other alternative.</p><p><strong>I encourage you all to check the </strong><a href="https://medium.com/@ibrahim.ayadhi97/deploying-of-infrastructure-and-technologies-for-a-soc-as-a-service-socass-8e1bbb885149"><strong>previous article</strong></a><strong> to have a better understanding of what we are going to discuss here.</strong></p><p><strong>The article is divided into these sections:</strong></p><p><strong>*Installing and configuring ElastAlert, ElastAlert-Server and Praeco</strong></p><p><strong>*Creating Rules</strong></p><h3>1-Installing and configuring ElastAlert, ElastAlert-Server and Praeco :</h3><h4>1.1 Introduction:</h4><h4>A- Definitions</h4><p>- <strong>Praeco</strong>: allows for the building of alerts with notification options including Slack, e-mail, Telegram, Jira.</p><p>Alerts within Praeco can either be assembled by choosing fields to be alerted on and their relevant operators using the query builder, or manually using the Kibana Query Language (KQL).</p><p><strong>- ElastAlert</strong> is a simple framework for alerting on anomalies, spikes, or other patterns of interest from data in Elasticsearch. It works by combining Elasticsearch with two types of components, rule types and alerts. Elasticsearch is periodically queried and the data is passed to the rule type, which determines when a match is found. When a match occurs, it is given to one or more alerts, which take action based on the match.</p><p>This is configured by a set of rules, each of which defines a query, a rule type, and a set of alerts.</p><p><strong>- Sigma Rules</strong>: Sigma is a generic and open signature format that allows you to describe relevant log events in a straight forward manner. The rule format is very flexible, easy to write and applicable to any type of log file. The main purpose of this project is to provide a structured form in which researchers or analysts can describe their once developed detection methods and make them shareable with others.</p><h4>B- Projects cloning:</h4><blockquote>cd /etc</blockquote><blockquote>git clone <a href="https://github.com/Yelp/elastalert.git">https://github.com/Yelp/elastalert.git</a></blockquote><blockquote>git clone <a href="https://github.com/ServerCentral/elastalert-server.git">https://github.com/ServerCentral/elastalert-server.git</a></blockquote><blockquote>git clone <a href="https://github.com/ServerCentral/praeco.git">https://github.com/ServerCentral/praeco.git</a></blockquote><p>You can find more information in this URL : <a href="https://github.com/ServerCentral/praeco">https://github.com/ServerCentral/praeco</a></p><h3>1.2-Setting up Elastalert:</h3><blockquote>cd /etc/elastalert</blockquote><blockquote>​mkdir rules rule_templates</blockquote><blockquote>cp config.yaml.example config.yaml</blockquote><blockquote>nano config.yaml</blockquote><p>Configure the elastalert config.yaml with:</p><p>Your es_host: localhost</p><p>A unique writeback_index: elastalert_status</p><p>Change the rules_folder to rules</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/0*unyF-4tiihYauriq" /></figure><p><strong>NOTE : If you are running python 2.7 , you have to change it to 3.6</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/0*HbUEFP6Mt25Kj1vt" /></figure><h4>A- Installing python3.6 on Ubuntu :</h4><blockquote>sudo add-apt-repository ppa:deadsnakes/ppa</blockquote><blockquote>sudo apt update</blockquote><blockquote>sudo apt install python3.6</blockquote><h4>B-Updating python configuration :</h4><blockquote>sudo update-alternatives — install /usr/bin/python python /usr/bin/python2.7</blockquote><blockquote>sudo update-alternatives — install /usr/bin/python python /usr/bin/python3.6</blockquote><h4>C-Changing the default python:</h4><blockquote>update-alternatives — config python</blockquote><p>And select python3.6</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/0*jkCUCgcAZxApPjn1" /></figure><p>You should now have python3.6 by default</p><h4>D-Install pip3:</h4><blockquote>sudo apt install python3-pip</blockquote><h4>E- You also have to install PyYAML ( example 5.1 ):</h4><blockquote>pip install PyYAML==5.1</blockquote><h4>F- Install Requirement and elastalert</h4><blockquote>cd /etc/elastalert</blockquote><blockquote>pip3 install “setuptools&gt;=11.3”</blockquote><blockquote>python setup.py install</blockquote><h4>G- Creating index :</h4><blockquote>cd /usr/local/bin/</blockquote><blockquote>./elastalert-create-index</blockquote><p>ES Host : localhost</p><p>ES Port : 9200</p><p>Use ssl : t</p><p>Verify ssl :f</p><p>We will use the default ES_username : admin and ES_password : admin</p><p>Also keep the default answer for the rest of questions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/0*wEQEfxAhCtZZ3qna" /></figure><h3>1.3- Setting up the API server :</h3><p>Configure the API server <strong>/etc/elastalert-server/config/config.json</strong> with:</p><ul><li>An <em>absolute path</em> to your elastalert folder for elastalertPath : /etc/elastalert</li><li>The address of your elasticsearch instance for es_host : elasticsearch</li><li>The same writeback_index from the config.yaml : elastalert_status</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/367/0*50aXpnQ2bhuxSJKG" /></figure><h4>A- Troubelshooting Alert Logs ( No Data ) :</h4><p>The metadata handler specific to the alert logging writeback index, is searching for documents with a _type of elastalert. Since 7.x, this returns no results, because all documents have a _type of _doc.</p><p>So in your Alert Log ( in Praeco Interface Later ) you will see No Data.</p><p>So you have to :</p><blockquote>cd /etc/elastalert-server/src/handlers/metadata/</blockquote><blockquote>nano get.js</blockquote><p>remove the line containing type: ‘elastalert’,</p><p>Now you will be able to see your alert logs in your praeco interface</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/0*_U4fLzkBderIlGvM" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/0*nk5dJ6Dy8EPND4dS" /></figure><h4>B-Install Elastalert-Server :</h4><blockquote>sudo npm install</blockquote><blockquote>sudo npm run start</blockquote><p>You should see this line if it started successfully. This is just a warning because of the insecure connection ( SSL_verify = False ).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xfu7J5VhW2ikCW1R" /></figure><h3>1.4- Setting up Praeco :</h3><h4>A- Change Configuration files :</h4><blockquote>cd /etc/praeco/config</blockquote><blockquote>nano api.config.json</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/0*hUmFdKWUpbS1kR1u" /></figure><blockquote>nano elastalert.yml</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/0*JjxJAFTw1_Zb4C-T" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*dyH26xbXhqwdE3cJ" /></figure><h4>B- Install Praeco :</h4><blockquote>sudo npm install</blockquote><p>export PRAECO_ELASTICSEARCH=localhost</p><h4>C- Copy BaseRule.cfg :</h4><p>Before starting the services you have to :</p><blockquote>cp /etc/praeco/rules/BaseRule.config /etc/elastalert/rules/</blockquote><p>This file contains Settings for Slack , SMTP and Telegram</p><p>Here we will add the Slack Webhook URL used in Section 2</p><blockquote>cd /etc/elastalert/rules/</blockquote><blockquote>nano BaseRule.config</blockquote><p>add the Webhook URL</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/0*ZvkBnzmuHa-QeZHK" /></figure><h4>D- Start Praeco :</h4><blockquote>npm run serve</blockquote><p>You should now see the UI running at <a href="http://yourserverip:8080/">http://yourServerIP:8080</a>.</p><p>Here is your Praeco Interface</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V7VXKrsUsdaROnFF" /></figure><h3>2- Creating Rules:</h3><h4>2.1.- Creating Rules with Praeco Interface and sending them to slack webhook :</h4><p>Navigate to Rules — -&gt; Add Rule:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uPYRWVEaP__rLgGn" /></figure><p>Now, you can see that creating the rule is very similar to Open Distro Alerting Tool, we will filter the alert and specify the destination.</p><p>Click on UNFILTERED and specify the filter manually or using the prebuild tool.</p><p>Then Click Close</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OZuQR60ZueuU8-v3" /></figure><p>We will use Slack notifications, with the Same Webhook URL used in Section 2 and same channel ( #test)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2Zm-iAw7oG0tHS1a" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/0*_kO29ZWoYZwus-A-" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/0*lWxnuue61ydCZJiR" /></figure><p>Click Save</p><p>Your Alert is enabled by default</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/0*uEpMelFM9dyYF6mz" /></figure><p>We can check that the alerts were successfully sent to Slack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/0*gT9uwMBHi35dKKJ_" /></figure><p>In our slack channel:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nH3sWVIaxdg0kElA" /></figure><h3>2.2- Sending Alerts from ElastAlert to TheHive</h3><p>Unfortunately, Praeco does not provide an alert output to TheHive, so we will be editing our rules manually and sending them using elastalert-server.</p><p>With this workaround, rules will be working well in the background thanks to Elastalert-server, they will be also present in Praeco interface but unfortunately, we will not be able to edit or configuring them using Praeco interface.</p><p><strong>A- Creating a rule: “</strong>User_creation”:</p><p>First, we will create our rule from Praceo Interface like we did before, we will specify <strong>any</strong> <strong>URL</strong> in our HTTP output because we will be removing it later on.</p><p>When you finish click Save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jCoAK_1rvcxCJXIe" /></figure><h4>B- Shipping alerts to Thehive:</h4><p>Add TheHive setting , Save and restart Elastalert-Server</p><p>Go to /etc/elastalert/rules</p><blockquote>nano User_creation.yml</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/0*688BzBS2-GJsmlht" /></figure><h4>C- Checking alerts in Praeco :</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/0*2Vq0MLsam0QFikyb" /></figure><p>Our Alert was successfully sent to the Hive</p><p>Unfortunately, as we mentioned before, the rule will not be editable with Praeco Interface, you will have to edit it manually in /etc/elastalert/rules :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-5X11ApAF-enIaoR" /></figure><h4>D- Checking alerts in TheHive Interface:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*I-RksKR4QjEuhHer" /></figure><h3>2.3- Get help with Sigma tool to create rules :</h3><p>As mentioned before, Sigma tool helped us convert sigma rules in multiple formats including Elastalert.</p><p>Project URL with detailed steps : <a href="https://github.com/Neo23x0/sigma.git">https://github.com/Neo23x0/sigma.git</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xdEGlgZXtaGggcdF" /></figure><h4>A- Download Sigma tool</h4><p>cd ~</p><p>git clone <a href="https://github.com/Neo23x0/sigma.git">https://github.com/Neo23x0/sigma.git</a></p><h4>B- Create your alert using sigma tool</h4><p>cd ~/sigma/tools</p><p>pip3 install -r requirements.txt</p><p>Execute ( example of rule ) :</p><p>./sigmac -t elastalert -c winlogbeat ../rules/windows/builtin/win_user_creation.yml</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/0*OPJ5XlFtMq8LXmNn" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/0*zLVhlNwbI3cLu50d" /></figure><p>Unfortunately, this rule can’t be directly used by ( Praeco/Elastalert-Server ) because of several missing fields. <br> So, you can pick the important information from this rule (the query string) and create your own rule in Praeco interface with this information. <br> This tool is very important because it helps you to gather information about a lot of rules and their query strings.</p><p>Note: Sometimes you have to check your logs in (Kibana → Discover Interface) and their fields to make sure that name fields in your logs match with name fields in sigma rules. If your fields show a yellow error, go to index pattern, choose the index to match and click refresh fields.</p><h3>2.4- Sending Wazuh Alerts to theHive :</h3><p>We will use the same workaround mentioned before for wazuh alerts , first we will create wazuh-alerts using praeco interface then we will edit the rule file manually to add theHive output :</p><h4>A- Create a wazuh rule and save it :</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZJqtd3HF1kA-mlSR" /></figure><p>We have used to filter the rule with rule.id ( you can pick any other field )</p><p>You can get rules id under wazuh → Overview → Security events</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7czzQYKOdR0ahcKk" /></figure><h4>B-Edit the rule and restart elastalert-server :</h4><blockquote>nano /etc/elastalert/wazuh-alert-TEST.yaml</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/0*FP3PBh_5T_vjD6kM" /></figure><h4>C- Checking alerts :</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/0*bhirJRa1l4wlS64y" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b4PrIg1rfifn22Wl" /></figure><p>Thank you for your Time. We hope you liked this article and got a better understanding of the alerting system used in our project. See you in the next article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=136cf6258c49" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Welcome to our fourth article of this series.]]></title>
            <link>https://medium.com/@ibrahim.ayadhi/welcome-to-our-fourth-article-of-this-series-2d5606221c0?source=rss-7e31712e1ff1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d5606221c0</guid>
            <dc:creator><![CDATA[Ibrahim Ayadhi]]></dc:creator>
            <pubDate>Tue, 14 Apr 2020 18:24:12 GMT</pubDate>
            <atom:updated>2020-04-14T18:29:49.140Z</atom:updated>
            <content:encoded><![CDATA[<h3>Wazuh Integration</h3><p>Welcome to our fourth article of this series. I encourage you all to check the <a href="https://medium.com/@ibrahim.ayadhi97/deploying-of-infrastructure-and-technologies-for-a-soc-as-a-service-socass-8e1bbb885149">previous article</a> to have a better understanding of what we are going to discuss here.</p><p>Moving along in our project now that we have completed the SIEM part. It is the time to transform our solution from a simple observer to an active responder. One of the important tools that we have used is Wazuh. In This article we hope to enlighten you about the advantages offered by this tool. As well as how to deploy it and use it.</p><p>The article is divided into these sections:</p><ul><li><strong>Installation of Wazuh server and agent</strong></li></ul><p><strong>Installing the Wazuh-Server</strong></p><p><strong>Installing the Wazuh-agent</strong></p><p><strong>Installing the app and integration with kibana</strong></p><p><strong>Configuring and connecting the agents</strong></p><ul><li><strong>Active response</strong></li></ul><h3>1- Installation of the wazuh server and the agent</h3><h4>Wazuh is a free, open source and enterprise-ready security monitoring solution for threat detection, integrity monitoring, incident response and compliance. These are some definition you need to know.</h4><ul><li><strong>Wazuh server:</strong> Runs the Wazuh manager, API and Filebeat. It collects and analyzes data from deployed agents.</li><li><strong>Wazuh agent</strong>: Runs on the monitored host, collecting system log and configuration data and detecting intrusions and anomalies. It talks with the Wazuh server to which it forwards collected data for further analysis.</li></ul><h4><strong>1.1-</strong> Introduction to Wazuh server architecture :</h4><p>The Wazuh architecture is based on agents running on monitored hosts that forward log data to a central server. Also, agentless devices (such as firewalls, switches, routers, access points, etc.) are supported and can actively submit log data via syslog and/or a periodic probe of their configuration changes to later forward the data to the central server. The central server decodes and analyzes the incoming information and passes the results along to an Elasticsearch cluster for indexing and storage.</p><p>We will be using the <strong>Single-host architecture (HIDS)</strong> which his the following :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/0*cGUl5M36C7eJDV1_" /></figure><p>For more details about the other architecture. Check the official website:</p><p><a href="https://documentation.wazuh.com/3.8/getting-started/architecture.html">https://documentation.wazuh.com/3.8/getting-started/architecture.html</a></p><h4><strong>1.2- Installation of the Wazuh manager and API and Filebeat</strong></h4><p>Here we will provide you with the official site of wazuh for the installation</p><p><a href="https://documentation.wazuh.com/3.12/installation-guide/installing-wazuh-manager/linux/ubuntu/wazuh_server_packages_ubuntu.html#wazuh-server-packages-ubuntu">https://documentation.wazuh.com/3.12/installation-guide/installing-wazuh-manager/linux/ubuntu/wazuh_server_packages_ubuntu.html#wazuh-server-packages-ubuntu</a></p><p>After installing we have to configure the configuration file of filebeat : you can connect filebeat to elasticsearch output or logstash output. In our case , we will setup the elasticsearch output with no ssl verification ( we can see here that only the alerts module is enabled )</p><blockquote><strong>cd /etc/filebeat</strong></blockquote><blockquote><strong>nano filebeat.yml</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/0*aU4dW8qHQlp7Iv_X" /></figure><p>Now will setup the index template and start the 3 services :</p><blockquote><strong>filebeat setup — index-management</strong></blockquote><blockquote><strong>service filebeat start</strong></blockquote><blockquote><strong>service wazuh-manager start</strong></blockquote><blockquote><strong>service wazuh-api start</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/0*KdxTIQa-ClDMRfZW" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/0*L_JIfACqmXWZcTk-" /></figure><h4><strong>1.3- Installation of the wazuh-agent</strong></h4><p>Use this link for the installation</p><p><a href="https://documentation.wazuh.com/3.12/installation-guide/installing-wazuh-agent/linux/ubuntu12.04-or-greater/wazuh_agent_package_ubuntu12.04_or_greater.html#wazuh-agent-package-ubuntu12-04-or-greater">https://documentation.wazuh.com/3.12/installation-guide/installing-wazuh-agent/linux/ubuntu12.04-or-greater/wazuh_agent_package_ubuntu12.04_or_greater.html#wazuh-agent-package-ubuntu12-04-or-greater</a></p><p>check if the wazuh-agent is running properly :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/0*lZhAJPkdsV6hCmzx" /></figure><h4><strong>1.4- Installation of the wazuh app and integration with Kibana :</strong></h4><p>This app will be the bridge between the Wazuh server and the Kibana of the elk that we have previously installed.</p><p>This app is only provided on a git hub repository and not within the official web site.</p><p>We will be installing the wazuh app with is compatible with the ELK Stack 7.6.1. To do so.</p><blockquote><strong>cd /usr/share/kibana</strong></blockquote><blockquote><strong>sudo -u kibana bin/kibana-plugin install </strong><a href="https://packages.wazuh.com/wazuhapp/wazuhapp-3.12.2_7.6.1.zip"><strong>https://packages.wazuh.com/wazuhapp/wazuhapp-3.12.2_7.6.1.zip</strong></a></blockquote><p>It is recommended to increase the heap size of Kibana to ensure the plugin installation:</p><blockquote><strong>cat &gt;&gt; /etc/default/kibana &lt;&lt; EOF</strong></blockquote><blockquote><strong>NODE_OPTIONS=” — max_old_space_size=2048&quot;</strong></blockquote><blockquote><strong>EOF</strong></blockquote><p>Restart Kibana :</p><blockquote><strong>systemctl restart kibana</strong></blockquote><p>You can check the all the available versions in this site:</p><p><a href="https://github.com/wazuh/wazuh-kibana-app">https://github.com/wazuh/wazuh-kibana-app</a></p><p>Now in your kibana you should see that the symbol of wazuh appeared in the left tab of your kibana. Click on it. The wazuh api will open. Take some time to explore it. You should get something similar to this. You will not have any agents connected to it for now. In the coming part we will discuss how to connect your agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/0*H3sUPUNgFsnBpWRR" /></figure><h4><strong>1–5 Connecting and configuring the agents</strong></h4><p>There are many ways to register the agent. In this article we will use the manual way. <br> <br>In the CLI of the Wazuh manager host, we will run manage_agents to add the agent. In this example, we are going to add a new agent. To do that type</p><p><strong>/var/ossec/bin/manage_agents</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/0*iXqlboZVZPn_7of1" /></figure><p>Select the add agent by typing A and hitting enter. <br>then we enter the name that we want to give to our machine in this case user1 <br>we type the IP of the endpoint device. Note that if you don’t have a static IP address for the endpoint device you can use the keyword (any) instead of the IP address. <br>Once done, hit enter <br> <br>Now we are going to extract the secret key that will enable our agent to connect to the wazuh server. <br>To do that this time we will select the option E extract key for an agent. Then we type the id of our agent and this case I have chosen the agent with the id 001.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/0*XUGAHmzRqxY5YQDp" /></figure><p>Once you have added the agent in the Wazuh manager host, open a session in your Linux agent host as root user. After that, let’s import the key and connect the agent to the manager.</p><p>Type the following</p><blockquote><strong>/var/ossec/bin/manage_agents -i “Your_Secret_key”</strong></blockquote><p>You should get a result like this type y and hit enter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/0*zZDlyJCXfoY39XU4" /></figure><p>One more step to go</p><p>Edit the Wazuh agent configuration in /var/ossec/etc/ossec.conf to add the Wazuh server IP address. In the &lt;client&gt;&lt;server&gt; section, change the MANAGER_IP value to the Wazuh server address. The address of the Wazuh server can be an IP address or a DNS name:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*0HrYb_sMqXw0FcIg" /></figure><h4><strong>1.6- Checking received Data :</strong></h4><p>To check if ELK is receiving data from the wazuh server. Go to index Management. You should get something similar to this ( wazuh-alerts and wazuh-monitoring )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZIgomjfch8BEMj5m" /></figure><h3>2. Wazuh active response :</h3><p>Wazuh provides an active response module to handle automatic response to specific alerts that you configure on the Wazuh-manager.</p><p>An active response is a script that is configured to execute when a specific alert, alert level or rule group has been triggered. Active responses are either stateful or stateless responses. Stateful responses are configured to undo the action after a specified period of time while stateless responses are configured as one-time actions.</p><p>For example, if we want to automatically block certain IP based certain logs coming from your endpoint device showing that they are performing Bruteforce attack whether it is RDP or SSH depending on the OS of the host.</p><p>We can create an active-response that will block the IP of the attacker when it matches the behavior with the ruleset stored on Wazuh. We will take the example of an SSH-Bruteforce. We will consider 8 failed logins as an attempt of attack. When this event happens the rule “5712 — SSHD brute force trying to get access to the system.” Will be triggered. Thus, the command of blocking the IP is executed.</p><p>First, we need to define the command that we’ll use for the response.</p><p>OSSEC comes with a set of common scripts used in active response. These scripts are in /var/ossec/active-response/bin/ in the server machine. We are going to use the firewall-drop.sh script that should work with common Linux/Unix operating systems and it allows the blocking of a malicious IP using the local firewall.</p><p>Define the command in the ossec.conf of your OSSEC Manager:</p><blockquote><strong>nano /var/ossec/etc/ossec.conf</strong></blockquote><p>We are going to use the firewall-drop.sh script that should work with common Linux/Unix operating systems and it allows blocking of a malicious IP using the local firewall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/0*J2Xz4J-bcFxJVlOT" /></figure><p>Next and in the same file, we configure OSSEC to run the active response. The main fields are:</p><p><strong>-command</strong>: The command previously defined (firewall-drop).</p><p><strong>-location</strong>: Where the command should be executed. We want to execute it on the agent that reported the event. So, we use local.</p><p><strong>-rules_id</strong>: The command is executed if the rule 5712 is fired.</p><p><strong>-timeout</strong>: Block the IP for 60 seconds on the firewall (iptables, ipfilter, etc)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/0*uPGp5AWhU40nASh7" /></figure><p>Then save the modification and close the file. Restart the wazuh-manager with the command:</p><blockquote>Service wazuh-manager restart</blockquote><p>Now on your wazuh-agents hosts, don’t forget to modify the file <strong>ossec.conf</strong> and add:</p><blockquote>&lt;active-response&gt;</blockquote><blockquote>&lt;disabled&gt;no&lt;/disabled&gt;</blockquote><blockquote>&lt;/active-response&gt;</blockquote><p>Now you can try to bruteforce the SSH on your host machine where the Wazuh agent is installed and you’ll be blocked for 60 secondes after 8 failed logins .</p><p>For more details on Wazuh active respone , you can check :</p><p><a href="https://documentation.wazuh.com/3.7/user-manual/capabilities/active-response/how-it-works.html">https://documentation.wazuh.com/3.7/user-manual/capabilities/active-response/how-it-works.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d5606221c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Visualizing Dashboards and ELK SIEM]]></title>
            <link>https://medium.com/@ibrahim.ayadhi/visualizing-dashboards-and-elk-siem-c4a669f3fae8?source=rss-7e31712e1ff1------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4a669f3fae8</guid>
            <dc:creator><![CDATA[Ibrahim Ayadhi]]></dc:creator>
            <pubDate>Mon, 13 Apr 2020 21:49:37 GMT</pubDate>
            <atom:updated>2020-04-13T21:49:37.319Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to our second article of this series. I encourage you all to check the <a href="https://medium.com/@ibrahim.ayadhi97/deploying-of-infrastructure-and-technologies-for-a-soc-as-a-service-socass-8e1bbb885149">previous article</a> to have a better understanding of what we are going to discuss here.</p><p>The article is divided into these sections:</p><p><strong>1- Walk-through ELK SIEM</strong></p><p><strong>2- default dashboards</strong></p><p><strong>3- Creating your first Dashboards</strong></p><h3>1-Walk-through ELK SIEM</h3><p>ELK SIEM was recently added to the elk Stack in the 7.2 release in 25th of June 2019</p><p>It is a SIEM solution created by elastic.co to make the life of security analyst much easier and less tedious.</p><p>In our solution we decided to create our own SIEM and choose our own dashboard.</p><p>But, we believe that it is fundamental to have a look at ELK SIEM first</p><p><strong>1.1- Host events section:</strong></p><p>First, we will be covering the host section. The host section will enable you to see events that are generating within the endpoint itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iU6zHWR_qK06y0An" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Nf_NeDabnVfW4wq5" /></figure><p>After clicking on view hosts, you should get something like this. As you can see, we have three hosts connected to this machine:<br>1 Windows 10.<br>2 Ubuntu server 18.04.</p><p>We have several displayed Visualization each one is displaying different type of events.<br>For example the one in the middle is showing data about the logins in all of the three machines.<br>This amount of data you are seeing here has been collected over five days. Thus explaining the large number of failed and successful logins. You will probably have a small number of logs so no worries</p><p><strong>1.2- Network events section :</strong></p><p>Moving on to the network section, you should be getting something like this. This section will enable you to have an eagle eye on everything that is happening within your network from HTTP /TLS traffic to DNS traffic and event external alerts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3Udu5KI4UhHwBDJ0" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tUhLfx0m4tWRBHXN" /></figure><h3>2- Default dashboards :</h3><p>In order to make life easier for users. The developers of elastic.co have created a default dashboard for each beat officially supported by ELK. Our beats where no exception to this rule. Here I will be taking as example the default dashboards of Packetbeat.</p><p>If you have followed the step of the second article correctly. You should have your dashboard already set and waiting for you. So, let get going.<br>On the left tab of Kibana select the symbol of the dashboard. It is the third one counting from above.<br>Type the name of the beat in the search tab<br>If the beat has several modules. A dashboard of each single one of them will be created. But only the one with the active module will be displaying non-empty data.</p><p>Select the one with the name of your module.</p><p>This is the main dashboard <strong>PacketBeat</strong> overview.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*n2yVBxYyILdDJlex" /></figure><p>This is the dashboard of the network flows. It will inform us about the incoming and outgoing packet. IP sources and destination and a lot of useful of information for a security operation center analyst.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*T9h70Ue3xd2idCLB" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s6B-yiMLKvPpUF7D" /></figure><h3>3- Creating your first dashboard</h3><h4>3–1- Basic Concepts:</h4><h4>A- Types of dashboards:</h4><h4>These are the various types of visualizations you can use to visualize your data.</h4><p><strong>for example we have</strong> :</p><ul><li>Bar chart</li><li>Map</li><li>Markdown widget</li><li>Pie chart</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/0*Kie3XTHn8sEAqbXc" /></figure><h4>B- KQL (Kibana Query Language):</h4><p>Is the language used by kibana to search through the data in an user friendly way. It enables you to check if certain data exists and many other useful features. To know more you can check this link</p><p><a href="https://www.elastic.co/guide/en/kibana/current/kuery-query.html">https://www.elastic.co/guide/en/kibana/current/kuery-query.html</a></p><p>This is an example of a query to search for host with a windows 10 pro system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Fejtb_ieELFFLjdE" /></figure><p><strong>C- Filters:</strong></p><p>This feature will enable you filter through certain parameters for example hosts name, the code or id of an event, etc. Filters will incredibly improve the investigation phase in terms of time and efforts spent in searching for clues.</p><p><strong>D- First Visulaization :</strong></p><p>We will create a visualization for MITRE ATT&amp;CK.<br>First we need to go to.<br><strong>Dashboard → Create new dashboard→create new →Pie dashboard<br></strong>Set the type to <strong>index pattern</strong> then tap the name of your beat.</p><p>Press Enter. By now you should be seeing a green donut.<br>In Buckets on the left, you will find:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/311/0*Y4DARI2h4nxJEm6k" /></figure><p>- Split slices will split the donut into different<br>parts depending on the variance of the data.</p><p>- Split Chart will create another donut next to.<br>this one.</p><p>We will be using split slices.<br>In aggregation select terms. We will be visualizing our data depending on a term of our choice. In this case the term will be related to MITRE ATT&amp;CK.</p><p>In Winlogbeat the filed that will be providing us with this information is called:</p><p><strong>winlog.event_data.RuleName</strong></p><p><strong>We will set the count metric in order by to order the events depending on the number of their occurrences.</strong></p><p>Enable Group other values in the separate bucket.<br>This will come handily if the terms that you have chosen have so many different values coming from the beat. It helps you visualize the rest of data as one. Which will gives you an insight of the percentage of rest of events.</p><p>Now that we have finished configuring the data tab, let’s move to the options tab</p><p>You should realize the following ones:</p><p>** Remove the donut shape to have a full circle in the visualization.</p><p>** Chose the legend position you like. In this case we will display them on the right.</p><p>** Set show values to make them appear next to their slice for easier reading,and keep the rest to default</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/0*RncSB1g2LEdMw6R_" /></figure><p><strong>Truncate determine how much you want to display from the name of the event.</strong></p><p>Set the time you want the visualization to start from and then click the blue square.</p><p>You should get something similar:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4JUWlAsiCVZ1SUfq" /></figure><p>You can also add a filter to your visualization to filter through certain host you would like to check or any parameters that you think are useful for your objective. The visualization will only display data matching the rule placed inside the filter. In this case we will display the MITRE ATT&amp;CK data coming from the host called win10 only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/0*s3s0VtLis1z3u-90" /></figure><h4>3–2- Creating your first dashboard:</h4><p>A dashboard is a collection of many visualization. Your dashboards should be clear easy to understand and with useful and deterministic data. Here is an example of dashboards that we have created from zero for winlogbeat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*talFnPL6Gi3H3p8y" /></figure><p>Thank you for your time. I hope this article was of use to you. If you want more details about the subject, we recommend that you check the official site.</p><p><a href="https://www.elastic.co/guide/en/kibana/current/tutorial-visualizing.html">https://www.elastic.co/guide/en/kibana/current/tutorial-visualizing.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4a669f3fae8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A walk-through open Distro]]></title>
            <link>https://medium.com/@ibrahim.ayadhi/a-walk-through-open-distro-9e5a03bdcbd6?source=rss-7e31712e1ff1------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e5a03bdcbd6</guid>
            <dc:creator><![CDATA[Ibrahim Ayadhi]]></dc:creator>
            <pubDate>Sun, 12 Apr 2020 20:21:34 GMT</pubDate>
            <atom:updated>2020-04-12T20:56:09.825Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to our third article of this series. I encourage you all to check the <a href="https://medium.com/@ibrahim.ayadhi97/deploying-of-infrastructure-and-technologies-for-a-soc-as-a-service-socass-8e1bbb885149">first article</a> to have a better understanding of what we are going to discuss here.</p><p><strong>open Distro available plugins are :</strong></p><ul><li>Security</li><li>Alerting</li><li>SQL</li><li>Index State Management</li><li>Performance Analyzer</li></ul><h4>In our project we installed just the security and alerting plugins.</h4><h3>1- Alerting Feature :</h3><p><strong>Open Distro for Elasticsearch allows you to monitor your data and send alerts automatically to your stakeholders. It is easy to setup and manage and it uses Kibana interface with a powerful API.</strong></p><p>Alerting feature allows you to setup rules so that you can be notified when something of interest changes in your data. Anything you can query on, you can build an alert on that. The Alerting feature notifies you when data from one or more Elasticsearch indices meets certain conditions.</p><p>This URL provides the versions history of opendistro ( in our case we will use <strong>1.6.0 </strong>) :</p><p><a href="https://opendistro.github.io/for-elasticsearch-docs/version-history/">https://opendistro.github.io/for-elasticsearch-docs/version-history/</a></p><p>To add the alerting feature of opendistro you have to manage plugins for elasticsearch and kibana : managing plugins is under</p><ul><li><strong>/usr/share/elasticsearch</strong> : for Elasticsearch</li><li><strong>/usr/share/kibana</strong> : for Kibana</li></ul><p><strong>1.1- Install Alerting plugin for elasticsearch :</strong></p><blockquote>cd /usr/share/elasticsearch</blockquote><blockquote>sudo bin/elasticsearch-plugin install <a href="https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-sql/opendistro_sql-1.6.0.0.zip">https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-sql/opendistro_sql-1.6.0.0.zip</a></blockquote><p><strong>1.2- Install the corresponding alerting plugin for kibana :</strong></p><blockquote>cd /usr/share/kibana</blockquote><blockquote>sudo bin/kibana-plugin install — allow-root <a href="https://d3g5vo6xdbdb9a.cloudfront.net/downloads/kibana-plugins/opendistro-alerting/opendistro-alerting-1.6.0.0.zip">https://d3g5vo6xdbdb9a.cloudfront.net/downloads/kibana-plugins/opendistro-alerting/opendistro-alerting-1.6.0.0.zip</a></blockquote><p><strong>1.3- To list your plugins or remove them , you can use these commands :</strong></p><p>- For <strong>Kibana</strong> :</p><blockquote>sudo bin/kibana-plugin list</blockquote><blockquote>sudo bin/kibana-plugin remove &lt;plugin-name&gt;</blockquote><p>- For <strong>elasticsearch</strong> :</p><blockquote>sudo bin/elasticsearch-plugin list</blockquote><blockquote>sudo bin/elasticsearch-plugin remove &lt;plugin-name&gt;</blockquote><p><strong>1.4- Now you should restart kibana and elasticsearch :</strong></p><blockquote>systemctl restart kibana elasticsearch</blockquote><p><strong>NOTE : </strong>after installing , removing or updating plugins for elasticsearch or kibana , it takes about few minutes to restart properly ,meanwhile your kibana server will be responding with ( kibana is not ready yet ). You could check kibana and elasticsearch processes in real time with command top.</p><p><strong>1.5- Now you can check your plugins in kibana interface :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/0*sK25Z5HSYaBDi83R" /></figure><p><strong>1.6- Working with alerting plugin :</strong></p><p><strong>a ) Creating Slack webhook URL :</strong></p><p><a href="https://slack.com/"><strong>Slack</strong></a><strong> is a workplace</strong> communication tool, “a single place for <a href="https://slack.com/features">messaging, tools and files</a>.” This means Slack is an instant messaging system with lots of add-ins for other workplace tools.</p><p><strong>Incoming Webhooks</strong> are a simple way to post messages from apps into Slack. Creating an Incoming Webhook gives you a unique URL to which you send a <a href="https://en.wikipedia.org/wiki/JSON">JSON</a> payload with the message text and some options. You can use all the usual <a href="https://api.slack.com/reference/surfaces/formatting">formatting</a> and <a href="https://api.slack.com/messaging/composing/layouts">layout blocks</a> with Incoming Webhooks to make the messages stand out.</p><ul><li><strong>First create an account ( slack.com)</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c6Ov_id1nDbKagfI" /></figure><ul><li><strong>Choose the second if you are new in Slack ( you don’t belong to any workspace )</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/0*Julrwo-M4dEdnWsX" /></figure><ul><li><strong>Get the code that you just received in your mailbox and create your new workspace</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/0*LdhoQdUtw7E8LTl3" /></figure><ul><li><strong>Try to follow the steps until your reach your home page , Go to application and search for Incoming Webhook, click add :</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rifYo9O4wiz-2nzC" /></figure><ul><li><strong>Click add to Slack</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6zFrcZ9vxPorzZcq" /></figure><ul><li><strong>Choose a channel to receive messages ( for example test ) and click add integration</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*xOko0MHgd9FvDIb1" /></figure><ul><li><strong>Now scroll down until you find your Webhook URL ( save it because we will use it later )</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v3QgQTDUAJ_ftfpA" /></figure><ul><li><strong>Go to Kibana → Alerting → Destination and click add destination :</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TtjuxJd3cIJ2ExyE" /></figure><ul><li><strong>Choose Destination name , Pick Slack destination , Copy the your Webhook URl and click create</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bYCy5lFUu6BmYdQE" /></figure><p><strong>1.6.2- Creating Alerts and sending them to Slack :</strong></p><ul><li>Now go to Monitoring and click Create Monitor :</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DraLjJBwMOO7LmWx" /></figure><ul><li>Setup your settings : you can use Graphical setup or extraction query setup</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/0*o-TkaokuXHxLPEWj" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/0*GYCi11LTyuXugBQK" /></figure><p>Here an example of Graphical Setup ( Event ID: 4624 means that an account has successfully logged on )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hNDtokc7f6eMUs8Q" /></figure><ul><li>Check you Monitor Schedule and click create</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/0*go3bkZ8_g_LbkrNE" /></figure><p>Now you should create a trigger , For example :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KX5-uxllSe6nFcRS" /></figure><p>Now go to notification and select the destination that you have created then click create :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/0*RttkfucwjkXAP1Wt" /></figure><p>Now you can follow your alerts in Kibana Alerting interface and every alert will be sent to your Slack Channel :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f0-eJaxV5hdVrodR" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kHk08kikPkg4n6mK" /></figure><p>Go to your slack channel ( #test channel in this tutorial ) and wait for your alerts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D3km9krSczCpuNNx" /></figure><h3>2- Security Feature :</h3><h3>This plugin provides a user interface for managing users, roles, mappings, action groups, and tenants.</h3><p><strong>2.1-</strong> <strong>Installing security plugin :</strong></p><p>The choice of this pluging was made because Kibana does not come with an authentication panel in the basic version. Thus to ensure the security of our interfaces we will be using the free authentication panel offered by open distro.</p><p>You can follow the same steps <strong>( from 1 to 4 )</strong> as installing alerting plugin to install security plugins. You just have to change the URL install plugin :</p><p>For <strong>Kibana</strong> :</p><blockquote>sudo bin/kibana-plugin install — allow-root <a href="https://d3g5vo6xdbdb9a.cloudfront.net/downloads/kibana-plugins/opendistro-security/opendistro_security_kibana_plugin-1.6.0.0.zip">https://d3g5vo6xdbdb9a.cloudfront.net/downloads/kibana-plugins/opendistro-security/opendistro_security_kibana_plugin-1.6.0.0.zip</a></blockquote><p>For <strong>Elasticsearch</strong> :</p><blockquote>sudo bin/elasticsearch-plugin install <a href="https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-security/opendistro_security-1.6.0.0.zip">https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-security/opendistro_security-1.6.0.0.zip</a></blockquote><p><strong>A warning message will be displayed : type y</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/0*KWCkbBKCroOUHdMU" /></figure><ul><li>After installing the Security plugin, you can run :</li></ul><blockquote>sudo sh /usr/share/elasticsearch/plugins/opendistro_security/tools/install_demo_configuration.sh</blockquote><p>to quickly get started with demo certificates.</p><p>Otherwise, you must configure it manually and run <a href="https://opendistro.github.io/for-elasticsearch-docs/docs/security-configuration/security-admin/"><strong>securityadmin.sh</strong></a>.</p><p>We will use the <strong>first option</strong> :</p><blockquote>cd /usr/share/elasticsearch/plugins/opendistro_security/tools/</blockquote><blockquote>change permission if required : chmod +x install_demo_configuration.sh</blockquote><blockquote>execute : ./install_demo_configuration.sh</blockquote><p>For all question type y and the default credentials are ( <strong>Username : admin </strong>/ <strong>Password: admin</strong> )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/0*4HRYXNmPx6tlwuPY" /></figure><p>Another configuration will be added by open distro security in your<strong> /etc/elasticsearch/elasticsearch.yml</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*PS-UI_pejXDT1KaS" /></figure><p><strong>2.2- Changing configuration for elasticsearch logstash and kibana :</strong></p><p>In our case we will make a username, password and SSL certificate for elasticsearch , we want to mention that the verification of the certificate in this section and in all other upcoming sections is beyond the scoop of these articles.</p><p><strong>2.2.1- For Elasticsearch :</strong></p><p><strong>Disabling x-pack security feature for elasticsearch : </strong>When restarting elastic you will probably get an error because of xpack security feature enabled by default for the ELK Stack Basic Version , so you will have to disable it in<strong> /etc/elasticsearch/elasticsearch.yml </strong>before restarting your service.</p><p><strong>2.2.2- For Kibana:</strong></p><p><strong>Disabling x-pack security feature for kibana : </strong>Also for kibana we have to disable the xpack.security feature and ignore ssl verification in <strong>/etc/kibana/kibana.yml</strong></p><p><strong>NOTE </strong>: Make sure that your protocol is <strong>https instead of http</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/0*Ak5-oJnC2jv5l-uD" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/0*CIVs_UbydaEJYtvS" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/0*iLf3Rj1DITXROCo4" /></figure><p><strong>2.2.3- For Logstash:</strong></p><p>As our beats are not connected directly to elasticsearch , they are instead connected to logstash , so we don’t have to manage our beats or reconfigure them , we have only to configure logstash configuration file.</p><p><strong>Make sure that your protocol is https instead of http</strong></p><blockquote><strong>sudo nano /etc/logstash/conf.d/logstash.conf</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/0*e648UVqeglHYyoa9" /></figure><p><strong>NOTE : if you are reconfiguring beats or setting up another beat while your elasticsearch has the security plugin installed with username , password and SSL certificate you can add this configuration to your beat to make it reachable. Make sure that your protocol is https instead of http.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/0*575s1f86QIe9E2xH" /></figure><p><strong>2.3- Resart all of your services :</strong></p><blockquote><strong>systemctl restart elasticsearch</strong></blockquote><blockquote><strong>systemctl restart logtash</strong></blockquote><blockquote><strong>systemctl restart kibana</strong></blockquote><p>As mentioned before it may takes few minutes to restart properly and you check that with top command in real time. <strong>meanwhile your kibana server will be responding with ( kibana is not ready yet ).</strong></p><p>Now your ELK stack is connected properly with new security credentials.</p><p>You can check that by using the Elasticsearch URL ( http will not work, you have to use https instead )</p><p><a href="https://your_elasticsearch_ip:9200/"><strong>https://your_elasticsearch_ip:9200</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/0*-VUFomeJht-hM6oq" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/0*7IJw4T07jhLzhGwE" /></figure><p>You can check it in Kibana also :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/0*uIE2redEbKP8uOQY" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Jkb2G3eL5KocZrrM" /></figure><p>Here, you can create users , assign roles and permissions :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/0*tBHC8iQnX8o3Gu6o" /></figure><p>This will help you organize the SOC teams based on roles and actions and privileges.</p><p>Here are Roles and Internal Users Database defined by default:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iQQ-2jBolixLvaq9" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1WNMvuGrBpJM_t0X" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e5a03bdcbd6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ELK stack: Installation and shipping data]]></title>
            <link>https://medium.com/@ibrahim.ayadhi/elk-stack-installation-and-shipping-data-2b7c903d5a71?source=rss-7e31712e1ff1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b7c903d5a71</guid>
            <category><![CDATA[soc]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[elk]]></category>
            <category><![CDATA[siem]]></category>
            <dc:creator><![CDATA[Ibrahim Ayadhi]]></dc:creator>
            <pubDate>Sat, 11 Apr 2020 23:27:06 GMT</pubDate>
            <atom:updated>2020-04-12T00:15:09.897Z</atom:updated>
            <content:encoded><![CDATA[<p>Welcome to our second article of this series. I encourage you all to check the <a href="https://medium.com/@ibrahim.ayadhi97/deploying-of-infrastructure-and-technologies-for-a-soc-as-a-service-socass-8e1bbb885149">previous article</a> to have a better understanding of what we are going to discuss here.</p><p><strong>1- Installing ELK STACK and configuration</strong></p><p><strong>1.1- Introduction to ELK</strong></p><h4>A- What’s ELK?</h4><blockquote><a href="https://www.elastic.co/fr/what-is/elk-stack">https://www.elastic.co/fr/what-is/elk-stack</a></blockquote><h4>B- Difference between ELK Basic and ELK Oss?</h4><blockquote><a href="https://www.elastic.co/fr/what-is/open-x-pack">https://www.elastic.co/fr/what-is/open-x-pack</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/0*OQd6bxR3tlKHGp2a" /></figure><p><strong>1.2- ELK Installation</strong></p><p>In our project we proceeded to setup the ELK Stack Basic (7.6.1) and we referred to official guide provided by elastic.co:</p><blockquote><a href="https://www.elastic.co/guide/en/elastic-stack/current/installing-elastic-stack.html">https://www.elastic.co/guide/en/elastic-stack/current/installing-elastic-stack.html</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*rCzPLdc8RV2RyIMy" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/132/0*Veh7ul1TdM4pnYfi" /></figure><p><strong>1.3- ELK Configuration</strong></p><p>In this section we will be providing you with the configuration we have made to the ELK Stack.</p><p><strong>A- Elasticsearch configuration</strong></p><p>All the configurations were made into the elasticsearch.yml file located in <strong>/etc/elasticsearch/elasticsearch.yml</strong></p><p>To open it use the following command : <strong>sudo nano /etc/elasticsearch/elasticsearch.yml</strong></p><p>These are the default paths for data and logs for elasticsearch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/0*1yRUp1AwbAt5Qhwr" /></figure><p>Then navigate to the network section of the file.Network section it is very simple , you don’t even have to mention the port if you are using the default one. But you must change http.port and undo the comment. if you are going to use another port.</p><p><strong>network.bind_host: 0.0.0.0 </strong>will enable remote access to the Elasticsearch server which will help us connect the beats to the ELK Stack later on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/242/1*xdpW5gHCNGm1gKv0-K5tMw.png" /></figure><p>Once this is established we need to restart ElasticSearch service via this command:</p><blockquote><strong>sudo systemctl restart elasticsearch</strong></blockquote><blockquote><strong>Disclaimer: </strong>S​​​​​​​etting network.bind_host to 0.0.0.0 is not recommended due to security issues and should not be used in a production level.<strong> </strong>We are just at the prototyping phase.</blockquote><p><strong>B-Kibana configuration:</strong></p><p>All the configurations were made into the kibana.yml file located in <strong>/etc/kibana/kibana.yml</strong>. To open it use the following command:</p><blockquote><strong>sudo nano /etc/kibana/kibana.yml</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/206/0*lrramYM9ApJ2DuJt" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/0*7MYHeyw4OxNEk5cU" /></figure><p>To make Kibana remotely accessible we must set <strong>server.host: “0.0.0.0”</strong>. There is no restriction when it comes to the port that it should be on. So, we will leave it to the default setting which is 5601. Now restart your Kibana: <strong>sudo systemctl restart kibana</strong></p><p>Now you should be able to access your Kibana from the browser.<a href="http://your_server_ip:5601/">http://Your_Server_IP:5601</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ajPGtw4GQCgR4i2j" /></figure><blockquote>While you are at it, enjoy the amazing UX it provide and try some of the dashboards samples and data it provides.</blockquote><blockquote><strong>Disclaimer: </strong>setting server.host to 0.0.0.0 is not recommended due to severe security issues and should not be used at a production level. We are just at the prototyping phase.</blockquote><p><strong>C-Logstash configuration :</strong></p><p>Now we will be tackling the configuration of the logstash :</p><blockquote><strong>sudo cat /etc/logstash/logstash-sample.conf</strong></blockquote><p>This file contains the necessary configuration for the Logstash. So, we need to copy it to the directory <strong>/etc/logstash/conf.d/</strong> and change its name to logstash.conf</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/0*GLV1sjO4f5X2c_nS" /></figure><blockquote>Don’t forget to restart the service: <strong>sudo systemctl restart logstash</strong></blockquote><p><strong>D-Checking services :</strong></p><p>After setting up the configuration files of logstash, kibana and elasticsearch properly. you can start your services and check them :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/0*8WGmgykbwlzCUHzR" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/0*4Q8Hns0srJYwopO_" /></figure><p>You can check if these services are listening on their ports. It doesn’t matter if you have tcp6 instead of tcp.</p><blockquote>Kibana : 5601</blockquote><blockquote>Elasticsearch : 9200</blockquote><blockquote>Logstash : 5044</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/0*m0eROyI9a9RpZw3m" /></figure><p><strong>2-Beats configuration and data shipping :</strong></p><p><strong>A- Download and Installation of Winlogbeat:</strong></p><p>Donwload URL :</p><blockquote><a href="https://www.elastic.co/fr/downloads/beats/winlogbeat">https://www.elastic.co/fr/downloads/beats/winlogbeat</a></blockquote><p>Installation :</p><blockquote><a href="https://www.elastic.co/guide/en/beats/winlogbeat/current/winlogbeat-installation.html">https://www.elastic.co/guide/en/beats/winlogbeat/current/winlogbeat-installation.html</a></blockquote><p><strong>B- Winlogbeat configuration:</strong></p><p>In our project we used this configuration of winlogbeat.yml:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/0*TitXWhtrt9WQEEfw" /></figure><p><strong>Understanding winlogbeat.event_logs :</strong></p><p>The winlogbeat section in winlogbeat.yml specifies all options that are specific to Winlogbeat. Most importantly, it contains the list of event logs to monitor. We can see that Sysmon module is enabled by default.</p><p>To add more modules you can refer this URL :</p><blockquote><a href="https://www.elastic.co/guide/en/beats/winlogbeat/current/configuration-winlogbeat-options.html">https://www.elastic.co/guide/en/beats/winlogbeat/current/configuration-winlogbeat-options.html</a></blockquote><p><strong>Understanding number of shards and number of replicas :</strong></p><h4>- index.number_of_shards :</h4><p>An index can potentially store a large amount of data that can exceed the hardware limits of a single node. To solve this problem, Elasticsearch provides the ability to subdivide your index into multiple pieces called shards each one saved on a different machine.</p><h4>-index.number_of_replicas :</h4><p>Is the number of copies that Elasticsearch will be storing. This feature is useful when you have a network of machine running Elasticsearch. If one machine goes down the data is not lost.</p><p><strong>Outputs :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/205/0*kzZwidMZ2FxrK6aR" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/0*8jUHCZZ-rICwgHLo" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/209/0*AiTc1hgkC8Vu-eG6" /></figure><p>For Elasticsearch output and Logstash output <strong>, only one of them must be enabled</strong> when starting the service or checking the configuration.</p><p><strong>Processors and logging settings :</strong></p><p>This section contains the default processors used by winlogbeat and an example of the logging settings :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/0*EZZQ6a2s26MTo5Zs" /></figure><p><strong>Index Lifecycle Managment ( ILM ) :</strong></p><p>Finally, we had to disable index lifecycle manager. ILM or Index Lifecycle Manager is free x-pack feature integrated with the ELK stack Basic but not with ELK oss version. You could use ILM to automatically manage indices according to your performance, resiliency, and retention requirements. For example: Create a new index each day, week, or month and archive previous ones, spin up a new index when an index reaches a certain size or deletes stale indices to enforce data retention standards.</p><p>ILM feature is enabled by default for ELK stack basic version but it requires further configuration specially when your beats are not connected directly to Elasticsearch. ILM feature is beyond the scope of this article, so we will disable it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/215/0*irSwRU5ooPCLGzdZ" /></figure><p><strong>Sysmon configuration &amp; integration with MITRE ATT&amp;CK:</strong></p><p>We will setup and make the new Sysmon configuration before loading index templates to make sure that the new sysmon fields and configuration are loaded properly in ELK stack.</p><p><strong>System Monitor (Sysmon) </strong>is a Windows system service and device driver that, once installed on a system, remains resident across system reboots to monitor and log system activity to the Windows event log. It provides detailed information about process creations, network connections, and changes to file creation time. By collecting the events, it generates using Windows Event Collection or SIEM agents and subsequently analyzing them, you can identify malicious or anomalous activity and understand how intruders and malware operate on your network.</p><p><strong>MITRE ATT&amp;CK</strong> is a globally-accessible knowledge base of adversary tactics and techniques based on real-world observations. The ATT&amp;CK knowledge base is used as a foundation for the development of specific threat models and methodologies in the private sector, in government, and in the cybersecurity product and service community.</p><p><strong>I.</strong> Download Sysmon :</p><blockquote><a href="https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon">https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon</a></blockquote><p><strong>II.</strong> Download the xml configuration for sysmon containing MITRE ATT&amp;CK references: <a href="https://raw.githubusercontent.com/ion-storm/sysmon-config/master/sysmonconfig-export.xml">https://raw.githubusercontent.com/ion-storm/sysmon-config/master/sysmonconfig-export.xml</a></p><p><strong>III.</strong> Install Sysmon with the appropriate configuration file: <strong>sysmon64 -accepteula -i sysmonconfig-export.xml</strong></p><p><strong>IV. </strong>Check the current configuration: <strong>sysmon64 –c</strong></p><p><strong>Setup index template, dashboards and index pattern:</strong></p><p><strong>I. Load Index template:</strong></p><p>Index templates allow you to define templates that will automatically be applied when new indices are created. The templates include both settings and mappings and a simple pattern template that controls whether the template should be applied to the new index.</p><p>A connection to Elasticsearch is required to load the index template. If the output is not Elasticsearch, you must load the template manually. In our case winlogbeat will not be connected directly to Elasticsearch, so we will have to setup the index template manually before starting the service.</p><p>Disabling Logstash output and enabling Elasticsearch output temporarily is required.</p><blockquote><a href="https://www.peerlyst.com/wall">https://www.elastic.co/guide/en/beats/winlogbeat/current/winlogbeat-template.html#load-template-manually</a></blockquote><p><strong>II. Load Dashboards and Index pattern:</strong></p><blockquote><a href="https://www.elastic.co/guide/en/beats/winlogbeat/current/load-kibana-dashboards.html">https://www.elastic.co/guide/en/beats/winlogbeat/current/load-kibana-dashboards.html</a></blockquote><p><strong>Changing output:</strong></p><p>After loading properly, the index template, index pattern and dashboards, you can check them in Kibana interface.</p><p>Index Template, Index Pattern and Dashboards are loaded Successfully:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8ztbGGW4r2U0uhDb" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AG7oCPFcc2ty9dTT" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aKIfVz9ASwLHgiH7" /></figure><p>Now, after opening the configuration file. We will disable the Elasticsearch output by commenting it then we will enable the Logstash output by removing the commenting.</p><p><strong>Shipping data to ELK stack :</strong></p><p>Now we can start winlogbeat and sysmon services from PowerShell or using the services.msc interface, and check data in Kibana interface.</p><p>When starting the winlogbeat. The ELK STACK will use the configuration in Logstash to create the index that will enable the storing of data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3EXl50J-uml4vqHB" /></figure><p>This is the default dashboard for winlogbeat :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/0*CCY4aL51STG6H0uL" /></figure><p>Under Discover , we can check sysmon logs with the new configuration ( MITRE references ) :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yZD8bDKulFdOiHTF" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*prrmlGuEiJTXhFHx" /></figure><p>The rest of the beats does not differ a lot from the winlogbeat whether in configuration or installation.</p><p>The beats that we have used are :</p><ul><li>Winlogbeat</li><li>Filebeat</li><li>Packetbeat</li><li>Metricbeat</li></ul><p>We want to mention that certain beats like metricbeat or filebeat have several modules that you can use.</p><p>For example, we used the module system in filebeat to monitor the ssh authentication, sudo commands on ubuntu machine and we used the module Suricata to collect logs from Suricata IDS.</p><p><strong>Enabling Suricata module :</strong></p><p>We have used this command to enable the Suricata module in filebeat :</p><blockquote><strong>sudo filebeat modules enable Suricata</strong></blockquote><p>to see modules available in filebeat you can check the directory <strong>/etc/filebeat/modules.d/</strong></p><p>To see active modules, use this command :</p><blockquote><strong>filebeat modules list</strong></blockquote><p>This is the link we have used to install Suricata on our device:</p><blockquote><a href="https://www.alibabacloud.com/blog/594941">https://www.alibabacloud.com/blog/594941</a></blockquote><p>You should get a dashboard relatively similar to this. No worries if you don’t get exactly like this, we will be handling dashboard in the upcoming articles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/0*1jdLa2QW8SvTB2B4" /></figure><p>It is possible also to integrate the Suricata interface in the ELK stack for that you can check this link below:</p><blockquote><a href="https://www.howtoforge.com/tutorial/suricata-with-elk-and-web-front-ends-on-ubuntu-bionic-beaver-1804-lts/">https://www.howtoforge.com/tutorial/suricata-with-elk-and-web-front-ends-on-ubuntu-bionic-beaver-1804-lts/</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b7c903d5a71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying of infrastructure and technologies for a SOC as a Service ( SOCasS)]]></title>
            <link>https://medium.com/@ibrahim.ayadhi/deploying-of-infrastructure-and-technologies-for-a-soc-as-a-service-socass-8e1bbb885149?source=rss-7e31712e1ff1------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e1bbb885149</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[soc]]></category>
            <dc:creator><![CDATA[Ibrahim Ayadhi]]></dc:creator>
            <pubDate>Fri, 10 Apr 2020 18:37:10 GMT</pubDate>
            <atom:updated>2020-05-18T15:05:19.565Z</atom:updated>
            <content:encoded><![CDATA[<p>In the last couple of years, the number of cyberattacks have gone through the roof. These attacks not only target single individuals but also firms, governments ,critical infrastructure, etc. Traditional solutions like antivirus, firewall, NIDS and NIPS are no longer sufficient due to the sophistication of attacks and their overwhelming amount.</p><p>Big organizations commonly integrate SIEM solutions (Security Information and Event Management) into their environment to ingest and correlate alerts and logs generated by network devices, security devices and endpoints. However, this solution is time/money consuming and requires security teams dedicated for triage of false positives and investigation of the complex cases.</p><p>This leads to the approach of the Security Operations Center also known as SOC which is considered the new approach in the world of cyber-security to mitigate against the increasing number of attacks in quantity and level of complexity and sophistication. A SOC is a centralized unit comprised of skilled people, processes, and technologies working together to deliver end-to-end security capabilities. These include the prevention, detection, and investigation of and response to, cybersecurity threats and incidents. But this solution is the privilege of only Big Firms due to the expensive cost of the SOC team.<br>This is where the approach of the Security Operation Center as a Service comes into play. SOCaaS is outsourcing the security operations center to a third party. This will enable organizations with limited resources to improve their security posture and provide enhanced controle over their attack surface at a cheaper price, more efficiency and a faster deployment time.</p><p>This is an end year project realized by three students from the university of INSAT Tunisia: <a href="https://www.linkedin.com/in/brahimayadhi/">Ibrahim Ayadhi</a>, <a href="https://www.linkedin.com/in/ghassen-miled-a9594a172/">Ghassen Miled</a> and <a href="https://www.linkedin.com/in/mehdi-masri-22a221161/">Mehdi Masri</a>, under the supervision of A.Prof. <a href="https://www.linkedin.com/in/bassem-ben-salah-3487a259/">Bassem Ben Salah</a>. The technologies and tools that were used are 100% free and open source.</p><p>In recognition of the open source communities and their help in making this project come true. We have decided to publish our documentation and the steps we took into creating this project for the community.</p><h3><strong>Detailed architecture diagram of our solution:</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TAoB_84vsDlRA3LhWAuxxA.png" /><figcaption>Detailed architecture diagram of our solution</figcaption></figure><h4>This solution allows for log retention, analysis, monitoring, alert generation,reports generation, IoC enrichment and incident response management.</h4><p>In the figure above, we collect all the different types of logs and events from hosts, network components. Then ,these logs are ingested in Logstash via a secure channel (VPN tunnel). We used ELK beats and Wazuh-agent for the collection of data and logs and sent them to the ELK SIEM.</p><p>After data aggregation and processing by Logstash. Elasticsearch will handle the indexing of data to optimize the storage process and the data search. Data is then forwarded to Kibana which will take care of the Analysis and visualization of the stored data.</p><p>In the same time, the Wazuh HIDS agent sends data back to the Wazuh Manager and Elasticsearch.</p><p>From there, ElastAlert will watch for new events of interest and generate alerts inside TheHive.</p><p>A workflow will then enrich the case with additional queries from the Cortex analyzers and MISP, resulting in either an automatic closure of the case or an escalation to an analyst. Alerts are available for Analysts to claim and trigger enrichment through Cortex and MISP.</p><h3>Hardware and software components used in this deployment :</h3><blockquote><strong>Hardware components:</strong></blockquote><p>This table represents the overall infrastructure, requirements and services deployed in our project.</p><p>Besides it can be deployed in larger environments with the right configurations and scalable infrastructure.</p><p>For end points, it is possible to connect any device generating logs with the server machine (e.g. : routers , switches , etc. .. )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*x_T125adkTnuqPQIQeJrdA.png" /><figcaption>Overall infrastructure, requirements and services deployed in our project.</figcaption></figure><p><strong>Disclaimer :</strong></p><p>-The endpoint devices shown in the diagram were not all implemented in this project due to the POC context and the limited ressources.Therefore, firewalls and routers wont’t be covered in this POC.<br>- The hardware that we chose for this project aren’t suited for production. It is recommended to dedicate more hardwares ressources. We would recommend 8 Vcpu for each server, 32GB of RAM for the first server and 8GB for the second one.</p><blockquote><strong>Software components:</strong></blockquote><p><strong>- ELK stack : </strong>The ELK stack is an acronym used to describe a stack that comprises of three popular open-source projects: Elasticsearch, Logstash, and Kibana. Often referred to as Elasticsearch, the ELK stack gives you the ability to aggregate logs from all your systems and applications, analyze these logs, and create visualizations for application and infrastructure monitoring, faster troubleshooting, security analytics, and more.</p><p>- <strong>Beats :</strong> are lightweight data shippers, that you install on your servers to capture all sorts of operational data (think of logs, metrics, or network packet data). The Beats send the operational data to Elasticsearch, either directly or via Logstash, so it can be visualized with Kibana.</p><p>- <strong>Elastalert</strong> <strong>: </strong>is a simple framework for alerting on anomalies, spikes, or other patterns of interest from data in Elasticsearch. It works by combining Elasticsearch with two types of components, rule types and alerts. Elasticsearch is periodically queried and the data is passed to the rule type, which determines when a match is found. When a match occurs, it is given to one or more alerts, which act based on the match.</p><p>- <strong>Suricata</strong> <strong>: </strong>is an open source threat detection engine that was developed by the Open Information Security Foundation (OISF). Suricata can act as an intrusion detection system (IDS), and intrusion prevention system (IPS), or be used for network security monitoring.</p><p>- <strong>Open Distro for Elasticsearch :</strong></p><ul><li><strong>Alerting feature</strong> : it provides a powerful, easy-to-use event monitoring and alerting system, enabling you to monitor your data and send notifications automatically to your stakeholders. With an intuitive Kibana interface and powerful API, it is easy to set up and manage alerts.</li><li><strong>Security feature </strong>: it includes a number of authentication options (such as Active Directory and OpenID), encryption in-flight, fine-grained access control, detailed audit logging, advanced compliance features, and more.</li></ul><p><strong>- Praeco: </strong>is an alerting tool for Elasticsearch — a GUI for <a href="https://github.com/yelp/elastalert">ElastAlert</a>, using the <a href="https://github.com/bitsensor/elastalert">ElastAlert API</a>. With Praeco you can Interactively build alerts for your Elasticsearch data using a query builder , send notifications to Slack, Email, Telegram or an HTTP POST endpoint , in addition to many other features provided by this tool.</p><p>- <strong>Wazuh : </strong>i​​s a free and open source platform for threat detection, security monitoring, incident response and regulatory compliance. It can be used to monitor endpoints, cloud services and containers, and to aggregate and analyze data from external sources. Wazuh agents scan the monitored systems looking for malware, rootkits and suspicious anomalies. They can detect hidden files, cloaked processes or unregistered network listeners, as well as inconsistencies in system call responses.</p><p>- <strong>Nessus Essentials</strong> : is a free vulnerability scanner that provides an entry point for vulnerability assessment. It allows you to scan your environment with the same high-speed, in-depth assessments and agentless scanning convenience.</p><p>-<strong>TheHive: </strong><a href="https://thehive-project.org/">TheHive</a> describes itself as “A scalable, open source and free Security Incident Response Platform designed to make life easier for any information security practitioner dealing with security incidents that need to be investigated and acted upon swiftly”.In essence it’s an alert management platform for managing an incident alert from creation to closure.</p><p><strong>-Cortex: </strong><a href="https://github.com/TheHive-Project/Cortex">Cortex</a> is another software product from the same team as TheHive and complements that product with data enrichment. Cortex allows the use of “analyzers” to gain additional information on the indicators already present in your logs. It allows the querying of third-party services on indicators such as IP, URL, and file hash, and will tag the alert with this additional information. No need to send a file hash manually to VirusTotal when an analyzer will automatically do it for you and tag the alert with the results.</p><p><strong>-MISP : </strong>The Malware Information and Sharing Platform (MISP) is a threat intelligence platform for sharing, storing and correlating Indicators of Compromise of targeted attacks, threat intelligence, financial fraud information, etc. MISP is used today in multiple organizations to store, share knowledge, collaborate on cyber security indicators, malware analysis In order to insure a better security protection.</p><h4><strong>This first article was meant as an introduction to our work. Details will be provided in the upcoming articles and this is the planning that we will be following :</strong></h4><p>1-<a href="https://medium.com/@ibrahim.ayadhi97/elk-stack-installation-and-shipping-data-2b7c903d5a71?fbclid=IwAR390WRYNhgEHBi9QaEO_es7OGpla00ABpTjA-hs7j3JNNmLu8G2tSTiTtE">ELK stack : Installation and shipping data</a></p><p>2- <a href="https://medium.com/@ibrahim.ayadhi97/a-walk-through-open-distro-9e5a03bdcbd6">A walk-through open Distro.</a></p><p>3-<a href="https://medium.com/@ibrahim.ayadhi97/visualizing-dashboards-and-elk-siem-c4a669f3fae8">Vizualizing Dashboards and ELK SIEM</a></p><p>4-<a href="https://medium.com/@ibrahim.ayadhi97/welcome-to-our-fourth-article-of-this-series-2d5606221c0">WAZUH integration</a></p><p>5-<a href="https://medium.com/@ibrahim.ayadhi97/hello-and-welcome-to-our-new-article-which-will-be-covering-the-alerting-part-in-our-socaas-136cf6258c49">Alerting</a></p><p>6- <a href="https://medium.com/@ibrahim.ayadhi97/reporting-f54e1ee84cf4">Reporting</a></p><p>7-<a href="https://medium.com/@ibrahim.ayadhi97/case-management-20d8fd815ee2">Case Management</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e1bbb885149" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>