<?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 Ravi Rajput on Medium]]></title>
        <description><![CDATA[Stories by Ravi Rajput on Medium]]></description>
        <link>https://medium.com/@ravisrajput?source=rss-886c91046e61------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LSULunevoX5iCTfwKB9esg.jpeg</url>
            <title>Stories by Ravi Rajput on Medium</title>
            <link>https://medium.com/@ravisrajput?source=rss-886c91046e61------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 18:40:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ravisrajput/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[Security Inside Kubernetes: Admission & Runtime Guardrails with Kyverno and KubeArmor]]></title>
            <link>https://ravisrajput.medium.com/security-inside-kubernetes-admission-runtime-guardrails-with-kyverno-and-kubearmor-82ce993bbd50?source=rss-886c91046e61------2</link>
            <guid isPermaLink="false">https://medium.com/p/82ce993bbd50</guid>
            <category><![CDATA[kyverno]]></category>
            <category><![CDATA[kubearmor]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[kubernetes-security]]></category>
            <dc:creator><![CDATA[Ravi Rajput]]></dc:creator>
            <pubDate>Sat, 03 Jan 2026 10:16:22 GMT</pubDate>
            <atom:updated>2026-01-03T10:16:22.350Z</atom:updated>
            <content:encoded><![CDATA[<h4>Adding deployment-time and runtime guardrails inside Kubernetes using Kyverno and KubeArmor</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*eYg12ePFjpZOhQqaRdLjzA.jpeg" /><figcaption>Image from <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><p>This article is a continuation of my previous article, “Guardrails Over Gates: A Smarter Way to Enable Security Without Slowing DevOps”, in which we secured code, dependencies, and container images and ensured that only trusted applications are deployed to the cluster.</p><p>Now we extend guardrails further inside Kubernetes. Even a trusted image can become risky after deployment if misconfigured or exploited.</p><h3>Prerequisites</h3><p>Before continuing, ensure you have the following components available and understand their role in the workflow:</p><ul><li>Kubernetes tools: <a href="https://kubernetes.io/docs/tasks/tools/">Kubectl</a> and <a href="https://helm.sh/">Helm</a>.</li><li>A working GKE cluster.</li></ul><h3>Adding Guardrails with Kyverno</h3><p>Before we look at real security policies, it’s essential to understand what a Kyverno policy is and how it works. Kyverno is a Kubernetes-native policy engine.<br>It doesn’t require learning a new language; policies are written in YAML, just like Kubernetes manifests.</p><p>A Kyverno policy watches resource requests (like pods, deployments, or namespaces) and decides whether to:</p><ul><li>Allow the request.</li><li>Block the request.</li><li>Modify the request (e.g., auto-add labels or limits).</li></ul><p>Think of Kyverno policies like seatbelts in a car:</p><ul><li>They don’t stop you from driving.</li><li>They don’t slow you down.</li></ul><p>They just keep you safer by preventing risky behaviour.</p><p>In most organizations, security rules are either stored in PDFs, Wiki pages, or Slack messages. Developers often forget, misunderstand, or miss them under pressure to deliver. Kyverno solves this by letting you write these rules as code, and Kubernetes enforces them automatically.</p><p>Once our application is running on Kubernetes, we want to ensure it stays secure.</p><p>But instead of blocking developers at the CI pipeline and causing frustration, we add guardrails in the cluster itself.</p><p>This means:</p><ul><li>Developers can deploy quickly.</li><li>The cluster checks if the deployment is safe.</li><li>If something violates policy, Kubernetes provides guidelines for resolving the issue.</li></ul><p>This differs from old “security gate” approaches. We are not stopping developers. We are guiding them. <a href="https://kyverno.io/">Kyverno</a> works as a security coach inside Kubernetes.</p><p>First, we will install Kyverno in the GKE cluster. Run the commands below to install Kyverno:</p><pre>kubectl create namespace kyverno<br>kubectl apply -f <a href="https://github.com/kyverno/kyverno/releases/latest/download/install.yaml">https://github.com/kyverno/kyverno/releases/latest/download/install.yaml</a></pre><p>To see the running components, run the following command:</p><pre>kubectl get all -n kyverno</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t1SqHnw1KkW_jhlhCM79wg.png" /><figcaption>Kyverno components got installed in the GKE cluster.</figcaption></figure><h4>Create Kyverno guardrail policies and validate them</h4><p>Once Kyverno is installed in the cluster, the next step is to define policies.</p><p>Policies are basically rules that help keep Kubernetes deployments safe, stable, and consistent.</p><p>Before jumping into the policy examples, it’s important to understand how a Kyverno policy manifest is structured. A Kyverno policy contains one or more rules, and each rule defines which Kubernetes resources it targets, what expected configuration it requires, and what action Kyverno should take when the requirement isn’t met.</p><p>At a high level:</p><ul><li>match decides where the rule applies (e.g., pods, deployments, specific namespaces, or labels).</li><li>validate describes the configuration that Kyverno expects (e.g., no privileged containers, non-root user, resource limits).</li><li>validationFailureAction determines what happens if the rule is broken: Enforce blocks the deployment, while audit allows it but reports a violation.</li></ul><pre>apiVersion: kyverno.io/v1<br>kind: ClusterPolicy<br>metadata:<br>  name: disallow-root-user<br>spec:<br>  validationFailureAction: enforce<br>  rules:<br>  - name: must-run-as-non-root<br>    match:<br>      resources:<br>        kinds:<br>        - Pod<br>    validate:<br>      message: &quot;Running containers as root is not allowed&quot;<br>      pattern:<br>        spec:<br>          containers:<br>          - securityContext:<br>              runAsNonRoot: true</pre><p>The YAML structure doesn’t just describe <em>what the policy is about;</em> each field maps to a responsibility:</p><ul><li>scope → match</li><li>requirement → validate</li><li>outcome → validationFailureAction</li></ul><p>We will add <a href="https://github.com/ravisinghrajput95/guardrails-demo/tree/main/kyverno-policies">four</a> robust but developer-friendly policies:</p><ul><li>Allow only Artifact Registry images.</li><li>Disallow privileged containers.</li><li>Disallow running as root.</li><li>Require CPU &amp; memory limits.</li></ul><p>Let’s apply the first policy, <a href="https://github.com/ravisinghrajput95/guardrails-demo/blob/main/kyverno-policies/allow-only-artifact-registry.yaml">Allow images from Artifact Registry</a>, by using the command below and validating.</p><pre>cd kyverno-policies<br>kubectl apply -f allow-only-artifact-registry.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jduzzC10wExbwXdDIEqfdQ.png" /><figcaption>Kyverno policy created in the GKE cluster.</figcaption></figure><p>We will now validate our first Kyverno policy created in the previous step. The first policy only allows the image to be pulled from Artifact Registry.</p><p>Let’s deploy a public image and test policy. You can pull any image and run a pod using the command below:</p><pre>kubectl run test --image=nginx</pre><p>Once you run the command, the Kyverno policy will restrict the public image from being deployed to the cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kbOgbpPcPbuWyL9XAuG42A.png" /><figcaption>Public image cannot be deployed due to the Kyverno policy restriction.</figcaption></figure><p>Now, let’s create and test the second policy, which disallows<a href="https://github.com/ravisinghrajput95/guardrails-demo/blob/main/kyverno-policies/disallow-privileged.yaml"> privileged containers</a>.</p><p>Here is the command to create the policy:</p><pre>kubectl apply -f disallow-privileged.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zC13FU4NNT9WUPW-B2Ujfg.png" /><figcaption>Kyverno policy created in the GKE cluster.</figcaption></figure><p>Now, we will try to run a pod with a privileged container by using the command below:</p><pre>kubectl run badpod --image=nginx --overrides=&#39;<br>{<br> &quot;spec&quot;: {<br>   &quot;containers&quot;: [{<br>     &quot;name&quot;: &quot;nginx&quot;,<br>     &quot;image&quot;: &quot;nginx&quot;,<br>     &quot;securityContext&quot;: { &quot;privileged&quot;: true }<br>   }]<br> }<br>}&#39;</pre><p>Once we run the above command, we observe the following output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k9L9FPYRuZbNAdz0sDfgBw.png" /><figcaption>Kyverno policy restricts running a pod with a privileged container.</figcaption></figure><p>Now we will validate our third policy, which is <a href="https://github.com/ravisinghrajput95/guardrails-demo/blob/main/kyverno-policies/disallow-root-user.yaml">disallow-root-user</a>. First, apply the policy, then try running a pod with the root user.</p><p>Here is the command to create the policy:</p><pre>kubectl apply -f disallow-root-user.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*deIPlYownp8cd5p0MBgS2w.png" /><figcaption>Kyverno policy created in the cluster.</figcaption></figure><p>Now, let’s validate the policy by creating a pod that runs as root using the command below:</p><pre>kubectl run rootpod --image=nginx --overrides=&#39;<br>{<br> &quot;spec&quot;: {<br>   &quot;containers&quot;: [{<br>     &quot;name&quot;: &quot;nginx&quot;,<br>     &quot;image&quot;: &quot;nginx&quot;,<br>     &quot;securityContext&quot;: { &quot;runAsNonRoot&quot;: false }<br>   }]<br> }<br>}&#39;</pre><p>Here is an example output when we create a pod that runs as the root user. Kyverno policy restricts the creation of the pod:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d1qe8usmJulbGNB1CbBdYQ.png" /><figcaption>Kyverno policy restricts running a pod as root.</figcaption></figure><p>Now, let’s create and validate our fourth policy, which requires <a href="https://github.com/ravisinghrajput95/guardrails-demo/blob/main/kyverno-policies/require-resources.yaml">require-resources</a>.</p><p>Here is the command to create the policy:</p><pre>kubectl apply -f require-resources.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_fbnsKephAL56XmiTcrQjw.png" /><figcaption>Kyverno policy restricts running a pod without any resource limits.</figcaption></figure><p>With these Kyverno policies in place, our Kubernetes cluster now has built-in safety checks that guide developers rather than block them. Developers can deploy at full speed, and the cluster ensures that workloads adhere to the proper security and operational practices.</p><p>These guardrails:</p><ul><li>Keep risky images out of the cluster</li><li>Prevent privileged or root-level containers</li><li>Avoid unstable workloads with missing resource limits</li><li>Ensure only trusted images from Artifact Registry are allowed</li></ul><p>Together, these policies provide a safer, more predictable Kubernetes environment without compromising delivery. This is what <em>Shift Smart</em> really means: security that <em>helps</em>, not security that <em>blocks</em>. With Kyverno handling enforcement at deployment time, we can move forward confidently knowing every workload entering the cluster meets the standards we expect.</p><h3>Adding runtime policies with KubeArmor</h3><p>Up to this point, Snyk has helped us identify issues in code and dependencies, and Kyverno ensured only safe workloads can be deployed. But what happens after the application is already running?</p><p>Even if the workload passes all checks, an attacker might still:</p><ul><li>Exploit a vulnerable endpoint.</li><li>Run unexpected commands inside a container.</li><li>Try to read sensitive files.</li><li>Download malicious tools.</li><li>Attempt container escape.</li></ul><p>This is where KubeArmor comes in.</p><p>KubeArmor provides runtime protection, meaning it monitors container activity while it is running. If something suspicious happens, KubeArmor can:</p><ul><li>Detect it.</li><li>Alert you.</li><li>Or block it completely.</li></ul><p>It works like a security guard inside every node, watching process execution, file access, and network activity.</p><p>Here are the installation commands for KubeArmor:</p><pre>helm repo add kubearmor <a href="https://kubearmor.github.io/charts">https://kubearmor.github.io/charts</a><br>helm repo update<br>kubectl create namespace kubearmor<br>helm install kubearmor kubearmor/kubearmor --namespace kubearmor</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0LKZMlpgF7BcoJk4EHd4fQ.png" /><figcaption>Kuberarmor is deployed in the cluster.</figcaption></figure><p>Before jumping into the KubeArmor policy examples, it’s important to know how a KubeArmor policy is structured.</p><p>A KubeArmor policy contains:</p><ul><li>Selector: which pods it applies to (matched by labels).</li><li>Rules: what activity to monitor (process execution, file access, network).</li><li>Action: what to do, like Allow, Audit, or Block.</li></ul><p>Let’s see an example to block shell execution inside the app container:</p><pre>apiVersion: security.kubearmor.com/v1<br>kind: KubeArmorPolicy<br>metadata:<br>  name: block-shell-execution<br>  namespace: demo-app<br>spec:<br>  selector:<br>    matchLabels:<br>      app: vulndemo<br>  process:<br>    matchPaths:<br>      - path: /bin/sh<br>      - path: /usr/bin/bash<br>  action: Block</pre><p>Under the previous policy, even if an attacker exploits a vulnerability and attempts to spawn a shell, execution is immediately blocked and logged without requiring external dashboards or manual monitoring.</p><p>Now, we will create another <a href="https://github.com/ravisinghrajput95/guardrails-demo/blob/main/kubearmor-policies/block-sensitive-files.yaml">policy</a>, which is about blocking the reading of sensitive files:</p><pre>cd kubearmor-policies<br>kubectl apply -f block-sensitive-files.yaml</pre><p>Here is an example output when we create our first KuberArmor policy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YDYQHhJGx2iszwbTkfhKNQ.png" /><figcaption>Kubearmor’s policy to block access to the sensitive file has been created.</figcaption></figure><p>Now, we will test the policy by trying to read a sensitive file in a pod, such as /etc/shadow. Here is the example command to identify the running application pod and access the sensitive file in the pod:</p><pre>kubectl get pods -n demo-app<br>kubectl exec -it &lt;pod&gt; -n demo-app -- cat /etc/shadow</pre><p>Here is an example output when the above commands are run:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h8ZHGlpLmscumBcSrxo0Tw.png" /><figcaption>File reading blocked by Kubearmor policy.</figcaption></figure><p>Let’s create our 2nd policy to block shell execution. Here is the command to make the policy:</p><pre>kubectl apply -f block-cron-and-systemd-writes.yaml</pre><p>Here is an example output when the above command is run:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MXc7AUFvc1UbQm0bMDyK6g.png" /><figcaption>Block cron and systemd writes the Kubearmor policy created.</figcaption></figure><p>Now, let’s test the policy by running the command below:</p><pre>kubectl exec -it -n demo-app vulndemo-5cdcf5b6cb-clwkl  -- /bin/sh<br>echo &#39;* * * * * root echo hi&#39; &gt; /etc/cron.d/persist 2&gt;/dev/null</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p7rRbIhtxvIZ__oOj7DOWg.png" /><figcaption>Kubearmor policy blocking the creation of a cron in a pod.</figcaption></figure><p>Let’s explore our third <a href="https://github.com/ravisinghrajput95/guardrails-demo/blob/main/kubearmor-policies/block-dangerous-procs.yaml">policy</a>, which is about the blocking process in the cluster. Here is the command to create the policy:</p><pre>kubectl apply -f block-dangerous-procs.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jlsK5o8FUuUsGhJTu43SLA.png" /><figcaption>Kubearmor’s policy to block the process has been created.</figcaption></figure><p>Now, we will run the commands below and test this policy.</p><pre>kubectl exec -it -n demo-app vulndemo-9788779fc-5mfcv  -- sh<br>curl -I <a href="https://www.google.com/">https://www.google.com</a><br>wget -qO- <a href="https://example.com/">https://example.com</a></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d9x7v3vvdPTy1YCz6ic_rg.png" /><figcaption>Curl and Wget operations are blocked inside the pod.</figcaption></figure><p>Let’s examine our fourth <a href="https://github.com/ravisinghrajput95/guardrails-demo/blob/main/kubearmor-policies/restrict-writes.yaml">policy</a>, which concerns preventing reads and writes in specific directories inside the pod. Here is the command to create the policy:</p><pre>kubectl apply -f restrict-writes.yaml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-qlEPxDS9T-e3OEUsmkiYQ.png" /><figcaption>KubeArmor policy created read and write operations.</figcaption></figure><p>Now, let’s test this policy by running the commands below inside the pod:</p><pre>kubectl exec -it -n demo-app vulndemo-9788779fc-5mfcv  -- sh<br>echo PWNED &gt; /app/evil.sh 2&gt;/dev/null</pre><p>Below is an example output when the above command is run:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZTCLrfdL_6vLBa6lq1EYeg.png" /><figcaption>Kubearmor policy restricting write operation in the app directory.</figcaption></figure><h3>Best Practices for Building Developer-Friendly Security Guardrails</h3><p>Keeping applications secure in the cloud is no longer something you can leave for the end. It must be part of every step, from writing code to building images and running them in Kubernetes. By following a few clear best practices, teams can avoid common mistakes, mitigate risks, and ensure their systems stay safe while still moving fast. The points below highlight the most essential habits for keeping both your applications and your Kubernetes environment secure. Below are the best practices:</p><ul><li><em>Shift Security Left</em>: Start checking for security issues early so they are easier and cheaper to fix.</li><li><em>Automate Everything</em>:<strong> </strong>Let the pipeline handle scans, checks, and alerts automatically so nothing gets missed.</li><li><em>Use Least Privilege</em>:<strong> </strong>Give each app, user, and container only the permissions they genuinely need.</li><li><em>Use Layers of Security</em>:<strong> </strong>Combine code scanning, image scanning, policies, and runtime protection for stronger safety.</li><li><em>Use Trusted Sources Only</em>:<strong> </strong>Pull images and packages only from approved and safe locations.</li><li><em>Keep Policies Simple</em>:<strong> </strong>Write policies that are clear, concise, and easy to understand and maintain.</li><li><em>Monitor Continuously</em>:<strong> </strong>Watch your apps in real-time and alert on anything unusual.</li><li><em>Provide Helpful Feedback to Developers</em>:<strong> </strong>Ensure security tools clearly identify issues and provide guidance on how to resolve them.</li><li><em>Review Policies Often</em>:<strong> </strong>Update your security rules regularly as threats and apps change.</li><li><em>Integrate Security into Developer Workflows</em>:<strong> </strong>Make security part of CI/CD and everyday tools so it helps developers, not slows them down.</li></ul><h3>Conclusion</h3><p>With CI/CD guardrails in place, the next challenge is securing workloads after deployment. Kyverno and KubeArmor solve that by automatically enforcing security directly within Kubernetes without manual review.</p><p>Kyverno prevents unsafe workloads from running in the first place: no privileged containers, no root users, and no unapproved images. KubeArmor continues the protection at runtime, blocking suspicious behavior such as reverse shells or access to sensitive system paths. Together, they ensure that even if a vulnerability slips through or an attack happens, the cluster stays protected.</p><p>These runtime and admission guardrails do not slow teams down; they give developers confidence that the platform protects them by default. When security shifts from “stop and fix” to “secure by design,” delivery becomes faster and safer.</p><h3>References</h3><ul><li><a href="https://kubernetes.io/docs/concepts/security/pod-security-standards/">Pod Security Standards (PSS)</a></li><li><a href="https://github.com/cncf/tag-security">CNCF Cloud Native Security Whitepaper</a></li><li><a href="https://kubernetes.io/docs/concepts/security/">Kubernetes Best Practices</a></li><li><a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/">Admission Controllers</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82ce993bbd50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Guardrails Over Gates: A Smarter Way to Enable Security Without Slowing DevOps]]></title>
            <link>https://ravisrajput.medium.com/guardrails-over-gates-a-smarter-way-to-enable-security-without-slowing-devops-60b96603ce10?source=rss-886c91046e61------2</link>
            <guid isPermaLink="false">https://medium.com/p/60b96603ce10</guid>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[devsecops]]></category>
            <dc:creator><![CDATA[Ravi Rajput]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 12:55:32 GMT</pubDate>
            <atom:updated>2025-12-31T12:55:32.862Z</atom:updated>
            <content:encoded><![CDATA[<h4>A practical approach to security that supports developer velocity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RfItG75hO03M_bLd343Trg.png" /><figcaption>Image from <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><p>Many companies say they have “shifted left,” but in reality, most have only moved security scans a little earlier in the CI pipeline. The way of working hasn’t changed much. Security still shows up at the end, after the code is written and the pull request is open. When the scan finally runs, it reports a long list of issues, and the build fails. Developers are then told to “fix it fast.”</p><p>This doesn’t really improve security. It mostly creates frustration. Imagine opening a pull request and suddenly seeing thirty security issues, many of which come from dependencies you never chose. Naturally, you feel blocked and annoyed. You start thinking, “Why am I being stopped for something I didn’t even write?”</p><p>When this keeps happening, developers try to avoid the process. They ignore alerts, disable checks, or bypass security steps entirely.</p><p>This article aims to show a different approach: G<em>uardrails over Gates</em>. Instead of blocking developers at the last minute, we create a system that guides them early and automatically protects workloads. The goal is speed <em>and</em> safety.</p><p>To help you apply this idea in real projects, the article walks through a practical<strong>, </strong>step-by-step setup using tools like Snyk, Artifact Registry, Kyverno, KubeArmor, GKE, and GitHub Actions. Technical readers will get clear, hands-on instructions, while non-technical readers get the conceptual reasoning behind each guardrail and how it improves the developer experience.</p><h3>Problem Statement: Late Security Feedback in Development</h3><p>One of the most significant problems in modern development is that security feedback arrives too late. Most teams still find issues only after the code is written, the pull request is open, and the CI pipeline starts running. At that point, fixing vulnerabilities becomes slow, painful, and expensive. Developers feel blocked, pipelines often fail, and security becomes something people avoid rather than trust.</p><p>This delay happens because the workflow still looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OUOCo1AQ25A7ZpDI1pfNnw.png" /><figcaption>Late Feedback in Development.</figcaption></figure><p>By the time the scan runs, the developer has already moved on mentally. Late feedback interrupts their flow and creates friction.</p><p>Security guardrails solve this by moving security earlier and making it automatic, continuous, and developer-friendly. Instead of blocking work at the end, guardrails quietly guide developers as they work, similar to lane assist in a car.</p><p>Here’s how guardrails fix the late-feedback problem:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aK0daI55LEQa_1o7OzVmAA.png" /><figcaption>Guardrails providing instant feedback to Developers without blocking them.</figcaption></figure><p>The diagram illustrates how security is built into the development pipeline without slowing developers down. Instead of adding checks only at the end, security feedback is delivered continuously and automatically across different stages.</p><p>The workflow starts in the developer’s IDE, where the Snyk plugin scans dependencies in real time. If issues are detected, the developer gets instant feedback while coding, preventing problems from reaching later stages. Once the code is committed, GitHub Actions CI runs:</p><ol><li>Run Snyk dependency scan again to verify no new vulnerabilities were introduced.</li><li>Container build step to package the app.</li><li>Snyk container scan to analyze the Docker image before pushing.</li></ol><p>Only images that pass CI security checks are pushed to Artifact Registry, ensuring the cluster uses only trusted images. When deployment is triggered to GKE:</p><ol><li>Kyverno policies validate the workload before deployment</li><li>Unsafe workloads (e.g., privileged containers, no resource limits, non-verified registries) are blocked automatically</li><li>The developer receives actionable feedback instead of a silent failure.</li></ol><p>Once the application is running, KubeArmor enforces runtime behavior policies, preventing malicious actions (e.g., spawning shells, accessing sensitive files, and outbound exfiltration).</p><h3>Why Early Security Feedback Matters</h3><p>When security feedback comes too late, both developers and security teams suffer. Developers often feel blocked and pressured, and security teams feel ignored. This leads to delays, stress, and sometimes insecure code going to production. The goal of security is to help teams build safer software, not to create roadblocks or blame. If feedback comes early and straightforwardly, developers can fix issues while they are still coding, and everything becomes smoother and faster. Here are some key points to consider:</p><ul><li>Late security checks lead to rework and slow down delivery.</li><li>Developers get frustrated when pipelines fail at the last minute.</li><li>Teams start ignoring or bypassing security controls to “just get things done”.</li><li>Security is often viewed as a blocker rather than a helpful part of development.</li><li>Resolving issues early is easier, cheaper, and less stressful than fixing them later.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0aL0RKN-p78Vv7opjmAWWA.png" /><figcaption>Before and After Guardrails.</figcaption></figure><h3>Prerequisites</h3><p>Security guardrails can be implemented on many different cloud and Kubernetes platforms. The tools listed here are one example setup to demonstrate the concepts in this article. Before following the steps, make sure you have these components available and understand what each one does. They will help you build a smooth, automated, and secure workflow from development to deployment.</p><ul><li>CI/CD platform: <a href="https://github.com/features/actions">GitHub Actions</a></li><li>Deployment Platform: <a href="https://cloud.google.com/kubernetes-engine">Google Kubernetes Engine</a></li><li>Container registries: <a href="https://docs.cloud.google.com/artifact-registry/docs/overview">Artifact Registry</a></li></ul><h3>Checklist to Implement Cost-Aware Workflows in Cloud-Native Pipelines</h3><p>The goal of this approach is to give developers quick, helpful security feedback while they are still writing and testing their code, not at the final stages of deployment. By shifting security earlier and using guardrails instead of hard blockers, teams can work faster, avoid last-minute surprises, and reduce production risks. The sections below walk through how to set up practical, adequate security guardrails for a cloud-native pipeline.</p><h4>Enable early feedback in the developer workflow</h4><p>One of the most significant problems in traditional security workflows is that developers typically become aware of security issues only at the end, usually during Continuous Integration (CI) or during a production review. By that time, the code is already written, deadlines are close, and fixing issues feels like extra work.</p><p>Instead, we aim to bring security feedback where developers already work — inside their IDE (<a href="https://code.visualstudio.com/">Visual Studio Code</a>, <a href="https://www.jetbrains.com/idea/">IntelliJ</a>, etc.) and during local development.</p><p>This is where tools like Snyk help. Snyk scans code, libraries, and container configurations as developers write code. It highlights vulnerable packages, outdated libraries, and misconfigurations in real time, just like a spell-checker but for security.</p><p>Example developer workflow:</p><ul><li>The developer writes code in the IDE.</li><li>Snyk plugin highlights a vulnerable library.</li><li>The developer clicks the “Upgrade dependency” suggestion.</li><li>Code stays secure without slowing down delivery.</li></ul><p>Let’s get started setting up Snyk.</p><p>First, <a href="https://app.snyk.io/login">sign up</a> at Snyk:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w-2OVKSgGl4jg5Ot-U-JzQ.png" /><figcaption>Snyk login page to create an account.</figcaption></figure><p>Now, agree to the terms and conditions and complete the registration process:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UgZwgRX9gCY2JFFnmkIudQ.png" /><figcaption>Example screen after the account creation.</figcaption></figure><p>Now, generate an auth token to get started with Snyk:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*88NS-je315XNMlz4eO3_bQ.png" /><figcaption>All Projects page in the Snyk dashboard.</figcaption></figure><p>Click on your username as shown in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cXgf4p2KR10u9OntmxQHuw.png" /><figcaption>Navigating to account settings.</figcaption></figure><p>Click on <em>Account Settings</em> as shown in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xj4g33qw3hNK8mHPyxo8Og.png" /><figcaption>Copy the auth token for CI/CD integration.</figcaption></figure><p>Copy the auth token. We will use this auth token in the CI/CD workflow and the Snyk IDE plugin to authenticate with Snyk.</p><p>Now, open <a href="https://code.visualstudio.com/">Visual Studio Code</a> or any IDE based on your preference and navigate to Extensions and search for the Snyk IDE plugin:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BjkclDLQrWFsE2tV6mzj1A.png" /><figcaption>Snyk IDE plugin installation in Visual Studio Code.</figcaption></figure><p>Open the Snyk IDE plugin and click on <em>Connect and Trust Workspace</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ldrqNaupvDqDorfSnaOMpg.png" /><figcaption>Allowing the Snyk IDE plugin to connect and trust the workspace.</figcaption></figure><p>Grant the required application access to connect the Snyk IDE plugin with the Snyk dashboard:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d3Bz1nggus_kw6ROHQDV6w.png" /><figcaption>Granting app access for the Snyk IDE plugin.</figcaption></figure><p>Now, we can start using Snyk to detect vulnerabilities in the open-source dependencies.</p><p>You can fork or clone the <a href="https://github.com/ravisinghrajput95/guardrails-demo">GitHub project</a> to get the vulnerable codebase. After you fork the repository, open Visual Studio Code and scan the codebase for open-source dependencies.</p><p>Before developers push code to GitHub or open a pull request, they should already know whether the code has security issues. This is what we call early feedback. Instead of finding problems later in CI, we help developers spot and fix issues as they write code on their laptops.</p><p>Snyk instantly identifies vulnerable dependencies and provides developers with early feedback, allowing issues to be fixed before they reach CI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gNHe5ni72AozvJkNUFF8mA.png" /><figcaption>Vulnerabilities detected by the Snyk IDE plugin in Visual Studio Code.</figcaption></figure><p>By using Snyk within the IDE, developers get warnings in the same place they write code. This makes fixing easier because:</p><ul><li>They do not have to stop their work later.</li><li>They understand the code context at that moment.</li><li>They can fix the issue before it spreads to more files.</li><li>The CI pipeline does not fail unexpectedly later.</li></ul><p>This also reduces stress because developers are not blocked or surprised by security checks when they try to merge code.</p><p>To get all the findings on the Snyk Dashboard, add this <a href="https://github.com/ravisinghrajput95/guardrails-demo/blob/main/.github/workflows/guardrails.yaml">configuration</a> to your current GitHub Actions workflow, or create a new file named .github/workflows/guardrails.yaml.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ay2zDStWeImsWcGuWpXc7w.png" /><figcaption>Project vulnerabilities were detected and reflected in the Snyk Dashboard.</figcaption></figure><h4>Scan container images during build</h4><p>Once the code is written and passes basic checks, the next step is to build a container image. The container image is what will run in Kubernetes. But container images often contain:</p><ul><li>Old system packages.</li><li>Known vulnerabilities in base images.</li><li>Misconfigurations in Dockerfiles.</li></ul><p>If we do not scan the image early, these problems will not be detected until deployment, which is too late. So we use <a href="https://snyk.io/product/container-vulnerability-management/">Snyk Container</a> to scan the image while it is being built. This gives developers a clear view of:</p><ul><li>Which vulnerabilities exist inside the image?</li><li>Their severity (High, Medium, Low).</li><li>How to fix them. (Upgrade image, change base image, etc.)</li></ul><p>The goal is not to block builds immediately but to help the team improve the image over time. Here’s how to run a Snyk container test for the Docker image:</p><pre>snyk container test vulndemo:1.0 --file=Dockerfile</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JZb6gPn6IjZ02UBqE6c8Qw.png" /><figcaption>Snyk container test in a GitHub Actions workflow.</figcaption></figure><p>To have all the vulnerabilities in the Snyk Dashboard, the following command can be run:</p><pre>snyk container monitor vulndemo:1.0 --file=Dockerfile</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*THJ9nLaL_6J44ui35mgY4Q.png" /><figcaption>Snyk container monitor in a GitHub Actions workflow.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dJrPCQQxZhYHU9zWnhsg6w.png" /><figcaption>Vulnerabilities were detected after the Snyk container monitor displayed on the Snyk dashboard.</figcaption></figure><p>Next, we will push our Docker image to the Artifact Registry using the same GitHub Actions workflow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jRMpoi9BWSZefraMEQACSg.png" /><figcaption>Docker image pushed to the artifact registry.</figcaption></figure><h3>Conclusion</h3><p>Traditional “shift left” security often fails because it slows developers down instead of helping them. What truly works is <em>Shift Smart</em>, bringing security early into the workflow in a way that’s helpful, fast, and automatic.</p><p>By adopting this setup, teams can expect fewer pipeline failures, faster delivery cycles, and earlier vulnerability detection, all while keeping developers productive and confident. Security stops being a bottleneck and becomes a built-in advantage.</p><p>The next step is simple:</p><p>Start small: enable Snyk scanning in your IDE as we saw in this article. Then, add a basic Kyverno policy or apply a single KubeArmor runtime rule, as we will see in the second part. Each step moves you closer to secure, frictionless delivery.</p><p>Guardrails don’t slow you down; they give you the confidence to move faster, safely.</p><h3>References</h3><ul><li><a href="https://docs.snyk.io/developer-tools/snyk-cli">Snyk CLI</a></li><li><a href="https://github.com/cncf/tag-security">CNCF Cloud Native Security Whitepaper</a></li><li><a href="https://docs.cloud.google.com/kubernetes-engine/docs/deploy-app-cluster">GKE</a></li><li><a href="https://www.blackduck.com/glossary/what-is-software-composition-analysis.html">Software Composition Analysis</a></li><li><a href="https://www.guardrails.io/why-choose-guardrails/">Guardrails</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60b96603ce10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Cloud, DevOps, Platform Engineering, SRE, and DevSecOps Really Mean in 2025]]></title>
            <link>https://ravisrajput.medium.com/what-cloud-devops-platform-engineering-sre-and-devsecops-really-mean-in-2025-699754d80f9b?source=rss-886c91046e61------2</link>
            <guid isPermaLink="false">https://medium.com/p/699754d80f9b</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[sre]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Ravi Rajput]]></dc:creator>
            <pubDate>Mon, 17 Nov 2025 18:08:58 GMT</pubDate>
            <atom:updated>2025-11-17T18:24:00.688Z</atom:updated>
            <content:encoded><![CDATA[<h4>Technology keeps changing fast, and with it come many big terms: Cloud, DevOps, Platform Engineering, SRE, and DevSecOps</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*kPv_amn-ltthSVWye3VVmA.avif" /><figcaption>Image from Unsplash</figcaption></figure><p>The technology world loves buzzwords, and none are more common than Cloud, DevOps, Platform Engineering, SRE, and DevSecOps. These terms dominate conference talks, job descriptions, and strategy meetings — yet they’re often confused, blended, or misunderstood.</p><p>By 2025, each of these areas will have matured into a well-defined discipline with its own principles, responsibilities, and ways of thinking. Taken together, they form the modern engineering operating model: a way for teams to build software quickly, safely, and reliably at a global scale.</p><p>This article breaks down each of these domains from a <em>theoretical and practical</em> perspective — and explains how they connect to form the backbone of today’s high-performing tech organizations. Cloud: The Abstracted Compute Model</p><p>The cloud is not simply <em>“servers on the internet.”</em> Theoretically, the cloud represents:</p><h3>Cloud: The Programmable Foundation of Everything</h3><p>When people talk about <em>“the cloud,”</em> it often sounds like a giant warehouse of servers. But the cloud of 2025 is something much more sophisticated:<br> a global, programmable infrastructure layer.</p><p>Modern cloud systems work on three principles:</p><h4>1. Elasticity</h4><p>Systems scale up or down automatically based on demand. No more buying hardware in advance.</p><h4>2. Abstraction</h4><p>Developers don’t manage physical servers. They interact with APIs, managed services, serverless platforms, and container orchestrators.</p><h4>3. Distribution</h4><p>Applications run across multiple regions and zones, improving availability and performance.</p><p>In other words, the cloud transforms infrastructure into software-controlled building blocks.<br> This shifts engineers from <em>“managing machines”</em> to <em>“designing systems.”</em> And this foundation becomes the stage on which DevOps, SRE, DevSecOps, and Platform Engineering operate.</p><h3>Platform Engineering: The Internal Product for Developers</h3><p>Platform Engineering is one of the most important engineering shifts of the decade.<br> Instead of every team managing its own pipelines, infrastructure, and tools, Platform Engineering creates <strong>standardized, reusable systems</strong> that everyone can use.</p><p>Think of it this way:</p><p>If the cloud is raw power, Platform Engineering is the machine that makes that power easy and safe to use.</p><p>Platform teams build:</p><ul><li>Golden paths (approved best-practice workflows)</li><li>Internal developer portals</li><li>CI/CD templates</li><li>Secure infrastructure modules</li><li>Service catalogs</li><li>Automated environment provisioning</li></ul><p>The theory behind Platform Engineering comes from two ideas:</p><h4>Cognitive Load Theory</h4><p>Developers should focus on the business problem, not infrastructure complexity.</p><h4>Abstraction Layers</h4><p>Platforms hide complexity while providing consistency.</p><p>In 2025, Platform Engineering is the engine that turns DevOps from a philosophy into an actual working system.</p><h3>DevOps: The Flow of Change and Delivery</h3><p>DevOps started as a cultural movement, but in 2025, it represents something larger:<br>The operating model for delivering software quickly and safely.</p><p>At its heart, DevOps is built on three theoretical pillars:</p><h4>1. Flow Efficiency</h4><p>Shorten the time it takes for code to move from development to production.</p><h4>2. Automation</h4><p>Replace manual steps with predictable, repeatable pipelines.</p><h4>3. Feedback Loops</h4><p>Detect problems early and learn from them continuously.</p><p>DevOps is not one team. It’s not a role.<br> It’s a shared mindset that encourages:</p><ul><li>small, frequent deployments</li><li>cross-team collaboration</li><li>continuous integration and delivery</li><li>shared responsibility for production</li></ul><p>Platform Engineering provides the toolset. DevOps provides the behaviours. Together, they drive velocity.</p><h3>SRE: The Reliability and Resilience Layer</h3><p>As systems grew more complex and distributed, traditional operations could no longer keep up.<br>Site Reliability Engineering (SRE) emerged as the <strong>formal discipline</strong> for managing reliability.</p><p>SRE introduces engineering concepts into operations:</p><h4>Service-Level Indicators (SLIs)</h4><p>Measurable metrics that reflect the user experience — latency, errors, saturation, etc.</p><h4>Service-Level Objectives (SLOs)</h4><p>Targets for these indicators, defining how reliable the system should be.</p><h4>Error Budgets</h4><p>An allowance for failure.<br> If the budget is spent, speed slows down to reduce risk.</p><h4>Toil Reduction</h4><p>Manual, repetitive work is eliminated through automation. While DevOps focuses on delivery speed, SRE focuses on delivery safety.</p><p>If DevOps asks, “How fast can we move?” SRE asks, “How stable can we stay while moving fast?”</p><p>Both are essential for a modern engineering system.</p><h3>DevSecOps: Security Built Into the Pipeline</h3><p>As teams shipped faster, security had to evolve.<br>DevSecOps is the practice of weaving security into every layer of the lifecycle — not tacking it on at the end.</p><p>In 2025, DevSecOps means:</p><h4>Shift-Left + Shift-Right Security</h4><ul><li><em>Left:</em> Scan code, dependencies, and infrastructure as early as possible.</li><li><strong><em>Right</em></strong><em>:</em> Monitor behaviour in production for threats and anomalies.</li></ul><h4>Policy as Code</h4><p>Security rules are automatically enforced by pipelines.</p><h4>Zero-Trust Architecture</h4><p>No system, identity, or workload is trusted by default.</p><h4>Continuous Verification</h4><p>Vulnerabilities are checked constantly, not once per release.</p><p>The goal is simple: Security should not slow teams down — it should protect them as they move fast. DevSecOps makes this possible.</p><h3>How These Disciplines Form an Integrated Theoretical Model</h3><p>Together, these five domains create a layered, coherent architecture for modern engineering:</p><h4>Cloud</h4><p>→ Provides the elastic, programmable environment.</p><h4>Platform Engineering</h4><p>→ Abstracts this environment into safe, reusable interfaces.</p><h4>DevOps</h4><p>→ Drives the collaborative processes and automation that deliver software.</p><h4>SRE</h4><p>→ Ensures the running system meets reliability constraints.</p><h4>DevSecOps</h4><p>→ Ensures the system meets security and compliance constraints.</p><h3>The Modern Engineering Paradigm (2025)</h3><p>By 2025, successful organizations will operate using a combined theoretical model:</p><ul><li>Each layer depends on the one beneath it:</li><li>Cloud provides compute building blocks.</li><li>Platform Engineering turns them into usable tools.</li><li>DevOps defines how teams use those tools to ship software.</li><li>SRE ensures what’s shipped is reliable.</li><li>DevSecOps ensures everything is secure.</li></ul><p>This layered model is the backbone of modern engineering organizations in 2025.</p><p>The theoretical foundation is not just about tools — it is about <strong>d</strong>esigning systems and teams that can evolve with complexity.</p><h3>The One-Line Summary</h3><blockquote>Cloud runs it.<br>Platform Engineering builds the path.<br>DevOps moves fast.<br>SRE keeps it stable.<br>DevSecOps keeps it safe.</blockquote><p>Together, they form the modern engineering system — fast, scalable, resilient, and secure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=699754d80f9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing Zero Trust in CI/CD Pipelines: A Secure DevOps Approach]]></title>
            <link>https://ravisrajput.medium.com/implementing-zero-trust-in-ci-cd-pipelines-a-secure-devops-approach-0f4b055ef3b0?source=rss-886c91046e61------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f4b055ef3b0</guid>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[zero-trust]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Ravi Rajput]]></dc:creator>
            <pubDate>Fri, 12 Sep 2025 06:41:12 GMT</pubDate>
            <atom:updated>2025-09-12T06:41:12.787Z</atom:updated>
            <content:encoded><![CDATA[<h4>Ensuring strong security in software delivery</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YsTGLRJ8OEbr3TW39txxNA.png" /><figcaption>Image from <a href="https://unsplash.com/s/photos">Unsplash</a></figcaption></figure><p><a href="https://www.upguard.com/glossary/cyber-threat">Cyber threats</a> are increasing every day and becoming more common. Old security methods that used to work are no longer effective in protecting our systems, we need a new approach to security. One of the best ways to achieve this is by using a Security model called Zero Trust. <a href="https://www.zscaler.com/resources/security-terms-glossary/what-is-zero-trust">Zero Trust</a> is a security model that checks the identity of users and systems at every step. This approach helps keep <a href="https://www.redhat.com/en/topics/devops/what-is-ci-cd">Continuous Integration and Continuous Deployment</a> (CI/CD) pipelines safe from attacks.</p><p>This guide outlines the implementation of the Zero Trust method in a DevOps environment. It begins by establishing workload identity federation, signing, and verifying the artifacts. Then, it continues using Policy as Code to ensure compliance, monitoring runtime threats, implementing attribute-based access controls, and ensuring least privilege access.</p><h3>The Problem Statement</h3><p>The CI/CD pipelines are crucial for Software development. However, they also face many threats and problems. Here are some of the most common issues:</p><ul><li><em>Weak Access Controls</em>: Sometimes, the controls used for limited access are not strong enough. This can enable hackers to gain greater control, potentially resulting in significant security breaches.</li><li><em>Using Unsafe Open-Source Software</em>: Many Developers use open-source software to speed up their work. However, not all open-source software is secure. Using open-source software that is not secure can lead to vulnerabilities.</li><li><em>Automation Processes</em>: Automation is a key part of CI/CD, but sometimes these processes have too many permissions. If an attacker gains access to an automated process, they can exploit this and cause harm.</li><li><a href="https://www.cloudflare.com/en-gb/learning/security/what-is-a-supply-chain-attack/"><em>Supply chain attacks</em></a><em> and leaked passwords</em>: Attackers can target the supply chain, looking for weaknesses to exploit. Moreover, if passwords are not protected, they may be compromised, granting attackers access to confidential information.</li></ul><p>If security measures fail, the consequences can be severe. It can harm the software being developed, leading to financial losses, and damage a company’s reputation.</p><h3>Why It Matters</h3><p>Every company needs to protect its CI/CD pipelines. Here are some reasons why:</p><ul><li><em>Keep</em><strong><em> </em></strong><em>Code Safe:</em> Protecting code<strong> </strong>from tampering and unauthorized changes is essential. If code is altered without permission, it can lead to security vulnerabilities.</li><li><em>Limit Access:</em> Companies should limit who can access systems. This includes access to code repositories and secret keys that allow deployment.</li><li><em>Follow Security Rules: </em>Organizations should adhere to essential security rules and guidelines. One example is<strong> </strong><a href="https://nvlpubs.nist.gov/nistpubs/specialpublications/NIST.SP.800-207.pdf">NIST 800–207</a><strong>, </strong>which provides a framework to implement Zero Trust.</li></ul><h3>Prerequisites</h3><p>Before you start implementing Zero Trust in your CI/CD pipelines, make sure you have the following components in place and the basic knowledge about them:</p><ul><li>CI/CD platforms: <a href="https://github.com/ravisinghrajput95/zero-trust-ci-cd/blob/main/.github/workflows/zero-trust-pipeline.yml">GitHub Actions</a></li><li>Identity Provider (IdP): <a href="https://docs.aws.amazon.com/iam/">AWS IAM</a></li><li>Security tools: <a href="https://github.com/sigstore/cosign">Sigstore Cosign</a>, <a href="https://www.openpolicyagent.org/">Open Policy Agent</a>, <a href="https://falco.org/">Falco</a>, <a href="https://trivy.dev/latest/">Trivy</a></li><li>Container registries: <a href="https://hub.docker.com/">Docker Hub</a></li><li>Deployment Platform: <a href="https://kubernetes.io/">Kubernetes</a></li></ul><h3>Checklist to Implement Zero Trust in CI/CD Pipelines</h3><p>Zero Trust is a security model that assumes no internal or external entity should be trusted by default. In the context of CI/CD pipelines, this means continuously validating identities, enforcing the least privilege, monitoring activity, and securing every step from code to deployment. The following checklist outlines practical steps to embed Zero Trust principles into your CI/CD workflows, making them more secure, resilient, and compliant.</p><h4>Use workload identity federation</h4><p>Workload Identity federation allows GitHub actions to authenticate with cloud providers (like AWS, Azure, and GCP) without storing long-lived credentials. Instead, GitHub uses an OIDC token to prove the identity of the workflow, which is then exchanged for temporary credentials from the cloud provider.</p><p>One of the first steps to improve security in CI/CD pipelines is to avoid static passwords. Use OIDC (<a href="https://openid.net/developers/how-connect-works/">OpenID Connect</a>) authentication. This method ensures that identities are verified at every step.</p><p>Here is an example of how to set this for GitHub Actions with <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc.html">AWS OIDC</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oHKsHj9wXNGeNILm" /><figcaption>Authentication with an assumed role in AWS</figcaption></figure><p>Add the following configuration to your existing GitHub Actions workflow, or create a new file called .github/workflows/zero-trust.yaml:</p><pre>permissions:<br>  id-token: write<br>  contents: read</pre><pre>jobs:<br>  deploy:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: Configure AWS credentials<br>        uses: aws-actions/configure-aws-credentials@v4<br>        with:<br>          role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/GitHubAction-AssumeRoleWithAction<br>          aws-region: us-east-1</pre><p>In this step, we’re configuring AWS credentials in a secure, zero-trust way. Instead of storing long-lived static secrets (like access keys) in GitHub, we’re using GitHub’s OIDC token to assume an IAM role in AWS.</p><p>This allows your GitHub Actions workflow to access AWS resources securely and only when needed, aligning with the core principle of Zero Trust.</p><h4>Sign and verify artifacts</h4><p>The signing process in GitHub uses <a href="https://github.com/sigstore/cosign">Cosign</a>, a tool from the <a href="https://www.sigstore.dev/">Sigstore</a> project, to sign the container images after they are built and pushed to a container registry. The signing steps occur after the image is successfully pushed to ensure the final artifact is verified and trusted.</p><p>To prevent tampering, sign your software artifacts before deployment. This means creating a digital signature that can confirm the authenticity of the software.</p><p>Here’s how to sign a Docker image with a Private key:</p><pre>cosign sign --key cosign.key ${{ secrets.DOCKERHUB_USERNAME }}/my-image@$IMAGE_DIGEST</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2JHsm6_G2wnIMXJv" /><figcaption>Signing Docker Image with Private Key</figcaption></figure><p>In the previous example, Cosign is invoked in the workflow with the following command, which generates a cryptographic signature for the specified image. The signature is stored in the registry alongside the container image.</p><p>After signing, the signature must be verified to ensure the artifacts have not been altered. Cosign can be used again to validate that a trusted workflow signed the image. Here’s how to verify the signature:</p><pre>cosign verify --key cosign.pub ${{ secrets.DOCKERHUB_USERNAME }}/my-image@$IMAGE_DIGEST</pre><p>This is the output when the previous action is executed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Bl_BFzEHDCWXh7RF" /><figcaption>Signature verification with Public key</figcaption></figure><p>In the previous example, Cosign verifies the signature, and the image was not tampered with. This process adds an extra layer of security to your software delivery pipeline.</p><h4>Use Policy as Code</h4><p>Using <a href="https://www.paloaltonetworks.com/cyberpedia/what-is-policy-as-code">Policy as Code</a> to implement security policies directly in your CI/CD pipelines is a great way to ensure compliance. You can use <a href="https://www.openpolicyagent.org/">Open Policy Agent</a> (OPA) to apply these policies. For instance, you can create a rule to prevent unauthorized base images from being used in your applications.</p><p>Here is an example of an OPA Policy. This policy enforces the use of approved base images. It checks if a BaseImage field exists in the input configuration and then verifies whether the specified base image is part of an approved list by calling a helper function.</p><p>If the image is not approved, the policy generates a denial message indicating which image is disallowed:</p><pre>deny contains msg if {<br> input.config.BaseImage<br> image := input.config.BaseImage<br> not image_in_approved_base_images(image)<br> msg := sprintf(&quot;Base image &#39;%s&#39; is not approved&quot;, [image])<br>}</pre><p>Here is an example of an input JavaScript Object Notation (<a href="https://www.json.org/json-en.html">JSON</a>) that can be checked against this policy:</p><pre>{<br>    &quot;config&quot;: {<br>      &quot;User&quot;: &quot;flaskuser&quot;,<br>      &quot;BaseImage&quot;: &quot;python:3.11-slim&quot;<br>      }<br>}</pre><p>This ensures that only approved base images are used, which enhances security.</p><h4>Monitor for threats at runtime</h4><p>Real-time threat monitoring is a critical part of maintaining security. You can use <a href="https://falco.org/">Falco</a> to detect unusual activity as it happens. To execute Falco with GitHub Actions, initiate an action and then analyze it in live mode.</p><p>Here’s an example of an action to start Falco in a GitHub Actions workflow:</p><pre>Analyze:<br>  runs-on: ubuntu-latest<br>  needs: build<br>  permissions:<br>    contents: read<br>    actions: read<br>  steps:<br>  - name: Start Falco<br>    uses: falcosecurity/falco-actions/start@main<br>    with:<br>      mode: live<br>      falco-version: &#39;0.39.0&#39;<br>      verbose: true</pre><p>This is the output generated when the previous action is executed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PactIWzyEYwXlcu6" /><figcaption>Falco starts the action in a GitHub Actions workflow</figcaption></figure><p>In this example, Falco is started in live mode to monitor the actions being taken in the pipeline. To stop Falco, you can use this action:</p><pre>- name: Stop Falco<br>  uses: falcosecurity/falco-actions/stop@main<br>  with:<br>    mode: live<br>    verbose: true</pre><p>This is the output when the previous action is executed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*W7t0RKOr4QnQTW9u" /><figcaption>Falco Stop action in a GitHub Action workflow</figcaption></figure><p>This continuous monitoring helps quickly identify and respond to security threats.</p><h3>Attribute-based access control (ABAC) and the Principle of least privilege access</h3><p>To restrict access, you can use Attribute-based access control (ABAC) and <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html">Security best practices in IAM</a>. The diagram below illustrates the concept of Attribute-Based<strong> </strong>Access Control (ABAC), a powerful method to enforce Zero Trust principles in CI/CD environments. Instead of assigning fixed roles or permissions to users, ABAC dynamically grants access based on matching attributes of users and resources:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*SQ2vqj9hSDo3jSb2" /><figcaption>Source: AWS — Understanding the attribute-based access controls</figcaption></figure><p>In the illustration:</p><ul><li>On the left, we see workforce users, each tagged with a unique color-coded attribute (e.g., department, job role, or clearance level).</li><li>In the middle, permissions are granted or denied based on policy evaluations that compare user attributes to resource attributes.</li><li>On the right, resources (like compute, storage, or dashboards) are also labeled with matching attribute tags.</li></ul><p>ABAC uses attributes to manage access permissions. These attributes can be based on the job roles, department, or location to determine access. A user can access a resource only if their attributes match the resource’s tags and the policy allows it.</p><p><strong>Why ABAC Matters in CI/CD</strong></p><ul><li><em>Fine-grained control</em>: Access decisions aren’t binary or static; they’re based on dynamic conditions.</li><li><em>Scalability</em>: You don’t need to manually assign permissions as environments grow, as attribute policies handle it.</li><li><em>Security by design</em>: Access is granted only when the user’s attributes match the resource’s attributes, reducing the attack surface.</li></ul><p>Let’s see an example:</p><p>Imagine your DevOps team is running a Jenkins or GitHub Actions pipeline to deploy microservices across multiple environments: dev, staging, and prod.</p><p>Let’s say your CI runner (e.g., GitHub Actions) is operating with the following attributes:</p><ul><li>Environment = production</li><li>Service = payment-api</li><li>Team = payments</li></ul><p>Your AWS ECS services, IAM roles, and S3 buckets are all tagged with:</p><ul><li>Environment = production</li><li>Service = payment-api</li><li>Compliance = PCI-DSS</li></ul><p>You’ve implemented the following ABAC policies in AWS IAM:</p><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [{<br>    &quot;Effect&quot;: &quot;Allow&quot;,<br>    &quot;Action&quot;: &quot;ecs:UpdateService&quot;,<br>    &quot;Resource&quot;: &quot;*&quot;,<br>    &quot;Condition&quot;: {<br>      &quot;StringEquals&quot;: {<br>        &quot;aws:ResourceTag/Environment&quot;: &quot;${aws:PrincipalTag/Environment}&quot;,<br>        &quot;aws:ResourceTag/Service&quot;: &quot;${aws:PrincipalTag/Service}&quot;<br>      }<br>    }<br>  }]<br>}</pre><p>The principle of least privilege access means to provide only the required permissions to do their job. Below are some of the possible ways to implement the least privileged access:</p><ul><li>Start with the least permissions and provide more only when necessary.</li><li>Regularly review permissions and revoke access when it is no longer needed.</li><li>Rotate admin passwords frequently to keep them secure.</li><li>Offer Just-in-time access, which restricts user access to only the necessary duration.</li></ul><h3>Security Challenges and Solutions</h3><p>While implementing Zero Trust, you may face some challenges. Below are some of the common challenges along with possible solutions:</p><ul><li><em>Challenge</em><strong>:</strong> Configuration complexity makes it difficult to set up Zero Trust correctly<br><em>Solution</em><strong>: </strong>Start with OIDC authentication, a step to add more security controls as you become more comfortable.</li><li><em>Challenge</em><strong>: </strong>Slower deployments due to security checks.<br><em>Solution</em><strong>:</strong> Apply security policies in stages and monitor for violations. This way, you can find a balance between security and speed.</li><li><em>Challenge</em><strong>:</strong> Implementing Zero Trust may require extra tools, which can be overwhelming.<br><em>Solution</em><strong>:</strong> Use the built-in security features of your CI/CD tools before adding new ones. This can simplify the process.</li></ul><h4>Real-World Examples</h4><p>Let’s look at some companies that successfully implemented Zero Trust:</p><ul><li><a href="https://cloud.google.com/beyondcorp?hl=en">BeyondCorp</a>: Google removed the reliance on VPNs and enforced the Zero Trust approach throughout its organization. This has made their network much more secure.</li><li><a href="https://www.linkedin.com/pulse/how-netflix-uses-security-patterns-protect-its-microservices-xwzbe/">Netflix Secure DevOps</a>: Netflix has limited access to critical systems and signs artifacts. Hence, software delivery is secure. This helps them maintain a high level of security.</li><li><a href="https://darktrace.com/blog/back-to-square-one-the-capital-one-breach-proved-we-must-rethink-cloud-security">Capital One</a>: Capital One switched to OIDC for authentication, which has helped reduce password leaks and improve overall security.</li></ul><h4>Following Industry Standards</h4><p>Implementing Zero Trust aligns well with important industry standards. Some of these include:</p><ul><li>NIST 800–207: This is the Zero Trust Model, which provides guidelines for implementing Zero Trust measures</li><li><a href="https://www.cisa.gov/news-events/alerts/2023/06/28/cisa-and-nsa-release-joint-guidance-defending-continuous-integrationcontinuous-delivery-cicd">CISA Secure CI/CD Pipeline</a> <a href="https://media.defense.gov/2023/Jun/28/2003249466/-1/-1/0/CSI_DEFENDING_CI_CD_ENVIRONMENTS.PDF">Guidelines</a>: This guide helps organizations create secure CI/CD pipelines.</li><li><a href="https://project.linuxfoundation.org/hubfs/CNCF_SSCP_v1.pdf">CNCF Security Best Practices</a>: This resource offers best practices for securing cloud-native applications.</li><li><a href="https://slsa.dev/">Supply-Chain Levels for Software Artifacts:</a> The Supply-Chain Level of Software Artifacts is a framework aimed at designing and enhancing the software supply chain security. It sets maturity levels to secure the build pipeline and artifact integrity.</li></ul><h3>Pros and Cons of Zero Trust in CI/CD</h3><p>Implementing Zero Trust in Continuous Integration and Continuous Deployment pipelines introduces a robust layer of security by assuming that no user or system should be trusted by default. While this model strengthens the security posture, it also brings certain trade-offs in terms of setup complexity and deployment speed. Below is the breakdown of key benefits and challenges.</p><h4>Pros:</h4><ul><li><em>Stops Unauthorized Access</em>: Zero Trust enforces strict identity checks that can prevent unauthorized access.</li><li><em>Removes Static Passwords</em>: By eliminating static passwords, the risk of password-related breaches is significantly reduced.</li><li><em>Ensures Security Compliance</em>: Following Zero Trust principles helps organizations comply with important security regulations.</li><li><em>Detects Threats Early</em>: Continuous monitoring allows organizations to detect threats early, reducing the potential impact.</li></ul><h4>Cons:</h4><ul><li><em>Needs Setup Effort</em>: Implementing Zero Trust requires initial effort and time to set up properly.</li><li><em>Uses Multiple Tools</em>: Organizations may need multiple tools to implement Zero Trust effectively, which can complicate the process.</li><li><em>Can Slow Down Deployments</em>: Certain security checks may hinder deployment speed, posing a challenge for fast-paced development teams.</li></ul><h3>Conclusion</h3><p>In conclusion, Zero Trust is a powerful approach to improving security in CI/CD pipelines. By enforcing strict access controls, checking artifacts, and continuously monitoring for threats, organizations can greatly enhance the security of their software delivery process. While implementing Zero Trust may add some complexity, the long-term benefits of preventing supply chain attacks and ensuring compliance outweigh the initial challenges.</p><h3>References</h3><ul><li><a href="https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect">GitHub OIDC Authentication</a></li><li><a href="https://github.com/sigstore/cosign">Sigstore Cosign</a></li><li><a href="https://www.openpolicyagent.org/">Open Policy Agent (OPA)</a></li><li><a href="https://falco.org/">Falco Runtime Security</a></li><li><a href="https://en.wikipedia.org/wiki/Zero_trust_architecture">Zero Trust Architecture</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f4b055ef3b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FinOps Meets DevOps: Smarter, Cost-Aware Cloud Workflows]]></title>
            <link>https://ravisrajput.medium.com/finops-meets-devops-smarter-cost-aware-cloud-workflows-27969fec8ee0?source=rss-886c91046e61------2</link>
            <guid isPermaLink="false">https://medium.com/p/27969fec8ee0</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[finops]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Ravi Rajput]]></dc:creator>
            <pubDate>Fri, 12 Sep 2025 06:31:20 GMT</pubDate>
            <atom:updated>2025-09-12T06:31:20.510Z</atom:updated>
            <content:encoded><![CDATA[<h4>Control cloud spend while building fast with DevOps</h4><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*obHPBS5h7xwSzk0R.png" /><figcaption>Image from <a href="https://unsplash.com/">Unsplash</a></figcaption></figure><p>Companies use <a href="https://kubernetes.io/">Kubernetes</a> to run their apps on the cloud using Amazon <a href="https://aws.amazon.com/eks/">EKS</a>. Kubernetes helps run and scale apps efficiently. However, the cloud costs can multiply rapidly if you don’t closely watch your billing regularly. Sometimes, teams deploy cloud resources without realizing the cost factor. This leads to wasted money and surprise bills.</p><p>That’s why <a href="https://www.finops.org/introduction/what-is-finops/">FinOps</a> is essential for <a href="https://www.atlassian.com/devops">DevOps</a> teams. When DevOps teams also think about money, their applications work well, stay stable, and don’t waste cash.</p><p>This guide outlines how to build an automated, cost-aware DevOps pipeline for EKS, utilizing advanced tools as:</p><ul><li>Provision EKS clusters with Terraform.</li><li>Monitor costs with Kubecost and Cast AI.</li><li>Automate governance with Cloud Custodian.</li><li>Integrate cost checks with Infracost in CI/CD pipelines.</li></ul><h3>Problem Statement: Managing EKS Costs in DevOps</h3><p>EKS clusters utilize various cloud resources, including worker nodes, storage volumes, and load balancers, and their cost is pay-as-you-go. Unlike a single Elastic Cloud Compute (<a href="https://aws.amazon.com/ec2/?trk=21260d66-fde3-4fe4-893d-2684ccbc5690&amp;sc_channel=ps&amp;ef_id=CjwKCAjwv5zEBhBwEiwAOg2YKNtgPcEtslRgd5D9KHv-rX0C-uisEV81HHeunEQMK2PIOcCbAis2TBoCBxQQAvD_BwE%3AG%3As&amp;s_kwcid=AL%214422%213%21476942909971%21e%21%21g%21%21ec2%2111539707735%21118057053088&amp;gad_campaignid=11539707735&amp;gclid=CjwKCAjwv5zEBhBwEiwAOg2YKNtgPcEtslRgd5D9KHv-rX0C-uisEV81HHeunEQMK2PIOcCbAis2TBoCBxQQAvD_BwE">EC2</a>) server, Kubernetes runs many small workloads that can be moved around. This makes it challenging to figure out exactly what is costing money and who is using it.</p><p>To manage these costs better, you need innovative tools and automation that can:</p><ul><li>Show cost details for each team, app, or namespace.</li><li>Find idle nodes or leftover storage.</li><li>Automatically clean up and send alerts about high costs.</li><li>Add cost checks to your <a href="https://www.redhat.com/en/topics/devops/what-cicd-pipeline">CI/CD pipelines</a> to stop waste before it happens.</li></ul><p>This helps keep cloud bills under control without slowing down your team.</p><h3>Why It Matters</h3><p>DevOps teams work rapidly. They build and change applications many times a day using tools like Kubernetes and CI/CD pipelines. However, this rapid work can cause cloud bills to increase without our notice.</p><h4>What happens when we don’t watch the cloud costs?</h4><p>If we don’t keep watch on our cloud spending, it’s easy to waste money without knowing. Here’s what can happen:</p><ul><li><em>Cloud bills increase quietly:</em> Kubernetes keeps adding more servers and storage as needed. If we don’t keep an eye on things, we might not realize how much money we’re spending until it’s already too late.</li><li><em>No clear owner of costs:</em> Many teams use the same cluster. So, no one knows who is spending money, and everyone thinks someone else is watching.</li><li><em>Wasting money is easy:</em> We might have servers or storage that are unused, yet incur costs.</li><li><em>Bills surprise us:</em> Finance teams see the bill only after spending. Then it is too late to stop.</li></ul><h4>How does cost-aware DevOps help?</h4><p>Cost-aware DevOps means adding money sense into how we build and run apps. It helps teams:</p><ul><li>See how much each application or team costs.</li><li>Teams should only use what they need and shouldn’t spend money on extra cloud resources.</li><li>Get alerts before money is wasted.</li><li>Automation for cost control and waste reduction.</li><li>Share costs fairly between teams.</li></ul><h4>Why is this good for everyone?</h4><p>Keeping an eye on cloud spending helps everyone, not just the finance team. Below are some crucial points to remember:</p><ul><li>Developers incorporate financial considerations into the building process.</li><li>DevOps teams identify and resolve issues at an early stage, before they incur significant cost.</li><li>Managers and leaders can control budgets and optimize spending.</li><li>In short, watching costs helps teams save money and work smarter.</li></ul><p>When everyone is aware of the cost, we make better choices together.</p><h3>Prerequisites</h3><p>Before setting up workflows to save cloud costs, ensure you have these tools ready and understand their capabilities:</p><ul><li>Infrastructure as Code: <a href="https://developer.hashicorp.com/terraform">Terraform</a>.</li><li>Kubernetes tools: <a href="https://github.com/kubecost">Kubecost</a>, <a href="https://kubernetes.io/docs/reference/kubectl/">Kubectl</a>, and <a href="https://helm.sh/">Helm</a>.</li><li>Kubernetes cost optimization: <a href="https://cast.ai/">Cast AI</a>.</li><li>CI/CD platform: <a href="https://github.com/features/actions">GitHub Actions</a>.</li><li>AWS: <a href="https://aws.amazon.com/cli/">AWS CLI</a>.</li><li>Policy as Code: <a href="https://cloudcustodian.io/">Cloud Custodian</a>.</li><li>Cloud cost estimation: <a href="https://www.infracost.io/">Infracost</a>.</li></ul><h3>Checklist to Implement Cost-Aware Workflows in Cloud-Native Pipelines</h3><p>Before building cost-aware workflows in your cloud-native pipelines, it’s essential to establish a solid foundation. Start by making sure you have visibility into your cloud costs using tools like Infracost, Kubecost, or Cloud Custodian. Add automated checks in your CI/CD pipelines to estimate costs before changes go live. Tag all cloud resources consistently to track ownership and usage. Monitor spending by utilizing budget alerts and reporting dashboards. Prioritize using spot instances, shut down unused environments, and clean up idle resources. By putting these checks early, your team can move fast while keeping costs under control. Here are the steps to implement cost-aware workflows in your cloud-native pipelines.</p><h4>Provision an EKS cluster using Terraform</h4><p>AWS EKS lets you use Kubernetes on AWS without needing to build all the infrastructure by yourself. In this step, we will set up an EKS cluster using Terraform, a tool that lets us create cloud resources using code.</p><p>We will use Terraform modules that are already made to help us set up the EKS cluster easily. You can fork or clone the <a href="https://github.com/ravisinghrajput95/eks-terraform">GitHub project</a> to get these Terraform files. After you fork the repository, open your terminal and run the command below from the repository’s root directory to get started:</p><pre>cd eks-terraform<br>terraform init</pre><p>The command above is the first command you run to begin working with Terraform. It prepares your folder, downloads the necessary tools, sets up storage for your settings, and downloads the modules it will use.</p><p>After running this, you’ll see a message that says Terraform is ready:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*V61R28I7VpqnhPmN.png" /><figcaption>Terraform initialized and fulfilled all the prerequisites.</figcaption></figure><p>Once Terraform has been initialized, as a user, we should observe what cloud resources it will provision. Below is the command that will show a blueprint of what it will do on our AWS account:</p><pre>terraform plan</pre><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*HIp1JdEnSV8iFNuX.png" /><figcaption>Terraform plan output showing resources to provision.</figcaption></figure><p>After Terraform is set up, you can create your EKS cluster by running the command below:</p><pre>terraform apply</pre><p>This command will tell you what Terraform plans to do. Next, Terraform will ask you to confirm. To proceed with resource creation, simply type “yes”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*ug0kuqmd7ViAtmas.png" /><figcaption>Terraform prompts to approve the changes.</figcaption></figure><p>After you allow Terraform to proceed, it will go ahead and provision the resources on the AWS cloud:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*3RwbI03NBseVfFpM.png" /><figcaption>Infrastructure provisioning completed by Terraform.</figcaption></figure><p>After it finishes, you can go to the AWS Console and validate that the resources, like the EKS cluster, VPC, and others, were created.</p><p>Check the EKS clusters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*7Z6eZnDSUWwq_h5G.png" /><figcaption>AWS EKS cluster provisioned by Terraform.</figcaption></figure><p>And the VPCs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*HvdFhrX-ulzLIRe3.png" /><figcaption>AWS VPC provisioned by Terraform.</figcaption></figure><p>Now that your cluster is ready, you can connect to it using this command:</p><pre>aws eks --region us-east-1 update-kubeconfig --name finops-demo-cluster</pre><p>Here’s an example of what shows up after you connect to the cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*ZWh7BJCUSA6XLRs7.png" /><figcaption>Authentication to the AWS EKS cluster</figcaption></figure><h4>Install Kubecost in the EKS cluster</h4><p>When you use Kubernetes on AWS with EKS, it can be challenging to track precisely where your cloud money is going. That’s where Kubecost helps.</p><p>Kubecost provides capabilities for monitoring and allocating Kubernetes costs. It tells you exactly how much you’re spending on each team, <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/">namespace</a>, <a href="https://kubernetes.io/docs/concepts/workloads/pods/">pod</a>, or <a href="https://kubernetes.io/docs/concepts/services-networking/service/">service</a> in near real-time. Teams can manage their cloud expenditures and reduce wasteful spending with this approach.</p><p>We will now install Kubecost in the EKS cluster to track and understand Kubernetes costs. We’ll use Helm to do the installation, and to install it, use the command below:</p><pre>export KUBECOST_VERSION=&quot;2.8.0&quot;<br>helm upgrade -i kubecost \<br>oci://public.ecr.aws/kubecost/cost-analyzer --version=&quot;$KUBECOST_VERSION&quot; \<br>--namespace kubecost --create-namespace \<br>-f <a href="https://raw.githubusercontent.com/kubecost/cost-analyzer-helm-chart/develop/cost-analyzer/values-eks-cost-monitoring.yaml">https://raw.githubusercontent.com/kubecost/cost-analyzer-helm-chart/develop/cost-analyzer/values-eks-cost-monitoring.yaml</a> \<br>--set prometheus.configmapReload.prometheus.enabled=&quot;false&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*pRZ_4nAqiE9lDAHY.png" /><figcaption>Kubecost is deployed in an AWS EKS cluster</figcaption></figure><p>You can change the version if needed. All versions are listed on the <a href="https://gallery.ecr.aws/kubecost/cost-analyzer">AWS ECR public Gallery</a>. Kubecost will be ready in a few minutes. You can check if it’s working by running the command below:</p><pre>kubectl get pods -n kubecost</pre><p>All pods and services in the Kubescost namespace are shown in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*su3wUYJopcroiPlk.png" /><figcaption>Pods and Services in the Kubecost namespace</figcaption></figure><h4>Generate the Kubecost dashboard endpoint</h4><p>Depending on your company’s operation and system configurations, there are different ways to access the Kubecost dashboard. If you want to access it quickly (for internal use or testing), you can change its service type to LoadBalancer. This makes it easier to access from outside the cluster without a complex setup:</p><pre>kubectl patch svc kubecost-cost-analyzer \<br>  -n kubecost \<br>  -p &#39;{&quot;spec&quot;: {&quot;type&quot;: &quot;LoadBalancer&quot;}}&#39;</pre><p>After a few seconds, AWS will create a load balancer to help you access Kubecost.</p><p>To find the endpoint, run the command below and copy the External IP from the kubecost-cost-analyzer service:</p><pre>kubectl get svc -n kubecost</pre><p>Once you run the previous command, it will display all the running services in the Kubecost namespace. Will focus on the kubecost-cost-analyzer service, which can be accessed by an external address:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*HAJf55XSr-jvYbz6.png" /><figcaption>Kubecost-cost-analyzer service is patched as a Load Balancer.</figcaption></figure><p>If you’re planning to use Kubecost in a real-world, production environment, exposing the dashboard securely is important. Instead of opening a random port or exposing a service directly to the internet, the best way is to set up the <a href="https://kubecost.awsworkshop.io/4_deploy_kubecost/42_loadbalancer.html">AWS Load Balancer controller</a>.</p><h4>Access the cost monitoring dashboard</h4><p>In your web browser, navigate to the endpoint generated from the previous step to access the dashboard:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*8eKfbiM-ZYS1pa83e_5thQ.png" /><figcaption>Kubecost overview page</figcaption></figure><p>Kubecost provides visibility into the costs and utilization of your Amazon EKS cluster. It shows you how much your cluster is costing, where the money is going, and if there is any waste.</p><p>Here is a sample view of the Kubecost dashboard that displays your cluster’s cost and usage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*UhMZkkerN31OzDsLnr7Myw.png" /><figcaption>Kubecost shows the Cluster’s cost and usage</figcaption></figure><p>The image below shows the cost usage based on the namespaces:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*OXeLODJxGHGQHzw-Wade8g.png" /><figcaption>Kubecost is showing costs based on Namespaces</figcaption></figure><p>You can also see the cluster right-sizing recommendations from Kubecost, as shown in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*QQy1AUJlyejXba2M9ZpfwQ.png" /><figcaption>Cluster Right-Sizing Recommendations by Kubecost</figcaption></figure><h4>Kubernetes cost optimization and automation</h4><p>While Kubecost helps you observe Kubernetes costs, Cast AI goes further, automating cost savings with real-time decisions and actions in your Kubernetes clusters.</p><p><a href="https://login.cast.ai/login?state=hKFo2SAyZUQ5UzdGQ1FyMmp3UllCQkNVSy01WWJuRUZlaFVfc6FupWxvZ2luo3RpZNkgMVV6RFpqWWlzbktKYm9nMHlfTVVpX0twR2RjWTFscEOjY2lk2SBDM3dKT2FCdmRJR0ljU3BkSGhMZWlONnNJVkExaURoSw&amp;client=C3wJOaBvdIGIcSpdHhLeiN6sIVA1iDhK&amp;protocol=oauth2&amp;redirect_uri=https%3A%2F%2Fconsole.cast.ai%2Fapi%2Fauth&amp;response_type=code&amp;scope=openid%20profile%20email&amp;screen_hint=SIGNUP">Cast AI</a> helps optimize Kubernetes costs by providing various cost-saving functionalities as mentioned below:</p><ul><li>Continuously rightsizes and scales your cluster nodes.</li><li>Automatically chooses the most cost-efficient instance types.</li><li>Helps reduce cloud bills without needing manual intervention.</li></ul><p>Imagine it as your own automatic FinOps system for Kubernetes.</p><h4>Connecting a Kubernetes cluster with Cast AI</h4><p>To connect your Kubernetes cluster with Cast AI, follow the steps below:</p><p>First, sign up at Cast AI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*QeTdF7rdPLfSIR1el-xWKQ.png" /><figcaption>Creating an account for Cast AI</figcaption></figure><p>Then, install the <a href="https://cast.ai/blog/how-does-the-read-only-cast-ai-agent-work-and-what-data-can-it-read/">Cast AI agent</a> in your cluster. You can get the required command from the Cast AI:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*-KOJ9WWOxABcnwEWKD5LKg.png" /><figcaption>Installation of the Cast AI agent</figcaption></figure><p>Copy the script and run it on your EKS cluster. Here is an example output once the script is successfully executed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*XcS6vq4MtreKeAHRwPNcOw.png" /><figcaption>Kubernetes objects created after script execution</figcaption></figure><p>You can also check the Cast AI dashboard to see the clusters that have been added:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*dqU82fpJF7Y-UPilQTOYAg.png" /><figcaption>EKS cluster onboarded in Cast AI</figcaption></figure><p>Now, we will enable cost monitoring in the EKS cluster. To achieve this, click on the cluster name and then click on <em>Enable Cast AI</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*WBCbtHALQC7R3eNRAd9zyA.png" /><figcaption>Enabling Cast AI for cost monitoring purposes</figcaption></figure><p>You will now see a screen to enable cost monitoring for the EKS cluster:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*QVJp3zVwvvi6va-RxiqhCg.png" /><figcaption>Enabling cost monitoring</figcaption></figure><p>To enable the cost monitoring feature, execute the script as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*Jh4jsAzTRP_jp8ZTS7rRDA.png" /><figcaption>Example script to enable cost monitoring in the EKS cluster</figcaption></figure><p>Here is the example output after successful execution of the script:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*wON5uT-svXuggTiRoBzu9Q.png" /><figcaption>Example output after all required components are installed</figcaption></figure><p>This will install the following components:</p><ul><li><a href="https://github.com/castai/cluster-controller">castai-cluster-controller: </a>manages the overall cluster connection with Cast AI<a href="https://github.com/castai/cluster-controller">.</a></li><li><a href="https://github.com/castai/spot-handler">castai-spot-handler</a>: helps use cheaper spot instances safely.</li><li><a href="https://cast.ai/blog/automate-kubernetes-bin-packing-for-cost-savings-and-efficiency-gains/">castai-evictor</a>: moves or stops pods when resources need cleanup.</li><li><a href="https://cast.ai/blog/automated-workload-rightsizing-precisionpack/">castai-pod-pinner</a>: keeps important pods on the right nodes.</li><li><a href="https://github.com/castai/kvisor">castai-kvisor</a>: provides security and performance monitoring.</li></ul><p>Now, the Cast AI feature for cost monitoring will be enabled, and data collection will begin:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*2N8iduVnGB_pkhHB7ccl-Q.png" /><figcaption>The Cast AI feature is getting enabled</figcaption></figure><p>Once the cost monitoring feature is enabled, you can see the cost details for compute, including CPU, memory, and storage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*mTHC_DiEMPLv1OATJsXvjA.png" /><figcaption>Compute the cost in the EKS cluster</figcaption></figure><p>The following is an example screenshot showing how to check the cluster efficiency:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*5DMzVOWOTiqk1XINVsXi-w.png" /><figcaption>EKS cluster efficiency for compute resources</figcaption></figure><p>You can also enable workload rightsizing, utilize spot instances, and employ cluster scheduling:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*yfWUxeS2JCF-Wymf01BkTw.png" /><figcaption>Workload optimization and Configuration preferences</figcaption></figure><p>If you are looking to compare the cost over time, then Cast AI provides this feature:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*uHmf6BAHG8tLFEG3MThMjg.png" /><figcaption>Cost Comparison over time</figcaption></figure><h3>Automate the cloud governance with Cloud Custodian</h3><p>In most cloud setups, unused or misconfigured resources can result in significant waste. This is where Cloud Custodian comes in. It’s an open-source tool that acts like a rulebook and watchdog for your cloud. You define rules (policies), and it takes care of enforcement automatically.</p><h4>What Cloud Custodian Does?</h4><p>Cloud Custodian helps teams manage their cloud by following smart rules and taking actions. Here’s how it helps:</p><ul><li>Find and stop idle EC2 instances.</li><li>Enforce tagging (e.g., every resource must have a cost center).</li><li>Delete public Simple Storage Service (<a href="https://aws.amazon.com/s3/">S3</a>) buckets.</li><li>Notify you about policy violations.</li><li>Schedule actions like resource cleanup.</li></ul><p>To install Cloud Custodian, execute the command below:</p><pre>pip install c7n</pre><p>Here is a policy that targets EC2 instances currently running but with low<strong> </strong>CPU usage (below 5%) for 3 days, and automatically stops them:</p><pre>policies:<br>  - name: stop-unused-ec2<br>    resource: ec2<br>    description: |<br>      Stop EC2 instances that are running and have had CPUUtilization &lt; 5%<br>      for the past 3 days<br>    filters:<br>      - &quot;State.Name&quot;: &quot;running&quot;<br>      - type: metrics<br>        name: CPUUtilization<br>        days: 3<br>        period: 86400<br>        value: 5<br>        op: less-than<br>    actions:<br>      - stop</pre><p>Save the policy in a file, e.g., stop-unused-ec2.yml.</p><p>Here, we have an EC2 instance up and running. We will enforce the policy in this instance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*id-0IvDSpbBneWtEdRZ6Dw.png" /><figcaption>An Idle EC2 instance in the running state</figcaption></figure><p>Run the policy by using the command below:</p><pre>custodian run -s output stop-unused-ec2.yml</pre><p>Here is an example output once the policy is run successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*fVhYGqGi6ZpbWwzafMr79w.png" /><figcaption>Cloud Custodian policy runs successfully</figcaption></figure><p>You can see the idle EC2 instance has stopped in the AWS console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*tHeIKKPkIhv_QY5LaJmpNw.png" /><figcaption>An Idle EC2 instance got stopped</figcaption></figure><h3>Integrate cost checks in your CI/CD pipelines</h3><p>When engineers build cloud projects, they often write Terraform code to create servers, storage, and databases. Before running the code, it’s difficult to know the cost. This is where Infracost is helpful. Infracost is a tool that shows the price of your cloud resources before you create them. It reads your Terraform code and gives you a breakdown of:</p><ul><li>How much will each item cost every month?</li><li>What will change in cost if you update the code?</li><li>The total monthly cost of your plan.</li></ul><p>Think of it like a cloud bill preview before you spend money.</p><p>Where can you use Infracost?</p><p>You can run Infracost:</p><ul><li>On your local laptop before deploying.</li><li>In GitHub pull requests, check the cost changes.</li><li>Inside CI/CD pipelines to block costly changes.</li><li>Along with other FinOps tools used for creating reports and dashboards.</li></ul><p>Add this <a href="https://github.com/ravisinghrajput95/eks-terraform/blob/main/.github/workflows/infracost.yml">configuration</a> to your current GitHub Actions workflow, or create a new file named .github/workflows/infracost.yaml.</p><p>This is the result when a GitHub Action runs on the main branch of the repository:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*qP3JqzN1oFzMxFxyu_Wwgg.png" /><figcaption>Perform a cost check with Infracost on the default branch</figcaption></figure><p>You can check the Infracost Dashboard to see all the cost problems that come from the FinOps policies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*yrgSK4XZ0Qloimir_pebEw.png" /><figcaption>FinOps posture check for cost after changes on the default branch</figcaption></figure><p>You can make a new branch for a feature from the main branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*vlx-ur24sZShuCzc4t1laQ.png" /><figcaption>Created a feature branch called Infracost</figcaption></figure><p>Now you can remediate cost issues as per the FinOps policies provided by Infracost. Here is an example of a FinOps policy that suggests deleting incomplete multi-part uploads for the AWS S3 bucket. Based on this policy, you can apply the suggested fix:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*ZHpXXCqgBMF5FIe9GZmLAw.png" /><figcaption>Issues detected as per the FinOps Policy</figcaption></figure><p>For more details, you can see the policy description and its suggested fix:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*zXPi15LKf-SMmVTxhS5vYg.png" /><figcaption>FinOps policy and the suggested fix</figcaption></figure><p>On your feature branch, add a rule that specifies to abort the incomplete multi-part upload configuration. Here is an example snippet that you can add to the existing S3 module:</p><pre>{<br>    id  = &quot;upload&quot;<br>    enabled  = true<br>    abort_incomplete_multipart_upload_days = 7<br>}</pre><p>Create a <a href="https://github.com/ravisinghrajput95/eks-terraform/pull/8">Pull Request</a> to merge the latest changes to the default branch. Infracost will check the cost associated with this infrastructure change. Here’s an example of what GitHub Actions looks like after you create a pull request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*PcZRIJ7HymYpKhovpQNGZg.png" /><figcaption>Generating a Cost Diff with Infracost</figcaption></figure><p>After the pull request is merged, Infracost will automatically update its dashboard with the new cost changes. Here’s an example of what it looks like when the GitHub Action runs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*uobMSApzpvleFJyc3axTmQ.png" /><figcaption>Updating PR status in the Infracost portal</figcaption></figure><p>You can also see that the pull request is updated in the Infracost portal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*9met8Ec30x_7uz2fz3RBbQ.png" /><figcaption>Validating the Pull request update in the Infracost portal</figcaption></figure><p>Now go to the Infracost dashboard to check the latest update:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*y4X0g98t3Y-RCmQyO1Hu-w.png" /><figcaption>FinOps approach on the main branch after applying the recommended fix</figcaption></figure><p>There, you can see more details about issues that were fixed or stopped, based on the FinOps policy for object storage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*I_WDEkd20yK-gmOdPbbZrg.png" /><figcaption>Tracking Fixed and Prevented Cost Issues</figcaption></figure><h3>Best Practices for Cost-Aware DevOps</h3><p>Cloud is fast and easy to use. But if we don’t manage it well, it can become very costly. DevOps teams should save money while building and running apps. Here are some simple things you can do:</p><ul><li>Use <a href="https://aws.amazon.com/ec2/spot/?cards.sort-by=item.additionalFields.startDateTime&amp;cards.sort-order=asc&amp;trk=05a37234-d869-4022-962d-3d41700b2b52&amp;sc_channel=ps&amp;ef_id=Cj0KCQjws4fEBhD-ARIsACC3d29u8G-KTi1LB1yTL6-DGAeV2Pq91ZvXuTA7WbfyeFIh3IcEaX-WzrAaAlQlEALw_wcB:G:s&amp;s_kwcid=AL!4422!3!517651795636!e!!g!!spot%20instance!12876354690!124026471280&amp;gad_campaignid=12876354690&amp;gbraid=0AAAAADjHtp-f2u_zW44t4-jQIgcFQmUaX&amp;gclid=Cj0KCQjws4fEBhD-ARIsACC3d29u8G-KTi1LB1yTL6-DGAeV2Pq91ZvXuTA7WbfyeFIh3IcEaX-WzrAaAlQlEALw_wcB">Spot instances</a> for tasks that aren’t urgent or critical.</li><li>Turn off servers at night or when not in use.</li><li>Add labels to Kubernetes objects to track which team is using what.</li><li>Check cost reports from Kubecost every week.</li><li>Set <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-create.html">Budget</a> <a href="https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-sns-policy.html">alerts</a> in AWS to warn you when spending is high.</li><li>Delete unused stuff like storage, IPs, or load balancers.</li><li>Check cloud cost in your CI/CD pipelines before changes go live.</li><li>Leverage Cloud Custodian to follow rules and stop waste.</li></ul><h3>Conclusion</h3><p>In this article, we explored how FinOps and DevOps can work together to build more intelligent, cost-aware cloud workflows. We focused on Amazon EKS because many teams use Kubernetes for running their applications, but often overlook how quickly costs can grow if resources are not managed appropriately.</p><p>We began by demonstrating how to create an EKS cluster using Terraform, making the setup easy to repeat and manage through code. Then we learned how to install Kubecost to track where the money is going inside the cluster, down to each namespace, team, or workload. This automation helps clean up unused resources, such as idle nodes or outdated storage, without requiring manual intervention on a daily basis.</p><p>We also added Cast AI, which takes optimization to the next level by automatically adjusting cluster size, using the right instance types, and helping you save without manual effort.</p><p>We also introduced Cloud Custodian, which acts like a guard that enforces rules, stops waste, and sends alerts when something doesn’t follow the cost policies.</p><p>For teams that want to plan, we covered Infracost, which tells you the price of your infrastructure changes before you deploy them. This helps avoid mistakes and keeps spending under control. By combining these tools, you can build a complete cost-aware DevOps workflow. This approach helps you:</p><ul><li>See where your cloud money is going.</li><li>Stop waste before it happens.</li><li>Automate cleanups and alerts.</li><li>Plan costs before deploying.</li><li>And keep your Kubernetes clusters fast, reliable, and affordable.</li></ul><h3>References</h3><ul><li><a href="https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/governance.html">Cost Governance</a></li><li><a href="https://spot.io/resources/finops/ultimate-guide-to-finops-principles-phases-and-technology/">FinOps Principles</a></li><li><a href="https://www.finops.org/framework/previous-capabilities/workload-management-automation/">FinOps Foundation</a></li><li><a href="https://www.nops.io/blog/finops-vs-devops/">FinOps vs DevOps</a></li><li><a href="https://learn.finops.org/">FinOps certifications and training</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27969fec8ee0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to generate dynamic credentials for AWS RDS instance using HashiCorp Vault]]></title>
            <link>https://ravisrajput.medium.com/how-to-generate-dynamic-credentials-for-aws-rds-instance-using-hashicorp-vault-7be0d76b7fdc?source=rss-886c91046e61------2</link>
            <guid isPermaLink="false">https://medium.com/p/7be0d76b7fdc</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[hashicorp-vault]]></category>
            <dc:creator><![CDATA[Ravi Rajput]]></dc:creator>
            <pubDate>Wed, 25 Jan 2023 17:41:04 GMT</pubDate>
            <atom:updated>2023-01-25T17:45:31.502Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qpI8BzCIcmb9EKaKNiFJow.png" /></figure><p><strong><em>What is HashiCorp Vault?</em></strong></p><ol><li>It’s a Cloud agnostic secrets management system.</li><li>Used to generate Dynamic or short lived credentials, or encrypt application data on fly.</li><li>Manage secrets and protects sensitive data.</li><li>Provides single source of secrets for both Human and Machines.</li><li>Lifecycle management of the Secrets.</li><li>Governance for access to Secrets, Tokens, Passwords, Certificates and Encryption keys.</li></ol><p><strong><em>Pre-Requisites:-</em></strong></p><ol><li>Provision a AWS RDS MySQL instance.</li><li>Installation and Configuration of HashiCorp Vault.</li></ol><p>Once the Pre-Requisites are completed, dynamic credentials can be generated by the following steps.</p><p><strong><em>Step-1:-</em></strong> Create a Secrets engine of type database</p><pre>vault secrets enable -path=database database</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jhezTD6Y-tL4Cc82jzQMeQ.png" /></figure><p><strong><em>Step-2:-</em></strong> Validate the created secrets engine</p><pre> vault secrets list</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d8-F6gju-2Uiu2FOf9lrDQ.jpeg" /></figure><p><strong><em>Step-3:-</em></strong> Configure secrets engine with RDS instance connection url, master username and password</p><pre>vault write database/config/mysql-database \<br>   plugin_name=mysql-rds-database-plugin \<br>   connection_url=&quot;{{username}}:{{password}}@tcp(rds-endpoint:3306)/&quot; \<br>   allowed_roles=&quot;advanced&quot; \<br>   username=&quot;username&quot; \<br>   password=&quot;password&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BDTnhJLj3GxYvN4nhwiC9Q.png" /></figure><p><strong><em>Step-4:-</em></strong> Create a role named as “advanced”, using this role we will be retrieving credentials, this role we have already mapped in Step-3.</p><pre>vault write database/roles/advanced \<br>   db_name=mysql-database \<br>   creation_statements=&quot;CREATE USER &#39;{{name}}&#39;@&#39;%&#39; IDENTIFIED BY &#39;{{password}}&#39;;GRANT SELECT ON *.* TO &#39;{{name}}&#39;@&#39;%&#39;;&quot; \<br>   default_ttl=&quot;1h&quot; \<br>   max_ttl=&quot;24h&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LOK2CC3CS9TnE1joBKRKtg.png" /></figure><p><strong><em>Step-5:-</em></strong> Retrieve credentials</p><pre>vault read database/creds/advanced</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yjAP0Zot9qcb1f0uc85TMA.png" /></figure><p><strong><em>Step-6:-</em></strong> Now we have the username and password, lets test the login to RDS instance.</p><pre>mysql -h &lt;enter your RDS instance endpoint here&gt; -P 3306 -u v-adva-YQ8GTpb9V -p</pre><p>Provide the dynamically generated password when prompted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q3miVWllcDj8tb8Lkv8jYg.png" /></figure><p><strong><em>Advantages of using Dynamic credentials:-</em></strong></p><ol><li>Short lived.</li><li>Follows principle of least privilege.</li><li>Automatically revoked.</li><li>Each system can retrieve unique creds.</li><li>Programmatically retrieved.</li><li>Valid for time as required.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7be0d76b7fdc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Four Golden signals to measure System’s performance]]></title>
            <link>https://ravisrajput.medium.com/four-golden-signals-to-measure-systems-performance-2b4a01bdf4aa?source=rss-886c91046e61------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b4a01bdf4aa</guid>
            <category><![CDATA[reliability]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[system]]></category>
            <dc:creator><![CDATA[Ravi Rajput]]></dc:creator>
            <pubDate>Sun, 22 Jan 2023 17:42:42 GMT</pubDate>
            <atom:updated>2023-01-22T17:42:42.184Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*l_HbwDH4mIxB3wnpwtaNQw.png" /></figure><p><strong>Performance management</strong> is necessary to optimize utilization of your computer system by measuring <strong>current capabilities</strong>, <strong>recognizing trends</strong>, and making appropriate adjustments to satisfy end user and management requirements such as<strong> response time</strong> or <strong>job throughput</strong>. It is needed to maintain business efficiency and avoid prolonged suspension of normal business activities. Therefore, managing performance is part of your daily operations.</p><p>4 Golden signals that measures System’s performance and reliability:-</p><ol><li><strong>Latency: </strong>It directly affects user experience, Its values may be tied to capacity demands.</li></ol><p><strong>How to measure Latency?</strong></p><p><em>Page Load latency, No. of requests waiting for a thread, query duration, Service response time, Transaction duration, Time to first duration, Time to first response.</em></p><p>2. <strong>Traffic:</strong> Its an indicator of current system in demand, historical trends can be used for Capacity planning, Its a core measure for calculating Infrastructure spend.</p><p><strong>How to measure Traffic?</strong></p><p><em>HTTP requests per second, requests for static vs dynamic contents, Network I/O, concurrent sessions, No. of retrievals per second, No. of active requests per second, No. of write operations, No. of read operations, No. of active connections.</em></p><p>3. <strong>Saturation:</strong> Its an indicator of how full the service is. It focusses on the most constrained resources, frequently tied to degrading performance as capacity is reached.</p><p><strong>How to measure Saturation?</strong></p><p><em>% memory utilization, % thread pool utilization, % cache utilization, % disk utilization, % CPU utilization, Disk quota, Memory quota, No. of available connections, No. of users on the system.</em></p><p>4. <strong>Errors:</strong> It indicates that something is failing, they may indicate configuration or capacity issues, SLO violations. an error might mean its time to send out an alert.</p><p><strong>How to measure Error?</strong></p><p><em>No. of 400/500 status codes, No. of failed requests, No. of exceptions, No. of stack traces, No. of dropped connections, Servers that fails liveness checks.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b4a01bdf4aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>