<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Gadi Naor</title>
    <description>The latest articles on Forem by Gadi Naor (@gadinaor).</description>
    <link>https://forem.com/gadinaor</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F345825%2F9ec0898e-2667-44e0-9830-4988c9cc5d33.png</url>
      <title>Forem: Gadi Naor</title>
      <link>https://forem.com/gadinaor</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/gadinaor"/>
    <language>en</language>
    <item>
      <title>New Kubernetes Node Vulnerability (CVE-2020-8558) bypasses localhost boundary</title>
      <dc:creator>Gadi Naor</dc:creator>
      <pubDate>Wed, 22 Jul 2020 08:11:30 +0000</pubDate>
      <link>https://forem.com/alcide/new-kubernetes-node-vulnerability-cve-2020-8558-bypasses-localhost-boundary-64f</link>
      <guid>https://forem.com/alcide/new-kubernetes-node-vulnerability-cve-2020-8558-bypasses-localhost-boundary-64f</guid>
      <description>&lt;h3&gt;
  
  
  Vulnerability Description and Impact
&lt;/h3&gt;

&lt;p&gt;A security issue was discovered in kube-proxy which &lt;strong&gt;allows adjacent nodes/hosts to reach TCP and UDP services bound to 127.0.0.1 running on the node or in the node's network namespace (host network)&lt;/strong&gt;. This breaks security assumptions made by services listening on localhost.&lt;/p&gt;

&lt;p&gt;This security bug was originally raised in issue &lt;a href="https://github.com/kubernetes/kubernetes/issues/90259"&gt;#90259&lt;/a&gt; which details how the kube-proxy sets net.ipv4.conf.all.route_localnet=1 and causes the system not to reject traffic to localhost which originates on other hosts (martian traffic). Such traffic would look like packets on the wire with an IPv4 destination in the range 127.0.0.0/8 and a layer-2 destination MAC address of a target node may indicate that an attack is targeting this vulnerability.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lxkO_ygG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bkmaxt4z8yexz2piymdl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lxkO_ygG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bkmaxt4z8yexz2piymdl.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, if a cluster administrator runs a TCP service on a node that listens on 127.0.0.1:1234, because of this security bug, that service would be potentially reachable by other hosts on the same LAN as the node, or by containers running on the same node as the service. If the example service on port 1234 required no additional authentication (because it assumed that only other localhost processes could reach it), then it could be vulnerable to attacks that make use of this security bug.&lt;/p&gt;

&lt;p&gt;While many Kubernetes installers explicitly disable the API Server's insecure port, and Kubernetes v1.20 is planned to remove this insecure option, An &lt;strong&gt;API server&lt;/strong&gt; that uses this insecure option and listens on 127.0.0.1:8080 &lt;strong&gt;will accept requests without authentication&lt;/strong&gt;.&lt;br&gt;
To mount such an attack on the API server, an attacker must have access to another system on the same LAN or with control of a container running on the master. Managed Kubernetes services such as EKS, AKS, GKE and others should be resilient attacks on the API server insecure port.&lt;/p&gt;

&lt;h3&gt;
  
  
  Are You Vulnerable?
&lt;/h3&gt;

&lt;p&gt;The vulnerability affects &lt;strong&gt;kubelet&lt;/strong&gt; &amp;amp; &lt;strong&gt;kube-proxy&lt;/strong&gt; which are core Node components:&lt;/p&gt;

&lt;h4&gt;
  
  
  Affected Versions:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;kubelet/kube-proxy v1.18.0-1.18.3&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;kubelet/kube-proxy v1.17.0-1.17.6&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;kubelet/kube-proxy &amp;lt;=1.16.10&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Or if one or more of the following items are applicable to your environments:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Your cluster nodes run in an environment where untrusted hosts share the same layer 2 domain (i.e. same LAN) as the cluster nodes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your cluster allows untrusted pods to run containers with CAP_NET_RAW which is enabled by default by Kubernetes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your nodes (or hostnetwork pods) run any localhost-only services which do not require any further authentication. To list services that are potentially affected, run the following commands on nodes:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;lsof +c 15 -P -n &lt;a href="mailto:-i4TCP@127.0.0.1"&gt;-i4TCP@127.0.0.1&lt;/a&gt; -sTCP:LISTEN&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;lsof +c 15 -P -n &lt;a href="mailto:-i4UDP@127.0.0.1"&gt;-i4UDP@127.0.0.1&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Risk:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Typical Clusters: medium (5.4) CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In clusters where API server insecure port has not been disabled: high (8.8) CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Automatic Detection of adjacent Node attacks with Alcide Runtime
