<?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 VanillaCache on Medium]]></title>
        <description><![CDATA[Stories by VanillaCache on Medium]]></description>
        <link>https://medium.com/@vanillacache?source=rss-3a5d51abb56a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7cvxwTGB7k8INQt-6IjdrQ.jpeg</url>
            <title>Stories by VanillaCache on Medium</title>
            <link>https://medium.com/@vanillacache?source=rss-3a5d51abb56a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 04:26:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vanillacache/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 Default ‘Edit’ role in Kubernetes: A key to the city.]]></title>
            <link>https://medium.com/@vanillacache/the-default-edit-role-in-kubernetes-a-key-to-the-city-59e8982fd099?source=rss-3a5d51abb56a------2</link>
            <guid isPermaLink="false">https://medium.com/p/59e8982fd099</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[rbac]]></category>
            <dc:creator><![CDATA[VanillaCache]]></dc:creator>
            <pubDate>Sun, 15 Oct 2023 13:24:57 GMT</pubDate>
            <atom:updated>2023-10-15T13:24:57.567Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BWIZbhW5p1Sa2uBMIZFAvw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@growtika?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Growtika</a> on <a href="https://unsplash.com/photos/KU9ABpm7eV8?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></figcaption></figure><p>In the city of Kubernetes, filled with nodes, pods, services, and the ever vigilant mayor RBAC. We can still keep an eye on the roles and bindings within. One such role is that of the ‘edit’.</p><p>I was recently looking into a ClusterRoleBinding (CRB) of a service account to the default ‘edit’ role in Kubernetes. This seemingly harmless configuration had the potential for security ramifications.</p><p>The further I looked into the role, the more I noticed it felt like a key to the city.</p><p>Feel free to spin up a cluster and inspect:<br>For this I am using a kind cluster: <a href="https://kind.sigs.k8s.io/">https://kind.sigs.k8s.io/</a></p><pre>kind create cluster</pre><pre>kubectl get clusterroles.rbac.authorization.k8s.io edit -o yaml</pre><pre>...<br>...<br>...<br>rules:<br>- apiGroups:<br>  - &quot;&quot;<br>  resources:<br>  - pods/attach<br>  - pods/exec<br>  - pods/portforward<br>  - pods/proxy<br>  - secrets<br>  - services/proxy<br>  verbs:<br>  - get<br>  - list<br>  - watch<br>- apiGroups:<br>  - &quot;&quot;<br>  resources:<br>  - serviceaccounts<br>  verbs:<br>  - impersonate<br>- apiGroups:<br>  - &quot;&quot;<br>  resources:<br>  - pods<br>  - pods/attach<br>  - pods/exec<br>  - pods/portforward<br>  - pods/proxy<br>  verbs:<br>  - create<br>  - delete<br>  - deletecollection<br>  - patch<br>  - update<br>- apiGroups:<br>  - &quot;&quot;<br>  resources:<br>  - pods/eviction<br>  verbs:<br>  - create<br>- apiGroups:<br>  - &quot;&quot;<br>  resources:<br>  - configmaps<br>  - events<br>  - persistentvolumeclaims<br>  - replicationcontrollers<br>  - replicationcontrollers/scale<br>  - secrets<br>  - serviceaccounts<br>  - services<br>  - services/proxy<br>...<br>...<br>...<br>&lt; AND THE LIST GOES ON...&gt;</pre><p>I have provided just a snippet, but it immediately becomes clear that the role provides permissions across various Kubernetes resources. It grants management and viewing capabilities for pods, secrets, services, service accounts, replication controllers, and components. From the initial setup this comes to over 48 different resources.</p><h3>Mutability of the ‘Edit’ Role:</h3><p>If you’ve noticed, I previously stated that the permissions we viewed are from the “initial setup”. This is because Kubernetes allows modifying (or mutating) built-in roles like ‘edit’. This mutability can be both advantageous and problematic. Specifically as it allows the permissions granted by the role to grow over time.</p><h3>When to Use the ‘Edit’ Role</h3><p>The ‘edit’ role, along with all its permissions is best suited for:</p><ol><li><strong>User Roles and Collaborative Environments:</strong> In some instances, particularly in larger teams or organisations, specific users or teams might be given the ‘edit’ permissions. This can be to manage a specific namespace, handle a set of applications, or oversee certain cluster resources. Similarly, this may also be seen in CI/CD pipelines as automated systems may require a wide range of permissions to manage application deployments, scaling, and updates.</li><li><strong>Prototyping Environments:</strong> When developers need to quickly prototype, test, and iterate on applications. In these cases, a broader set of permissions can be helpful. This minimises the need for frequent permission checks allowing you to quickly develop with the intent of returning to refine the permissions later.</li></ol><h3>Security Implications of our Issue</h3><p>Tying back to the initial problem — a ClusterRoleBinding of a service account to the ‘edit’ role — it’s essential to note that service accounts are meant for processes, not people. A process with the ‘edit’ role has a significant amount of control over resources. If misused, it can lead to accidental disruptions. Therefor returning to the suggestion of revisiting the usage of an edit role, to reduce these permissions in a new role may be optimal for your cluster :)</p><h3>Conclusion</h3><p>When it comes to Kubernetes RBAC, it’s good to be cautious and informed. Always ensure you understand the permissions you’re granting, audit regularly, and refine when needed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59e8982fd099" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>