<?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 Samer Younes on Medium]]></title>
        <description><![CDATA[Stories by Samer Younes on Medium]]></description>
        <link>https://medium.com/@samer-younes?source=rss-4bce3e86561b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*1ktHayOA0M_wHenF.jpg</url>
            <title>Stories by Samer Younes on Medium</title>
            <link>https://medium.com/@samer-younes?source=rss-4bce3e86561b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 21:09:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@samer-younes/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[Thoughts on NextCloud + OpenProject  Integration]]></title>
            <link>https://samer-younes.medium.com/thoughts-on-nextcloud-openproject-integration-8a9e2bef40dd?source=rss-4bce3e86561b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a9e2bef40dd</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[groupware]]></category>
            <category><![CDATA[integration]]></category>
            <category><![CDATA[project-management]]></category>
            <dc:creator><![CDATA[Samer Younes]]></dc:creator>
            <pubDate>Fri, 14 May 2021 14:00:52 GMT</pubDate>
            <atom:updated>2021-05-14T14:24:47.113Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*Mp2Z9XnvcsjxhpMxfDpPvw.jpeg" /></figure><h3>Thoughts on NextCloud + OpenProject Integration</h3><p>Recent news of integration between NextCloud and OpenProject was welcomed by the broader community and felt like a natural progression that bordered on overdue.</p><p>Having designed, deployed and maintained both these projects on enterprise self-hosted systems for a while now, it felt like the integrations between these two projects was finally sounding the advent of corporate groupware that would provide the flexibility, and interoperability towards more productivity for end users on one end, as well as better control and management over data processes from a systems perspective.</p><p>Typical groupware solutions revolve around three main axes: Collaboration, Communication, Infrastructure, with each of these axes comprising a number of interrelated components that form the groupware stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YnI0FQvCOLxpianODDRWFg.png" /><figcaption>The three axes of Groupware and their components</figcaption></figure><p>Project management solutions share a lot of similar components with Groupware, chiefly Communication and Infrastructure with an approach to Collaboration revolving mainly around the distribution of tasks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*91AijsUv_j0VsdskzZ5lJQ.png" /><figcaption>Groupware + Project Management axes and components</figcaption></figure><p>By integrating the key components of Project Management with Groupware, we can achieve a higher level of sharing on the Collaboration axis and leverage in parallel the Communication components already in place to keep teams appraised either asynchronously or in real-time depending on the communication components available.</p><p>This in turn would lead to better insight into the project(s) progress as well as keep a clearer trail of assignments, responsibilities and accountability throughout the project lifecycle.</p><p>Project templates and reusability also benefit from decoupling the Project Management Collaboration axis from the ones below by providing a higher level of abstraction while leveraging the pre-existing components in the Communication and Infrastructure axes.</p><p>Interfacing the Project Management components with their Groupware equivalents also provides a more streamlined and simplified view of projects for managers and users alike who may not want or require the more detailed views that usually accompany project management interfaces.</p><p>This can also be used to provide a dashboard like view of all projects and their respective timelines while still allowing stakeholders to participate in the conversation and outcome by providing them with this more simplified interface, all from within the groupware layers.</p><p>In this specific case NextCloud’s Tasks and Deck apps can certainly be used as a simplified presentational tools for OpenProject’s project(s) while still being a conduit to the Communication and Infrastructure layers already available via the Deck interface.</p><p>Same applies to the Calendar component in Groupware where tasks assigned in projects also appear in the calendar allowing for better time planning and management with events that go beyond the scope of the projects.</p><p>Though early days, the integration of these two projects presents a boon for their corresponding user bases as more convergence and cross functionalities between both projects start to see the light.</p><p>Exciting times indeed looking forward to further integration towards a more streamlined and productive usage of both these platforms while simplifying the user experience and the systems maintenance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a9e2bef40dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enhanced Windows Monitoring with Sysmon, Graylog and Winlogbeat]]></title>
            <link>https://samer-younes.medium.com/enhanced-windows-monitoring-with-sysmon-graylog-and-winlogbeat-77110818882f?source=rss-4bce3e86561b------2</link>
            <guid isPermaLink="false">https://medium.com/p/77110818882f</guid>
            <category><![CDATA[dashboard]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[sysmon]]></category>
            <category><![CDATA[logs]]></category>
            <category><![CDATA[graylog]]></category>
            <dc:creator><![CDATA[Samer Younes]]></dc:creator>
            <pubDate>Mon, 01 Mar 2021 11:53:18 GMT</pubDate>
            <atom:updated>2021-03-15T17:46:40.414Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SFeJ6iNpTZhsHAo97TJXPQ.jpeg" /></figure><h3>Overview</h3><p>This article covers configuring Graylog’s Winlogbeat sidecar to process Sysmon events from the Windows event log and parse it into relevant fields that allow more detailed and actionable information to be extracted and viewed in a Graylog dashboard. It is meant to update the original article published on Graylog’s Blog but which contains an outdated pipeline script and some configuration options for newer Graylog deployments beyond version 3.2. The original article can be read by following this <a href="https://www.graylog.org/post/back-to-basics-enhance-windows-security-with-sysmon-and-graylog">link</a>.</p><p>Pre-requisties include a working Graylog deployment with a running Beats input endpoint, as well as a functioning Windows deployment to install and run Sysmon on.</p><h3>Rationale for Sysmon</h3><p>Monitoring Microsoft Windows deployments using the venerable Event Viewer can be tedious especially when having to deal with multiple deployments.</p><p>The stock events as well as the group policy and auditing events that can be enabled in Windows can also be helpful at the expense of log volume and frequency. Though thorough and comprehensive, some key aspects of the Windows subsystem still remain unchecked; enter Sysmon by Sysinternals.</p><p>Originally developed by Mark Russinovich as part of a set of Windows utilities, <a href="https://docs.microsoft.com/en-us/sysinternals/downloads/sysmon#:~:text=System%20Monitor%20(Sysmon)%20is%20a,changes%20to%20file%20creation%20time.">Sysmon</a> is now an integral tool in the Microsoft arsenal with the latest iterations being co-developed with Thomas Garnier. Version 13 was released with a number new features that include among others a process image tampering event that reports when the mapped image of a process doesn’t match the on-disk image file, or the image file is locked for exclusive access. These indicators are triggered by process hollowing and process <a href="https://jxy-s.github.io/herpaderping/#:~:text=Process%20Herpaderping%20is%20a%20method,products%20and%20the%20OS%20itself.">herpaderping</a>.</p><p>Sysmon is meant to complement the Windows logging subsystem not replace it, though it does add a level of visibility that can be invaluable when diagnosing malware or other system instabilities.</p><p>The Sysmon driver though is as good as the configuration file used to run it. It is essential that it be customized to the environment and system(s) being monitored to provide essential event logs into the system’s performance and behavior. An excellent and comprehensive starter config can be found in SwiftOnSecurity’s <a href="https://github.com/SwiftOnSecurity/sysmon-config">Git repo</a> pre-configured for general-use case and with excellent in file comments that document the various modules, functions and effects.</p><p>Once the configuration file ready and Sysmon downloaded on the target system, installing and running using the desired file is as straightforward as running the following command from an elevated command prompt:</p><pre>sysmon.exe -accepteula -i sysmonconfig-export.xml</pre><p>This installs Sysmon as a service, that auto starts upon system reboot.</p><p>If any changes are made to the config file while Sysmon is running, the configuration can be updated on the fly through an elevated command prompt:</p><pre>sysmon.exe -c sysmonconfig-export.xml</pre><p>To uninstall Sysmon simply issue the following command from an elevated command prompt:</p><pre>sysmon.exe -u</pre><h3>Winlogbeat Sidecar</h3><p>As mentioned in the overview section, a working Graylog deployment with a functioning Beats input is needed in order to ingest the events generated by Sysmon on the target machine.</p><p>Starting with Graylog v3, the sidecar subsystem went through a complete overhaul; sidecar agents can now be managed directly from the Graylog server and push configurations to Windows clients from a centralized location offering ease of management and deployment.</p><p>The following assumes that the Windows machine already has a deployed sidecar being managed through Graylog. If not please have a look at Graylog’s documentation on how to go about that <a href="https://docs.graylog.org/en/4.0/pages/sidecar.html">here</a>.</p><p>The latest Graylog deployment (4.0.5 as of this writing) was used to run the configurations and transformations outlined in this article.</p><p>Below is a sample Winlogbeat configuration that can be deployed to the remote agent to collect Sysmon events from the Event Log:</p><pre># Needed for Graylog<br>fields_under_root: true<br>fields.collector_node_id: ${sidecar.nodeName}<br>fields.gl2_source_collector: ${sidecar.nodeId}</pre><pre>output.logstash:<br>   hosts: [&quot;[[Graylog Server IP Address]]:5044&quot;]<br>path:<br>  data: C:\Program Files\Graylog\sidecar\cache\winlogbeat\data<br>  logs: C:\Program Files\Graylog\sidecar\logs<br>tags:<br> - windows<br>winlogbeat:<br>  event_logs:<br>   - name: Application<br>   - name: System<br>   - name: Security<br>   - <strong>name: Microsoft-Windows-Sysmon/Operational</strong></pre><p>The above configuration uses the default event node name created by Sysmon “Microsoft-Windows-Sysmon/Operational”.</p><h3>Graylog Pipelines — Where the magic happens</h3><p>Now that Sysmon logs are being ingested into Graylog its time to do some pre-processing on the data being ingested in order to create actionable fields mapped to Sysmon in order to search, manipulate and display Sysmon specific data.</p><p>To do this, a pipeline needs to be created and associated with the Stream to which the beats input in Graylog was configured to write to. For a full read-up on Graylog pipelines follow this <a href="https://docs.graylog.org/en/4.0/pages/pipelines/pipelines.html?highlight=pipeline#pipeline-structure">link</a>.</p><p>Our pipeline will be composed of two Stages:</p><ul><li>Stage 0: Renames specific Winlogbeat fields to Sysmon in order to distinguish them.</li></ul><pre>rule &quot;Stage 0 Sysmon Cleanup&quot;  </pre><pre>when   </pre><pre>// Only run for Sysmon messages  <br>has_field(&quot;winlogbeat_source_name&quot;) &amp;&amp; $message.winlogbeat_source_name == &quot;Microsoft-Windows-Sysmon&quot;  </pre><pre>then    </pre><pre>// Rename some fields to clean up   rename_field(&quot;winlogbeat_computer_name&quot;, &quot;sysmon_computer_name&quot;);   rename_field(&quot;winlogbeat_event_data_Image&quot;, &quot;sysmon_data_process&quot;);   rename_field(&quot;winlogbeat_event_data_UtcTime&quot;, &quot;sysmon_data_utc_time&quot;);   rename_field(&quot;winlogbeat_event_id&quot;, &quot;sysmon_event_id&quot;);   rename_field(&quot;winlogbeat_level&quot;, &quot;sysmon_data_level&quot;);   rename_field(&quot;winlogbeat_task&quot;, &quot;sysmon_task&quot;);   rename_field(&quot;winlogbeat_event_data_User&quot;, &quot;sysmon_data_user&quot;);   rename_field(&quot;winlogbeat_event_data_TargetFilename&quot;, &quot;sysmon_data_file_created&quot;);   rename_field(&quot;winlogbeat_event_data_CreationUtcTime&quot;, &quot;sysmon_data_file_created_time&quot;);   rename_field(&quot;winlogbeat_event_data_PreviousCreationUtcTime&quot;, &quot;sysmon_data_file_created_time_previous&quot;);   rename_field(&quot;winlogbeat_user_name&quot;, &quot;sysmon_data_user_name&quot;);   rename_field(&quot;winlogbeat_thread_id&quot;, &quot;sysmon_thread_id&quot;);    rename_field(&quot;winlogbeat_user_domain&quot;, &quot;sysmon_user_domain&quot;);   rename_field(&quot;winlogbeat_user_identifier&quot;, &quot;sysmon_user_identifier&quot;);   rename_field(&quot;winlogbeat_user_type&quot;, &quot;sysmon_user_type&quot;);   rename_field(&quot;winlogbeat_event_data_DestinationHostname&quot;, &quot;sysmon_dns_lookup&quot;);   rename_field(&quot;winlogbeat_event_data_DestinationIp&quot;, &quot;sysmon_dns_lookup_ip&quot;);   rename_field(&quot;winlogbeat_event_data_DestinationPort&quot;, &quot;sysmon_dest_port&quot;);   rename_field(&quot;winlogbeat_event_data_DestinationPortName&quot;, &quot;sysmon_dest_port_name&quot;);   rename_field(&quot;winlogbeat_event_data_Initiated&quot;, &quot;sysmon_con_initiated&quot;);   rename_field(&quot;winlogbeat_event_data_Protocol&quot;, &quot;sysmon_con_proto&quot;);   rename_field(&quot;winlogbeat_event_data_SourceHostname&quot;, &quot;sysmon_src_name&quot;);   rename_field(&quot;winlogbeat_event_data_SourceIp&quot;, &quot;sysmon_src_ip&quot;);   rename_field(&quot;winlogbeat_event_data_SourcePort&quot;, &quot;sysmon_src_port&quot;);   rename_field(&quot;winlogbeat_event_data_SourcePortName&quot;, &quot;sysmon_src_port_name&quot;);   rename_field(&quot;winlogbeat_event_data_CommandLine&quot;, &quot;sysmon_cmd_event&quot;);   rename_field(&quot;winlogbeat_event_data_CurrentDirectory&quot;, &quot;sysmon_cmd_location&quot;);   rename_field(&quot;winlogbeat_event_data_Hashes&quot;, &quot;sysmon_cmd_hash&quot;);   rename_field(&quot;winlogbeat_event_data_IntegrityLevel&quot;, &quot;sysmon_cmd_integrity&quot;);   rename_field(&quot;winlogbeat_event_data_LogonId&quot;, &quot;sysmon_cmd_logon_id&quot;);   rename_field(&quot;winlogbeat_event_data_ParentCommandLine&quot;, &quot;sysmon_cmd_parent_cmd&quot;);   rename_field(&quot;winlogbeat_event_data_ParentImage&quot;, &quot;sysmon_cmd_parent_file&quot;);   rename_field(&quot;winlogbeat_event_data_ParentProcessId&quot;, &quot;sysmon_cmd_parent_pid&quot;);   rename_field(&quot;winlogbeat_event_data_TerminalSessionId&quot;, &quot;sysmon_cmd_terminal_pid&quot;);   rename_field(&quot;winlogbeat_event_data_LogonGuid&quot;, &quot;sysmon_cmd_logon_guid&quot;);   rename_field(&quot;winlogbeat_event_data_ParentProcessGuid&quot;, &quot;sysmon_cmd_parent_guid&quot;);     </pre><pre>// Remove clutter.   <br>let fix = regex(&quot;^\\{(\\S+)\\}$&quot;, to_string($message.winlogbeat_event_data_ProcessGuid));   set_field(&quot;sysmon_data_process_guid&quot;, to_string(fix[&quot;0&quot;]));   remove_field(&quot;winlogbeat_event_data_ProcessGuid&quot;);    </pre><pre>let fix = regex(&quot;^\\{(\\S+)\\}$&quot;, to_string($message.winlogbeat_provider_guid));   set_field(&quot;sysmon_data_provider_gui&quot;, to_string(fix[&quot;0&quot;]));   remove_field(&quot;winlogbeat_provider_guid&quot;);     </pre><pre>// Remove unwanted fields   <br>remove_field(&quot;name&quot;);   <br>remove_field(&quot;tags&quot;);   <br>remove_field(&quot;type&quot;);    </pre><pre>// Remove winlogbeats fields we don&#39;t need   remove_field(&quot;winlogbeat_event_data_ProcessId&quot;);   remove_field(&quot;winlogbeat_log_name&quot;);   remove_field(&quot;winlogbeat_opcode&quot;);   remove_field(&quot;winlogbeat_process_id&quot;);   remove_field(&quot;winlogbeat_record_number&quot;);   remove_field(&quot;winlogbeat_source_name&quot;);   remove_field(&quot;winlogbeat_tags&quot;);   remove_field(&quot;winlogbeat_type&quot;);   remove_field(&quot;winlogbeat_version&quot;);   remove_field(&quot;winlogbeat_event_data_SourceIsIpv6&quot;);   remove_field(&quot;winlogbeat_event_data_DestinationIsIpv6&quot;);  </pre><pre>end</pre><ul><li>Stage 1: Performs IP lookups and threat intel lookup using Graylog’s built-in threat-intel-lookup data adapter.</li></ul><pre>rule &quot;Stage 1 Sysmon Threatintel&quot;  </pre><pre>when   </pre><pre>// To save CPU cycles, only run if there is something to look up  has_field(&quot;ip&quot;)  </pre><pre>then    </pre><pre>// look up the requested DNS captured by sysmon   <br>// this will be the most fired rule   <br>let sysmon_dns_lookup_intel = threat_intel_lookup_domain(to_string($message.query_domain), &quot;sysmon_dns_lookup&quot;);   <br>set_fields(sysmon_dns_lookup_intel);    </pre><pre>// look up the ip from the DNS answer   <br>// if we do not monitor the dns, then this might be nice to have   let sysmon_lookup_ip_answer_intel = threat_intel_lookup_ip(to_string($message.query_answer), &quot;sysmon_dns_lookup_ip&quot;);   set_fields(sysmon_lookup_ip_answer_intel);    </pre><pre>// look up the requesting IP   <br>// this is useful if dealing with non internal IPs    <br>// so you know if your IP is seen as a problem   let sysmon_src_ip_answer_intel = threat_intel_lookup_ip(to_string($message.query_answer), &quot;sysmon_src_ip&quot;);   <br>set_fields(sysmon_src_ip_answer_intel);    </pre><pre>// WHOIS lookup. This is disabled by default. Enable and carefully watch latency and performance.   <br>// let sysmon_dns_lookup_ip_whois = whois_lookup_ip(to_string($message.query_answer), &quot;sysmon_dns_lookup_ip&quot;);   <br>// set_fields(sysmon_dns_lookup_ip_whois);  </pre><pre>end</pre><ul><li>Stage 1&#39;: adds a threat_indicated field if the threat intel from Stage 1 returns <strong>true</strong>.</li></ul><pre>rule &quot;Stage 1&#39; Sysmon Threatintel Inflate&quot;  </pre><pre>when   <br>// run only if one of the fields is true  to_bool($message.src_threat_indicated) || to_bool($message.dst_threat_indicated)  </pre><pre>then    <br>// This is to make Graylog searches easy   <br>// -- Enables searches like threat_indicated:true   set_field(&quot;threat_indicated&quot;, true);  </pre><pre>end</pre><p>Thanks to <a href="https://community.graylog.org/t/sysmon-script-not-pulling-in-logs/10750"><strong>apitest2</strong></a> from the Graylog community for updating the Graylog pipeline rules to work.</p><h3>Graylog Dashboard</h3><p>By this stage log ingestion and pipeline transformations should be up and running. Given the frequency and volume of logs that may be generated by Sysmon, having a summary of key indicators is essential to pave the way to more in-depth investigations when needed.</p><p>Graylog dashboards provide a convenient space to present and visualize large volume of information using charts and data tables. This convenience also allows for quick data drill-down based on selected criteria.</p><p>The dashboard is a representation of specific fields combinations that represent meaningful actionable information. As such this can vary from one deployment to another depending on requirements and key indicators. The dashboard presented herein is but a sample but provides a solid starter to further explore.</p><p>For details on how to go about creating a dashboard refer to the following Graylog documentation <a href="https://docs.graylog.org/en/4.0/pages/dashboards.html">here</a>.</p><p>Here is a sample widget that shows the count of tasks monitored by Sysmon over a time span of 1 hour.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WaLtR3ki-8HtClCVEQqhOw.jpeg" /></figure><p>You can build a set of widgets relevant to your use case by leveraging Graylog’s search capabilities to produce a full fledged dashboard based on the newly created fields like the sample below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wfzTKqMO2PI7W8Gg_15MbQ.jpeg" /><figcaption>Graylog Sysmon Dashboard</figcaption></figure><h3>Conclusion</h3><p>In this article we gave a quick overview of how to leverage the power of Sysmon events, ingest and transform them in Graylog and visually present the information in a meaningful dashboard that summarizes key indicators that are being monitored.</p><p>As mentioned in the introduction this is a rewrite of an existing article in Graylog’s blog dating back to 2017 which is now out of date. So i hope this article will help those getting started with Sysmon and Graylog to leverage the informational insights this combination provides.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77110818882f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Installing and Configuring Keycloak - Domain Clustered Deployment]]></title>
            <link>https://samer-younes.medium.com/installing-and-configuring-keycloak-domain-clustered-deployment-fe941146d3c4?source=rss-4bce3e86561b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe941146d3c4</guid>
            <category><![CDATA[configuration]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[keycloak]]></category>
            <category><![CDATA[cluster]]></category>
            <dc:creator><![CDATA[Samer Younes]]></dc:creator>
            <pubDate>Mon, 18 Jan 2021 17:08:14 GMT</pubDate>
            <atom:updated>2021-01-18T17:08:14.369Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ONds4jRQSf4vGeKNUCe95w.png" /></figure><h3>Overview</h3><p>Keycloak is an open source IAM developed as part of the RedHat community and ecosystem. It allows for securing applications and providing authorization and authentication services straight from within it, through federated services or external providers such as Active Directory, OpenLDAP, Social Login services (Facebook, Google, etc.) and programmatic Client Adapters via OpenID Connect, OAuth2 and SAML2.0.</p><p>The flexibility provided by Keycloak can be very advantageous when properly utilized within a existing production environment allowing securing applications and better controlling authentication and authorization with minimum overhead and code rewrite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*X6ilD79HIyjYmqvtb76vPw.png" /><figcaption>Source: keycloak.org</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*YBu5N5fuFQe7Mg-R-6juDw.png" /><figcaption>Source: keycloak.org</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*1-7576C6oiShzUlM7pIq9Q.png" /><figcaption>Source: keycloak.org</figcaption></figure><p>The subject of application security is quite wide and diverse and is specific to need, so in this article we will focus solely on the installation and configuration of Keycloak as a Domain Cluster deployment, which offers centralized configuration management as well as high availability fault tolerance through WildFly admin panel for deployment and load balancing services, as well as Keycloak’s admin panel for managing Realms, authentication and authorizations services, users and groups.</p><h3>Pre-Requisites</h3><p>Keycloak requires a Java runtime environment to be installed. On Ubuntu you can install the default OpenJDK for your distribution as long as its Java 8 or 11 for the latest release.</p><p>The simplest way to install the default JRE on Ubuntu 18.06 is by using the apt package manager and then checking java is installed by having it print out its current active version:</p><pre>$ apt install default-jre<br>...<br>$ java --version</pre><p>In a clustered deployment, Keycloak also requires a working installation RDBMS installation such as MariaDB or MySQL. Make sure one is installed and properly working before continuing.</p><h3>Installing Keycloak</h3><ol><li>Download <strong>keycloak-12.0.1.zip</strong> from <a href="https://www.keycloak.org/downloads.html">Keycloak downloads</a>.</li><li>Place the file in a /opt.</li><li>Unpack the ZIP file using the appropriate unzip utility, such as unzip, tar, or Expand-Archive.</li><li>Linux/Unix<br>$ unzip keycloak-12.0.1.zip</li></ol><h3>Quick Start</h3><p>Keycloak can be quickly started in standalone mode with little to no modification to its default configuration.</p><p>Only an admin user is needed to login to Keycloak and is usually created via the Keycloak welcome screen if logging in via localhost or using the add-user-keycloak CLI script located under /bin directory under Keycloak home, as follows:</p><pre>$ bin/add-user-keycloak.sh -r master -u &lt;username&gt; -p &lt;password&gt;</pre><p>Once the user created you can launch the standalone deployment of Keycloak for a quick test through the following script:</p><pre>$ cd bin /<br>$ ./standalone.sh -b [IP ADDRESS]</pre><p>From your browser go to the selected IP address you bound the server to on port 8080 i.e. http://[IP ADDRES]:8080/auth</p><p>Use the created username and password for the master realm using the add-user-keycloak.sh script to login. Once certain that Keycloak starts in standalone mode, its time to start modifying the needed configuration files to allow for a Clustered Domain deployment.</p><p>The following section outlines the changes required to specific configuration files JDBC Datasource/Drivers required to connect to an RDBMS, the necessary changes to make to allow access to the WildFly application management server.</p><h3>Keycloak Directory Structure &amp; Key Configuration Files</h3><p>Below are the most pertinent directories for the purpose of this article:</p><h4>Directories</h4><p><strong><em>bin</em></strong><em>/ <br></em>This contains various scripts to either boot the server or perform some other management action on the server.</p><p><strong><em>domain/</em></strong><em><br></em>This contains configuration files and working directory when running Keycloak in domain mode.</p><p><strong><em>modules/</em></strong><em><br></em>These are all the Java libraries used by the server.</p><p><strong><em>standalone/</em></strong><em><br></em>This contains configuration files and working directory when running Keycloak in standalone mode.</p><h4>Configurations</h4><p><strong><em>standalone/configuration/standalone.xml</em></strong><br>The default configuration file for launching Keycloak in Standalone mode.</p><p><strong><em>domain/configuration/domain.xml</em></strong><br>The default configuration file for launching Keycloak in Domain Clustered mode. The file is broken down into two main profiles, <em>standalone</em> (HA) and <em>clustered</em>. For the purposes of this article we will be focusing on the <em>clustered</em> profile section for our changes (though making changes to both profiles would be totally ok as well).</p><p><strong><em>domain/configuration/host.xml</em></strong><br>Contains the WildFly default configuration for Domain Clustered mode, including built-in load balancer settings and Wildfly administration binding addresses</p><p><strong><em>domain/configuration/host-master.xml</em></strong><br>The domain primary controller and authentication node configuration options</p><p><strong><em>domain/configuration/host-slave.xml</em></strong><br>The domain slave authentication node(s) configuration options. <br>(P.S. By default only one node is configured)</p><h3>Topology of a Domain Clustered Deployment</h3><p>As mentioned earlier when deploying Keycloak in a Domain Clustered mode, the underlying cluster is controlled centrally via a domain host controller through WildFly, the application runtime management platform.</p><p>The diagram below covers the general topology of Domain Clustered deployment generalized to any runtime application using WildFly and not specific just to Keycloak.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*muHHfzZZHRPwhqnRkugtVQ.png" /><figcaption>Source: wildfly.org</figcaption></figure><p>Host 1 is the main Domain controller but can also host a Server component as well.</p><p>The slave hosts 2 through 4 all have local Host Controllers that synchronize with the Domain controller.</p><p>Two additional elements not shown in the diagram above are:</p><p>1- The built-in load balancer which also usually runs on the main domain controller and can distribute traffic across the cluster. Keycloak recommends not using the WildFly’s built-in load balancer but rather rely on a third party hardware or software solution.</p><p>2- When deploying Keycloak in Domain Clustered mode a RDBMS systems is mandatory in order to provide the master and slave with a centralized managed data repository for settings and controls.</p><p>To manage all these various services (RDBMS excluded), a number of interfaces are predefined in WildFly in order to create logical parts for each of the components.</p><p>Three main interfaces are included in Keycloak:</p><h4>Management Interface</h4><p>Primarily for accessing the WildFly application runtime administration environment. By default this is bound to the loopback interface (127.0.0.1).</p><h4>Private Interface</h4><p>Used for the host controller, load balancing and multicast components of WildFly. Often the management and private interfaces share the same physical host interface. As with the management interface, it is bound by default to the loopback interface (127.0.0.1).</p><h4>Public Interface</h4><p>Is used to access the Keycloak application layer and is usually bound to the host’s public facing physical interface.</p><blockquote><strong>Note:<br></strong>Before modifying the configuration files make sure that the server is not running. If it is, then changes to some of the parameters in these files may be overwritten or removed by the domain controller.</blockquote><h3>Making the Wildfly Console Interface Publicly Accessible</h3><p>As mentioned earlier, when launching Keycloak in Clustered mode, the Wildfly application management server is the first to be bootstrapped.</p><p>When testing Clustered Keycloak on a local machine, Wildfly console interface is directly accessible through the loopback interface on port 9<strong>990</strong>. Note that even on the loopback interface a management user needs to be created in order to access the management admin interface; <em>(you can skip the configuration file changes and go straight to creating a management user via the CLI tool)</em>.</p><p>If running in production, this might not be possible and therefore some configuration changes are in order to make the management interface accessible through one of the host’s interfaces. Usually in production, the management IP would be bound to a dedicated physical ethernet interface which in turn is on a private network only accessible to select administrators.</p><p>For the purpose of this example we do not make that distinction but only bind the management console to the host’s unique IP interface.</p><p>In order to do so the domain.xml, host.xml and host-master.xml management interface block needs to be updated as follows.</p><h4>domain.xml</h4><pre>&lt;!-- domain.xml --&gt;<br>...<br>&lt;interfaces&gt;<br>    &lt;interface name=&quot;management&quot;/&gt;<br>    &lt;interface name=&quot;private&quot;&gt;<br>        &lt;inet-address value=&quot;${jboss.bind.address.private:<strong>[[Public IPv4 Address]]</strong>}&quot;/&gt;<br>    &lt;/interface&gt;<br>    &lt;interface name=&quot;public&quot;/&gt;<br>    &lt;/interfaces&gt;<br>...</pre><h4>host.xml</h4><pre>&lt;!-- host.xml --&gt;<br>...<br>&lt;interfaces&gt;<br>    &lt;interface name=&quot;management&quot;&gt;<br>        &lt;inet-address value=&quot;${jboss.bind.address.management:<strong>[[Public IPv4 Address]]</strong>}&quot;/&gt;<br>    &lt;/interface&gt;<br>...<br>&lt;/interfaces&gt;<br>...</pre><h4>host-master.xml</h4><pre>&lt;!-- host-master.xml --&gt;<br>...<br>&lt;interfaces&gt;<br>    &lt;interface name=&quot;management&quot;&gt;<br>        &lt;inet-address value=&quot;${jboss.bind.address.management:<strong>[[Public IPv4 Address]]</strong>}&quot;/&gt;<br>    &lt;/interface&gt;<br>...<br>&lt;/interfaces&gt;<br>...</pre><p>One additional step is needed in order to login and that’s the creation of a management account for authentication via the CLI script bin/add-user.sh.</p><p>Note that when prompted to enter a group select Administrator if you’re going to be using RBAC in Wildfly otherwise the default none works as well; this can always be changed later via the Wildfly admin interface.</p><p>On another note, make sure to to answer yes when asked wether the user would be needed to connect from one AS server to another and take note of the secret hash generated which is required when configuring the slave node.</p><pre>$ ./add-user.sh</pre><pre>What type of user do you wish to add?<br>a) Management User (mgmt-users.properties)<br>b) Application User (application-users.properties)<br>(a): a</pre><pre>Enter the details of the new user to add.<br>Using realm &#39;ManagementRealm&#39; as discovered from the existing property files.<br>Username : <strong>wadmin<br></strong>Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.<br>- The password should be different from the username<br>- The password should not be one of the following restricted values {root, admin, administrator}<br>- The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)<br>Password :<br>Re-enter Password :<br>What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]: <strong>Administrator<br></strong>About to add user &#39;wadmin&#39; for realm &#39;ManagementRealm&#39;<br>Is this correct yes/no? <strong>yes<br></strong>Added user &#39;wadmin&#39; to file &#39;/opt/keycloak/standalone/configuration/mgmt-users.properties&#39;<br>Added user &#39;wadmin&#39; to file &#39;/opt/keycloak/domain/configuration/mgmt-users.properties&#39;\<br>Added user &#39;wadmin&#39; with groups Administrator to file &#39;/opt/keycloak/standalone/configuration/mgmt-groups.properties&#39;<br>Added user &#39;wadmin&#39; with groups Administrator to file &#39;/opt/keycloak/domain/configuration/mgmt-groups.properties&#39;<br>Is this new user going to be used for one AS process to connect to another AS process?<br>e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.<br>yes/no? <strong>yes<br></strong>To represent the user add the following to the server-identities definition &lt;<strong>secret value=&quot;bWdtdDEyMyE=</strong>&quot; /&gt;</pre><p>Once this user added, use the provided credentials when prompted upon accessing the console admin interface.</p><p>With the above changes made and management user added, the Wildfly management admin interface will be available via the browser at: <a href="http://[[Public"><strong>http://[[Public</strong></a><strong> IPv4 Address]]:9990/</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZAS5mR9XbZRk-Djnhj-UhQ.png" /><figcaption>Wildfly Administration Console Homepage</figcaption></figure><p>The various deployed services controller, application, load balancer) can also be monitored and controlled via Topology under the Runtime tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VtVYbEv_VYJbwwgk7qtlvA.png" /><figcaption>Deployed Services Status Overview and Control</figcaption></figure><h3>Configuring Keycloak to Use a Database Connection</h3><p>As mentioned earlier, when deploying Keycloak in Domain Clustered mode, an RDBMS is required in order to centralize settings and controls for the master node and its slaves.</p><p>By default, Keycloak uses the H2 JDBC Driver which it comes preconfigured for, loading and using a memory loaded database directly when running out of the box.</p><p>It is beyond the scope of this article to delve into the details of such an RDBMS deployment which can take multiple forms depending on scalability, availability and performance needs.</p><p>Usually in production environments a database cluster deployment would be considered to cover three parameters listed earlier along with the necessary tweaks to maximize performance.</p><p>For the purposes of this example we will be using MariaDB and it’s JDBC Connector Driver as a backend. A database schema named <strong><em>keycloak</em></strong> should have already been created along with a user with full grants to that database.</p><blockquote><strong>Note:</strong><br>When creating the database using the latest MariaDB (or MySQL). the <strong>InnoDB</strong> engine should be enabled and the database should be created using <strong>UTF8</strong> character set rather than the default <strong>UTF8mb4</strong> which is not compatible with Keycloak.</blockquote><p>For starters download the corresponding JDBC driver for the database being used. For MariaDB the JDBC the latest driver can be download from the following <a href="https://mariadb.com/kb/en/about-mariadb-connector-j/">link</a>. Make sure the driver matches the Java version installed on the system being deployed to.</p><p>Recent versions of Keycloak will automagically load JDBC drivers properly installed under the<em> </em><strong><em>modules/</em></strong> folder. To do so the driver’s <strong><em>.jar</em> </strong>file can be placed in a folder structure that follows that driver’s package name. In this case we opted for <strong><em>modules/com/mariadb/main/</em></strong> or any other logical structure that works making the path unique to that module to avoid namespace clashes.</p><p>In addition to the <strong><em>.jar</em></strong> file a <strong><em>module.xml</em></strong> file should also be created within the same directory in order to provide WildFly with the necessary information to automagically create the Datasource when launching Keycloak. In our example the <strong><em>module.xml </em></strong>looks as follows:</p><pre><strong>&lt;?xml version=&quot;1.0&quot; ?&gt;<br>&lt;module xmlns=&quot;urn:jboss:module:1.3&quot; name=&quot;com.mariadb&quot;&gt;<br>    &lt;resources&gt;<br>        &lt;resource-root path=&quot;mariadb-java-client-2.7.1.jar&quot;/<br>    &lt;/resources&gt;</strong></pre><pre><strong>    &lt;dependencies&gt;<br>        &lt;module name=&quot;javax.api&quot;/&gt;<br>        &lt;module name=&quot;javax.transaction.api&quot;/&gt;<br>    &lt;/dependencies&gt;<br>&lt;/module&gt;</strong></pre><p>Once the files copied/created to the above location, a number of changes are needed to <strong><em>domain.xml</em></strong> configuration in order to use the new JDBC driver as the data source. Update both the <em>standalone</em> and <em>clustered</em> sections.</p><p>Locate the drivers tag in both sections and append a new driver child tag:</p><pre>...<br>&lt;datasource&gt;<br>    ...<br>&lt;/datasource&gt;<br>&lt;drivers&gt;<br>    <strong>&lt;driver name=&quot;mariadb&quot; module=&quot;com.mariadb&quot;&gt;<br>        &lt;driver-class&gt;org.mariadb.jdbc.Driver&lt;/driver-class<br>    &lt;/driver&gt;</strong><br>...<br>&lt;/drivers&gt;<br>...</pre><p>You will find a driver entry already exist for the H2 JDBC driver; do not remove it, just append the above before it.</p><p>This change will need to be done twice in the <em>standalone</em> and <em>clustered</em> sections of the <strong>domain.xml</strong> file.</p><p>Next we move on to update the <strong>&lt;datasource&gt;</strong> section to provide the connection string, credentials and connection options using the newly added MariaDB driver.</p><p>By default Keycloak will come with two preconfigured datasources: ExampleDS and KeycloakDS that use the H2 JDBC driver.</p><p>For simplicity, we will reuse the KeycloakDS JNDI datasource and link it to MariaDB rather than the H2.</p><pre>...<br>&lt;datasource jndi-name=&quot;java:jboss/datasources/KeycloakDS&quot; pool-name=&quot;KeycloakDS&quot; enabled=&quot;true&quot; use-java-context=&quot;true&quot; statistics-enabled=&quot;${wildfly.datasources.statistics-enabled:${wildfly.statistics-enabled:false}}&quot;&gt;<br>    <strong>&lt;connection-url&gt;jdbc:mariadb://[DB IP Address]:3306/keycloak&lt;/connection-url&gt;<br>    &lt;driver&gt;mariadb&lt;/driver&gt;<br>    &lt;security&gt;<br>        &lt;user-name&gt;[DB Username]&lt;/user-name&gt;<br>        &lt;password&gt;[DB Password]&lt;/password&gt;<br>    &lt;/security&gt;</strong><br>&lt;/datasource&gt;<br>...</pre><p>To make sure all is in order, two more sections in <strong>domain.xml </strong>need to be checked to make sure that the keycloak datasource defined above is the default datasource.</p><p>The &lt;default-binding/&gt;</p><pre>...<br>&lt;default-bindings context-service=&quot;java:jboss/ee/concurrency/context/default&quot; datasource=&quot;java:jboss/datasources/<strong>KeycloakDS</strong>&quot; managed-executor-service=&quot;java:jboss/ee/concurrency/executor/default&quot; managed-scheduled-executor-service=&quot;java:jboss/ee/concurrency/scheduler/default&quot; managed-thread-factory=&quot;java:jboss/ee/concurrency/factory/default&quot;/&gt;<br>...</pre><p>and the &lt;SPI&gt; section which is responsible to populating the database on initial launch:</p><pre>...<br>&lt;spi name=“connectionsJpa&quot;&gt;<br>    &lt;provider name=&quot;default&quot; enabled=&quot;true&quot;&gt;<br>        &lt;properties&gt;<br>            &lt;property name=&quot;dataSource&quot; value=&quot;java:jboss/datasources/<strong>KeycloakDS</strong>&quot;/&gt;<br>            &lt;property name=&quot;initializeEmpty&quot; value=&quot;true&quot;/&gt;<br>            &lt;property name=&quot;migrationStrategy&quot; value=&quot;update&quot;/<br>            &lt;property name=&quot;migrationExport&quot; value=&quot;${jboss.home.dir}/<strong>keycloak-database-update.sql</strong>&quot;/&gt;<br>        &lt;/properties&gt;<br>    &lt;/provider&gt;<br>&lt;/spi&gt;<br>...</pre><p>At this stage the Keycloak master node is ready to be started. You can do so by issuing the following command from Keycloak’s <strong><em>bin/</em></strong> directory:</p><pre>$ sudo ./domain.sh --host-config=host-master.xml \<br>-Djboss.bind.address.private=[[Master Node Public IP]] \<br>-Djboss.bind.address=[[Master Node Public IP]]</pre><p>If any errors are displayed check the possible error messages section later in this document.</p><h3>Setting up the Slave Identity Server</h3><p>The slave identity server can use the same deployment as the master, with the added difference of launching Keycloak using the <strong>host-slave.xml</strong> configuration.</p><p>Copy the configured keycloak directory to the target slave server and edit the <strong>host-slave.xml</strong> file as follows:</p><pre>&lt;management&gt;<br>        ​&lt;security-realms&gt;<br>            ​&lt;security-realm name=&quot;ManagementRealm&quot;&gt;<br>                ​&lt;server-identities&gt;<br>                    ​&lt;secret value=&quot;<strong>bWdtdDEyMyE=</strong>&quot;/&gt;</pre><p>Use the secret saved from earlier when creating the Management User from the <em>./add-user.sh</em> script.</p><p>Next we need to provide the username associated with the above secret as well by editing the following section:</p><pre>...<br>&lt;remote username=&quot;<strong>wadmin</strong>&quot; security-realm=&quot;ManagementRealm&quot;&gt;<br>    &lt;discovery-options&gt;<br>        &lt;static-discovery name=&quot;primary&quot; protocol=&quot;${jboss.domain.master.protocol:remote}&quot; host=&quot;${jboss.domain.master.address:<strong>[[Master Host IP]]</strong>}&quot; port=&quot;${jboss.domain.master.port:9999}&quot;/&gt;<br>    &lt;/discovery-options&gt;<br>&lt;/remote&gt;<br>...</pre><p>Save the file and launch the slave node using the following command:</p><pre>$ ./domain.sh --host-config=host-slave.xml \<br>-Djboss.bind.address.private=[[Slave Node Public IP]] <br>-Djboss.bind.address=[[Slave Node Public IP]]</pre><p>By default Keycloak is configured to bootstrap one master and one slave node named respectively <strong>server1</strong> and <strong>server2</strong>.<strong> </strong>Additional nodes can be added as needed by modifying the host-slave.xml and renaming the server name in the &lt;server&gt; section. All servers belong by default to a group named “<em>auth-server-group”.</em></p><h3>Possible Error Messages</h3><p>As with all complex deployments, it is very probable errors will be encountered. Needless to say that the first thing to check would be any typos such as misspelled configuration names or options and unclosed tags.</p><p>Keycloak’s startup output provides a very detailed error logging which usually allows for efficient tracing.</p><p>Two of the more obscure errors encountered when testing Keycloak and resource strained system posed more fo a challenge to remedy. These are included below for reference:</p><h4>WFLYCTL0348 Timeout:</h4><p>This error usually happens when using a database backend and running Keycloak on a system with constrained resources. The Wildfly management subsystem will timeout before the resources are avaialble to Keycloak and throw the following error:</p><pre>ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0348: Timeout after [300] seconds waiting for service container stability. Operation will roll back. Step that first updated the service container was &#39;add&#39; at address &#39;[(&quot;core-service&quot; =&gt; &quot;management&quot;),(&quot;management-interface&quot; =&gt; &quot;http-interface&quot;)]&#39;</pre><p>To fix this error we need to modify the management.blocking.timeout property by adding it to the <strong>domain.xml</strong> configuration file:</p><pre>...<br>&lt;/extensions&gt;<br>    &lt;system-properties&gt;<br>        &lt;property name=&quot;java.net.preferIPv4Stack&quot; value=&quot;true&quot;/&gt;<br>        <strong>&lt;property name=&quot;jboss.as.management.blocking.timeout&quot; value=&quot;1800&quot;/&gt;</strong><br>    &lt;/system-properties&gt;<br>&lt;management&gt;<br>...</pre><h4>ARJUNA012117: TransactionReaper::Check Timeout</h4><p>Another database and timeout related error stems from the Arjuna TX Manager timing out before completing the initial table creation in the DB and not releasing the Tx lock in a timely manner.</p><p>The full error may look something like this:</p><pre>ARJUNA012117: TransactionReaper::Check Timeout For TX 0:Ffff0a400e22:2251d537:519c37fa:35d4</pre><p>To address the timeout, the coordinator environment timeout should be tweaked in the domain.xml configuration in order to give the Tx manager more time to finish its operations on the database:</p><pre>&lt;coordinator-environment statistics-enabled=&quot;${wildfly.transactions.statistics-enabled:${wildfly.statistics-enabled:false}}&quot; <strong>default-timeout=&quot;1800&quot;</strong>/&gt;</pre><h3>Conclusion</h3><p>Keycloak is an excellent IAM solution and offers excellent support out of the box to standard authentication and authorization mechanisms such as OAuth2.0, OpenID Connect and SAML2.0.</p><p>Integrating applications with Keycloak is also straightforward depending on the used development environment which can range from Python to .NET. Examples using .NET may be published at a later date to provide working proof using both .NET Core and .NET Framework 4.7 via Owin.</p><p>When deploying Keycloak in a production environment the standalone and standalone-ha modes may not provide, respectively, the necessary fault tolerance, centralized management and scalability needed for most medium to large businesses and enterprises.</p><p>This guide offers a brief overview of setting up Keycloak in a Domain Clustered mode and is intended to augment the official Keycloak documentation.</p><p>For further information you can visit the reference links listed below for a more in-depth documentation on deploying, managing and using Keycloak.</p><h3>References</h3><ul><li><strong><em>Keycloak Official Documentation for version 12.0.1</em></strong><em><br></em><a href="https://www.keycloak.org/docs/latest/server_installation/index.html">https://www.keycloak.org/docs/latest/server_installation/index.html</a></li><li><strong><em>Wildfly Official Documentation</em></strong><em><br></em><a href="http://docs.wildfly.org/22/Admin_Guide.html">http://docs.wildfly.org/22/Admin_Guide.html</a></li><li><strong><em>Janua: How to install Keycloak with MariaDB</em></strong><br><a href="https://www.janua.fr/how-to-install-keycloak-with-mariadb/">https://www.janua.fr/how-to-install-keycloak-with-mariadb/</a></li><li><strong><em>Setting up Keycloak Standalone with MySQL Database</em></strong><br><a href="https://medium.com/@pratik.dandavate/setting-up-keycloak-standalone-with-mysql-database-7ebb614cc229">https://medium.com/@pratik.dandavate/setting-up-keycloak-standalone-with-mysql-database-7ebb614cc229</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe941146d3c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Graylog as an SIEM Solution]]></title>
            <link>https://samer-younes.medium.com/graylog-as-an-siem-solution-8a9920d6a3fe?source=rss-4bce3e86561b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a9920d6a3fe</guid>
            <category><![CDATA[compliance]]></category>
            <category><![CDATA[log-management]]></category>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[graylog]]></category>
            <dc:creator><![CDATA[Samer Younes]]></dc:creator>
            <pubDate>Sun, 24 Nov 2019 11:45:38 GMT</pubDate>
            <atom:updated>2019-11-24T17:30:12.082Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*H0HMNUl0m8_az_ruKor3Lg.jpeg" /></figure><h3>What is SIEM and why do we need it</h3><p>In the tech world, acronyms abound, but this particular one is of prime importance and should be a mantra for almost any security and administration team; SIEM stands for Security Information and Event Management and is one of the cornerstones of sound system management and monitoring. In a previous article, I wrote about realtime system monitoring and visualization, and in it, I also touched on the issue of data correlation with events that take place on systems; having a centralized and robust SIEM solution allows all this information to be gathered analyzed, aggregated and correlated and visualized in context, providing a 360 view of your infrastructure when properly setup, as well as instant alerting and providing deep insight to incidents that will arise.</p><h3>Enter Graylog</h3><p>Many SIEM solutions have been developed over the past decade such as <a href="https://www.splunk.com/">Splunk</a> and <a href="https://www.ibm.com/security/security-intelligence/qradar">QRadar</a>, have usually been the domain of large enterprises with deep pockets and massive infrastructure requirements to run them. Although any SIEM solution would require enough processing and storage resources to properly run and operate, smart log retention and rotation can go a long way in helping keeping searches fast, while not losing events and data resolution.</p><p>For the past five years, we’ve been looking for a serious SIEM with Open Source roots that is enterprise ready, easily deployable, scalable and adaptable in terms of data source ingestion, manipulation and output. Enter <a href="https://www.graylog.org/">Graylog</a>!</p><p>Over the past few years we’ve been testing and tweaking Graylog in our test environment trying to get the most out of its many features. The community version comes with a rich feature set, and the Enterprise version adds a lot of key features that simplify reporting or data retention among other things.</p><p>When working with Graylog, I tend to look at it first and foremost as a large stream manipulation engine (you can blame my developer background for that) the flexibility of working with practically any incoming log stream, manipulating and converting it, presenting it and also outputting it to other sources is a boon for most SIEM managers, as it allows fine tweaking, aggregation and correlation of on-the-fly data, which can be incorporated in the log entry itself to augment it and make it more understandable.</p><p>Add to the above, the fact that Graylog comes pre-bundled with a threat intelligence engine and an events and alerts component that can trigger alerts under specified conditions, a feature which has seen much improvement in the 3.1 release, as well as graphical dashboards that allow the visualization of aggregate data, you end up with an enterprise grade SIEM feature set.</p><p>Log ingestion in Graylog supports multiple ingress sources, be it remote syslog or even through it’s sidecar agent, which is managed directly via its web interface. This versatility coupled with first rate stream scripting and manipulation capabilities (think GROK on steroids) and you end up with a very versatile and customizable log management system.</p><p>The underlying <a href="https://www.elastic.co/">elasticsearch</a> engine provides the necessary scalability and search versatility other enterprise grade SIEMs enjoy. A robust web interface and built-in user management and access control also enhances the experience. From a scalability standpoint, Graylog can be deployed asa single node or in a cluster configuration to spread the load in large systems and provide redundancy.</p><p>Overall, our experience with Graylog has been extremely positive and the out-of-the-box features of the community edition were well balanced to hit the ground running with an enterprise level SIEM system. Can’t wait to see the future enhancements and features coming to Graylog. A big shoutout to the Graylog for all their hard work and their contributions back to the Open Source community.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8a9920d6a3fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Realtime Systems Monitoring Using Time Series Databases and Visualization Tools]]></title>
            <link>https://samer-younes.medium.com/realtime-systems-monitoring-using-time-series-databases-and-visualization-tools-f731954e407e?source=rss-4bce3e86561b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f731954e407e</guid>
            <category><![CDATA[dataviz]]></category>
            <category><![CDATA[real-time-analytics]]></category>
            <category><![CDATA[dashboard]]></category>
            <category><![CDATA[timeseries]]></category>
            <dc:creator><![CDATA[Samer Younes]]></dc:creator>
            <pubDate>Sun, 24 Nov 2019 11:42:10 GMT</pubDate>
            <atom:updated>2019-11-24T11:42:10.442Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*7G_qi2jlEAyVOXO9F5Xnjw.jpeg" /></figure><h3>Overview</h3><p>With the pervasiveness of cloud services, hybrid solutions and an explosion of data from ever increasing sources, it is easy for most systems managers to feel overwhelmed with the rising rush of data.</p><p>One of the proven ways of making sense and digesting complex data flows is through timely and pertinent visualization. It allows both specialists and laymen to instantly make sense of data, either in realtime or over a specific timespan, and to help in identifying issues and pinpointing problems in a fairly consistent manner, once properly set up.</p><p>Two challenges stem from dealing with an increasing amount of realtime or near-realtime data; one pertaining to storage and processing, the other to presentation and visualization.</p><h3>Storing and Manipulating Time-dependent Data</h3><p>Traditional relational database management systems are generally designed with particular emphasis on data integrity, atomic operations and either read or write optimization. They are also geared to work particularly well with large amounts of data with unique keys and related data. Working with time sensitive information is possible with RDBMS; however, due to their very architecture, working with single keys spread across time negatively impacts the way data is both stored requirements and accessed as data grows.</p><p>To remedy this issue, a new class of database systems has emerged in the past few years with particular emphasis on storing and manipulating time series data. The very architecture of these databases was geared towards efficient storage and retrieval of time based numeric data in particular and are akin to NoSQL type databases than relational ones. Popular time-series databases include <a href="https://www.influxdata.com/">InfluxDB</a>, <a href="https://graphiteapp.org/">Graphite</a> and <a href="https://prometheus.io/">Prometheus</a>.</p><p>The most prominent features of time-series databases include time-stamp data storage and compression, data lifecycle management, data summarization and aggregation, ability to handle large time series dependent scans of many records and time series aware queries. For a more detailed information you can refer to following links <a href="https://en.wikipedia.org/wiki/Time_series_database">here</a> and <a href="https://medium.com/schkn/4-best-time-series-databases-to-watch-in-2019-ef1e89a72377">here</a>.</p><figure><img alt="Metrics flow from monitored systems to time-series DB to visualization tools" src="https://cdn-images-1.medium.com/max/755/1*o8My2wl_JSHeDwJG6DpE9Q.png" /></figure><h3>Data Acquisition and Presentation</h3><p>Data acquisition and presentation represent respectively data collection and data consumption. We will focus mainly on the presentation aspect of this pipeline, which includes in the middle the time-series DB component, but it’s essential to mention the data acquisition aspect, which generally consists of an agent or system, that is able to generate time-stamped data from distinct systems to be monitored and send them to the time-series DB for storage. In time-series parlance, these are referred to as metrics which are discreet data sets that reflect the state of a particular component in time.</p><p>Visualization tools such as <a href="https://graphiteapp.org/">Graphite Web</a>, <a href="https://www.influxdata.com/time-series-platform/chronograf/">Chronograf</a> and <a href="https://grafana.com/">Grafana</a> provide the necessary front-end web interface and graphing capabilities and data connectivity tools to process, present, and most importantly, act on collected metrics based on specific criteria. The choice of data visualization is crucial when presenting time based metrics, and most platforms offer a vast array of options to make the most out of incoming data from presenting state-in-time single stats and gauges to complex tabular metrics, passing through the usual bar or line graphs. It is both an art and a science to select the right presentation of metrics in order to gleam and spot any outliers or odd spikes that diverge from baseline collected metrics.</p><p>Data visualizations platforms have now gone further than just presenting collected data and waded into data correlation wether with other metrics and more importantly with logs and events through complementary tools such as <a href="https://grafana.com/oss/loki/">Loki</a> and scripting solutions like <a href="https://www.influxdata.com/products/flux/">Flux</a>.</p><h3>Where to go from here</h3><p>This was meant as a quick overview of the current state of realtime data collection, processing and presentation. These emerging tools are becoming extremely necessary and useful in keeping track and alerting technical teams on the state of their internal and cloud systems. The provided links provide an excellent primer on the various components discussed in this article. We can expect many more features and integrations to be included as these tools evolve, which most assuredly have a bright future ahead.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f731954e407e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>