&lt;/h3&gt;

&lt;p&gt;This new vulnerability has long been covered by &lt;a href="//alcide.io/platform/microservices-anomaly-detection/"&gt;Alcide Runtime&lt;/a&gt; without requiring any configuration by the user. &lt;br&gt;
This detection has been part of Alcide Runtime for a long time, even prior to this vulnerability’s disclosure, and there was no need for us to add additional detection capabilities.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9sDuCjDC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/39u6gl0iwvivtyd4bdg5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9sDuCjDC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/39u6gl0iwvivtyd4bdg5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The traffic is flagged as spoofed traffic because localhost traffic should never cross network boundaries. Furthermore, if you explicitly define firewall policies using Alcide’s microservices firewall, then pods can’t access other resources in the network unless explicitly allowed. This is what zero-trust networking is all about!&lt;/p&gt;

&lt;h3&gt;
  
  
  Automatic Detection of API Server attacks with Alcide kAudit
&lt;/h3&gt;

&lt;p&gt;Exploit attempts of this vulnerability via the &lt;a href="https://kubernetes.io/docs/reference/access-authn-authz/controlling-access/#api-server-ports-and-ips"&gt;unsecured port of the API Server&lt;/a&gt; would show up in its audit log as entries from the "system:unsecured" principal, similar to entries from K8s services on the Master node accessing the API Server locally.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7zUEzUTs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/oast3f8xjjmyn3ccgwy1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7zUEzUTs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/oast3f8xjjmyn3ccgwy1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.alcide.io/kaudit-K8s-forensics/"&gt;Alcide kAudit&lt;/a&gt; analyzes the audit log of the Kubernetes API Server, continuously updates and compares behavioral activity profiles to actual observed activity and automatically detects anomalous access patterns from cluster principals (in this case, "system:unsecured" account) to various resource types, k8s APIs, namespaces, and specific resources. Thus, &lt;strong&gt;Alcide kAudit can automatically alert security teams to suspected attacks that rely on CVE-2020-8558 as they occur&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Furthermore, Alcide kAudit users can configure and customize it to alert on audit entries violating their specific policy. They can, for example, add alerts on API Server activity that reads or modifies sensitive namespaces or resources in the cluster, and use such alerts if they happen as an indicator that an exploit may be in progress and should be investigated.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automatic Detection of Vulnerable Clusters with Alcide Advisor
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.alcide.io/kubernetes-advisor"&gt;Alcide Advisor&lt;/a&gt; is a Kubernetes multi-cluster vulnerability scanner that covers rich Kubernetes and Istio security best practices and compliance checks such as Kubernetes vulnerability scanning, hunting misplaced secrets, or excessive secret access, and many more security configuration and compliance checks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7GVQoqhN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yeqdblcmbc54fluqr1re.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7GVQoqhN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/yeqdblcmbc54fluqr1re.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  With Alcide Advisor users can:
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Identify the vulnerable clusters for this vulnerability (as well as other CVEs)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Identify and explicitly allow/deny which Pods can run with elevated privileges that enables CAP_NET_RAW&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Identify and explicitly allow/deny which Pods can run on the host network.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On applicable environments, identify Pods that can run on master nodes that can potentially exploit the Kubernetes API Server.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Kubernetes, like any software, has bugs and vulnerabilities. Leveraging Kubernetes as cloud-native application infrastructure requires operators to monitor and secure all the moving parts, whether these are the application workloads or the platform and infrastructure components. CVE-2020-8558 joins other recent vulnerability disclosures (&lt;a href="https://blog.alcide.io/new-kubernetes-control-plane-vulnerability-cve-2020-8555"&gt;CVE-2020-8555&lt;/a&gt; and &lt;a href="https://blog.alcide.io/new-kubernetes-man-in-the-middle-mitm-attack-leverage-ipv6-router-advertisements"&gt;CVE-2020-10749&lt;/a&gt;) and highlights the need for a purpose-built Kubernetes security solution that can drive cluster operators to run workloads, applications, and infrastructure while leveraging the best security practices of the native Kubernetes security controls, as well as security monitoring &amp;amp; prevention.&lt;/p&gt;

