<?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 Boopaathy on Medium]]></title>
        <description><![CDATA[Stories by Boopaathy on Medium]]></description>
        <link>https://medium.com/@boopaathy?source=rss-4b002f2d7dfb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*kLg8_ZqU9upuR4sw.jpg</url>
            <title>Stories by Boopaathy on Medium</title>
            <link>https://medium.com/@boopaathy?source=rss-4b002f2d7dfb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 01:10:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@boopaathy/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[The Evolution of the Build — How AI is Dragging DevSecOps Out of the Dark Age]]></title>
            <link>https://medium.com/@boopaathy/the-evolution-of-the-build-how-ai-is-dragging-devsecops-out-of-the-dark-age-de78ddc0c4f3?source=rss-4b002f2d7dfb------2</link>
            <guid isPermaLink="false">https://medium.com/p/de78ddc0c4f3</guid>
            <category><![CDATA[devsecops]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ai-agents-in-action]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Boopaathy]]></dc:creator>
            <pubDate>Sat, 11 Apr 2026 23:17:15 GMT</pubDate>
            <atom:updated>2026-04-11T23:17:15.631Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oLWx6Uql9AsZqNAlqc5V1Q.png" /><figcaption>DevSecOps with AI</figcaption></figure><p>Imagine a typical scenario for modern developers: it’s late Friday afternoon, the new feature is complete, all tests pass locally, and the main branch receives the final push, promising a smooth build and the possibility of an early end to the week. This scene highlights the tension at the heart of contemporary DevSecOps and frames the following analysis.</p><p>Three minutes later, the CI bot starts speaking in the Slack channel.</p><p>Build failed: <strong>42 Major Vulnerabilities Found.</strong></p><p>You aren’t shipping today. Instead, you are going to spend the next four hours deciphering an auto-generated PDF full of Common Vulnerabilities and Exposures (CVEs) for packages you didn’t even know you were using. You’ll trace a vulnerable transitive dependency three layers deep, looking at an npm or pip tree, wondering if forcing an upgrade will quietly break the application in production.</p><p>This is the reality of the pipeline we built. We called it “DevSecOps.”</p><p>And it was a trap.</p><h3>The Reality of “Shift Left”</h3><p>For the last five years, the prevailing advice in software engineering was to “shift left.” The industry agreed that finding security issues during a production audit was too late. So, we bought Static Application Security Testing (SAST) tools. We bought dependency scanners. We wired them directly into our Continuous Integration pipelines.</p><blockquote>But we didn’t actually shift security left. We just shifted the blame.</blockquote><p>We turned our build pipelines into DoS attacks against our own engineering teams. By bolting security scanners onto the CI process without changing how those tools behaved, we weaponized visibility. A scanner finding 500 possible issues doesn’t make an application secure; it just makes the developers angry. Finding vulnerabilities was never the actual problem. The bottleneck has always been fixing them.</p><h3>The Friction Between Security and Development</h3><p>When a pipeline operates this way, something subtle breaks inside the engineering culture.</p><p>Security teams are fundamentally incentivized to find and reduce risk. Developers are incentivized to write and ship code. When a scanner drops 500 alerts into the Jira backlog, it pits these two groups against each other.</p><p>Alert fatigue sets in quickly. When everything is an emergency, nothing is. “Critical” no longer means the server is actively compromised. Instead, it becomes a filter that developers mentally tune out. They learn which warnings they can safely ignore, which ones they can negotiate with the security team to accept, and which ones will actually prevent them from merging their code.</p><p>Rather than enabling shipping, the pipeline turns into an obstacle course, reducing security to a tax at sprint’s end.</p><h3>Moving from Alerts to Pull Requests</h3><p>Look at what happens when the paradigm shifts from generating information to taking action.</p><p>What if the output of a security scanner is not a Jira ticket, a PDF report, or a broken build?</p><p>What if the output is a Pull Request?</p><p>While AI is rapidly advancing DevSecOps, key limitations remain and must be acknowledged. AI often struggles with complex or poorly documented codebases, increasing the likelihood of false positives or unsuitable remediation suggestions. It may also lack the domain expertise needed to address proprietary or unconventional systems. For example, there have been cases where AI-powered remediation tools automatically upgraded a dependency but failed to detect critical breaking changes, resulting in subtle runtime failures that were only discovered post-deployment.</p><p>In one incident, an AI tool suggested refactoring legacy authentication logic but introduced a logic error that inadvertently disabled multi-factor authentication, exposing the application to increased risk until it was caught during review. These incidents are reminders that while AI tools improve upon static detection methods and help reduce remediation bottlenecks, they still require careful oversight and human validation. Unlike traditional scanners, AI agents can analyze code context, suggest upgrade paths, and provide ready-to-merge fixes, but their outputs should be reviewed to ensure accuracy and safety.</p><p>For teams considering the move to AI-native pipelines, implementing these new technologies can feel daunting. To reduce uncertainty and help managers visualize a practical path forward, here is a step-by-step plan for piloting and rolling out AI-powered remediation, tailored for modern DevSecOps environments.</p><ol><li><strong>Assess your current pipelines</strong>: Identify critical workflows, pain points, and common sources of security friction in your existing CI/CD process.</li><li><strong>Select a limited pilot project</strong>: Choose a non-critical service or repository with good test coverage and representative code patterns. This will serve as a safe environment for experimentation.</li><li><strong>Evaluate and integrate AI remediation tools</strong>: Research available solutions (such as Snyk, Mend, or GitHub Copilot), and integrate one into your chosen pilot project. Ensure compatibility with your existing DevSecOps stack. Address these hurdles by working closely with stakeholders, reviewing documentation for compatibility issues, and starting integration in a controlled environment to limit the blast radius of any failures.</li><li><strong>Establish guardrails and oversight</strong>: Require human review of all AI-generated pull requests, and enforce automated and manual testing before merging any changes.</li><li><strong>Track results</strong>: Monitor key metrics such as time to remediation, developer workload, and reduction in alert fatigue. Solicit feedback from both security and development stakeholders throughout the pilot.</li><li><strong>Iterate and expand</strong>: Refine your workflows based on lessons learned, and gradually extend AI remediation capabilities to additional repositories and teams, scaling up with confidence.</li></ol><p>To confidently adopt AI-driven remediation while managing risk, teams should establish oversight best practices. Practitioners benefit from having a clear, actionable checklist for oversight, both to increase accountability and minimize the chances for mistakes. Here is a concise sequence to guide teams through effective oversight of AI-generated remediation:</p><ol><li>Assign designated human reviewers for all AI-generated pull requests. Ensure that each relevant pull request is reviewed by both a developer familiar with the codebase and a security engineer.</li><li>Set up automated test gates in the CI pipeline, requiring that all unit tests, integration tests, and security checks pass before merging.</li><li>Require manual exploratory testing, focusing on high-risk areas impacted by the change.</li><li>Provide clear documentation for every AI-driven change, including a summary of the vulnerability and details of the automated remediation.</li><li>Maintain detailed version control and create easy rollback points to quickly revert changes if unexpected issues arise in production.</li><li>Establish a feedback loop between reviewers and the AI tool, so that improvements and false positive reports can be incorporated over time.</li></ol><p>By creating this structured oversight process and fostering ongoing communication between developers and security engineers, organizations can strengthen trust in automated tools, ensure accuracy, and maintain security without introducing new risk.</p><p>With this transition, the developer’s job changes: when the pipeline fails, the role shifts from investigator reconstructing a crime scene to editor.</p><h3>How an AI-Native Pipeline Functions</h3><p>The mechanics of this era are fundamentally different from those of the past. Here is what an AI-native DevSecOps pipeline actually looks like in practice. Leading tools such as GitHub Copilot, Snyk, and Mend are already integrating AI-powered remediation into security workflows, offering automated code suggestions, vulnerability identification, and even generating ready-to-merge pull requests. By looking at these examples, we can see how theory is becoming reality across modern development environments:</p><ol><li><strong>The Intercept</strong>. A vulnerability is detected in the repository, perhaps an outdated package that was just flagged in a new CVE disclosure.</li><li><strong>The Analysis</strong>. An AI agent intercepts the alert before it ever reaches a developer’s screen. Crucially, the AI understands the broader architecture of a blue field application codebase. If your system runs on a microservice architecture spread across a polyrepo, the AI analyzes the dependency tree across repositories to map out exactly where the package is used and how the services interact.</li><li><strong>The Fix</strong>. The agent forks a branch and writes the necessary code to upgrade the package or refactor the vulnerable function.</li><li><strong>The Verification</strong>. The CI pipeline runs on the AI’s proposed branch. All unit tests and integration tests are executed to ensure the fix doesn’t break existing functionality throughout the microservices.</li><li><strong>The Handoff</strong>. A Pull Request arrives. It contains the code changes, a plain-English explanation of the vulnerability, and the proof that the tests still pass.</li><li><strong>The Review</strong>. The developer reads the diff, verifies the logic, and clicks merge.</li></ol><p>Security moves from a roadblock you hit at 100mph to a pair programmer sitting quietly next to you, handing you the code before you even realize there was a problem.</p><h3>Aligning Development and Security</h3><p>AI remediation does more than patch outdated syntax. It repairs the cultural damage inflicted by years of poorly integrated tools.</p><p>When CI/CD pipelines bring fixes instead of problems, the friction among Security and Development evaporates. Security teams get the risk reduction they need. Developers get to stay in their flow state and write features.</p><p>However, realizing this vision takes more than simply adopting new tooling. Shifting culture demands strong leadership support and clear communication between all stakeholders. Teams may encounter resistance as habits and expectations change, so it is essential for managers to prepare for real-world challenges and ensure ongoing alignment as these new practices take root.</p><p>To foster buy-in and ease the transition, leaders can take practical steps to manage resistance. For example, holding regular retrospectives focused on DevSecOps practices provides both developers and security professionals with a structured opportunity to surface concerns and share feedback on the new workflows.</p><p>Cross-team workshops or pilot project showcases can further build trust by allowing stakeholders to see early successes, learn from peers, and collaboratively shape process improvements. By actively involving teams in the rollout and maintaining open lines of communication, organizations can help transform mindset alongside process, smoothing the move to an AI-powered DevSecOps culture.</p><blockquote>The dark ages of DevSecOps were defined by noise. The next era is defined by signal.</blockquote><p>Pipelines should not impose unnecessary burdens on developers for simply engaging in the act of coding. As demonstrated throughout this analysis, the integration of AI enables automated systems not only to detect vulnerabilities but also to generate actionable fixes, directly addressing the remediation bottleneck identified in contemporary DevSecOps research.</p><blockquote>Evidence from industry reports, such as those by GitLab and Palo Alto Networks, underscores how AI-driven remediation reduces alert fatigue and aligns security protocols with development needs.</blockquote><p>For example, organizations that have adopted AI-powered remediation tools have reported a reduction in mean time to remediation (MTTR) by up to 65 percent, and some have seen the number of open critical vulnerabilities drop by half within the first six months of implementation. This shift signifies a transformative future in which development pipelines actively facilitate secure and efficient software delivery, rather than hindering it.</p><p>Ultimately, as argued in the thesis, AI’s ability to both identify and remediate security issues is pulling DevSecOps out of the dark ages by reducing remediation friction, improving collaboration between development and security teams, and laying the groundwork for more adaptive and resilient software engineering practices.</p><h3>References</h3><p>To arrive at this conclusion, the following concepts and industry patterns were verified during the research phase:</p><ol><li><a href="https://github.blog/news-insights/octoverse/"><strong>GitHub’s State of AI in Software Development</strong></a>: Analyzed data indicating that AI shifts developers into the role of code reviewers (”editors”) rather than code generators.</li><li><a href="https://about.gitlab.com/developer-survey/"><strong>GitLab’s Global DevSecOps Report</strong></a>: Verified the widespread developer frustration with traditional “Shift Left” practices, specifically alert fatigue.</li><li><a href="https://www.paloaltonetworks.com/state-of-cloud-native-security"><strong>Palo Alto Networks State of Cloud Native Security</strong></a>: Validated that the modern security problem is no longer “finding vulnerabilities” but rather the capacity for “remediating” them.</li><li><a href="https://www.atlassian.com/microservices/cloud-computing/microservices-vs-monolith"><strong>Microservices &amp; Polyrepo Architectural Patterns</strong></a>: Examined how traditional scanners lack cross-repository context required for blue field applications, proving AI remediation’s mapping ability is a critical differentiator.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de78ddc0c4f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Context Tax of Separated Codebases in the AI Era — MonoRepo vs PolyRepo]]></title>
            <link>https://medium.com/@boopaathy/the-context-tax-of-separated-codebases-in-the-ai-era-e38cb2408638?source=rss-4b002f2d7dfb------2</link>
            <guid isPermaLink="false">https://medium.com/p/e38cb2408638</guid>
            <category><![CDATA[polyrepo]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[monorepo]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Boopaathy]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 14:30:23 GMT</pubDate>
            <atom:updated>2026-04-11T23:06:03.468Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G3aF2Wr8L3HjdQ63vzz7Bw.png" /><figcaption>MonoRepo vs PolyRepo</figcaption></figure><p>Your multi-repo setup is blinding your AI tools and breaking your pipelines.</p><p>For ten years, engineering leaders treated splitting up code into different repositories (polyrepos) as the price we had to pay for independent teams. We broke our codebases into dozens of pieces just so the frontend team wouldn’t accidentally break the backend. We built our systems with walls on purpose.</p><p>That rule worked fine when systems were built only by humans. Developers could open five different IDE windows, trace network requests in their heads, and remember how everything connected.</p><p>Then we handed those same separated repositories to AI coding assistants. We promised executives a huge speed increase. Instead of getting work done faster, we got made-up code, wrong API responses, and broken builds that required hours of manual human fixing.</p><p>If your team is using Cursor, Copilot Workspace, or an AI agent for your CI/CD, you have probably noticed a painful pattern. The AI is great at writing logic inside a single file or a single repository. But it completely falls apart the moment a feature needs to cross over to another service.</p><p>This isn’t because the AI models are getting worse. The reality is much simpler, and it is entirely structural: an AI cannot reliably write code across boundaries when those boundaries are separated folders on a hard drive.</p><h3>The Missing Context Tax</h3><p>You pay a massive “context tax” every time you cross into a new repository.</p><p>Every time a developer wants an AI agent to write a feature that touches the database, the API, and the user interface, they hit a wall. The AI working in the frontend repository has absolutely zero native visibility into the backend repository.</p><p>I was reading Reddit last week when I saw a Staff Engineer summarise modern development perfectly:</p><blockquote><em>“I just spent three hours manually copying and pasting TypeScript code from our backend repository into my frontend Cursor window just so the AI wouldn’t guess the API response. We separated our teams, but we accidentally separated the context our AI needs.”</em></blockquote><p>This is the tax of using multiple repositories today. Engineers are no longer just writing code; they are acting as manual bridges for their AI tools.</p><p>But missing context isn’t even the worst part. The far bigger danger is <strong><em>wrong</em></strong> context. When a developer manually copies and pastes an interface to feed their AI, they are giving it second-hand information. What if they accidentally copied an older version of the file? What if they missed a deeply nested utility type? The AI ends up generating code based on human gossip instead of reading the actual, first-hand truth from the codebase.</p><h3><strong>The DevOps Deployment Nightmare</strong></h3><p>But the pain isn’t just felt by the developers copying and pasting types. It hits the DevOps and platform engineering teams even harder.</p><p>From a DevOps perspective, polyrepos create a deployment tax that directly cancels out the speed you gain from AI. Let’s assume your AI successfully writes the code for a full-stack feature across three different repositories. How do you deploy it?</p><p>DevOps teams have to coordinate incredibly complex syncs, manage fragmented dependency graphs, and orchestrate multiple CI pipelines to make sure the backend API goes live at the exact same time as the frontend client. If there is a delay in one pipeline, or if one repository fails it’s tests, the whole release is broken. You get “version drift” and “dependency hell.”</p><p>You are forcing your deployment pipeline to solve the fragmentation that the repositories created.</p><p>And this fragmentation completely breaks AI pull request reviewers. PR review agents (like Copilot Workspace) are supposed to catch breaking changes before they merge. But if a developer changes an API contract in the backend repository, the PR review agent looking at the frontend repository has no idea the change happened. It will happily approve a broken pull request because it is entirely blind to the services outside of its current folder.</p><h3><strong>The Microservice Reality</strong></h3><p>If your architecture relies on microservices, moving to a monorepo fundamentally changes the deployment math.</p><p>In a polyrepo world, microservices are completely isolated. This guarantees they can be deployed independently, but it makes synchronised updates a nightmare. If an AI agent attempts to update a shared authentication library across five different microservice repositories, DevOps has to manually track, tag, and sequence five separate deployments just to ensure the system doesn’t break in production.</p><p>A monorepo solves this orchestration nightmare instantly. When the AI changes that shared library, the CI pipeline can see exactly which microservices depend on it. It ensures that the API contracts are perfectly synchronised across the entire system <strong><em>before</em></strong> anything merges.</p><p>But this solution creates a massive new challenge for your DevOps team. The whole point of microservices is that they should be decoupled. When 20 microservices suddenly live inside a single repository, how do you release just one of them?</p><p>Your DevOps team can no longer rely on simple “push to main, deploy the repo” scripts. They are forced to build highly intelligent, differential deployment pipelines that can calculate the exact blast radius of a commit and only deploy the specific microservices that were actually modified. You fix the AI’s contract blindness, but you force your DevOps team to engineer a significantly more complex CI/CD infrastructure.</p><h3><strong>The New Trade-Off of Atomic Commits</strong></h3><p>Putting all your code in one place (a monorepo) is no longer a luxury reserved for massive tech companies. AI and DevOps are the real reasons everyone is switching. A monorepo solves the AI context problem and the DevOps deployment problem simultaneously by offering atomic commits. When the AI generates a cross-boundary feature, the entire dependency graph is tested, linted, and deployed as a cohesive unit in a single pipeline run.</p><blockquote><strong>But let’s be honest</strong>: moving your entire engineering organization into a single repository is not a magic fix. It fixes fragmentation, but it creates a whole new category of pain for DevOps.</blockquote><p>When you convert a polyrepo into a monorepo, you trade the chaos of fragmented deployments for the chaos of pipeline orchestration. Specifically, DevOps teams now face four massive challenges:</p><p>1. <strong>The Test Matrix Explosion: </strong>If you aren’t careful, a tiny change to a shared frontend button will trigger a 45-minute test suite across the entire backend infrastructure. Platform teams must build highly intelligent, cache-aware build systems that only test the code that actually changed.</p><p>2. <strong>Developer Experience Degradation:</strong> You fix the AI context window blindness, but suddenly, human developers complain about a massive, slow Git history. Cloning the repository takes minutes instead of seconds, and local IDEs freeze while trying to index millions of lines of code in a single window.</p><p>3. <strong>The `main` Branch Bottleneck:</strong> Remember how nice it was when teams deployed independently? In a monorepo, you have 50 developers — and their automated AI agents — trying to merge into `main` at the exact same time. The branch becomes a total traffic jam. Automated merge queues become a strict necessity to prevent constant merge conflicts.</p><p>4. <strong>Access Control and Blast Radius:</strong> In a polyrepo, security access is naturally siloed. In a monorepo, every developer and AI agent has visibility across the entire codebase. Managing who has permission to merge changes into the core authentication library versus the public marketing site becomes a complex security headache.</p><p>We didn’t get rid of engineering boundaries — we just moved them. We took the problem out of the repository structure and pushed it entirely onto the deployment pipeline. The AI agent can finally see all the code it needs to write the feature. It doesn’t have to guess.</p><p>But once the AI writes the code, can your DevOps pipeline handle the traffic?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e38cb2408638" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kiam Installing - The Easy Way]]></title>
            <link>https://medium.com/@boopaathy/kiam-installing-the-easy-way-9e8685c98129?source=rss-4b002f2d7dfb------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e8685c98129</guid>
            <category><![CDATA[kiam]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[k8s]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Boopaathy]]></dc:creator>
            <pubDate>Sat, 25 Apr 2020 06:41:02 GMT</pubDate>
            <atom:updated>2020-04-25T06:41:02.696Z</atom:updated>
            <content:encoded><![CDATA[<p>Want to upload the files from the Kubernetes pod to the S3 bucket? or Want to know how to access any AWS resource from the pod?.</p><p>You can definitely say, I can pass the Access key and Secret Key of AWS account and achieve this. Yes, you can but is it safe?</p><p>And yes, passing the keys as a K8s secret will solve this problem.</p><p>What if you mistakenly commit the secrets to a public repository?</p><p>There are many workarounds to pass the keys safely to the pod. One such method is <strong>Kiam.</strong></p><h3><strong>What is Kiam?</strong></h3><p>Kiam is a tool on Kubernetes that helps to solve the authentication/authorization on AWS. Using, Kiam you can access the AWS services from the pod running on the Kubernetes, the pod can use the specific IAM-role to interact with the AWS service resources.</p><h3><strong>Kiam features</strong></h3><p>Kiam feature includes the following</p><ul><li>No client SDK modifications are needed. Kiam intercepts metadata API requests.</li><li>Increased security by splitting the process into server &amp; agent. In that case, only server process are permitted to perform sts:AssumeRole</li><li>Prefetching credentials from AWS which reduces response time as observed by SDK clients.</li><li>Load balancing requests across multiple servers which helps in deploying updates to servers without breaking agents.</li><li>Multi-account IAM support. Pods can assume roles from any AWS account assuming trust relationship permits it</li><li>Text and JSON log formats</li></ul><h3>How Kiam works?</h3><p>Kiam is based on agent-server architecture.</p><ul><li><strong>Kiam Agent</strong>: Agent would typically be deployed as a DaemonSet to ensure that pods have no access to the AWS Metadata API. Instead, the Kiam agent runs an HTTP proxy which intercepts credentials requests and passes on everything else.</li><li><strong>Kiam Server</strong>: Server is responsible for connecting the Kubernetes API servers to watch pods, and for communicating with AWS Security Token Service (STS) to request credentials. It also maintains a cache of credentials for roles currently in use by running pods, ensuring that credentials are refreshed every few minutes and stored before the pods need them.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YfPrhbWBgFJGNBR3zLgmFA.png" /><figcaption>Image Credits: Blue Matador, Inc.</figcaption></figure><h3>Installation and Configuring Kiam</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*vi6Wx5P9QQf54PyFVsU4aA.png" /><figcaption>Image credits: mvps.net</figcaption></figure><h4><strong>Installation</strong></h4><p>Use the Helm package manager <a href="https://uswitch.github.io/kiam-helm-charts/charts/">helm</a> to install Kiam. The installation is done using Helm v3 it supports Helm v2 too.</p><pre>$ helm repo add uswitch https://uswitch.github.io/kiam-helm-charts/charts/<br>$ helm repo update<br>$ helm install uswitch/kiam</pre><h4><strong>custom values.yaml</strong></h4><pre>agent:<br>  ## agent whitelist of proxy routes matching this reg-ex<br>  ##<br>  whiteListRouteRegexp: ^$<br>  ## Host networking settings<br>  ##<br>  host:<br>    iptables: true<br>    # do not remove iptables forwarding rules when kiam-agent terminates<br>    # needed for RollingUpdate strategy and for security reeasons<br>    # see https://github.com/uswitch/kiam/issues/202 and https://github.com/uswitch/kiam/pull/253<br>    iptablesRemoveOnShutdown: true<br>    port: 8181<br>    interface: cali+<br>  ## Secret name of agent&#39;s TLS certificates<br>  ##<br>  tlsSecret: kiam-agent-tls<br>  <br>  ## Agent TLS Certificate filenames (Secret key&#39;s should be as below, modify the filename if needed)<br>  tlsCerts:<br>    certFileName: cert<br>    keyFileName: key<br>    caFileName: ca<br><br>server:<br>  ## Secret name of server&#39;s TLS certificates<br>  ##<br>  tlsSecret: kiam-server-tls<br><br>  ## Agent TLS Certificate filenames<br>  tlsCerts:<br>    certFileName: cert<br>    keyFileName: key<br>    caFileName: ca<br><br>  # Location of SSL certs on host<br>  ## Running on Amazon Linux or RHEL distros:<br>  #   /etc/pki/ca-trust/extracted/pem<br>  ## else:<br>  #   /usr/share/ca-certificates<br>  # Below cert path is based on the Ubuntu machine, change as needed<br>  sslCertHostPath: /etc/ssl/certs <br><br>  ## IAM role for the server to assume<br>  ##<br>  assumeRoleArn: &lt;create an IAM role for sts:AssumeRole&gt;<br><br>  ## Use hostNetwork for server<br>  ## Set this to true when running the servers on the same nodes as the agents,<br>  ## it should be set when the agent is running on the same node.<br>  ## If server pod is running on master set it `false`<br>  useHostNetwork: true<br><br>  # node selector ensures the pod goes to master node.<br>  nodeSelector:<br>    kubernetes.io/role: master<br>  # kops master nodes requires this tolerations<br>  # tolerations:<br>    # - key: &quot;node-role.kubernetes.io/master&quot;<br>    #   effect: &quot;NoSchedule&quot;<br>    #   operator: &quot;Exists&quot;</pre><h3><strong>Generating Self-Signed certificate for Kiam ( Manual Certificate )</strong></h3><p>Generating the manuall certificate using cfssl we can use openssl too.</p><h4><strong>1. Generate CA cert</strong></h4><p>ca.json</p><pre>{<br>  &quot;CN&quot;: &quot;Kiam CA&quot;,<br>    &quot;key&quot;: {<br>        &quot;algo&quot;: &quot;rsa&quot;,<br>        &quot;size&quot;: 2048<br>    },<br>    &quot;names&quot;: [<br>        {<br>            &quot;C&quot;:  &quot;India&quot;,<br>            &quot;L&quot;:  &quot;Chennai&quot;,<br>            &quot;O&quot;:  &quot;avengers&quot;,<br>            &quot;OU&quot;: &quot;WWW&quot;,<br>            &quot;ST&quot;: &quot;chennai&quot;<br>        }<br>    ]<br>}</pre><p>cfssl gencert -initca ca.json | cfssljson -bare ca</p><h4>2. <strong>Generate server key pair</strong></h4><p>server.json (Add the required hostnames, it will be good to have the service name of kiam in the host)</p><pre>{<br>    &quot;hosts&quot;: [<br>        &quot;kiam-server&quot;,<br>        &quot;127.0.0.1&quot;,<br>        &quot;localhost&quot;<br>    ],<br>    &quot;key&quot;: {<br>        &quot;algo&quot;: &quot;rsa&quot;,<br>        &quot;size&quot;: 2048<br>    },<br>    &quot;names&quot;: [<br>        {<br>            &quot;C&quot;:  &quot;India&quot;,<br>            &quot;L&quot;:  &quot;Chennai&quot;,<br>            &quot;O&quot;:  &quot;avengers&quot;,<br>            &quot;OU&quot;: &quot;WWW&quot;,<br>            &quot;ST&quot;: &quot;chennai&quot;<br>        }<br>    ]<br>}</pre><p>cfssl gencert -ca=ca.pem -ca-key=ca-key.pem server.json | cfssljson -bare server</p><h4>3. <strong>Generate agent key pair</strong></h4><p>agent.json</p><pre>{<br>  &quot;CN&quot;: &quot;Kiam Agent&quot;,<br>    &quot;key&quot;: {<br>        &quot;algo&quot;: &quot;rsa&quot;,<br>        &quot;size&quot;: 2048<br>    },<br>    &quot;names&quot;: [<br>        {<br>            &quot;C&quot;:  &quot;UK&quot;,<br>            &quot;L&quot;:  &quot;London&quot;,<br>            &quot;O&quot;:  &quot;uSwitch&quot;,<br>            &quot;OU&quot;: &quot;WWW&quot;,<br>            &quot;ST&quot;: &quot;London&quot;<br>        }<br>    ]<br>}</pre><p>cfssl gencert -ca=ca.pem -ca-key=ca-key.pem agent.json | cfssljson -bare agent</p><h3><strong>Store in Kubernetes</strong></h3><p>Add the generated certificates as the Kubernetes secret</p><h4><strong>Generated server cerificate</strong></h4><pre>kubectl create secret generic kiam-server-tls -n kube-system \<br>  --from-file=ca.pem \<br>  --from-file=server.pem \<br>  --from-file=server-key.pem</pre><h4><strong>Generated agent certificate</strong></h4><pre>kubectl create secret generic kiam-agent-tls -n kube-system \<br>  --from-file=ca.pem \<br>  --from-file=agent.pem \<br>  --from-file=agent-key.pem</pre><h3><strong>IAM configuration</strong></h3><p>The role need to have sts:AssumeRole policy to assume. I use an example server role of kiam-server, with a full ARN of arn:aws:iam::123456789012:role/kiam-server. This is the role that you&#39;ll specify against Kiam Server&#39;s --assume-role-arn flag.</p><p>With this you’ll need IAM policy which permits the EC2 instances to call sts:AssumeRole for the kiam-server role. This will ensure the server process can assume the server role. You&#39;ll also need IAM policy attached to the server role that permits it to call sts:AssumeRole. This ensures that the Kiam Server can request credentials for other roles.</p><h4><strong>Server node policy</strong></h4><p>This is the example policy that will allow the EC2 instance that runs the Server process can assume the server role.</p><p>The example below is expressed using <a href="https://www.terraform.io/">Terraform</a> and should help explain how AWS IAM resources are connected.</p><pre>resource &quot;aws_iam_role&quot; &quot;k8s-node-role&quot; {<br>  name = &quot;k8s-node-role&quot;</pre><pre>  assume_role_policy = &lt;&lt;EOF<br>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: { &quot;Service&quot;: &quot;ec2.amazonaws.com&quot;},<br>      &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>    }<br>  ]<br>}<br>EOF<br>}</pre><pre>resource &quot;aws_iam_role_policy&quot; &quot;server_node&quot; {<br>  name = &quot;server_node&quot;<br>  role = &quot;${aws_iam_role.server_node.name}&quot;</pre><pre>  policy = &lt;&lt;EOF<br>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: [<br>        &quot;sts:AssumeRole&quot;<br>      ],<br>      &quot;Resource&quot;: &quot;${aws_iam_role.server_role.arn}&quot;<br>    }<br>  ]<br>}<br>EOF<br>}</pre><pre>resource &quot;aws_iam_instance_profile&quot; &quot;server_node&quot; {<br>  name = &quot;server_node&quot;<br>  role = &quot;${aws_iam_role.server_node.name}&quot;<br>}</pre><pre>resource &quot;aws_iam_role&quot; &quot;server_role&quot; {<br>  name        = &quot;kiam-server&quot;<br>  description = &quot;Role the Kiam Server process assumes&quot;</pre><pre>  assume_role_policy = &lt;&lt;EOF<br>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Sid&quot;: &quot;&quot;,<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: {<br>        &quot;AWS&quot;: &quot;${aws_iam_role.server_node.arn}&quot;<br>      },<br>      &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>    }<br>  ]<br>}<br>EOF<br>}</pre><pre>resource &quot;aws_iam_policy&quot; &quot;server_policy&quot; {<br>  name        = &quot;kiam_server_policy&quot;<br>  description = &quot;Policy for the Kiam Server process&quot;</pre><pre>  policy = &lt;&lt;EOF<br>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Action&quot;: [<br>        &quot;sts:AssumeRole&quot;<br>      ],<br>      &quot;Resource&quot;: &quot;*&quot;<br>    }<br>  ]<br>}<br>EOF<br>}</pre><pre>resource &quot;aws_iam_policy_attachment&quot; &quot;server_policy_attach&quot; {<br>  name       = &quot;kiam-server-attachment&quot;<br>  roles      = [&quot;${aws_iam_role.server_role.name}&quot;]<br>  policy_arn = &quot;${aws_iam_policy.server_policy.arn}&quot;<br>}</pre><h4><strong>Application Roles</strong></h4><p>For any role which is to be assumed by a Pod you’ll need to ensure it also has a trust policy that permits the Kiam_server_role in the cluster to assume the role. This is referred to as the Trust Relationship in the AWS Console, and the assume_role_policy in Terraform.</p><pre>{<br>  &quot;Version&quot;: &quot;2012-10-17&quot;,<br>  &quot;Statement&quot;: [<br>    {<br>      &quot;Sid&quot;: &quot;&quot;,<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: {<br>        &quot;Service&quot;: &quot;ec2.amazonaws.com&quot;<br>      },<br>      &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>    },<br>    {<br>      &quot;Sid&quot;: &quot;&quot;,<br>      &quot;Effect&quot;: &quot;Allow&quot;,<br>      &quot;Principal&quot;: {<br>        &quot;AWS&quot;: &quot;arn:aws:iam::123456789012:role/kiam-server&quot;<br>      },<br>      &quot;Action&quot;: &quot;sts:AssumeRole&quot;<br>    }<br>  ]<br>}</pre><p>The cluster node EC2 instance role will need to have sts:AssumeRole permission for this role and for there to be an entry in the Server role&#39;s trust policy. Application roles will need to have a trust policy entry for kiam server role, instead of the cluster node role as noted above.</p><p><strong>Note:</strong> The Trust Relationship of the Kiam-server AWS Role should contain kubernetes node role ARN and the application roles should contain the kiam-server’s ARN on the Trust Relationship.</p><h3><strong>Kubernetes cluster configuration</strong></h3><p>Further, all namespaces must also have an annotation with a regular expression expressing which roles are permitted to be assumed within that namespace. <strong>Without the namespace annotation the pod will be unable to assume any roles.</strong></p><pre>kind: Namespace<br>metadata:<br>  name: iam-example<br>  annotations:<br>    iam.amazonaws.com/permitted: &quot;.*&quot;</pre><p>Kiam uses an annotation added to a Pod to indicate which role should be assumed. For example:</p><pre>kind: Pod<br>metadata:<br>  name: foo<br>  namespace: iam-example<br>  annotations:<br>    iam.amazonaws.com/role: s3-reader</pre><h3><strong>Conclusion</strong></h3><p>You might wonder the title said, “<strong>The easy way”</strong> but it’s too much to follow. Yes, configuring Kiam is a hard process but above process will help you to understand it’s working in depth.</p><h4><strong>Reference Links</strong></h4><ul><li><a href="https://github.com/uswitch/kiam">https://github.com/uswitch/kiam</a></li><li><a href="https://www.youtube.com/watch?v=vgs3Af_ew3c">https://www.youtube.com/watch?v=vgs3Af_ew3c</a></li><li><a href="https://github.com/vmware-tanzu/tgik/tree/master/episodes/070">https://github.com/vmware-tanzu/tgik/tree/master/episodes/070</a></li><li><a href="https://docs.google.com/document/d/1rn-v2TNH9k4Oz-VuaueP77ANE5p-5Ua89obK2JaArfg/edit">Compare Kiam with alternatives</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e8685c98129" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>