<?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 Arman Srivastava  🚀 DevOps &amp;&amp;  Code crafter 🖥️ on Medium]]></title>
        <description><![CDATA[Stories by Arman Srivastava  🚀 DevOps &amp;&amp;  Code crafter 🖥️ on Medium]]></description>
        <link>https://medium.com/@arman.bxm?source=rss-c8bbaf09848a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*sF7TNSgXV9JfaGpI</url>
            <title>Stories by Arman Srivastava  🚀 DevOps &amp;amp;&amp;amp;  Code crafter 🖥️ on Medium</title>
            <link>https://medium.com/@arman.bxm?source=rss-c8bbaf09848a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 17:00:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arman.bxm/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[How to Monitor a Service on an Azure Windows VM and Trigger an Alert if the Windows Service is not…]]></title>
            <link>https://medium.com/@arman.bxm/how-to-monitor-a-service-on-an-azure-windows-vm-and-trigger-an-alert-if-the-windows-service-is-not-64e32482de30?source=rss-c8bbaf09848a------2</link>
            <guid isPermaLink="false">https://medium.com/p/64e32482de30</guid>
            <category><![CDATA[azure-monitor]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[azure-monitor-agent]]></category>
            <dc:creator><![CDATA[Arman Srivastava   DevOps &&  Code crafter ️]]></dc:creator>
            <pubDate>Thu, 11 Dec 2025 10:54:30 GMT</pubDate>
            <atom:updated>2025-12-11T10:54:30.588Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Monitor a Service on an Azure Windows VM and Trigger an Alert if the Windows Service is not Running</h3><p><em>Use Azure Monitor to collect Windows Event Logs from the VM (via Azure Monitoring Agent + Data Collection Rules), create a Log‑based Alert with a Kusto query that detects the service crash, and attach an Action Group to notify the team and optionally trigger an automated restart.</em></p><h3>What we want to solve</h3><p>A <strong>critical Windows service on an Azure VM crashes</strong> and requires manual authentication to restart. We need <strong>fast detection</strong>, <strong>team notification</strong>, and ideally <strong>automated remediation</strong> to reduce downtime.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4fbW1oyBQ7nxCTwW" /><figcaption>Photo by <a href="https://unsplash.com/@bschmidt16?utm_source=medium&amp;utm_medium=referral">Brandon Schmidt</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>I think the extension name is ‘AzureMonitorWindowsAgent,’ so that’s good. I’ll include sample alert rule settings, action group options, and a runbook for restarting with Invoke-AzVMRunCommand. I’ll also provide a PowerShell runbook example for restarting a service with credentials, but since the service needs manual authentication, I’ll mention using Hybrid Runbook Worker or Managed Identity. I could suggest using Run Command with a script that pulls credentials from Key Vault, but I’ll be sure to note security considerations. I’ll keep the language simple and use short paragraphs with bold labels and code blocks. Let’s finalize this!</blockquote><blockquote>A Windows service on an Azure VM crashes and needs manual authentication to restart. This guide shows how to collect Windows Event Logs with the Azure Monitoring Agent (AMA) and a Data Collection Rule (DCR), verify collection, create a Log‑based alert that notifies the team, and optionally automate remediation. All steps use simple, repeatable building blocks so you can test and operate safely.</blockquote><h3>1. Configure the destination and deploy the agent</h3><ul><li><strong>Destination type</strong>: In the DCR wizard choose <strong>Azure Monitor Logs</strong> as the Destination Type and select the <strong>Log Analytics workspace</strong> and its subscription.</li><li><strong>Agent deployment</strong>: Creating the DCR will prompt Azure to install the <strong>Azure Monitoring Agent (AMA)</strong> on the VMs you include in the DCR by using the VM extension (Windows agent extension).</li><li><strong>What AMA sends</strong>: Heartbeat records, Windows Event Logs (Application, System, custom channels), and other telemetry you select in the DCR.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uufj20ur0HoaFyR7" /><figcaption>Photo by <a href="https://unsplash.com/@erol?utm_source=medium&amp;utm_medium=referral">Erol Ahmed</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>2. Verify the agent and event collection (Log Analytics)</h3><p>Open the Log Analytics workspace in the Azure Portal and run these Kusto queries to confirm data is arriving.</p><p><strong>Heartbeat check</strong></p><pre>Heartbeat<br>| where TimeGenerated &gt; ago(24h)<br>| where Computer has &quot;&lt;&lt;Your-Computer-Name&gt;&gt;&quot;<br>| project TimeGenerated, Computer, Category, Version<br>| order by TimeGenerated desc</pre><p><strong>Event log check</strong></p><pre>Event<br>| where Computer has &quot;&lt;&lt;Computer-Name&gt;&gt;&quot;<br>| where TimeGenerated &gt; ago(48h)<br>| order by TimeGenerated desc</pre><ul><li><strong>What to expect</strong>: Heartbeat rows for the VM and Event rows for the channels you selected in the DCR. If you don’t see data, check VM connectivity, AMA extension status, and workspace permissions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JhzLAnr-pnOHTu_q" /><figcaption>Photo by <a href="https://unsplash.com/@nilepereiraa?utm_source=medium&amp;utm_medium=referral">Nile Pereira</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>3. Local VM script to surface service state into Event Log</h3><ul><li><strong>Why</strong>: If the service requires manual authentication to restart, the VM can still detect the stopped state and write a Windows Event. Azure Monitor can then alert on that event.</li><li><strong>How it runs</strong>: Use <strong>Task Scheduler</strong> to run a PowerShell script every 5 minutes. Task settings: Trigger = On a schedule → One time (set start) → Advanced → <em>Repeat task every 5 minutes</em> for <em>Indefinitely</em>. Action = powershell.exe with argument -File &quot;C:\path\to\PS-script.ps1&quot;.</li></ul><p><strong>PowerShell script (PowerShell v5.1)</strong></p><pre># Define the service name you want to monitor<br>$serviceName = &quot;Spooler&quot;  # Example: Print Spooler</pre><pre># Define the event log source and log name<br>$logSource = &quot;ServiceMonitor&quot;<br>$logName = &quot;Application&quot;</pre><pre># Create event source if missing<br>if (-Not [System.Diagnostics.EventLog]::SourceExists($logSource)) {<br>    New-EventLog -LogName $logName -Source $logSource<br>}</pre><pre>Try {<br>    $service = Get-Service -Name $serviceName</pre><pre>    if ($service.Status -eq &#39;Running&#39;) {<br>        # Optional: log info for testing<br>        # Write-EventLog -LogName $logName -Source $logSource -EntryType Information -EventId 1000 -Message &quot;The service &#39;$serviceName&#39; is running.&quot;<br>    } else {<br>        # Log a Warning when service is not running<br>        Write-EventLog -LogName $logName -Source $logSource -EntryType Warning -EventId 1001 -Message &quot;The service &#39;$serviceName&#39; is not running. Current status: $($service.Status).&quot;<br>    }<br>}<br>Catch {<br>    # Log an Error if status cannot be retrieved<br>    Write-EventLog -LogName $logName -Source $logSource -EntryType Error -EventId 1002 -Message &quot;Failed to retrieve the status of the service &#39;$serviceName&#39;. Error: $_&quot;<br>}</pre><ul><li><strong>Test</strong>: Stop the service in services.msc, run the script manually, then check <strong>Event Viewer → Application</strong> for the ServiceMonitor events.</li></ul><h3>4. Create the Log‑based Alert in Azure Monitor</h3><ul><li><strong>Scope</strong>: Select the VM(s) you are monitoring.</li><li><strong>Condition</strong>: Choose <strong>Custom log search</strong> and paste this KQL (adapt computer name):</li></ul><pre>Event<br>| where Computer has &quot;&lt;&lt;computer-name&gt;&gt;&quot;<br>| where Source has &quot;ServiceMonitor&quot;<br>| where EventLevel == 3<br>| where EventID == 1001 or EventID == 1002<br>| where TimeGenerated &gt; ago(15m)<br>| order by TimeGenerated desc</pre><ul><li><strong>Measurement</strong>:</li><li><strong>Measure</strong> = Table Rows</li><li><strong>Aggregation Type</strong> = Count</li><li><strong>Aggregation granularity</strong> = 15 minutes</li><li><strong>Operator</strong> = Greater than or equal to</li><li><strong>Threshold value</strong> = 2</li><li><strong>Frequency of evaluation</strong> = 15 minutes</li></ul><p>This rule fires if <strong>2 or more Warning/Error events</strong> appear in the last 15 minutes.</p><ul><li><strong>Actions</strong>: Attach an <strong>Action Group</strong> to notify the team (email, SMS, push, webhook, ITSM, Logic Apps). Action Groups are reusable and can call automation.</li><li><strong>Details</strong>: Set alert severity, name, and description.</li></ul><h3>5. Optional: automate remediation (carefully)</h3><p>If manual authentication is the blocker, you can automate parts of the restart flow while keeping security in mind.</p><p><strong>Options</strong></p><ul><li><strong>Automation Account runbook</strong> (PowerShell): Use a runbook to run a script that performs the authentication steps and restarts the service. If the runbook must run inside the VM network or access local resources,</li><li><strong>VM Run Command</strong>: Use Invoke-AzVMRunCommand from a Logic App, Function, or runbook to execute a PowerShell script on the VM that performs the authentication and Restart-Service -Name &quot;NameofService&quot;.</li><li><strong>Logic App / Azure Function</strong>: Use these when the authentication requires calling external APIs or orchestrating multiple steps.</li></ul><p><strong>Security notes</strong></p><ul><li>Never store plaintext credentials on the VM. Use <strong>Key Vault</strong> and <strong>managed identities</strong>.</li><li>Log every automated action and require approval for high‑risk operations if possible.</li><li>Add RBAC so only the alert Action Group or automation identity can trigger remediation.</li></ul><h3>6. Validation, tuning, and operational tips</h3><ul><li><strong>End‑to‑end test</strong>: Stop the service, confirm the script writes an event, confirm the event appears in Log Analytics, confirm the alert fires, and confirm notifications and remediation (if enabled) run.</li><li><strong>Tune noise</strong>: Adjust the KQL, threshold, and evaluation frequency to avoid false positives. Consider adding filters for specific error text or service states.</li><li><strong>Monitoring and auditing</strong>: Enable diagnostic logs for Automation Accounts and track who/what restarted services.</li><li><strong>Cost control</strong>: Limit collected events to only what you need; log ingestion and alert frequency affect cost.</li><li><strong>Resilience</strong>: If the VM loses network connectivity, Heartbeat will stop — add a separate alert for missing Heartbeat to detect agent or network issues.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64e32482de30" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comparing HSRP, VRRP, and GLBP: A Simple Guide to Network Redundancy Protocols]]></title>
            <link>https://medium.com/@arman.bxm/comparing-hsrp-vrrp-and-glbp-a-simple-guide-to-network-redundancy-protocols-b6af43afcaad?source=rss-c8bbaf09848a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6af43afcaad</guid>
            <dc:creator><![CDATA[Arman Srivastava   DevOps &&  Code crafter ️]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 06:56:04 GMT</pubDate>
            <atom:updated>2025-07-01T06:56:04.535Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s world, networks need to stay up and running, no matter what. Imagine your office losing internet because a router fails — that’s a big problem! To prevent this, we use protocols like <strong>HSRP</strong>, <strong>VRRP</strong>, and <strong>GLBP</strong>. These are special tools that make sure your network has a backup plan, keeping things smooth even if something goes wrong. In this blog, we’ll break down these three protocols in simple language, compare them, and explain how they fit into network redundancy, including their use with modern solutions like SD-WAN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8GXPzdRP8ACQsEVQ" /><figcaption>Photo by <a href="https://unsplash.com/@neonbrand?utm_source=medium&amp;utm_medium=referral">Kenny Eliason</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>What is Network Redundancy?</h3><p>Network redundancy is like having a spare tire for your car. If one part of your network (like a router or internet connection) fails, a backup steps in to keep everything running. This is super important for businesses, schools, or hospitals where downtime can cause chaos. Protocols like HSRP, VRRP, and GLBP help by making sure your network’s “gateway” (the device that connects your local network to the internet or other networks) always has a backup ready.</p><h3>What is HSRP?</h3><p><strong>Hot Standby Router Protocol (HSRP)</strong> is a Cisco tool that makes sure your network doesn’t crash if a router stops working. Here’s how it works in simple terms:</p><ul><li><strong>How it Works</strong>: HSRP lets two or more routers share a “virtual IP address” that devices (like computers or phones) use to connect to the internet. One router is the “Active” one, handling all the traffic, while another is the “Standby,” waiting to jump in if the Active router fails.</li><li><strong>Failover</strong>: If the Active router breaks, the Standby takes over in about 10 seconds, so users barely notice.</li><li><strong>Who Uses It?</strong>: It’s made by Cisco, so it works best with Cisco routers and switches.</li></ul><p><strong>Example</strong>: Imagine two guards at a gate. One (Active) lets cars through, while the other (Standby) waits. If the first guard gets sick, the second steps in without stopping the traffic.</p><p><strong>Pros</strong>:</p><ul><li>Reliable for Cisco networks.</li><li>Easy to set up for backup gateways.</li><li>Can track if other connections (like a WAN link) fail and adjust automatically.</li></ul><p><strong>Cons</strong>:</p><ul><li>Only works with Cisco devices.</li><li>Only one router is active, so the backup sits idle.</li><li>Failover takes a few seconds, which might be slow for some apps.</li></ul><h3>What is VRRP?</h3><p><strong>Virtual Router Redundancy Protocol (VRRP)</strong> is like HSRP but works with any brand of router, not just Cisco. It’s an open standard, meaning anyone can use it.</p><ul><li><strong>How it Works</strong>: Like HSRP, VRRP creates a virtual IP address shared by multiple routers. One router is the “Master,” handling traffic, while others are “Backups.” If the Master fails, a Backup takes over.</li><li><strong>Failover</strong>: VRRP is faster than HSRP, switching to a Backup in about 3 seconds.</li><li><strong>Who Uses It?</strong>: Great for networks with mixed brands (Cisco, Juniper, etc.).</li></ul><p><strong>Example</strong>: Think of a team of chefs. The head chef (Master) cooks, while others (Backups) are ready to step in if the head chef leaves. The switch happens fast, so the kitchen keeps running.</p><p><strong>Pros</strong>:</p><ul><li>Works with any router brand.</li><li>Faster failover than HSRP.</li><li>Simpler because only the Master sends status updates.</li></ul><p><strong>Cons</strong>:</p><ul><li>Fewer advanced features than HSRP in Cisco setups.</li><li>Can cause unexpected switches if not configured carefully.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5xD0WcSP1l8M1gSM" /><figcaption>Photo by <a href="https://unsplash.com/@andriyba?utm_source=medium&amp;utm_medium=referral">Andriy Babchiy</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>What is GLBP?</h3><p><strong>Gateway Load Balancing Protocol (GLBP)</strong> is another Cisco tool, but it’s special because it does more than just backup — it also shares the work between routers.</p><ul><li><strong>How it Works</strong>: GLBP creates a virtual IP address, but unlike HSRP or VRRP, multiple routers can handle traffic at the same time. One router, the “Active Virtual Gateway” (AVG), assigns jobs to “Active Virtual Forwarders” (AVFs), which forward traffic for different devices.</li><li><strong>Failover</strong>: If one router fails, another takes over its job in about 10 seconds, similar to HSRP.</li><li><strong>Load Balancing</strong>: GLBP spreads traffic across routers, so no router sits idle.</li><li><strong>Who Uses It?</strong>: Best for Cisco networks with lots of traffic needing both backup and efficient use of routers.</li></ul><p><strong>Example</strong>: Picture a busy restaurant with multiple waiters serving tables. If one waiter takes a break, another covers their tables, but all waiters are working at once to serve customers faster.</p><p><strong>Pros</strong>:</p><ul><li>Uses all routers at once, maximizing efficiency.</li><li>Great for busy networks with lots of traffic.</li><li>Still provides backup if a router fails.</li></ul><p><strong>Cons</strong>:</p><ul><li>Cisco-only, like HSRP.</li><li>No support for IPv6 (newer internet protocol).</li><li>More complex to set up than HSRP or VRRP.</li></ul><h3>How Do They Compare?</h3><p>Here’s a simple table to compare HSRP, VRRP, and GLBP:</p><p><strong>Feature</strong> <strong>HSRP</strong> <strong>VRRP</strong> <strong>GLBP</strong> <strong>Made By</strong> Cisco (proprietary) Open standard (any brand) Cisco (proprietary) <strong>Main Job</strong> Redundancy Redundancy Redundancy + Load Balancing <strong>Active Routers</strong> 1 (Active) 1 (Master) Up to 4 (AVFs) <strong>Failover Time</strong> ~10 seconds ~3 seconds ~10 seconds <strong>Load Balancing</strong> Limited (needs multiple groups) Limited (needs multiple groups) Yes (true load balancing) <strong>Works With</strong> Cisco only Any brand Cisco only <strong>IPv6 Support</strong> Yes (HSRPv2) Yes (VRRPv3) No <strong>Best For</strong> Cisco networks needing backup Mixed-brand networks Cisco networks with high traffic</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IQE_5igySTL8A3yi" /><figcaption>Photo by <a href="https://unsplash.com/@theshubhamdhage?utm_source=medium&amp;utm_medium=referral">Shubham Dhage</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>How Do They Work with Network Redundancy?</h3><p>All three protocols help with <strong>network redundancy</strong> by making sure there’s always a working gateway for devices to connect to the internet or other networks. Here’s how they fit in:</p><ul><li><strong>HSRP and VRRP</strong>: These focus on having one router ready to take over if the main one fails. They’re great for keeping things running but don’t use backup routers for traffic unless there’s a failure.</li><li><strong>GLBP</strong>: Goes a step further by using all routers at once, so you get both backup and better performance. If one router fails, others keep handling traffic without missing a beat.</li><li><strong>SD-WAN Connection</strong>: In modern networks, SD-WAN (Software-Defined Wide Area Network) adds redundancy for internet connections (like switching from broadband to 5G if one fails). HSRP, VRRP, or GLBP can work on the local network side to ensure devices always have a gateway, while SD-WAN handles the internet side. For example:</li><li>A branch office might use GLBP to share traffic across two Cisco routers, while SD-WAN switches between broadband and 5G if one link goes down.</li><li>VRRP is popular in SD-WAN setups with different router brands, ensuring the local gateway stays up.</li><li>HSRP is common in Cisco SD-WAN setups for reliable backup.</li></ul><h3>Which One Should You Choose?</h3><ul><li><strong>Choose HSRP</strong> if you have a Cisco-only network and want a simple, reliable backup gateway. It’s great for most businesses needing redundancy without complex setups.</li><li><strong>Choose VRRP</strong> if you use routers from different brands (like Cisco and Juniper) or need faster failover for sensitive apps like video calls.</li><li><strong>Choose GLBP</strong> if you’re in a Cisco network with lots of traffic and want to use all your routers at once, not just for backup.</li></ul><p><strong>Things to Think About</strong>:</p><ul><li><strong>Your Equipment</strong>: HSRP and GLBP only work with Cisco. VRRP works with any brand.</li><li><strong>Traffic Needs</strong>: GLBP is best for busy networks. HSRP and VRRP are simpler if you just need backup.</li><li><strong>Speed</strong>: VRRP switches faster, which matters for apps that can’t tolerate delays.</li><li><strong>Future-Proofing</strong>: If you need IPv6 (newer internet protocol), pick HSRP or VRRP, as GLBP doesn’t support it.</li></ul><h3>Wrapping Up</h3><p>HSRP, VRRP, and GLBP are like different tools in a network toolbox, each helping keep your network online in their own way. <strong>HSRP</strong> is a dependable choice for Cisco setups, <strong>VRRP</strong> is flexible for any brand with quick failover, and <strong>GLBP</strong> shines in Cisco networks needing both backup and load sharing. In modern setups like SD-WAN, they team up with internet link redundancy to keep businesses running smoothly. If you’re curious about specific setups or pricing for network tools, check out resources like <a href="https://x.ai/grok">xAI’s Grok page</a> for related services or <a href="https://help.x.com/en/using-x/x-premium">X’s premium help page</a> for subscription details.</p><p>Want to know more about setting up one of these protocols or how they work with SD-WAN? Let me know!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6af43afcaad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[KEDA → Kubernetes Event-Driven Autoscaling]]></title>
            <link>https://medium.com/@arman.bxm/keda-kubernetes-event-driven-autoscaling-77f6e156677f?source=rss-c8bbaf09848a------2</link>
            <guid isPermaLink="false">https://medium.com/p/77f6e156677f</guid>
            <category><![CDATA[autoscaling]]></category>
            <category><![CDATA[keda]]></category>
            <dc:creator><![CDATA[Arman Srivastava   DevOps &&  Code crafter ️]]></dc:creator>
            <pubDate>Tue, 05 Nov 2024 05:56:37 GMT</pubDate>
            <atom:updated>2024-11-05T10:08:03.752Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, we’ll explore KEDA, a lightweight, single-purpose component designed to simplify application autoscaling.</p><p>As a CNCF (Cloud Native Computing Foundation) Graduate project, KEDA enables event-driven autoscaling, allowing applications to scale according to demand in a cost-effective and sustainable way, including the ability to scale to zero. With the KEDA add-on, you can easily deploy a managed KEDA instance, leveraging a comprehensive catalog of Azure KEDA scalers to efficiently scale applications within an AKS cluster.</p><h3>Architecture</h3><p>KEDA provides two main components:</p><p>→<strong> KEDA Operator </strong>allows end-users to scale workloads in/out from 0 to N instances with support for Kubernetes Deployments, Jobs, StatefulSets or any CR that defines <strong>/scal</strong>e sub-resource.</p><p>→ <strong>Metrics Server</strong> exposes external metrics to HPA in Kubernetes for autoscaling purpose such as messages in a Kafka topic, or number of events in an Azure event hub. Due to upstream limitations, KEDA must be the only installed external metric adapter.</p><h3>How KEDA works?</h3><p>KEDA performs three key roles within Kubernetes:</p><ol><li>Agent → KEDA activates and deactivates Kubernetes Deployments to scale to and from zero on no events. This is one of the primary roles for keda-operator container that runs while installing KEDA.</li><li>Metrics → KEDA acts as a Kubernetes Metrics Server that exposes rich event data like queue length or stream lag to the HPA to drive scale out. It is up to the deployment to consume the events directly from the source. The metric serving is the primary role of the <em>keda-operator-metrics-apiserver</em> container that runs when you install KEDA.</li><li>Admission Webhooks → Automatically validate resource changes to prevent misconfiguration and enforce best practices by using best practices by using an admission controller. Ex: it will prevent multiple ScaledObjects to target the same scale target.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*lnI5Fd3IExTybVAn.png" /><figcaption>This image is taken from offical KEDA documentation</figcaption></figure><h3>Flow Explanation</h3><ol><li><strong>Event Detection</strong>: KEDA continuously monitors external event sources (like a message queue).</li><li><strong>Trigger</strong>: If an event occurs, it registers the event through the ScaledObject in the Kubernetes API server.</li><li><strong>Metrics Collection</strong>: The scaler fetches metrics and provides them to the HPA via the metrics adapter.</li><li><strong>Scaling Decision</strong>: Based on the custom metrics and scaling rules, the HPA determines whether to scale the workload up (1-&gt;n or n-&gt;1) or scale it back down (n-&gt;1 or 1-&gt;0).</li><li><strong>Scaling Action</strong>: The workload is scaled up/down dynamically based on real-time events.</li></ol><h3>Custom Resources (CRD)</h3><p>When you install KEDA, it creates four custom resources:</p><ol><li>scaledobjects.keda.sh</li><li>scaledjobs.keda.sh</li><li>triggerauthentications.keda.sh</li><li>clustertriggerauthentications.keda.sh</li></ol><p>These custom resources enable you to map an event source (and the authentication to that event source) to a Deployment, StatefulSet, Custom Resource or Job for scaling.</p><ul><li>ScaledObjects represent the desired mapping between an event source (e.g. Rabbit MQ) and the Kubernetes Deployment, StatefulSet or any Custom Resource that defines /scale subresource.</li><li>ScaledJobs represent the mapping between event source and Kubernetes Job.</li><li>ScaledObject/ScaledJob may also reference a TriggerAuthentication or ClusterTriggerAuthentication which contains the authentication configuration or secrets to monitor the event source.</li></ul><h3><strong>Scaling Jobs</strong></h3><p>As an alternate to scaling event-driven code as deployments we can also run and scale the code as <strong>Kubernetes Jobs</strong>. The primary reason to consider this option is to handle processing long-running executions. Rather than processing multiple events within a deployment , for each detected event a single Kubernetes job is scheduled. That job will initialize, pull a single event from the message source and process to completion and terminate.</p><p>For example , if we want to use KEDA to run a job for each message that lands on a RabbitMQ queue , the flow may be:</p><ol><li>When no messages are awaiting processing , no jobs are created.</li><li>When a message arrived at the queue, KEDA creates a job.</li><li>When the job started running, it pulls a single message and processes it to completion.</li><li>As additional messages arrive, additional jobs are created. Each job processes a single message to completion.</li><li>Periodically remove completed/failed job by the SuccessfulJobsHistoryLimit and FailedJobsHistoryLimit.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77f6e156677f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Common Security Issues // Resolution]]></title>
            <link>https://medium.com/@arman.bxm/common-security-issues-resolution-7aac94e2617f?source=rss-c8bbaf09848a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7aac94e2617f</guid>
            <category><![CDATA[xss-attack]]></category>
            <category><![CDATA[data-validation]]></category>
            <category><![CDATA[stored-xss]]></category>
            <category><![CDATA[reflected-xss]]></category>
            <category><![CDATA[ldap-authentication]]></category>
            <dc:creator><![CDATA[Arman Srivastava   DevOps &&  Code crafter ️]]></dc:creator>
            <pubDate>Mon, 19 Aug 2024 07:46:53 GMT</pubDate>
            <atom:updated>2024-08-19T07:46:53.753Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, we will explore common security concerns when exploring a site or an application and how to solve them. I will particularly focus the resolution around Azure DevOps but a similar approach can be used for different platforms. (<em>This is the second part of the security vulnerability )</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_F03h7uaP14cRoqf" /><figcaption>Photo by <a href="https://unsplash.com/@lazycreekimages?utm_source=medium&amp;utm_medium=referral">Michael Dziedzic</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>1. DOM-bases XSS.</h4><p><em>DOM-based cross-site scripting</em> is a type of <a href="https://www.invicti.com/learn/cross-site-scripting-xss/">cross-site scripting (XSS)</a> where the attack takes advantage of the Document Object Model (DOM).</p><p>The DOM is an internal data structure that stores all of the objects and properties of a web page. For example, every tag used in HTML code represents a DOM object. Additionally, the DOM of a web page contains information about such properties as the page URL and meta information. Developers may refer to these objects and properties using JavaScript and change them dynamically. DOM-based XSS is purely a client-side vulnerability. This means that during a DOM-based XSS attack, the payload never reaches the server. The entire attack happens in the web browser.</p><p>Every DOM-based XSS vulnerability has two elements: the source of user input and the target where this user input is written, called a sink.</p><p>Resolution →</p><ol><li><strong>Use Safe DOM Methods</strong>: Instead of directly injecting user input into the DOM using innerHTML, document.write(), or similar methods, use safer methods such as textContent or createElement() which do not interpret the input as HTML.</li></ol><p><strong>2. Integrate tools in the Pipeline</strong></p><ul><li><strong>SonarQube</strong></li><li><strong>Dynamic Application Security Testing (DAST)</strong>: Use DAST tools like OWASP ZAP or Burp Suite</li><li>ESLint with XSS Plugin</li></ul><h4>2. <strong>Cookie and session management</strong></h4><p><strong>Cookie and session management</strong> involves handling user authentication, maintaining the session state, and protecting sensitive data exchanged between the user’s browser and the server. Poor cookie and session management can lead to various security vulnerabilities, including session hijacking, Cross-Site Scripting (XSS), and Cross-Site Request Forgery (CSRF).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7RjS238GT5dyDtTI" /><figcaption>Photo by <a href="https://unsplash.com/@sharonmccutcheon?utm_source=medium&amp;utm_medium=referral">Alexander Grey</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Key Concepts in Cookie and Session Management</p><p><strong>Cookies</strong>:</p><ul><li><strong>Definition</strong>: Cookies are small pieces of data stored on the user’s browser by a web application. They are used to remember information about the user between requests, such as authentication tokens or user preferences.</li><li><strong>Types</strong>:</li><li><strong>Session Cookies</strong>: Temporary cookies that are deleted when the browser is closed.</li><li><strong>Persistent Cookies</strong>: Cookies that remain on the user’s device until they expire or are deleted.</li></ul><p><strong>Sessions</strong>:</p><ul><li><strong>Definition</strong>: A session is a server-side storage of user data that persists across multiple requests from the same user. Sessions typically use a unique session ID stored in a cookie to associate requests with a particular user.</li></ul><p><strong>Session IDs</strong>:</p><ul><li><strong>Definition</strong>: A session ID is a unique identifier assigned to a user’s session. It is usually stored in a cookie and sent with each request to maintain the session state.</li><li><strong>Security Concerns</strong>: Session IDs must be unpredictable, securely transmitted, and stored to prevent session hijacking.</li></ul><p><em>More info regarding the cookie and session management.</em></p><p><em>Browsers and e-commerce sites use HTTP to communicate. HTTP is a stateless protocol, which means that each command is run independently without any knowledge of the commands that came before it. Because it is a stateless protocol, sessions must be managed between the browser side and the server side. With cookie-based session management, a message (cookie) containing user information is sent to the browser by the web server. This cookie is sent back to the server when the user tries to access certain pages. The cookie allows the server to identify the user and retrieve the user session from the session database so that the user session is maintained. A cookie-based session ends when the user logs off or closes the browser. Cookie-based session management is secure and has performance benefits over alternatives. For this reason, cookie-based session management is recommended for customer sessions.</em></p><p>Resolution →</p><ol><li>Use Secure Cookies</li></ol><ul><li><strong>HttpOnly Flag</strong>: Set the HttpOnly flag on cookies to prevent client-side scripts (like JavaScript) from accessing them.</li><li><strong>Secure Flag</strong>: Set the Secure flag on cookies to ensure they are only transmitted over HTTPS, preventing exposure over insecure connections.</li><li><strong>SameSite Attribute</strong>: Use the SameSite attribute to control whether cookies are sent with cross-site requests, which helps protect against CSRF attacks.</li></ul><pre>app.use(session({<br>  secret: &#39;your-secret&#39;,<br>  cookie: {<br>    httpOnly: true,   // Prevents JavaScript access to cookies<br>    secure: true,     // Only transmit cookies over HTTPS<br>    sameSite: &#39;Strict&#39; // Prevents cross-site cookie transmission<br>  }<br>}));</pre><p>2. Implement Strong Session Management</p><ul><li><strong>Session Expiration</strong>: Set a reasonable expiration time for sessions. Sessions should expire after a period of inactivity to reduce the risk of session hijacking.</li><li><strong>Session ID Rotation</strong>: Rotate session IDs after successful login or privilege escalation to mitigate the risk of session fixation attacks.</li><li><strong>Invalidate Sessions</strong>: Ensure that sessions are invalidated on logout and when no longer needed.</li></ul><p><strong>Example</strong>:</p><pre>req.session.regenerate(function(err) {<br>  // Generates a new session ID<br>});</pre><p>3. <strong>Domain and Path Restrictions</strong>: Set the domain and path attributes of cookies to limit their scope. This ensures that cookies are only sent to specific subdomains or paths where they are needed.</p><p>4. By the DevOps side it is always a best practice to use</p><p>→ SonarQube</p><p>→ ESLint with Security Plugins</p><p>→ Dynamic Application Security Testing (DAST)</p><p>→ <strong>Enforce Secure Configurations</strong>: Use IaC tools like Terraform, Ansible, or ARM templates to enforce secure configurations related to session and cookie management. This includes setting HTTPS-only traffic, secure cookie attributes, and session timeouts.</p><pre>resource &quot;azurerm_app_service&quot; &quot;example&quot; {<br>  name                = &quot;example-app-service&quot;<br>  https_only          = true<br>)<br>  site_config {<br>    http2_enabled = true<br>    always_on     = true<br>  }<br><br>  app_settings = {<br>    &quot;SESSION_TIMEOUT&quot;  = &quot;30m&quot;<br>    &quot;SESSION_SECURE&quot;   = &quot;true&quot;<br>  }<br>}</pre><p>→ <strong>Integrate Monitoring Tools</strong>: Use monitoring tools like Azure Monitor. (Use AzureMonitor@1 task)</p><p>→ <strong>Implement Security Gates</strong>: Use security gates in your CI/CD pipeline to enforce manual approval or automated checks for security-related changes.</p><p><strong>→ Use Secret Management Tools</strong>: Store session-related secrets, such as encryption keys, in secure vaults like Azure Key Vault or HashiCorp Vault. Integrate these secrets into your pipelines securely.</p><h4>3. Data Validation : Stored Cross-site scripting</h4><p>Stored cross-site scripting (also known as second-order or persistent XSS) arises when an application receives data from an untrusted source and includes that data within its later HTTP responses in an unsafe way.XSS differs from other web attack vectors (e.g., <a href="https://www.imperva.com/learn/application-security/sql-injection-sqli/">SQL injections</a>), in that it does not directly target the application itself. Instead, the users of the web application are the ones at risk.</p><p>Stores XSS also known as Type- 1 or Persistent XSS attacks m typically rely on unsanitized user inputs points for scripts permanetly stores on the target servers. Since these attacks allow malicious users to control how to browser executes a script , they can typically facilitate a complete user account takeover.</p><p>Ways to exploit stored cross-site scripting vulnerabilities include:</p><ol><li>Cookie Grabbing</li><li>Error Page Manipulation</li></ol><p>Resolution →</p><ol><li><strong>Perform proper input validation .</strong></li></ol><p>Input validation is the default primary step to prevent injection attacks. Proper validation controls must be performed at every application tier to ensure it only accepts trusted user inputs. Encoding input before sending it to browser ensures that attackers can’t tamper with user-supplied data.</p><p><strong>2. Enforce a strong Content Security Policy (CSP)</strong></p><p>Stores XSS attacks rely on the attacker to include malicious inline &lt;script&gt; tags within the &lt;html&gt; tag of the page, CSPs prevent attacks by implementing the same -origin policy.</p><p><strong>3. Use Security Libraries and Frameworks:</strong></p><p><strong>4. Use HTTPOnly Cookies.</strong></p><p>Other resolution are the method which are the those includes best practices in DevOps security part. ( explained above )</p><h4>4. Data Validation : Reflected Cross-Site Scripting</h4><p>Reflected Cross-Site scripting ( XSS ) arises when an application receives data in an HTTP request and includes that data within the immediate response in an unsafe way.</p><p>Lets take an example , Suppose a website has a search function which receives the user-supplied search term in a URL parameter:</p><pre>https://insecure-website.com/search?term=gift</pre><p>The application echoes the supplied search item in their response to its URL:</p><pre>&lt;p&gt;You searched for: gift&lt;/p&gt;</pre><p>Assuming the application doesn’t perform any other processing of the data , an attacker can construct an attack like this:</p><pre>https://insecure-website.com/search?term=&lt;script&gt;/*+Bad+stuff+here...+*/&lt;/script&gt;</pre><p>This URL results in the following response:</p><pre>&lt;p&gt;You searched for: &lt;script&gt;/* Bad stuff here... */&lt;/script&gt;&lt;/p&gt;</pre><p>If another user of the application requests the attacker’s URL, then the script supplied by the attacker will execute in the victim user’s browser, in the context of their session with the application. If an attacker can control a script that is executed in the victim’s browser , then they can typically fully compromise that user. . Amongst other things, the attacker can:</p><ul><li>Perform any action within the application that the user can perform.</li><li>View any information that the user is able to view.</li><li>Modify any information that the user is able to modify.</li><li>Initiate interactions with other application users, including malicious attacks, that will appear to originate from the initial victim user.</li></ul><p>The vast majority of reflected cross-site scripting vulnerabilities can be found quickly and reliably using Burp Suite’s <a href="https://portswigger.net/burp/vulnerability-scanner">web vulnerability scanner</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9hIiGcWSwCUV6oQA" /><figcaption>Photo by <a href="https://unsplash.com/@casparrubin?utm_source=medium&amp;utm_medium=referral">Caspar Camille Rubin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>What is Cross-site Scripting ?</strong></p><p><a href="https://www.invicti.com/learn/cross-site-scripting-xss/">Cross-site scripting (XSS)</a> attacks are <a href="https://www.invicti.com/blog/web-security/top-dangerous-injection-attacks/">injection attacks</a> that insert malicious script code into a web page processed by a user’s browser. The “cross-site” part means that the attack code has a different origin than the visited site. Normally, this should be impossible due to <a href="https://www.invicti.com/learn/same-origin-policy-sop/">same-origin policy (SOP)</a></p><p><a href="https://www.invicti.com/learn/cross-site-scripting-xss/">Cross-site scripting (XSS)</a> vulnerabilities can be divided into 3 broad categories.</p><ul><li><a href="https://www.invicti.com/learn/stored-xss-persistent-cross-site-scripting/">Persistent (stored) XSS</a>: Malicious JavaScript is stored in server-side content (for example, in a comment database) and executed every time a user’s browser loads it.</li><li><a href="https://www.invicti.com/learn/reflected-xss-non-persistent-cross-site-scripting/">Non-persistent (reflected) XSS</a>: Malicious JavaScript sent in the client request is echoed back in HTML code sent by the server and executed by the victim’s browser.</li><li><a href="https://www.invicti.com/learn/dom-based-cross-site-scripting-dom-xss/">DOM-based (client-side) XSS</a>: An indirect attack where the server’s HTTP response doesn’t include the actual malicious script. Instead, the browser is instructed to insert malicious code into its DOM structure and only then is the JavaScript executed.</li></ul><p>Resolution →</p><p>Most of the solution of these types of attacks are same as Stored XSS including general methods and also DevOps side methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1mHBpw8KJpqTfJEm" /><figcaption>Photo by <a href="https://unsplash.com/@chrisliverani?utm_source=medium&amp;utm_medium=referral">Chris Liverani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>5. Data Validation : LDAP Injection</h4><p>LDAP (Lightweight Directory Access Protocol) injection is a type of security exploit that is used to compromise the <a href="https://www.techtarget.com/searchsecurity/definition/authentication">authentication</a> process used by some websites. LDAP injection is a vulnerability that occurs when an application injects unfiltered user input into an LDAP statement without prior validation or sanitization. LDAP is a directory access protocol that allows users to find resources on a network, and can also store usernames and passwords as part of a single sign-on (SSO) system. Websites that construct LDAP statements from user data are vulnerable to this type of attack.</p><p>LDAP injections create malformed queries to gain access in order to potentially change data in a directory. LDAP queries contain special characters such as asterisks, brackets, ampersands and quotes.</p><p>LDAP injection attacks can happen when:</p><ul><li>Input validation is missing or weak</li><li>Input contains control characters like brackets, asterisks, ampersands, or quotes</li><li>The application doesn’t properly sanitize user input</li></ul><p><strong>For example,</strong></p><p>An LDAP directory may contain lists of the different usernames, passwords and email addresses of the users in the organization. If an LDAP directory is used for website authentication, an attacker can enter malicious code into a user input field, gain unauthorized access to the directory, and view or change usernames and passwords.</p><p>There are several different types of LDAP injection attacks,</p><p><strong>Authentication bypass.</strong></p><p><strong>Elevation of access privileges.</strong></p><p><strong>Resource disclosure</strong></p><p>Resolution → SAME AS ALL DATA VALIDATION ATTACKS.</p><p><em>Note:- These notes are taken from different informative websites and rewritten/ explained in this blog.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7aac94e2617f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Common Security Issues // Resolution]]></title>
            <link>https://medium.com/@arman.bxm/common-security-issues-resolution-94fa961397a2?source=rss-c8bbaf09848a------2</link>
            <guid isPermaLink="false">https://medium.com/p/94fa961397a2</guid>
            <category><![CDATA[oauth]]></category>
            <category><![CDATA[forced-browsing]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[authentication-bypass]]></category>
            <dc:creator><![CDATA[Arman Srivastava   DevOps &&  Code crafter ️]]></dc:creator>
            <pubDate>Sat, 17 Aug 2024 19:31:41 GMT</pubDate>
            <atom:updated>2024-08-17T19:34:34.581Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, we will explore common security concerns when exploring a site or an application and how to solve them. I will particularly focus the resolution around Azure DevOps but a similar approach can be used for different platforms. (<em>This is the first part of the security vulnerability )</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7FBAPr4f5vNba8Pe" /><figcaption>Photo by <a href="https://unsplash.com/@hackernoon?utm_source=medium&amp;utm_medium=referral">HackerNoon</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>1. Forced Browsing.</h4><p>Forced browsing is a type of security attack aimed at discovering and accessing resources within a web application that are not directly linked or referenced. The attacker seeks to identify and exploit unprotected directories and files — such as temporary storage, backup files, and configuration files — that may still be accessible despite not being intended for public access.</p><p>By employing brute force techniques, attackers systematically search for these resources, which might include sensitive information such as source code, credentials, or internal network details. Such information can significantly aid in further compromising the web application or its underlying systems.</p><p>This attack is also referred to as <strong>Predictable Resource Location, File Enumeration, Directory Enumeration, or Resource Enumeration.</strong></p><p><strong>Resolution →</strong></p><p><strong>Role-Based Access Control (RBAC):</strong></p><ul><li>Ensure that RBAC is correctly implemented, so users can only access resources and perform actions according to their roles.</li></ul><p><strong>Policy Enforcement:</strong></p><ul><li>Implement access control policies that are enforced at every layer of the application, including the application code, API endpoints, and user interfaces.</li><li>AzurePolicyCheckGate@0 Task</li><li>We can also use the Gates for production deployment as if the security policy check fails the deployment must be failed and only deployed if the policy check is passed.</li></ul><p><em>Common security practices</em> → <a href="https://learn.microsoft.com/en-us/azure/devops/organizations/security/security-best-practices?view=azure-devops"><em>https://learn.microsoft.com/en-us/azure/devops/organizations/security/security-best-practices?view=azure-devops</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x94DGWbcBkxPet9Q" /><figcaption>Photo by <a href="https://unsplash.com/@bernardhermant?utm_source=medium&amp;utm_medium=referral">Bernard Hermant</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>2. Access to Internal files without Authentication:</h4><ul><li><strong>Service Principal:- </strong>If working with different environments that require internal files access we can make use of <strong>Service Principal </strong>with the necessary permission and store the keys in Azure Key Vault.</li></ul><p>The security principal defines the access policy and permissions for the user/application in the Microsoft Entra tenant. There are three types of service principles:</p><ul><li>Application:- The service principal object defines what the app can do for the specific tenant, who can access the app, and what resources the app can access.</li><li>Managed Identity:- When a managed identity is enabled, a service principal representing that managed identity is created in your tenant.</li><li>Legacy:- A legacy service principal can have credentials, service principal names, reply URLs, and other properties that an authorized user can edit, but doesn’t have an associated app registration. The service principal can only be used in the tenant where it was created.</li></ul><pre>az ad sp create-for-rbac --name &lt;your-service-principal-name&gt;</pre><ul><li><strong>IP Whitelisting</strong>: Restrict access to files by allowing only certain trusted IP addresses or ranges to access the resources. This ensures that only specific machines or services can bypass authentication.</li><li><strong>Virtual Networks (VNETs)</strong>: Place your resources within a VNET, restricting access to the files to only those services within the network. This limits exposure</li></ul><h4>3. Inadequate Authentication Policy.</h4><p><strong>Policy Password </strong>:</p><ul><li>A password policy is applied to all user and admin accounts that are created and managed directly in Microsoft EntraID. We can ban weak passwords and define parameters to lock out an account after repeated bad password attempts. Other password policies can’t be modified.</li></ul><p><strong>Implement Multi-Factor Authentication (MFA)</strong>:</p><ul><li>Require MFA for all users, especially for accessing sensitive systems and data. The two-gate policy requires two pieces of authentication data, such as an email address, an authenticator app, or a phone number, and it prohibits security questions. Office and mobile voice calls are also prohibited for trial or free versions of Microsoft Entra ID.</li></ul><p><strong>Regularly Rotate Credentials</strong>:</p><ul><li>Set up automated processes to rotate credentials (e.g., API keys, passwords) regularly, particularly for service accounts and system-level credentials.</li></ul><p><strong>Enable Account Lockout and Monitoring</strong>:</p><ul><li>Implement account lockout policies that temporarily disable an account after a defined number of failed login attempts.</li></ul><h4>4. Bypass Using SQL Injection.</h4><p>SQL injection is a technique used to exploit user data through web page inputs by injecting SQL commands as statements.</p><p><em>Checkout this page for an SQL Injection attack → </em><a href="https://portswigger.net/support/using-sql-injection-to-bypass-authentication"><em>https://portswigger.net/support/using-sql-injection-to-bypass-authentication</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4b63G2VCEye9Ke09" /><figcaption>Photo by <a href="https://unsplash.com/@flyd2069?utm_source=medium&amp;utm_medium=referral">FlyD</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A web page or web application that has an SQL Injection vulnerability uses such user input directly in an SQL query. The attacker can create input content. Such content is often called a malicious payload.</p><p>Let’s take a simple example,</p><p>The script is pseudocode executed on a web server. It is a simple example of authenticating with a username and a password.</p><pre># Define POST variables<br>uname = request.POST[&#39;username&#39;]<br>passwd = request.POST[&#39;password&#39;]<br><br># SQL query vulnerable to SQLi<br>sql = “SELECT id FROM users WHERE username=’” + uname + “’ AND password=’” + passwd + “’”<br><br># Execute the SQL statement<br>database.execute(sql)</pre><p>These input fields are vulnerable to SQL Injection.they could use a trick involving a single quote and set the passwd field to:</p><pre>password&#39; OR 1=1</pre><pre><br><br>SELECT id FROM users WHERE username=&#39;username&#39; AND password=&#39;password&#39; OR 1=1&#39;</pre><p>As a result, the database server runs the above SQL query</p><p><strong>Resolution →</strong></p><ul><li><strong>Environment Variables and Secrets</strong>: Store database connection strings and credentials securely using environment variables or secret management tools like Azure Key Vault . Avoid hard-coding them in your code or pipeline scripts.Use the <strong>AzureKeyVault@1</strong> task in your pipeline to retrieve and inject the secret into the environment.</li><li><strong>Limit Database Permissions</strong>: Ensure that the database user executing the queries has the least privileges necessary. For example, avoid giving SELECT permissions on sensitive tables to users who don&#39;t need it.</li><li><strong>Continuous Monitoring</strong>: Implement regular security testing in your CI/CD pipeline using tools like SQLMap, OWASP ZAP, or custom scripts to detect SQL injection vulnerabilities.</li><li><strong>Static Code Analysis</strong>: Use static code analysis tools to detect hard-coded SQL queries that are vulnerable to injection.</li></ul><p><strong>What is 0-auth?</strong></p><p>A 0-authentication (0-auth) bypass is a type of security vulnerability that allows an attacker to access restricted areas of a system or application without providing valid authentication credentials. Essentially, it means bypassing the authentication mechanism altogether, and gaining unauthorized access to protected resources, functionalities, or data.</p><h4>5. Authentication Bypass using Data Tampering</h4><p>It is a security vulnerability where an attacker manipulates data in such a way that they can bypass the normal authentication mechanisms of an application or system. This can occur when the application relies on client-side data (such as cookies, session tokens, or form fields) to validate user identity or access permissions without properly validating or securing that data on the server side.</p><p>This authentication bypass using Data Tampering typically involves these steps:-</p><p><strong>Identify Vulnerable Data</strong>:</p><ul><li>The attacker identifies data that the application uses to authenticate users or grant access, such as cookies, hidden form fields, or session tokens.</li></ul><p><strong>Tamper with the Data</strong>:</p><ul><li>The attacker modifies the data to escalate privileges or impersonate another user. For example, they might change a user ID in a session token or alter a cookie’s value to gain unauthorized access.</li></ul><p><strong>Bypass Authentication</strong>:</p><ul><li>By sending the tampered data back to the server, the attacker can bypass the authentication mechanism and gain unauthorized access to restricted areas of the application.</li></ul><p>This can happen in the scenario If an application stores authentication information in cookies without proper encryption or validation.</p><p><strong>Tampering with URL Parameters</strong>:</p><ul><li>Applications that use URL parameters to pass authentication tokens or user IDs can be vulnerable if these parameters are not properly validated or encrypted.</li></ul><p><strong>Example</strong>:</p><ul><li>An attacker could modify a URL parameter like <a href="https://example.com/account?id=123">https://example.com/account?id=123</a></li></ul><p>Resolution →</p><p>The usual steps that we can take to prevent this attack are:-</p><ul><li>Always validate any data used for authentication or authorization on the server side, regardless of its origin (cookie, form, URL, etc.).</li><li>Encrypt sensitive data such as session tokens and cookies, and use digital signatures to ensure data integrity.</li><li>Avoid storing critical authentication or authorization information on the client side. If necessary, ensure it is securely encrypted and validated on the server.</li><li>Use role-based access control (RBAC) and ensure that each request is authorized based on the user’s role and permissions, not just their identity.</li><li><strong>Integrate Security Scanning Tools</strong>: Use security scanning tools in your CI/CD pipeline to detect vulnerabilities related to data tampering and authentication bypass. Tools like OWASP ZAP, Burp Suite, or Snyk can be integrated into your pipelines to automatically scan your codebase, APIs, and web applications for such issues.</li></ul><pre>jobs:<br>  - job: SecurityScan<br>    steps:<br>      - script: |<br>          zap-baseline.py -t https://yourapp.example.com -r zap_report.html<br>        displayName: &#39;Run OWASP ZAP Scan&#39;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94fa961397a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Introduction— Day →1]]></title>
            <link>https://medium.com/@arman.bxm/kubernetes-introduction-day-1-fd3a2eae00e0?source=rss-c8bbaf09848a------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd3a2eae00e0</guid>
            <category><![CDATA[docker-vs-kubernetes]]></category>
            <category><![CDATA[kubernetes-architecture]]></category>
            <category><![CDATA[why-kubernetes]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Arman Srivastava   DevOps &&  Code crafter ️]]></dc:creator>
            <pubDate>Sun, 21 Jul 2024 12:18:26 GMT</pubDate>
            <atom:updated>2024-07-21T12:18:26.481Z</atom:updated>
            <content:encoded><![CDATA[<p>Dive into the depths of Kubernetes with our comprehensive blog series, exploring every wave from the basics to the advanced. In this section, we’ll set sail on the following topics:</p><ul><li><strong>Kubernetes and Its Architecture</strong>: Unravel the core structure and components that make up Kubernetes.</li><li><strong>How Kubernetes Works in the Backend</strong>: Discover the hidden currents and mechanisms powering Kubernetes.</li><li><strong>Crafting Pods with YAML</strong>: Learn how to create your first Kubernetes pod using a simple YAML file, like a pro navigator plotting a course on a maritime map.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*n9GINgm_tng24O4-" /></figure><p>What is Orchestration?</p><p>Orchestration involves controlling and coordinating the development and operations of multiple software components or services to work together efficiently. In the realm of Kubernetes, orchestration refers to managing containerized applications across a cluster of servers or nodes. Container orchestration platforms automate tasks such as:</p><p>- Container Deployment<br>- Health Monitoring<br>- Scaling<br>- Rolling Updates<br>- Load Balancing<br>- Configuration Management</p><p>Kubernetes and Ephemeral Resources</p><p>In Kubernetes, “ephemeral” typically refers to resources or objects that are short-lived or temporary in nature. This concept is crucial as it aligns with Kubernetes’ design philosophy of declarative management and dynamic resource provisioning.</p><p>Auto Healing in Kubernetes</p><p>Auto healing in Kubernetes refers to the platform’s ability to automatically detect and recover from failures or unhealthy states within the cluster. This feature ensures that applications remain up and running, providing resilience in the face of failures. When a failure is detected, Kubernetes takes proactive steps to recover the affected resources, which may involve restarting or rescheduling unhealthy pods on healthy nodes.</p><p>Kubernetes employs various mechanisms to ensure self-healing, including:</p><p>- Pod Restart Policies: Kubernetes allows defining restart policies for pods, such as ‘Always’, ‘On-Failure’, or ‘Never’. This helps in automatically restarting pods that fail or crash.<br>- Replica Sets &amp; Deployments: If the number of replicas is not met, Kubernetes automatically creates or destroys pods to maintain the desired state.<br>- Node Management: If a node becomes unhealthy or unreachable, Kubernetes marks it as ‘unavailable’ and reschedules the pods running on that node to healthy nodes within the same cluster.</p><p>Problems with Docker</p><p>Docker has several limitations, including:</p><p>- Single-Host: Docker is primarily designed for managing containers on a single host.<br>- Auto-Healing: Docker lacks built-in auto-healing capabilities.<br>- Auto-Scaling: Docker does not provide native auto-scaling features.<br>- Enterprise Nature: Docker’s features may not fully meet enterprise-level requirements.</p><p>Kubernetes: A Solution to Docker’s Drawbacks</p><p>To tackle these limitations, Kubernetes was developed. Kubernetes is an open-source container orchestration platform originally developed by Google. It automates the deployment, scaling, and management of containerized applications.</p><p>Kubernetes Architecture</p><p>Kubernetes can group any number of containers into a single logical unit for easy management and deployment. It integrates seamlessly with all cloud vendors, including public, on-premises, and hybrid environments. Kubernetes is written in Go (Golang).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*R0w16TqGLmP0EFuj.jpg" /></figure><p>Kubernetes Architecture</p><p>Kubernetes architecture is divided into two main types of nodes: Master Node and Worker Node.</p><p>Master Node:<br>1. Kubectl (CLI): This command-line configuration tool for Kubernetes is used to interact with the master node. Kubectl communicates with the API Server to perform tasks such as creating and deleting pods. It uses a configuration file called `kubeconfig`, which contains server information and authentication details.<br>2. API Server: This component of the Kubernetes control plane exposes the Kubernetes API. It acts as the initial gateway to the cluster, validating and processing requests received via tools like Kubectl. The API Server forwards valid requests to other components but does not allow direct access to the cluster.<br>3. Kube-Scheduler: When the API Server receives a request to schedule pods, the Kube-Scheduler determines the optimal node for pod placement, ensuring efficient cluster operation.<br>4. Kube-Controller Manager: This component manages various controllers that handle different aspects of the cluster’s control loop. Key controllers include the replication controller, which ensures the desired number of application replicas are running, and the node controller, which monitors node status.<br>5. etcd: This key-value store acts as the cluster’s brain, storing the cluster state and changes. It informs the scheduler and other processes about resource availability and cluster state changes.</p><p>Node Components:<br>These are the nodes where the actual work happens. Each node can host multiple pods, and each pod contains containers running inside them.</p><p>1. Container Runtime: This is needed to run the application containers inside the pods. Docker is a common container runtime.<br>2. Kubelet: This process interacts with the container runtime and the node, responsible for starting pods and the containers within them.<br>3. Kube-proxy: This process forwards requests from services to the appropriate pods. It includes intelligent logic to route requests to the correct pod within the worker node.</p><p>Broad Categories of Components:</p><p>1. Node Components: Each Kubernetes cluster requires at least one worker node, a collection of worker machines where containers are deployed.<br> — Container Runtime<br> — Kubelet<br> — Kube-proxy</p><p>2. Control Plane: The worker nodes and any pods within them are controlled by the control plane.<br> — Kube API Server<br> — Kube-Scheduler<br> — Kube-Controller Manager<br> — etcd</p><p>Available Add-ons:</p><p>1. CoreDNS: This add-on provides DNS-based service discovery within the cluster.<br>2. KubeVirt: This allows Kubernetes to manage and run virtual machines alongside container workloads.<br>3. ACI (Azure Container Instances): This integrates Kubernetes with Azure’s serverless container offering, allowing for rapid container deployment.<br>4. Calico: This networking and network security solution provides high-performance networking for Kubernetes.</p><p>Kubernetes architecture is designed to ensure efficient management, scaling, and operation of containerized applications, making it a robust platform for modern cloud-native applications. Dive into the depths of Kubernetes, where every component works in harmony to create a seamless and resilient environment for your applications to thrive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZCUn5CC8zwaFfCzY.jpg" /></figure><p>Distribution for Kubernetes for production-grade</p><ul><li>OpenShift</li><li>Rancher</li><li>EKS</li><li>Kubernetes</li></ul><p>Kubernets Images:- are the key building blocks of containerizied Infrastructure. Each container in a pod has it Docker image running inside it.</p><p>Pull and create a container</p><pre>Kubectl create -f test-for-pull</pre><p>Fetch the log</p><pre>kubectl log test-for-pull</pre><p>JOB:</p><p>Job function is to create one or more pod and tracks about the success of pods. They ensure that the specific number of pods are completed successfully. When a specified number of successful run of pods is completed then the job is considerate complete.</p><p>Kind of job which tell kubectl that the YAML file being used is to create a type pod.</p><pre>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: example-deployment<br>spec:<br>  replicas: 3<br>  selector:<br>    matchLabels:<br>      app: example<br>  template:<br>    metadata:<br>      labels:<br>        app: example<br>    spec:<br>      containers:<br>      - name: example-container<br>        image: example-image<br>        ports:<br>        - containerPort: 8080</pre><p>Let’s break each line down…</p><ul><li>apiVersion: Specifies the Kubernetes API version. In this case, it’s using the “apps/v1” API version, which is appropriate for Deployments.</li><li>kind: Specifies the type of Kubernetes resource. Here, it’s “Deployment,” indicating that this configuration file is defining a Deployment.</li><li>spec: This section defines the desired state of the Deployment.</li><li>replicas: 3: Specifies that you want to run three replicas of your application.</li><li>selector: Describes the selector to match pods managed by this Deployment.</li><li>matchLabels: Specifies the labels that the Replica Set created by the Deployment should use to select the pods it manages. In this case, pods with the label app: example are selected.</li><li>template: Defines the pod template used for creating new pods.</li><li>metadata: Contains the labels to apply to the pods created from this template. In this case, the pods will have the label app: example.</li><li>spec: Describes the specification of the pods.</li><li>containers: This section specifies the containers to run in the pod.</li><li>name: example-container: Assigns a name to the container.</li><li>image: example-image: Specifies the Docker image to use for this container.</li><li>ports: Defines the ports to open in the container.</li><li>containerPort: 8080: Indicates that the container will listen on port 80.</li></ul><pre>kubectl create -f py.yaml</pre><p>→ create the job using the following command with yaml which is saved with the name py.yaml</p><p>Status of the job</p><pre>kubectl describe jobs/py</pre><p>So , we keeping refering pods what exactly is it?</p><p>Pod is a collection of containers and its storage inside a node of a Kubernetes cluster . It is possible to create a pod with Multiple containers inside it.</p><p>Node is a working machine in Kubernetes cluster which is also known as minion. They are working units which can be physical VM or cloud interface.</p><p>Difference between Container , Pod and Deployment .</p><p>Container → are lightweight standalone and executable software packages that include thing that are required to run a bit of software program including code , runtime , libraries and system tools.</p><pre>docker run -it $name-of-pod</pre><p>Pod → represents the smallest unit encapsulating containers with shared resources and storage as mentioned above too. Containers inside it share same IP address and port space which allows them communicate with each other using local- host itself.</p><p>Deployment:- are upgraded and version of replication controller. They manage the deployment of replica set which is also an upgraded version of replication controller. It is like a high-level abstraction wrapper to replicaset.</p><p>I think this is good start for the intro into Kubernetes. If there are the things which you can’t grasp or relate .please stay tuned with next release which includes next related topics and advance topics of Kubernetes like Replica sets , federation and also Helm .</p><p>STAY TUNED!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd3a2eae00e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Provider in Terraform - HOWGARTS]]></title>
            <link>https://medium.com/@arman.bxm/provider-in-terraform-howgarts-3eb8509f327d?source=rss-c8bbaf09848a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3eb8509f327d</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[provider]]></category>
            <category><![CDATA[terraform-provider]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[terraform-aws]]></category>
            <dc:creator><![CDATA[Arman Srivastava   DevOps &&  Code crafter ️]]></dc:creator>
            <pubDate>Mon, 22 Apr 2024 11:40:22 GMT</pubDate>
            <atom:updated>2024-04-22T11:40:22.404Z</atom:updated>
            <content:encoded><![CDATA[<p>This blog gives the introduction for the providers in terraform and some related concepts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aDTmVrytJNBT0y88" /><figcaption>Photo by <a href="https://unsplash.com/@bitu2104?utm_source=medium&amp;utm_medium=referral">Tuyen Vo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Why do we need Provider in the first place?</strong></p><p>Providers are akin to magical wands that connect Terraform to remote systems. Just as wizards rely on their wands to channel their magical abilities, Terraform depends on providers to interact with the mystical realms of cloud computing and beyond. Wizards and witches must declare which providers they require in their magical incantations, ensuring Terraform can conjure and utilize them to weave spells of creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*3o-VWft6CfRS9y0wKE1R-g.jpeg" /></figure><blockquote>Provider — Definition</blockquote><p>In the enchanted halls of Hogwarts School of Witchcraft and Wizardry, where magic courses through the very stones, providers are akin to the enchanted wands wielded by young wizards and witches. Just as a wand channels the magical energies of its wielder, so too do providers serve as conduits for Terraform to command external APIs with the wave of a metaphorical wand.</p><p>As young wizards and witches prepare for their magical journeys, they must first perform the ancient incantation of Terraform init. With each utterance of the spell, the required providers are summoned forth from the depths of the mystical Terraform registry, their essence imbued into the very fabric of the wizarding world and saved locally within the enchanted vault of the Terraform directory.</p><p>Crafted with the precision and artistry of Ollivanders, providers are akin to magical artifacts, each imbued with its unique properties and powers. Written in the ancient language of Go, these providers are published on the Terraform registry, waiting to be discovered by aspiring wizards and witches.</p><p>Within the enchanted halls of Hogwarts, young wizards and witches can declare a new provider in their magical incantations using a provider block. This block serves as a portal through which Terraform channels its magic, instructing it to install and utilize the chosen provider. But beware, for within the provider block lie secrets and configurations, waiting to be unlocked by those with the courage to venture forth.</p><p>And just as a skilled wizard must possess the proper wand movements and incantations to cast spells, so too must aspiring practitioners of Terraform possess the knowledge to configure their providers, passing in the necessary ingredients such as API keys to unlock the full potential of their magic.</p><p>So let us embark on this magical journey together, as we navigate the enchanted realms of Terraform with the wisdom of providers and the boundless potential of Harry Potter’s wizarding world. For in the realm of magic and possibility, where dreams take flight and spells are cast, the power of creation lies within.</p><p>Example: (this is the example for terraform version 0.12 above )</p><pre>terraform {<br>  required_providers {<br>    aws = {<br>      source = &quot;hashicorp/aws<br>      version = &quot;~&gt;5..0&quot;<br>}<br>}<br>}<br><br>#configure the AWS provider<br>provider &quot;aws&quot; {<br>  region = &quot;us-east-1&quot;<br>}<br><br>#create a vpc <br>resource &quot;aws_vpc&quot; &quot;example_name&quot; {<br>  cidr_block = &quot;10.0.0.0/16&quot;<br>}</pre><p>All declared providers must be meticulously configured within the confines of the “required_providers” block, a sanctum nestled beneath the hallowed “terraform” block. This block serves as a portal to summon and harness the powers of the chosen providers, akin to selecting the proper spells from a wizard’s spellbook.</p><p>Within the required_providers block, practitioners of Terraform must inscribe the local name of the provider, akin to the magical incantation that identifies its essence, alongside the source and version, much like the coordinates for a hidden magical artifact. This sacred configuration ensures that Terraform can accurately summon and integrate the desired providers into its mystical workings.</p><p>And just as a wizard may master multiple spells to navigate the perils of their magical journey, so too can the practitioner of Terraform configure multiple provider configurations within the required_providers block. With each configuration, a new conduit to the realms of possibility is opened, allowing for the seamless orchestration of spells across diverse magical domains.</p><p>Thus, within the required_providers block lies the key to unlocking the full potential of Terraform, enabling wizards and witches to craft enchantments that shape the very fabric of their world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*pE6XyF1cYMnYyKiyDO3G7g.jpeg" /></figure><blockquote>Resource</blockquote><p>Resource block describes one or more infrastructure objects. Resource type and name together serves as a identifier for a given resource and so must be unique. <strong>We can only use the resource that are supported by the specific provider.</strong></p><p>Example:-</p><pre>resource aws_instance &quot;my-ec2&quot; {<br>  ami = &quot;ami----&quot;<br>  instance_type = &quot;t2.micro&quot;<br>}</pre><blockquote>Provider Namespace</blockquote><p>Provider Namespace are used to help users identify the organization or publisher responsible for the integration.</p><p>Terraform requires explicit source information for any providers that are not Hashi-Corp maintained.</p><pre>------- HASHICORP MAINTAINED -------<br>provider &quot;aws&quot; {<br>  region = &quot;us-east-2&quot;<br>  access_key = &quot;----&quot;<br>  secret_key = &quot;----&quot;<br>}<br><br>------- NOT HASHICORP MAINTAINED ------<br>terraform {<br>  required_providers {<br>    digital_ocean = {<br>        source = &quot;---&quot;<br>  }<br>}<br>}<br>provider &quot;digital_ocean&quot; {<br>  token = &quot;---&quot;<br>}<br><br>--------#####--------</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*128Qqr4ZZvd-xSzPMUAyqQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3eb8509f327d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How TLS Termination works?]]></title>
            <link>https://medium.com/@arman.bxm/how-tls-termination-works-089d473f3ce1?source=rss-c8bbaf09848a------2</link>
            <guid isPermaLink="false">https://medium.com/p/089d473f3ce1</guid>
            <category><![CDATA[tls]]></category>
            <category><![CDATA[tls-termination]]></category>
            <category><![CDATA[tls-handshake]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Arman Srivastava   DevOps &&  Code crafter ️]]></dc:creator>
            <pubDate>Thu, 21 Mar 2024 08:30:23 GMT</pubDate>
            <atom:updated>2024-03-21T08:30:23.362Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article we will discuss about TLS Termination what it is and How it works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5Tr4zONoWlXoM90A" /><figcaption>Photo by <a href="https://unsplash.com/@alinnnaaaa?utm_source=medium&amp;utm_medium=referral">Alina Grubnyak</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>TLS termination stands as a pivotal bastion in network security, bearing the responsibility of unfurling encrypted traffic within defined network perimeters, notably orchestrated by load balancers, reverse proxies, or application delivery controllers (ADCs). Here’s a deep dive into the intricate mechanics of TLS termination:</p><p>Client Connection:</p><p>A client takes the initiative, unleashing a potent “Client Hello” message to the server, articulating its allegiance to specific cryptographic algorithms and preferences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DWloES9tZUuzVCWd" /><figcaption>Photo by <a href="https://unsplash.com/@charlesdeluvio?utm_source=medium&amp;utm_medium=referral">charlesdeluvio</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>TLS Handshake:</p><p>In a synchronized dance, the server responds to the client’s call with a resounding “Server Hello,” accompanied by its digital certificate, a testament to its authenticity. The client meticulously scrutinizes this digital credential, ensuring it hails from a reputable certificate authority, a veritable stamp of trust.</p><p>TLS Encrypted Traffic:</p><p>With the handshake complete and mutual authentication sealed, the client and server forge an impregnable fortress of secure TLS session. Every subsequent exchange of data between these stalwarts is shrouded in cryptographic armor, safeguarded by symmetric keys meticulously crafted during the handshake.</p><p>Termination Process:</p><p>At the precipice of TLS termination, be it the poised stance of a load balancer or the vigilant vigil of a reverse proxy, encrypted traffic finds itself intercepted, denied passage to the inner sanctum of the destination server.</p><p>Decryption:</p><p>The intercepted encrypted trove undergoes a metamorphosis, shedding its cryptographic veil under the watchful eye of the private key tethered to the server’s digital certificate. This decryption ritual unfetters the plain text, allowing the intermediary guardian — whether it be a load balancer or reverse proxy — to peer into its unguarded secrets.</p><p>Processing:</p><p>Once the encrypted veil is lifted, the decrypted payload finds itself subjected to an array of processing crucibles. Here, the data may undergo meticulous content curation, undergo the rigors of load balancing, seek refuge in the sanctuary of caching, or be fortified by the bastion of application layer security measures.</p><p>Forwarding:</p><p>Emerging from the crucible of processing, the decrypted data embarks on a journey, traversing the unguarded plains of unencrypted connection. Guided by protocols such as HTTP or its brethren from the application layer, it finally reaches the doorstep of the destination server.</p><p>Response Encryption:</p><p>As the destination server prepares to dispatch its response to the awaiting client, the TLS termination point enshrouds this missive in a fresh coat of encryption. A new TLS session is summoned into existence, forging an unbreakable bond between client and server, ensuring the sanctity of end-to-end encryption remains unblemished during the tumultuous voyage through the digital realm.</p><p><strong>“In the ever-evolving landscape of technology, TLS termination stands as a stalwart guardian, ensuring the sanctity of data transmission and the integrity of communication channels. As we navigate the complexities of cyberspace, let us forge ahead with an unwavering commitment to security, innovation, and the relentless pursuit of excellence.”</strong></p><blockquote>CONNECT — <a href="https://www.linkedin.com/in/arman-srivastava/">Arman Srivastava | LinkedIn</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=089d473f3ce1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Merging VS Rebasing]]></title>
            <link>https://medium.com/@arman.bxm/merging-vs-rebasing-b306f0f3d84f?source=rss-c8bbaf09848a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b306f0f3d84f</guid>
            <category><![CDATA[git-rebase]]></category>
            <category><![CDATA[git-merge-vs-git-rebase]]></category>
            <category><![CDATA[git-merge-vs-rebase]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[git-merge]]></category>
            <dc:creator><![CDATA[Arman Srivastava   DevOps &&  Code crafter ️]]></dc:creator>
            <pubDate>Mon, 18 Mar 2024 07:42:04 GMT</pubDate>
            <atom:updated>2024-03-18T07:42:04.752Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is to deep dive two similar yet different concepts in Git i.e. git merge and git rebase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ctbrhUWmCqQd0xuJ" /><figcaption>Photo by <a href="https://unsplash.com/@synkevych?utm_source=medium&amp;utm_medium=referral">Roman Synkevych</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Concept-</p><p>Imagine you’re an architect designing a grand city of code, where every branch represents a district with its own unique architecture. In this bustling metropolis of version control, there are two powerful tools: Git Merge and Git Rebase, each with its own distinct approach.</p><p>Picture yourself as an urban planner, diligently constructing a new feature district in response to the client’s demands. Your branch stands tall, with its own blueprint and vision. But suddenly, another builder, your colleague, comes forth with fresh ideas, updating the main district. This creates a forked path in the city’s development history.</p><p>Now, as the main district evolves, its new changes beckon to your feature district, suggesting collaboration and progress. It’s a pivotal moment, and you have two strategic options: the Merge and the Rebase.</p><p>The Merge acts like a city council, bringing together the divergent paths of your districts to form a unified cityscape. It preserves the individuality of each district, creating a vibrant urban landscape where their stories intersect yet remain distinct.</p><p>On the other hand, the Rebase offers a different approach. It’s like urban redevelopment, where your feature district aligns itself with the evolving blueprint of the main district. With each update, your district adapts, seamlessly integrating the changes from the main district. It’s a process of renewal, transforming your feature district to better fit into the city’s overall vision.</p><p>In this bustling city of version control, the choice between Merge and Rebase reflects your approach to urban planning. Will you prioritize collaboration and diversity, or will you focus on alignment and evolution? The decision you make will shape the skyline of your codebase, weaving its story into the fabric of your project’s history.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5ZE2yXojxb4u8H2i" /><figcaption>Photo by <a href="https://unsplash.com/@justinbeisner?utm_source=medium&amp;utm_medium=referral">Justin Eisner</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><blockquote>→ The Merge Option</blockquote><p>Think of merging like blending ingredients in a recipe. It’s the simplest way to combine changes from the main branch into your feature branch. Just mix them together smoothly, ensuring your code stays tasty and cohesive.</p><pre>git checkout feature<br>git merge main </pre><p>we can also write in one-line.</p><pre>git merge feature main </pre><p>This will create a new merge conflict in the feature branch that ties together the histories of both branches. Merging is good because its non-destuctive operation. The existing branches are not changed in a way . This avoids all of the potential pitfalls of rebasing .</p><p>If main is very active , this can pollute our feature branch’s history quite a bit. While it;s possible to mitgate this issue with git log options , it can make it hard for other developers to understand the history of the project.</p><blockquote>→ The rebase option</blockquote><p>As an alternative to merging we can rebase the feature branch onto main branch using the -&gt;</p><pre>git checkout feature<br>git rebase main</pre><p>Rebasing is a like a grand renovation project for your codebase. Instead of just adding a new room (like merging does with a merge commit), rebasing is like redesigning the entire floor plan from scratch. It’s a bold move that relocates your feature branch to the cutting edge of the main branch, seamlessly integrating all the latest updates.</p><p>But here’s the twist: with rebasing, you’re not just rearranging furniture; you’re crafting a brand-new blueprint for your project’s history. Each original commit gets a makeover, as if they’re being reimagined in a sleek, modern style. This results in a pristine, linear history without the clutter of unnecessary merge commits.</p><p>Think of it as transforming a winding, branching path into a straight, smooth highway. With rebasing, you can effortlessly follow the journey of your feature branch from start to finish, without any confusing detours or forks along the way. It’s a creative overhaul that not only improves the aesthetics of your project but also enhances its navigability and overall appeal.</p><p>Thanks for reading this!</p><p>Follow for more: <a href="https://medium.com/u/c8bbaf09848a">Arman Srivastava 🚀 DevOps &amp;&amp; Code crafter 🖥️</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b306f0f3d84f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jenkins Schedule format]]></title>
            <link>https://medium.com/@arman.bxm/jenkins-schedule-format-855f0eddb55c?source=rss-c8bbaf09848a------2</link>
            <guid isPermaLink="false">https://medium.com/p/855f0eddb55c</guid>
            <category><![CDATA[jenkins-plugins]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[scheduling]]></category>
            <category><![CDATA[scheduling-tool]]></category>
            <dc:creator><![CDATA[Arman Srivastava   DevOps &&  Code crafter ️]]></dc:creator>
            <pubDate>Thu, 07 Mar 2024 09:42:43 GMT</pubDate>
            <atom:updated>2024-03-07T09:42:43.473Z</atom:updated>
            <content:encoded><![CDATA[<p>We will be learning how to schedule a Jenkins job and different parameters related to it .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/210/1*Rp9hR-6coCBSpy92SartkQ.jpeg" /></figure><p>To schedule Jenkins builds periodically at specific intervals we can us ethe buil-int scheduling feature . Jenkins uses a cron-like syntax for scheduling , allowing you to specify when and how often your builds should run.</p><p><strong>What is Cron-like?</strong></p><p>The cron is a software utility , offered by a Linux-like operating system that automates the scheduled task at a predetermined time. It is a daemon process, which runs as a background process and performs the specified operations at the predefined time and when a certain event or condition is triggered without the intervention of a user.</p><p>The Jenkins schedule format closely resembles the familiar cron syntax , with a few minor differences. A typical Jenkins schedule consists of five fields , representing minute , hour , day of the month , month , and day of the week , in that order.</p><p>Hence , what field means :-</p><ol><li><strong>Minute (0–59)</strong>: Specifies the minute of the hour when the build should run (e.g., 0 for the top of the hour, 30 for the half-hour).</li><li><strong>Hour (0–23):</strong> Specifies the hour of the day when the build should run (e.g., 1 for 1 AM, 13 for 1 PM).</li><li><strong>Day of the month (1–31):</strong> Specifies the day of the month when the build should run (e.g., 1 for the 1st day of the month, 15 for the 15th day).</li><li><strong>Month (1–12):</strong> Specifies the month when the build should run (e.g., 1 for January, 12 for December).</li><li><strong>Day of the week (0–7): </strong>Specifies the day of the week when the build should run (e.g., 0 or 7 for Sunday, 1 for Monday, and so on).</li></ol><p>Configuring the schedule in jenkins .</p><ol><li>Open your Jenkins job’s configuration page.</li><li>In the “<strong>Build Triggers” </strong>section, check the “<strong>Build periodically</strong>” option.</li><li>In the text box that appears, enter your desired schedule using the cron-like syntax</li></ol><p>4. Click “<strong>Save</strong>” to apply the schedule.</p><p>Jenkins will now automatically trigger your builds according to the specified schedule. You can use this scheduling feature to automate tasks, such as nightly builds, daily backups, or any other recurring job that fits your project’s needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=855f0eddb55c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>