&lt;p&gt;Start your &lt;a href="https://get.alcide.io/14-day-trial"&gt;14-day&lt;/a&gt; trial or &lt;a href="https://www.alcide.io/kaudit-K8s-forensics/"&gt;request a demo&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>security</category>
      <category>cve</category>
      <category>alcide</category>
    </item>
    <item>
      <title>Helm Scan With GitHub Actions &amp; K8s Advisor</title>
      <dc:creator>Gadi Naor</dc:creator>
      <pubDate>Tue, 21 Apr 2020 07:21:32 +0000</pubDate>
      <link>https://forem.com/alcide/helm-scan-with-github-actions-k8s-advisor-2i9i</link>
      <guid>https://forem.com/alcide/helm-scan-with-github-actions-k8s-advisor-2i9i</guid>
      <description>&lt;p&gt;GitHub Actions is a recent continuous integration (CI) and continuous deployment (CD) service from GitHub. GitHub Actions powers GitHub's built-in continuous integration service. In its essence, GitHub Actions help developers automate software development workflows in the same place they store code and collaborate on pull requests and issues. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uUPdAezL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vyy23hujmycktromp7nm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uUPdAezL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/vyy23hujmycktromp7nm.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
GitHub Actions enable developers to write individual tasks, called actions, and combine them to create a custom workflow. Workflows are custom automated processes that developers can set up in their repository to build, test, package, release, or deploy any code project on GitHub.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create Kubernetes KIND Cluster
&lt;/h3&gt;

&lt;p&gt;Kubernetes IN Docker, &lt;a href="https://kind.sigs.k8s.io/"&gt;KIND&lt;/a&gt;, is a tool to create local clusters for testing Kubernetes using Docker containers. KIND was primarily designed for testing Kubernetes itself but may be used for local development or CI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wsp8Mzv4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/i3802sohm0xkllts0z7a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wsp8Mzv4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/i3802sohm0xkllts0z7a.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Multi-node clusters and other advanced features may be configured with a config file - the detailed usage information and documentation are &lt;a href="https://kind.sigs.k8s.io/docs/user/quick-start"&gt;here&lt;/a&gt;. GitHub Actions has a marketplace for reusable actions, and the folks behind Helm already managed to put together &lt;a href="https://github.com/marketplace/actions/kind-cluster"&gt;Kind Cluster&lt;/a&gt;, a reusable action that can be plugged into GitHub’s automation workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Security Scanning of Helm Charts with GitHub Actions Workflow
&lt;/h3&gt;

&lt;p&gt;Alcide Advisor, an API driven, Kubernetes security and hygiene scanner, has a wide &lt;a href="https://github.com/alcideio/pipeline"&gt;integration surface&lt;/a&gt; into the continuous deployment (CD) platforms. However, GitHub's actions combined with KIND, introduce an interesting approach for scanning helm charts in continuous integration (CI) stage.&lt;br&gt;
In the example below, a GitHub workflow has 3 sequential jobs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Build&lt;/li&gt;
&lt;li&gt;Test&lt;/li&gt;
&lt;li&gt;Advisor Scan&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The &lt;strong&gt;Advisor Scan&lt;/strong&gt; Job performs the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download Helm 3&lt;/li&gt;
&lt;li&gt;Launch Kind Cluster using a GitHub Action&lt;/li&gt;
&lt;li&gt;Install a chart (uswitch kiam in this example) into a specific namespace&lt;/li&gt;
&lt;li&gt;Download Alcide Advisor scanner&lt;/li&gt;
&lt;li&gt;Scan with Alcide Advisor the namespace into which kiam was installed&lt;/li&gt;
&lt;li&gt;Publish the scan report into the pipeline artifacts&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bP7jPmhX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d825xt88daolav5493m7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bP7jPmhX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/d825xt88daolav5493m7.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1M-Z_VDH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/su075v5nrns1royjarcr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1M-Z_VDH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/su075v5nrns1royjarcr.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fS-HI4-w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4jjdjt7z8tqdnzn3v9y4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fS-HI4-w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4jjdjt7z8tqdnzn3v9y4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Helm is the de-facto tool for collaborating when creating, installing, and managing applications inside of Kubernetes. Rendering helm charts with configuration into a cluster that can be scanned by Alcide Advisor, opens the door for developers &amp;amp; DevOps to ‘get a handle‘ on the security and hygiene level of new helm charts as well as helm charts changes. To see the full pipeline example go to &lt;a href="https://github.com/alcideio/pipeline"&gt;https://github.com/alcideio/pipeline&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>GitOps - A Security Perspective (Part 1)</title>
      <dc:creator>Gadi Naor</dc:creator>
      <pubDate>Mon, 13 Apr 2020 13:03:45 +0000</pubDate>
      <link>https://forem.com/alcide/gitops-a-security-perspective-part-1-16ci</link>
      <guid>https://forem.com/alcide/gitops-a-security-perspective-part-1-16ci</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fp78.f0.n0.cdn.getcloudapp.com%2Fitems%2FyAu2864l%2FImage%25202020-04-13%2520at%25208.29.49%2520AM.png%3Fv%3Da8a200d5ca1a59379349e629f97e44a1" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fp78.f0.n0.cdn.getcloudapp.com%2Fitems%2FyAu2864l%2FImage%25202020-04-13%2520at%25208.29.49%2520AM.png%3Fv%3Da8a200d5ca1a59379349e629f97e44a1" alt="https://p78.f0.n0.cdn.getcloudapp.com/items/yAu2864l/Image%202020-04-13%20at%208.29.49%20AM.png?v=a8a200d5ca1a59379349e629f97e44a1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.gitops.tech/" rel="noopener noreferrer"&gt;GitOps&lt;/a&gt; is a paradigm that puts Git at the heart of building and operating cloud native applications by using Git as the single source of truth and empowers developers to perform what used to fall under IT operations. This post is part a blog post series covering GitOps and Kubernetes security.&lt;/p&gt;

