<?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 Bishesh Shrestha on Medium]]></title>
        <description><![CDATA[Stories by Bishesh Shrestha on Medium]]></description>
        <link>https://medium.com/@bishesh404?source=rss-e1d0c7720c6b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*WAM1FEdTOEZ1nbUeoSq20Q.jpeg</url>
            <title>Stories by Bishesh Shrestha on Medium</title>
            <link>https://medium.com/@bishesh404?source=rss-e1d0c7720c6b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 20:30:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bishesh404/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[LogPoint and its SOAR]]></title>
            <link>https://medium.com/@bishesh404/logpoint-and-its-soar-f7662341ad1d?source=rss-e1d0c7720c6b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7662341ad1d</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[soar]]></category>
            <category><![CDATA[automated-playbook]]></category>
            <category><![CDATA[playbook]]></category>
            <category><![CDATA[logpoint]]></category>
            <dc:creator><![CDATA[Bishesh Shrestha]]></dc:creator>
            <pubDate>Tue, 07 Feb 2023 05:28:21 GMT</pubDate>
            <atom:updated>2023-02-07T05:28:21.756Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are into the cyber world then you probably have heard of SIEM. Here in this blog, I will be sharing tips and how you can use LogPoint and its components of SOAR to protect your organization from various kinds of cyber threats. These all things have been collected through my experience using the product itself. So long story short</p><figure><img alt="https://cdn-images-1.medium.com/max/880/1*19sMWHDXnT3GKEUdPipTbw.png" src="https://cdn-images-1.medium.com/proxy/1*19sMWHDXnT3GKEUdPipTbw.png" /></figure><h3>Welcome to my blog on LogPoint!</h3><p>LogPoint is a SIEM (security information and event management) solution that is designed to help organizations detect and respond to security threats in real-time by collecting, analyzing and correlating log data from a variety of logs sources. There are also many functionalities that it provides, such as Log management, Advanced analytics, Visualization, reporting, alerting, integration and SOAR. To put it in simple terms, It is a comprehensive security solution which provides advanced threat detection, and automated incident response capabilities to help organizations detect and respond to the corresponding threats.</p><p>So, you might have heard of all these things about how every incident is detected and responded to automatically and the things that happen behind the scene of the organization which leads our question to one point.</p><h3>What is SOAR?</h3><p>SOAR stands for Security Orchestration, Automation, and Response. To put it in simple terms, it is like a superhero team of IT experts who work together to protect the organization from cyber threats. In simple terms, SOAR is a set of instructions and tools that help security teams work more efficiently. So why SOAR? A simple answer to this question can be that it can automate processes and alerts when suspicious activity is detected. It can also automate other tasks such as the isolation or remediation of compromised devices.</p><p>SOAR is a system that helps organizations improve incident response time and effectiveness by automating tasks, coordinating actions and providing a straightforward incident management process. It makes the incident response process more efficient, by reducing manual work and improving communication and collaboration among the teams involved.</p><p>Today, I will delve into the technical aspects of the detection procedure, specifically focusing on the implementation of Auto-Case Creation. This will enable efficient and automated detection of incidents for Response. In a follow-up writeup, I will then examine the utilization of this information to facilitate automated response mechanisms of SOAR.</p><h3>Detection</h3><p>Automated investigation refers to the use of software tools to streamline the process of analyzing incidents and determining an appropriate response. In this context, the use of cases in LogPoint is emphasized as a way to create automatic cases from detected alerts. The goal is to automate the investigation process by automatically creating cases based on the detection of alerts, thus allowing the security orchestration, automation, and response (SOAR) system to quickly respond to incidents. By doing this, manual efforts are reduced, enabling the security team to focus on more critical tasks.</p><h3>Installation</h3><p>Imagine this, you have a Windows machine that is constantly generating logs and events. You want to put these logs to good use and leverage them for security purposes. That’s where LogPoint comes in! By installing the LP agent on your Windows machine, you’re able to forward all those logs to a centralized location, our trusty Security Information and Event Management (SIEM) system. With just a few clicks, you’ll be able to transform your logs into valuable insights that can help you respond to incidents quickly and efficiently. Think of it as a virtual detective that’s working 24/7 to keep your environment secure. Want to give it a try? Check out the installation guide linked below:</p><p><a href="https://docs.logpoint.com/docs/logpoint-agent/en/latest/">LogPoint Documentation: LogPoint Agent</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2odrraBtnq41B685UZTquA.png" /><figcaption>Status of agent</figcaption></figure><p>After installation, our LP agent in our windows machine is up and running.</p><h3>Use case and trigger</h3><p>There can be a lot of use cases for SOAR, some of which could be like <strong>blocking an account from Active Directory</strong> if it is being attacked with brute force technique or it could also be something related to <strong>File Integrity Monitoring (FIM)</strong> in which if there is a certain file drop in the system our SOAR could instantly respond to it before any Security analyst even discovers it. This will help analysts to be more efficient and the SIEM solution to be more effective.</p><p>For this example, my use case will be event id <strong>4625 </strong>which is a password failure or bad password. I am keeping it simple since it will be easy to understand and can be triggered easily.</p><blockquote><em>Note: You can use according to your own necessities</em></blockquote><p>So here I have created an alert rule which will trigger once there is an occurrence of event id 4625 which is a bad password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*M_BkDEq0eswBJtAnLXeTQw.png" /><figcaption>Alert Rule for password failure</figcaption></figure><p>For every password failure coming from the windows machine, this alert will be triggered which will create an incident.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t8m2-3sW1GOhvIQT4trWLQ.png" /><figcaption>Log for the incident</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*1a-hD9QZRVx0jSqgjAEtEA.png" /><figcaption>Incident Created from Alert</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*dxyHFaJ0uQXGOp2Z8jOoeg.png" /><figcaption>Alert Incident Data</figcaption></figure><p>In the alert incident data, we will get the AlertRule ID. This will be handy afterwards when automating the investigation.</p><h3>Playbooks</h3><p>Playbooks in LogPoint are automated scripts that execute a series of tasks and actions to address specific security incidents or scenarios. They help organizations to standardize their security operations and improve the efficiency and speed of response to security incidents. Playbooks can be triggered manually or automatically based on specific events or conditions and can include actions such as data collection, correlation, analysis, and remediation. They can be customized to meet the specific needs and requirements of an organization and can integrate with other security tools and systems to provide a comprehensive and unified approach to security operations. Here for my use case, I have created a playbook named ‘<strong>Password Failure</strong>’ which will create a case and run sub-playbooks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W22bQ7VKRQfQ9ODfyawqhg.png" /><figcaption>Playbook</figcaption></figure><p>The next step here will be triggering this playbook automatically from a generated alert. So for triggering the playbooks automatically LogPoint SOAR provides something called <strong>Playbook Trigger (Automation).</strong></p><h3><strong>Playbook Trigger (Automation)</strong></h3><p>For creating an automated playbook trigger we first need to go to the trigger tab and click on <strong>+Create Trigger.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zyW5jQ_VrNYTod3o_KJmYQ.png" /></figure><p>Then in the General tab name the playbook trigger and put the source as <strong>LogPoint. </strong>After that give a description according to your use case and set the severity label and click on enable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*CRanATfE1tmCKj_hMq_zPA.png" /><figcaption>General Tab in Playbook Trigger</figcaption></figure><blockquote>Remember we got the alertrule_id from the incident data which was created before.</blockquote><p>Now go into the Trigger tab and write a trigger query something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*6wvtRBqRru9Xx9Hr4PrbxQ.png" /><figcaption>Trigger Query in Playbook Trigger</figcaption></figure><p>What this will do is trigger the playbook once there is the alertrule_id match in the LogPoint Table.</p><p>Lastly, for the Automation part go to the Automation tab and select the playbook you need to automate once the alert is triggered. Since we have created a playbook which will automatically create a case item. This whole procedure should do the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*SHTONPrxpHCom9VpEr9fhw.png" /></figure><p>Now we can see in the monitoring tab of the playbooks that the playbook named ‘<strong>Password Failure</strong>’ is executed successfully when the incident is triggered:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XuOFezYOayHUkYZ5m4tSFw.png" /><figcaption>Monitoring Tab for Playbook</figcaption></figure><p>All in all, Our goal for automated case creation is completed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FrM6WkewQt9jG59vcVEJsQ.png" /><figcaption>Case Creation</figcaption></figure><p>In conclusion, we’ve just scratched the surface of the capabilities of LogPoint SOAR’s detection and investigation features. It’s a powerful tool that streamlines the process of detecting potential security threats and conducting thorough investigations. But the real magic happens when we move on to the next chapter and explore the world of automated response. With the ability to quickly and efficiently respond to incidents, LogPoint SOAR takes the security game to a whole new level. So, keep your eyes peeled for our next blog, where we’ll dive even deeper into the wonders of this cutting-edge technology.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7662341ad1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to write custom decoder for Wazuh]]></title>
            <link>https://medium.com/@bishesh404/blog-on-wazuh-d3fdfe19abc1?source=rss-e1d0c7720c6b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3fdfe19abc1</guid>
            <dc:creator><![CDATA[Bishesh Shrestha]]></dc:creator>
            <pubDate>Fri, 04 Nov 2022 10:50:23 GMT</pubDate>
            <atom:updated>2022-11-04T11:18:35.493Z</atom:updated>
            <content:encoded><![CDATA[<h3>Blog on Wazuh</h3><h3>Introduction</h3><p>Wazuh is a platform that is used for security-monitoring. Since, it is free and open-source most small and medium enterprises use it as a threat detection, incident monitoring and compliance and integrity monitoring. As Wazuh is able of protecting workloads across virtualized, containerized and cloud-based environment it has gained its popularity within many securities’ organization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JNMWSF_lv0CQ-RXShwCR2g.png" /></figure><p>Decoders in Wazuh are the parsers by which the software parses valuable output to the user from the raw logs. These decoders are very useful as it helps security analyst to hunt threats and find the root cause of the problems that had been detected by the system. As Wazuh has the out-of-the-box set of decoders, most of the raw logs that are collected are automatically decoded. But sometimes there may be devices that are not in listed in the out-of-the-box set or clients may request a custom value for certain variables. For solving such use cases Wazuh provides the ability for users to build or create their own custom decoders to handle various unique use cases. These decoders are written in xml language and has their own set of tags. They are powered by regex library. As Wazuh supports 3 types of regular expression syntax also known as regex it has enhanced users more efficient to build their own tailored parsers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*4GR0bLIdtbYV_ONxxJwWkA.png" /><figcaption>Directory layout of Wazuh</figcaption></figure><p>The image above shows the Wazuh decoder and rule directory layout. Inside the <strong>etc/decoders/</strong> and <strong>etc/rules/</strong> directories all the custom decoders and custom rules are written. Whereas inside the <strong>ruleset/</strong> directory the default Wazuh decoders and rules are written. Note: As the files inside the ruleset resets every time wazuh is updated it is not recommended to write custom decoders or rules inside this directory.</p><h3>Building a Decoder</h3><h3>Parent Decoder</h3><p>Building a decoder is one of the most flexible things that Wazuh offers to its users as we can build decoders that will match on ANYTHING. For a reference we will use the log source below:</p><blockquote><em>1 1664354660.889911776 DNS_Meraki_MX84 events content_filtering_block url=’</em><a href="https://sgplog.ezvizlife.com/"><em>https://sgplog.ezvizlife.com/</em></a><em>...&#39; category0=’Adult and Pornography’ server=’161.117.5.66:443&#39; client_mac=’8C:7A:3D:86:67:54&#39;</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*p2VvWo03K8q8YpUEO4oUYQ.png" /><figcaption>No decoder found for the log.</figcaption></figure><p>We can see from the above image that no decoders were found. This is because Wazuh manager does not understand the log and its format and since this log format is not available in the out-of-the-box set we will build our own custom decoder. For building a decoder or a parser, first we need to understand its concept. Wazuh decoders includes parent decoder and a sibling decoder also known as child decoder. A parent decoder is used to link a child decoder with its parent. A parent decoder can have many children, but child decoder cannot have child or multiple parents. While writing a decoder there should always be a clear concept of what you are doing. So, for identifying a certain type of log we should always look for a common field that can be found on all the types of its log. So, for this log the common field will be ‘<strong>1 1664354660.889911776 DNS_Meraki’</strong> The number part and the ‘DNS_Meraki’ part so we will first write a parent decoder as the root decoder which will identify the logs that will come from the Meraki firewall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*yPTFXBdwANSRwUBTOqg-ug.png" /><figcaption>Making a Root decoder or Parent decoder</figcaption></figure><p>The above decoder is assumed as the root decoder since it will help identify the logs coming from the Meraki device. So whenever Wazuh sees the DNS_\w+. It will be identified as the decoder name Parent_meraki. The value inside the prematch is a regex code. There are many tags that can be used to build a custom decoder. All of the information about it can be found in the Wazuh documentation about custom decoders and rules.</p><p><a href="https://documentation.wazuh.com/current/user-manual/ruleset/custom.html">https://documentation.wazuh.com/current/user-manual/ruleset/custom.html</a></p><p>After writing the parent decoder we can see that Wazuh is recognizing our log and parsing it correctly through the decoder name Parent_Meraki. Now the next step is to write the child decoder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*TH7eNQ-gRwgzrXZccOHqGA.png" /><figcaption>Log-test of parent decoder</figcaption></figure><h3>Regular expressions Syntax (REGEX)</h3><p>Regex or regular expression syntax is a language that Wazuh recognizes to match the required input.</p><p>Wazuh support 3 types of of regular expressions:</p><ul><li>Regex(OS_Regex),</li><li>sregex(OS_match),</li><li>PCRE2 (Perl Compatible Regular Expressions )</li></ul><p><strong>Regex(OS_Regex)</strong></p><p>Regex(OS_Regex) is a fast and simple library for regular expressions in C.</p><p><strong>Supported Characters</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*0Kwt0lDjgEnAULmN-wNf2Q.png" /><figcaption>Supported characters on OS_Regex</figcaption></figure><p><strong>Modifiers</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/315/1*wkRhWxuCCoJHmHsUZvQfLw.png" /><figcaption>Modifiers in OS_Regex</figcaption></figure><p><strong>Special characters</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*1tEx9Ljb-gUVfOY9NX06Cw.png" /><figcaption>Special characters in OS_Regex</figcaption></figure><p><strong>Sregex(OS_match)</strong></p><p>This is faster than the OS_regex but it only supports simple string matching.</p><p><strong>Supported Characters</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*b0JmISnmk2ubSxkR3P8l_Q.png" /><figcaption>Supported Characters in OS_Match</figcaption></figure><p><strong>PCRE2 Syntax</strong></p><p>Perl Compatible Regular Expressions tries to match perl syntax and semantics. also provides features like recursive patterns, look-ahead and look-behind assertions, , non-capturing groups, non-greedy quantifiers, extended syntax for characters and character classes, and many other.</p><p><strong>Supported expressions</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/362/1*ctucHB44B0QaM1TMGs_swQ.png" /><figcaption>Supported expression on PCRE2</figcaption></figure><p>Characters escaping</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/334/1*pAg8CvAHEsV5-m3GbZxLbw.png" /><figcaption>Characters escaping on PCRE2</figcaption></figure><p>Quantifiers</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*NN1EIYQBBmqdGLMp3AmmXw.png" /><figcaption>Quantifiers on PCRE2</figcaption></figure><p><strong>Why PCRE2?</strong> <strong>(Advantages)</strong></p><ul><li>Quantifiers — ? (https?) , {n} (\d{4} ), {n,} \d{2,}, {n,m} (\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})</li><li>Case sensitivity — post will match with POST</li><li>Groups with groups — Ease and flexibility in data extraction</li><li>Groups comparing: backreferences -</li><li>character classes (Character set) — [A-zA-Z0–5] can be used instead of \w or \d+, etc</li></ul><p><strong>Configuring PCRE2</strong></p><p>PCRE2 can be enabled in rules and decodes using the type=”pcre2&quot; attribute.</p><p><strong>Use cases</strong></p><ul><li>Accurate Plug-gable authentication Modules (PAM) user alerts</li><li>PAM brings authentication support for applications and services in UNIX like systems</li></ul><p>All of the syntax for these regexes can also be found in the documentation linked below.</p><p><a href="https://documentation.wazuh.com/current/user-manual/ruleset/ruleset-xml-syntax/regex.html">https://documentation.wazuh.com/current/user-manual/ruleset/ruleset-xml-syntax/regex.html</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/0*yYwQDj7dcjvaVxph.jpg" /><figcaption>LOL</figcaption></figure><h3>Child Decoder</h3><p>Child Decoder will us to parse fields that can contain various dynamic values to store them into Elasticsearch. For example, we will write a child decoder that will continue to parse the value from the raw log to our elastic search which will be linked to our root decoder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*Dz9HrLFoxQjayEWdRW-Qpw.png" /><figcaption>Making of child decoder for device name</figcaption></figure><p>With the above child decoder, it will parse the field name device name which is a dynamic field on the log. The first line is for the decoder name. Remember that all the child decoders should have the same name for a single parent. The second line is for linking the decoder to its parent where parent decoder name is written. The third line is for the regex which will help identify the dynamic fields in the raw logs. The brackets ‘()’ will select the value from the log and store it into the order tag variables. These variables will then be shown in the log test as shown as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*a5wEEkTaJVfCLfLDkyrSCQ.png" /><figcaption>Log-test of device name decoder</figcaption></figure><p>Similarly, we will write all the more decoders which will decode various fields in the logs as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*_cpgPOiC7wZBOSrSvxe0dA.png" /><figcaption>Child decoders that decodes the fields in the log</figcaption></figure><p>Note that here I have made two different files for parent and child since it will be convenient to make changes later. I have named 00MerakiParent.xml since this will decode all the parent decoder at first and then name 01MerakiChild.xml as the child decoder since it will decode it second.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*vM2KG2Zq-uKClpkfc_C6Rg.png" /><figcaption>Two separate file for convenience</figcaption></figure><p>The Wazuh decoders run in two different way. If you want to understand the concept the image below might help.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wl4J20gZw9yD8NZSXquyAw.png" /><figcaption>Working Operation of decoder</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PsWsSlTfl8Y_ATjLB5Fx-Q.png" /><figcaption>Working operation of decoder</figcaption></figure><p>Now with this parent decoder and child decoder our raw log will be decoded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*xNSGg39eLsBr7GQiZhajbg.png" /><figcaption>Successfully Decoding logs</figcaption></figure><p>we can check if our decoder is running or not by <strong>/var/ossec/bin/wazuh-logtest</strong> command.</p><h3>JSON decoder</h3><p>Wazuh also has an integrated decoder for JSON logs enabling the extraction of data from any source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vBgDpvD_kDgvC_eTBWIkPg.png" /><figcaption>JSON decoder data types</figcaption></figure><p>Extracted fields are stored as dynamic fields. they can also be called by rules.</p><p>Changes inside the /ruleset/rules file will be lost in the update process of wazuh</p><h3>Dynamic fields</h3><p><strong>Traditional decoders</strong></p><p>One of the Important step for threat detection is the extraction of information from each event received.</p><p>Traditionally OSSEC has provided 13 predefined field for storing extracted information.(user,srcip,dstip,srcport,dstport,protocol,action,id,url,data,extract_data,extra_data, status,system_name) of which only 8 can be extracted simultaneously.</p><p><strong>Dynamic decoders </strong>But it is often necessary to extract more than 8 fields from an event. Wazuh has extended OSSEC to allow the decoding of an unlimited number of fields . Even nested field names are supported.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FOiKpIIqQrTHJFlI3hgFEg.png" /><figcaption>Decoded data through JSON decoders</figcaption></figure><p>By default the fields that can be extracted in the tag is 64 but it can be modified by changing anlaysisd.decoder_order_size in /var/ossec/etc/internal_options.conf .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3fdfe19abc1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>