&lt;h1&gt;
  
  
  Kubernetes - A GitOps Companion
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://www.alcide.io/kubernetes-security" rel="noopener noreferrer"&gt;Kubernetes&lt;/a&gt;, as the new application server, leverages a “declarative” approach when it comes to building cloud native application, which means that application configuration is guaranteed by a set of facts instead of by a set of instructions. With application’s declarations versioned in Git, we have a single source of truth, our apps can be easily deployed and rolled back to and from Kubernetes, and when disaster strikes, your cluster’s infrastructure can also be reproduced.&lt;/p&gt;

&lt;p&gt;With Git at the center of the delivery pipelines, developers can make pull requests to accelerate and simplify application deployments and operations tasks to Kubernetes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fp78.f0.n0.cdn.getcloudapp.com%2Fitems%2FqGudAXDm%2FImage%25202020-04-13%2520at%25208.31.54%2520AM.png%3Fv%3Da5b9b5f0fa77fdc11cfcabdb6f492de6" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fp78.f0.n0.cdn.getcloudapp.com%2Fitems%2FqGudAXDm%2FImage%25202020-04-13%2520at%25208.31.54%2520AM.png%3Fv%3Da5b9b5f0fa77fdc11cfcabdb6f492de6" alt="gitops-flowchart-advisor"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Is GitOps right for you?
&lt;/h1&gt;

&lt;p&gt;The fresh approach that GitOps + Kubernetes brings into the application delivery lifecycle is undeniably different, increasing engineering velocity, as well as simplifies building the CI+CD pipelines themselves. The question of whether a GitOps ‘Pull’ approach is a better fit than ‘Push’ approach is really a matter of engineering &amp;amp; operational culture of an organization, as well as almost a theological question of whether engineering are accountable for security and what visibility into this application server blackbox, security teams require.&lt;/p&gt;

&lt;h1&gt;
  
  
  GitOps &amp;amp; Security
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;GitOps changes are synched into the cluster only through the cluster git repository users. The repository is secured at the same level of the git user accounts. A compromised user account in with permissions to push into the cluster git repo can introduce changes that will result in a data breach, service disruption or anything in between. There must be additional guardrails that GitOps infrastructure must implement in the form of whitelisting in order to have a cluster side guardrails.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;GitOps tools like &lt;a href="https://www.weave.works/oss/flux/" rel="noopener noreferrer"&gt;Flux&lt;/a&gt;, &lt;a href="https://argoproj.github.io/argo-cd/" rel="noopener noreferrer"&gt;ArgoCD&lt;/a&gt; and alike are practically running with cluster god permissions - and are persistent in the cluster. Kubernetes Dashboard, which is considered to be a high risk cluster, is often times removed from the cluster. &lt;br&gt;
‘Push’ based CD pipelines, such as &lt;a href="https://www.spinnaker.io/" rel="noopener noreferrer"&gt;Spinnaker&lt;/a&gt;, &lt;a href="https://jenkins.io/" rel="noopener noreferrer"&gt;Jenkins&lt;/a&gt; and alike are external to the cluster, invoke on-demand, and introduce automation-driven changes into the cluster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fp78.f0.n0.cdn.getcloudapp.com%2Fitems%2Fp9u7d8Pb%2FImage%25202020-04-13%2520at%25208.34.35%2520AM.png%3Fv%3D6f4dfdfe4ccd49f7fa23619cfd35fe3c" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fp78.f0.n0.cdn.getcloudapp.com%2Fitems%2Fp9u7d8Pb%2FImage%25202020-04-13%2520at%25208.34.35%2520AM.png%3Fv%3D6f4dfdfe4ccd49f7fa23619cfd35fe3c" alt="RBAC GitOps"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example: &lt;a href="https://github.com/fluxcd/flux/blob/master/deploy/flux-account.yaml" rel="noopener noreferrer"&gt;Flux RBAC Permission&lt;/a&gt; - Cluster God * * * * *&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;GitOps tools like Flux, ArgoCD and alike require cluster external access, represented as domain names (github.com, bitbucket.org, gitlab.com,..) which means that the &lt;a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/" rel="noopener noreferrer"&gt;Kubernetes native policies&lt;/a&gt; are not suitable to implement to segment those highly privileged in-cluster components.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Application secrets in a GitOps era requires a Kubernetes external secret provider. For example &lt;a href="https://www.hashicorp.com/products/vault/" rel="noopener noreferrer"&gt;Hashicorp Vault&lt;/a&gt;, &lt;a href="https://aws.amazon.com/kms/" rel="noopener noreferrer"&gt;AWS KMS&lt;/a&gt;, &lt;a href="https://azure.microsoft.com/en-us/services/key-vault/" rel="noopener noreferrer"&gt;Azure Vault&lt;/a&gt; and alike. Alternatively, teams can revert into &lt;a href="https://git-secret.io/" rel="noopener noreferrer"&gt;Git Secrets&lt;/a&gt; which means committing secrets into git in their encrypted form, and decrypting the secrets before application consumption.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://www.alcide.io/secured-ci-cd-pipeline" rel="noopener noreferrer"&gt;Continuous integration/continuous development (CI/CD) with the Kubernetes ecosystem&lt;/a&gt; does have a variety of tools to choose from and organizations should use the tools that are best suited for their specific use cases and culture. Glueing all the pieces together is not trivial. Integrating security and consuming security insights by various stakeholders is an equally challenging task to achieve. GitOps simplifies this in some aspects, but complicates in other aspects.&lt;/p&gt;

&lt;p&gt;Stay tuned for Part 2.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Join our upcoming webinar on April 22nd: &lt;a href="https://webinars.devops.com/gitops-best-practices-for-continuous-deployment-and-progressive-security" rel="noopener noreferrer"&gt;GitOps Best Practices for Continuous Deployment and Progressive Security&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>gitops</category>
      <category>kubernetes</category>
      <category>security</category>
      <category>cicd</category>
    </item>
    <item>
      <title>Kubernetes RBAC Visualization</title>
      <dc:creator>Gadi Naor</dc:creator>
      <pubDate>Sun, 05 Apr 2020 15:16:19 +0000</pubDate>
      <link>https://forem.com/alcide/kubernetes-rbac-visualization-48nl</link>
      <guid>https://forem.com/alcide/kubernetes-rbac-visualization-48nl</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F99ehgzrjbwide7d20zs6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F99ehgzrjbwide7d20zs6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Role-based access control (RBAC) is a method of regulating access to a computer or network resources based on the roles of individual users within your organization. RBAC authorization uses the rbac.authorization.k8s.io API group to drive authorization decisions, allowing you to dynamically configure policies through the Kubernetes API.&lt;/p&gt;

&lt;p&gt;Permissions are purely additive and there are no “deny” rules.&lt;/p&gt;

&lt;p&gt;A Role always sets permissions within a particular namespace; when you create a Role, you have to specify the namespace it belongs in. ClusterRole, by contrast, is a non-namespaced resource, and grants access at the cluster level. ClusterRoles have several uses. &lt;br&gt;
You can use a ClusterRole to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Define permissions on namespaced resources and be granted within individual namespaces&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Define permissions on namespaced resources and be granted across all namespaces&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Define permissions on cluster-scoped resources&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Roles are used to define API access rules for resources within the namespace of the role, and ClusterRole is used to define API access across all cluster namespaces.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://github.com/alcideio/rbac-tool#rbac-tool-viz" rel="noopener noreferrer"&gt;Alcide’s rbac-tool viz&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Alcide’s &lt;a href="https://github.com/alcideio/rbac-tool" rel="noopener noreferrer"&gt;rbac-tool&lt;/a&gt;, an open-source tool from Alcide, introduces a visualization functionality of the relationships between the resources that make your cluster RBAC configuration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjf0yx2hsnysiwhax1sl6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjf0yx2hsnysiwhax1sl6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The diagram above captures the various relationship combinations between resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Roles&lt;/strong&gt; -  Defines the policy rules that constitute which API actions (read/create/update/delete) the subject (user/service) is allowed to perform on resources within the namespace resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ClusterRoles&lt;/strong&gt; -  Defines the policy rules that constitute which API actions (read/create/update/delete) the subject (user/service) is allowed to perform on resources cluster-wide.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bindings&lt;/strong&gt;, are the Kubernetes RBAC resources that define the link between principals (users of automated services).&lt;br&gt;
Bindings can point to multiple Roles:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;RoleBindings&lt;/strong&gt; can point to &lt;strong&gt;ClusterRoles&lt;/strong&gt; which grants the subject (user/service) cluster-wide access to the resources specified in the rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ClusterRoleBindings&lt;/strong&gt; can point to &lt;strong&gt;ClusterRoles&lt;/strong&gt; which grants the subject (user/service) cluster-wide access to the resources specified in the rules.&lt;/p&gt;

&lt;h3&gt;
  
  
  Nginx Ingress Controller RBAC
&lt;/h3&gt;

&lt;p&gt;The following diagram shows the moving parts of the RBAC resources created by an Nginx Ingress Controller.&lt;/p&gt;

&lt;p&gt;You can see 2 roles were created:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;A role that defines the allowed resources access within the namespace&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;ClusterRole defines the cluster-wide access permissions&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Note for example that the ClusterRole grants &lt;strong&gt;Nginx-ingress&lt;/strong&gt; account to&lt;br&gt;
&lt;strong&gt;Update&lt;/strong&gt; the resource &lt;strong&gt;status&lt;/strong&gt; of &lt;strong&gt;ingress&lt;/strong&gt; within the &lt;strong&gt;extensions&lt;/strong&gt; and &lt;strong&gt;networking.k8s.io&lt;/strong&gt; API group.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F47z4yi807tmy8to0wiex.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F47z4yi807tmy8to0wiex.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above visualization was generated by running the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ rbac-tool viz --include-subjects="nginx-ingress"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Under the hood, Alcide’s rbac-tool connects to the cluster context pointed by your kubeconfig , lists the various RBAC related resources, and visualize the resources based on the command line filters.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Example: API access for system:unauthenticated Group on GKE&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjvzq77yel9pu11kj3buk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjvzq77yel9pu11kj3buk.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ rbac-tool viz --include-subjects="system:unauthenticated"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Example: GCP permission covered cloud-provider ServiceAccount for GKE&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs80yovnd3bok80hquxdp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fs80yovnd3bok80hquxdp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ rbac-tool viz --include-subjects="^cloud-provider" --exclude-namespaces=""&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Kubernetes RBAC is a critical component in your Kubernetes deployment, which is definitely something cluster operators and builders must master.&lt;br&gt;
Alcide’s &lt;a href="https://github.com/alcideio/rbac-tool" rel="noopener noreferrer"&gt;rbac-tool&lt;/a&gt; visualization and filtering capabilities helps to unfold and simplify Kubernetes RBAC.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Kubernetes RBAC | Moving from ‘It's Complicated’ to ‘In a Relationship’ </title>
      <dc:creator>Gadi Naor</dc:creator>
      <pubDate>Wed, 01 Apr 2020 11:09:48 +0000</pubDate>
      <link>https://forem.com/alcide/kubernetes-rbac-moving-from-it-s-complicated-to-in-a-relationship-1bbm</link>
      <guid>https://forem.com/alcide/kubernetes-rbac-moving-from-it-s-complicated-to-in-a-relationship-1bbm</guid>
      <description>&lt;p&gt;Role-based access control (RBAC) is a method of regulating access to computer or network resources based on the roles of individual users within your organization. RBAC authorization uses the rbac.authorization.k8s.io API group to drive authorization decisions, allowing you to dynamically configure policies through the Kubernetes API.&lt;/p&gt;

&lt;p&gt;Permissions are purely additive and there are no “deny” rules.&lt;/p&gt;

&lt;p&gt;A Role always sets permissions within a particular namespace ; when you create a Role, you have to specify the namespace it belongs in. ClusterRole, by contrast, is a non-namespaced resource, and grants access at the cluster level. ClusterRoles have several uses. &lt;br&gt;
You can use a ClusterRole to:&lt;br&gt;
define permissions on namespaced resources and be granted within individual namespace(s)&lt;br&gt;
define permissions on namespaced resources and be granted across all namespaces&lt;br&gt;
define permissions on cluster-scoped resources&lt;/p&gt;

&lt;p&gt;If you want to define a role within a namespace, use a Role; if you want to define a role cluster-wide, use a ClusterRole.&lt;/p&gt;

&lt;p&gt;Default Cluster Roles&lt;br&gt;
While Kubernetes RBAC is a complex topic, one would always want to implement RBAC in the cluster. For this purpose Kubernetes offers out-of-the-box default cluster roles that can be used as a starting point. &lt;br&gt;
These are visible in the output of kubectl get clusterrole, and four cluster roles you can use right away are:&lt;/p&gt;

&lt;p&gt;cluster-admin&lt;br&gt;
admin&lt;br&gt;
edit&lt;br&gt;
view&lt;/p&gt;

&lt;p&gt;With these roles, you can start to define who can interact with your cluster and in what way. It is highly recommended to follow the principle of least privilege, and grant additional privileges as necessary for work to proceed. &lt;br&gt;
Kubernetes RBAC Resource Relationship&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Dq-mpCvs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fmmsq383f7jm2h5axarr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dq-mpCvs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fmmsq383f7jm2h5axarr.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Example: Nginx Ingress Controller RBAC Policy&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k4-aYuJY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w2ojo1gvi1rzhonhaxa5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k4-aYuJY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w2ojo1gvi1rzhonhaxa5.png" alt="Alt Text"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Explicitly Tuning RBAC Policies - ‘It's Complicated’&lt;br&gt;
Components like Operators or highly privileged controllers that require Cluster wide ‘Read-Only’ but do not necessarily require to read secrets for example, may leave a user to take a shortcut and provision RBAC policy with excessive permissions.&lt;/p&gt;

&lt;p&gt;Kubernetes RBAC additive model does not enable us to implement semantics that capture:&lt;br&gt;
deny access to specific resource groups, &lt;br&gt;
allow access to all other resources.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Gqod3xaD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wp7wliyen2urz86sz9q4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Gqod3xaD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wp7wliyen2urz86sz9q4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we can have the explicit set of policy access rules of all cluster resources - and “subtract” from that group the resources we would like to deny access to - we achieve the above semantics.&lt;/p&gt;

&lt;p&gt;Let’s how we can achieve that:&lt;br&gt;
Run kubectl api-resources and get all of the cluster installed/supported resources and their respective api-groups &lt;br&gt;
Derive the RBAC policy from the above list&lt;br&gt;
Manually tune the policy and reduce any resource and/or api-groups that we wish to deny access to.&lt;/p&gt;

&lt;p&gt;While this method will work, it’s manual, and takes significant effort.&lt;br&gt;
An easier way to achieve this is with Alcide rbac-tool&lt;/p&gt;

&lt;p&gt;rbac-tool - Simplify RBAC Policy Tuning&lt;br&gt;
Alcide rbac-tool has the ability to address this exact use case.&lt;br&gt;
Example: Generate a Role policy that allows create,update,get,list (read/write) everything except secrets, services, networkpolicies in core,apps &amp;amp; networking.k8s.io API groups&lt;br&gt;
rbac-tool  gen --generated-type=Role --deny-resources=secrets.,services.,networkpolicies.networking.k8s.io --allowed-verbs=* --allowed-groups=,extensions,apps,networking.k8s.io&lt;/p&gt;

&lt;p&gt;The generated policy is cluster specific.&lt;br&gt;
For a Kubernetes KIND cluster v1.16 the generated policy looks as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ca062_ar--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/v2a7s88zndwymfrkg4j4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ca062_ar--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/v2a7s88zndwymfrkg4j4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
Kubernetes RBAC helps us as users, to define and regulate API access to the Kubernetes cluster. In many cases where users wish to achieve even more granular controls, Validating Admission Controllers are the Kubernetes construct to achieve that. The Kubernetes ecosystem, and open-source tools such as Alcide’s rbac-tool help to unfold and simplify Kubernetes RBAC. get it here: &lt;a href="https://github.com/alcideio/rbac-tool"&gt;https://github.com/alcideio/rbac-tool&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>rbac</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Unfolding &amp; Sugar Coating for Kubernetes RBAC</title>
      <dc:creator>Gadi Naor</dc:creator>
      <pubDate>Tue, 31 Mar 2020 17:16:02 +0000</pubDate>
      <link>https://forem.com/gadinaor/unfolding-sugar-coating-for-kubernetes-rbac-1g4n</link>
      <guid>https://forem.com/gadinaor/unfolding-sugar-coating-for-kubernetes-rbac-1g4n</guid>
      <description>&lt;h2&gt;
  
  
  Kubernetes RBAC
&lt;/h2&gt;

&lt;p&gt;Role-based access control (RBAC) is a method of regulating access to computer or network resources based on the roles of individual users within your organization.&lt;br&gt;
RBAC authorization uses the &lt;code&gt;rbac.authorization.k8s.io&lt;/code&gt; API group to drive authorization decisions, allowing you to dynamically configure policies through the Kubernetes API.&lt;/p&gt;

&lt;p&gt;Permissions are purely &lt;strong&gt;additive&lt;/strong&gt; (there are &lt;strong&gt;no “deny”&lt;/strong&gt; rules).&lt;/p&gt;

&lt;p&gt;A Role always sets permissions within a particular namespace ; when you create a Role, you have to specify the namespace it belongs in.&lt;br&gt;
ClusterRole, by contrast, is a non-namespaced resource.&lt;br&gt;
ClusterRoles have several uses. You can use a ClusterRole to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;define permissions on namespaced resources and be granted within individual namespace(s)&lt;/li&gt;
&lt;li&gt;define permissions on namespaced resources and be granted across all namespaces&lt;/li&gt;
&lt;li&gt;define permissions on cluster-scoped resources&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to define a role within a namespace, use a Role; if you want to define a role cluster-wide, use a ClusterRole.&lt;/p&gt;
&lt;h1&gt;
  
  
  &lt;code&gt;rbac-tool viz&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;A Kubernetes RBAC visualizer that generate a graph as dot file format or in HTML format.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XtyXpSHW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/alcideio/rbac-tool/master/img/rbac-viz-html-example.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XtyXpSHW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/alcideio/rbac-tool/master/img/rbac-viz-html-example.png" alt="rbac-tool" width="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By default 'rbac-tool viz' will connect to the local cluster (pointed by kubeconfig)&lt;br&gt;
Create a RBAC graph of the actively running workload on all namespaces except kube-system&lt;/p&gt;

&lt;p&gt;See run options on how to render specific namespaces, other clusters, etc.&lt;/p&gt;

&lt;p&gt;Render Locally&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rbac-tool viz --outformat dot &amp;amp;&amp;amp; cat rbac.dot | dot -Tpng &amp;gt; rbac.png  &amp;amp;&amp;amp; open rbac.png
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Render Online&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://dreampuf.github.io/GraphvizOnline
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Examples:&lt;/p&gt;

&lt;p&gt;Scan the cluster pointed by the kubeconfig context 'myctx'&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rbac-tool viz --cluster-context myctx
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Scan and create a PNG image from the graph&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rbac-tool viz --outformat dot --exclude-namespaces=soemns &amp;amp;&amp;amp; cat rbac.dot | dot -Tpng &amp;gt; rbac.png &amp;amp;&amp;amp; google-chrome rbac.png
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Installation instructions can be found here: &lt;strong&gt;&lt;a href="https://github.com/alcideio/rbac-tool"&gt;rbac-tool&lt;/a&gt;&lt;/strong&gt; &lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>security</category>
      <category>rbac</category>
      <category>visualization</category>
    </item>
  </channel>
</rss>
