<?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 Stefan Büringer on Medium]]></title>
        <description><![CDATA[Stories by Stefan Büringer on Medium]]></description>
        <link>https://medium.com/@sbueringer?source=rss-4ae62690465a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*egjqwOh23Gbya5mZ4PR3zQ.jpeg</url>
            <title>Stories by Stefan Büringer on Medium</title>
            <link>https://medium.com/@sbueringer?source=rss-4ae62690465a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 01 Jun 2026 11:26:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sbueringer/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[Optimizing Open Policy Agent-based Kubernetes Authorization via Go Execution Tracer]]></title>
            <link>https://itnext.io/optimizing-open-policy-agent-based-kubernetes-authorization-via-go-execution-tracer-7b439bb5dc5b?source=rss-4ae62690465a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b439bb5dc5b</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[open-policy-agent]]></category>
            <category><![CDATA[execution-tracer]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Stefan Büringer]]></dc:creator>
            <pubDate>Mon, 25 Feb 2019 18:25:00 GMT</pubDate>
            <atom:updated>2019-02-25T18:52:43.576Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<p>As explained in <a href="https://itnext.io/kubernetes-authorization-via-open-policy-agent-a9455d9d5ceb">Kubernetes Authorization via Open Policy Agent</a>, OPA can be used to enforce authorization and admission policies in Kubernetes. Unfortunately, depending on your workload there are a few caveats when getting this in production. This blog post explains how OPA and <a href="https://github.com/open-policy-agent/gatekeeper">Kubernetes Policy Controller</a> (which has been renamed lately to Gatekeeper) can be fine-tuned for production usage. This blog is based on OPA 0.10.3 and our <a href="https://github.com/c445/kubernetes-policy-controller">forked Kubernetes Policy Controller</a> (we have not yet migrated to Gatekeeper).</p><h3>Recap</h3><p>As shown in the following diagram the Kubernetes Policy Controller (and therefore OPA) is called by the Kubernetes API Server in the following situations:</p><ul><li>For every authorized request to the Kubernetes API Server, i.e. almost every request</li><li>Potentially for every create/update/delete on resources, depending on how the MutatingWebhook is configured</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-s7y7xbncJB7Fqy0Zuxe4A.png" /><figcaption>Overview OPA integration for Kubernetes Authorization &amp; Admission</figcaption></figure><p>So obviously there’s a lot of potential to introduce latency when this is done wrong. The following sections show how we optimized the performance in our clusters.</p><h3>Baseline cluster</h3><p>In our baseline cluster a lot of the requests to the Kubernetes API Server originate from an operator which manages deployments of Helm Charts via CRDs. So there’s a steady stream of requests like creating Namespaces, updating Services/Deployments/Statefulsets and of course modifying the CRDs itself. I’m reproducing this use case via <a href="https://github.com/tsenart/vegeta">Vegeta</a> and the following mixture of requests:</p><ul><li>75% authorization only requests, e.g.: list Pods, get Services and watch Namespaces</li><li>25% admission requests, e.g.: update CRDs, delete Deployments and update Services (admission requests are also authorized before they are sent to the MutatingWebhook)</li></ul><p>Open Policy Agent is run with GO_MAX_PROCS=2. Vegeta is used with the following settings:</p><ul><li>60 s duration</li><li>20 concurrent connections</li><li>75 requests per second</li></ul><p>The baseline latencies measured when calling OPA directly from Vegeta are:</p><ul><li>Mean: 7.24 s</li><li>Quantile 50, 95, 99, max: 4.79 s, 24.01 s, 29.13 s, 31.54 s</li><li>About 13% of the requests got a timeout</li></ul><h3>Only send requests to the MutatingWebhook which should actually be validated</h3><p>Obviously OPA isn’t running very well. The first problem we identified is that it’s not really feasible to validate every object via the MutatingWebhook.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9718e12d0d24fb2d73fefb0540a061ef/href">https://medium.com/media/9718e12d0d24fb2d73fefb0540a061ef/href</a></iframe><p>So we restricted our MutatingWebhook to validate only the objects which are actually mentioned in our OPA policies:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e9bd4aaa12648a3d766e2834726ca546/href">https://medium.com/media/e9bd4aaa12648a3d766e2834726ca546/href</a></iframe><p>We don’t really want to validate deletions of objects, so now we’re only validating CREATE and UPDATE requests. All other listed resources are actually validated through our policies. A huge gain in performance was that we’re no longer validating resources like ConfigMaps. Usually a lot of configuration is stored via ConfigMaps and this comes at a huge performance penalty when Open Policy Agent parses all these resources. Especially, because OPA builds an Abstract Syntax Tree for every query.</p><p>So after changing the MutatingWebhookConfiguration we’re now getting less and smaller requests. The latencies with these optimizations are now:</p><ul><li>Mean: 3.22 s</li><li>Quantile 50, 95, 99, max: 1.04 s, 11.29 s, 13.32 s, 16.19 s</li><li>We’re still getting timeouts, but only for about 0.23% of the requests</li></ul><h3>Don’t send the old resource on Update AdmissionRequests</h3><p>The next optimization addresses Kubernetes Policy Controller. It sends requests like the following to OPA:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2eb1901b6048c62e36a97b8617194967/href">https://medium.com/media/2eb1901b6048c62e36a97b8617194967/href</a></iframe><p>The resources are basically sent twice to the MutatingWebhook on every update request. The old version in the oldObject field and the new version as object. Because our policies only apply on the new resource anyway, we removed the oldObject from the requests. This led to another performance improvement as we reduced the query size significantly:</p><ul><li>Mean: 790 ms</li><li>Quantile 50, 95, 99, max: 13 ms, 3.21 s, 3.92 s, 4.78 s</li><li>No timeouts</li></ul><h3>Go Garbage Collection</h3><p>To find out why certain requests are slow, the <a href="https://golang.org/pkg/net/http/pprof/">tracing pprof</a> endpoint was added to OPA and we took a look at the trace via <a href="https://blog.gopheracademy.com/advent-2017/go-execution-tracer/">Go Execution Tracer</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*89wTn6BsehrC-zrZ0zzsHA.png" /><figcaption>Go Trace with GOGC=100</figcaption></figure><p>It’s noticeable that there are a lot of Garbage Collections which only free up ~2–5 MB of memory. Those were mostly triggered from inside the AST parser. Of course this costs a lot of CPU time. We also added some <a href="https://medium.com/observability/debugging-latency-in-go-1-11-9f97a7910d68">tracing regions</a>. The most important code regions are <a href="https://github.com/open-policy-agent/opa/blob/v0.10.3/server/server.go#L1462-L1463">validating</a> and <a href="https://github.com/open-policy-agent/opa/blob/v0.10.3/server/server.go#L1489">executing</a> the query. The histograms provided some insights where the time is actually spent and lost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WjAGpvy3CmMuYD7wkoJArg.png" /><figcaption>Histogram of critical code regions with GOGC=100</figcaption></figure><p>When drilling into the slow runs of validate query it’s obvious that most time is spent waiting for scheduling:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xpzDCP5P82tOdrC7q1dhTg.png" /><figcaption>Table of time spent in the slowest executions of validate query</figcaption></figure><p>The conclusion was that all this is probably caused by the very frequent GC runs. To reduce the amount of GC cycles we set GOGC=1000. The following is the trace when running OPA with the new GOGC setting:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2K-0-ufuS6AyIwHYTjbaVg.png" /><figcaption>Go Trace with GOGC=1000</figcaption></figure><p>The obvious difference is that we now have a lot less GC cycles and they free up ~30–40 MB of memory. I think it’s important to hit the sweet spot between too less GC cycles which leads to increased memory usage and too much GC cycles which slows down the application. If the GOGC value is set too high and the GC is therefore run less frequently, the GC duration also increases because there is more memory to free up. This may lead to latency spikes when the GC is eventually run. The time spent to validate and execute the queries are also improved:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KF_Hbs8zrvn_QOe0H7kmuw.png" /><figcaption>Histogram of critical code regions with GOGC=1000</figcaption></figure><p>Be careful, although GOGC=1000 seems like a good value for us, this depends highly on your workload/queries.</p><p>The latency improved to:</p><ul><li>Mean: 15 ms</li><li>Quantile 50, 95, 99, max: 13 ms, 26 ms, 41 ms, 175 ms</li></ul><h3>Optimize Authorization query format</h3><p>Although we optimized the GC, we still had a few requests which took far too long. We took a closer look at authorization queries, because they represent by far the majority of our requests to OPA:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fbc11a62238ba86dd54f2036fbfcd64c/href">https://medium.com/media/fbc11a62238ba86dd54f2036fbfcd64c/href</a></iframe><p>This format was originally chosen to have a consistent query format with the admission requests. Obviously most of the fields like resourceAttributes or user and group are required to make useful authorization decision. But there is also a lot of overhead like the deep nested structure or the status and metadata fields. So we stripped the format to the bare minimum:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d66d01e4c3b72bf8dede1975da0971de/href">https://medium.com/media/d66d01e4c3b72bf8dede1975da0971de/href</a></iframe><p>OPA should now be able to parse this a lot faster then the previous format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FX6YVHItlfuxGWVENO1eRw.png" /><figcaption>Go Trace with GOGC=1000 &amp; optimized Authorization query</figcaption></figure><p>Notable differences are:</p><ul><li>The GC cycles are less frequent than before because we consume less memory. Time between GC cycles increased from 250 ms to 400 ms.</li><li>Goroutines aren’t waiting as long as before until they get scheduled. Peak runnable Goroutines dropped from 68 to 3 because most of our requests can be handled a lot faster.</li></ul><p>If we take a look at the histograms we see a huge improvement:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*8soeZdOc1No_g9YkOPLqdA.png" /><figcaption>Histogram of critical code regions with GOGC=1000 &amp; optimized Authorization query</figcaption></figure><p>The latencies improved to:</p><ul><li>Mean: 9 ms</li><li>Quantile 50, 95, 99, max: 6 ms, 24 ms, 42 ms, 90 ms</li></ul><h3>Future optimization: Server-side Apply</h3><p>Currently, kubectl apply implements the logic that resources are only applied if there is a difference between the current resources and the new resource version. Because we’re using client-go directly in our operator and haven’t implemented optimizations for this, a lot of resources are applied even when there are no changes. All these requests have to be validated by our MutatingWebhook. As soon as <a href="https://github.com/kubernetes/enhancements/issues/555">server-side apply</a> is implemented in Kubernetes, we expect that a lot of these requests aren’t sent to the MutatingWebhook anymore and that this helps drive down the latencies even more.</p><h3><strong>Conclusion</strong></h3><p>Finally we got the performance we require to putting OPA-based authorization into production. The following table shows an overview over the optimization steps:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/142570d643ae741886c27501b75aaaab/href">https://medium.com/media/142570d643ae741886c27501b75aaaab/href</a></iframe><p>Depending on how you use Kubernetes, this optimizations may provide a huge performance improvement regarding Kubernetes API Server latencies.</p><p>Thanks to my team for bearing with me during a few days of performance debugging :). A big shout-out to all contributors of Go execution tracer, it’s an invaluable tool to investigate Go performance. Thanks to all contributors of Open Policy Agent and Kubernetes Policy Controller/Gatekeeper.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b439bb5dc5b" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/optimizing-open-policy-agent-based-kubernetes-authorization-via-go-execution-tracer-7b439bb5dc5b">Optimizing Open Policy Agent-based Kubernetes Authorization via Go Execution Tracer</a> was originally published in <a href="https://itnext.io">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Authorization via Open Policy Agent]]></title>
            <link>https://itnext.io/kubernetes-authorization-via-open-policy-agent-a9455d9d5ceb?source=rss-4ae62690465a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9455d9d5ceb</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[open-policy-agent]]></category>
            <category><![CDATA[authorization]]></category>
            <dc:creator><![CDATA[Stefan Büringer]]></dc:creator>
            <pubDate>Wed, 09 Jan 2019 18:31:25 GMT</pubDate>
            <atom:updated>2019-03-06T04:00:14.308Z</atom:updated>
            <content:encoded><![CDATA[<p>In a best-practice Kubernetes cluster every request to the Kubernetes APIServer is authenticated and authorized. <a href="https://kubernetes.io/docs/reference/access-authn-authz/authorization/">Authorization </a>is usually implemented by the <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/">RBAC</a> authorization module. But there are alternatives and this blog post explains how to implement advanced authorization policies via <a href="https://www.openpolicyagent.org/">Open Policy Agent (OPA)</a> by leveraging the <a href="https://kubernetes.io/docs/reference/access-authn-authz/webhook/">Webhook</a> authorization module. There’s also another blog post about how to fine-tune this solution for production (<a href="https://itnext.io/optimizing-open-policy-agent-based-kubernetes-authorization-via-go-execution-tracer-7b439bb5dc5b">Optimizing Open Policy Agent-based Kubernetes Authorization via Go Execution Tracer</a>).</p><h3>Motivation</h3><p>We are a team providing managed Kubernetes clusters to our company-internal customers. To provide a near upstream Kubernetes experience, we want to grant our customers cluster-admin-like access. But to ensure baseline security and stability, we don’t want to grant full cluster-admin privileges. For example:</p><ul><li>We want to allow full access to any namespace except `kube-system`, because our infrastructure (e.g. monitoring &amp; logging) is deployed there.</li><li>We want to enforce a PodSecurityPolicy which doesn’t allow running containers as `root` user or the direct mount of `hostPath` volumes.</li></ul><p>Our first implementation was implemented via Kubernetes RBAC and a custom operator. The basic idea was to grant all necessary rights via RBAC RoleBindings. So we gave our customers the ClusterRole `admin` for every namespace except `kube-system` (via the operator). Every time we found that something wasn’t working as expected we added additional rights, either via a per-namespace Role or via a ClusterRole. This lead to a lot of individual rules for specific use-cases and wasn’t really maintainable in the long term. Especially as our user base continues to grow it’s not really feasible to adjust the Roles whenever somebody detects an edge cases which doesn’t work with our configuration.</p><p>So instead of configuring authorization based on a whitelist we switched to a blacklist-based model. What we actually wanted was to give our customers cluster-admin access and only restrict some specific rights. Therefore an implementation based on a blacklist via Open Policy Agent was a natural fit.</p><h4>Whitelist vs. Blacklist-based Authorization</h4><p>Most requirements regarding Authorization can be implemented by simply using the RBAC authorization module via Roles and RoleBindings, which are explained in <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/">Using RBAC Authorization</a>. But RBAC is by design limited to whitelisting, i.e. for every requests it’s checked if one of the Roles and RoleBindings apply and in that case the request is approved. Requests are only denied if there is no match, there is no way to deny requests explicitly. At first this doesn’t sound like a big limitation, but some specific use cases require more flexibility. For example:</p><ul><li>A user should be able to create/update/delete pods in all namespaces except `kube-system`. The only way to implement this via RBAC is to assign the rights on a per-namespaces basis, e.g. by deploying a ClusterRole and a per-namespace RoleBinding. If the namespaces change over time you have to either deploy this RoleBindings manually or run an operator for this.</li><li>A Kubernetes cluster is provided with pre-installed StorageClasses. A user should be able to create/update/delete custom StorageClasses, but he shouldn’t be able to modify the pre-installed ones. If this would be implemented via RBAC, the user must have the right to create StorageClasses and as soon as he creates a StorageClass additional rights must be assigned to update and delete this StorageClass. As above, this could be implemented via an operator.</li></ul><p>When you have lot of this use cases, you’ll get a lot of custom logic implemented via operators. Sooner or later this doesn’t scale, because with a lof of operators and accompanying RBAC Roles it gets really hard to understand what rights a user actually has. We will show that both cases can be implemented easier via Open Policy Agent.</p><h4>Webhook Authorization Module vs. ValidatingWebhook &amp; MutatingWebhook</h4><p>Some advanced use cases can also be implemented via <a href="https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/">Dynamic Admission Control</a>, i.e. ValidatingWebhook or MutatingWebhook. There are also blog posts which dive into how Open Policy Agent can be used for this: <a href="https://medium.com/@jimmy.ray/policy-enabled-kubernetes-with-open-policy-agent-3b612b3f0203">Policy Enabled Kubernetes with Open Policy Agent</a> and <a href="https://itnext.io/kubernetes-compliance-with-open-policy-agent-3d282179b1e9">Kubernetes Compliance with Open Policy Agent</a>. Dynamic Admission Control has the limitation that the webhooks are only called for create, update and delete events on Kubernetes resources. So it’s for example impossible to deny get requests. But they also have advantages compared to the Webhook authorization module because they can deny requests based on the content of a Kubernetes resource. These are informations the Webhook authorization module has no access to. For reference, the Webhook authorization module decides based on <a href="https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/authorization/types.go#L30">SubjectAccessReviews</a>, whereas the ValidatingWebhook and MutatingWebhook decide based on <a href="https://github.com/kubernetes/api/blob/master/admission/v1beta1/types.go#L29">AdmissionReviews</a>. In our implementation we’ve integrated OPA via authorization module and via MutatingWebhook.</p><h3>Architecture</h3><p>This section shows on a conceptual level how Kubernetes is integrated with Open Policy Agent. Because the Open Policy Agent itself doesn’t implement the REST interface required by Kubernetes, the Kubernetes Policy Controller translates Kubernetes SubjectAccessReviews and AdmissionReviews into Open Policy Agent queries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-s7y7xbncJB7Fqy0Zuxe4A.png" /></figure><p>For every request the Kubernetes API Server receives, the following sequence is executed:</p><ol><li>The request is authenticated.</li><li>Based on the user information extracted by the authentication the request is authorized:<br>1. First the Webhook is called. In our case, the Webhook can either deny the request or forward it to RBAC. The Kubernetes Webhook can also allow requests, but that’s not implemented in Kubernetes Policy Controller.<br> 2. Second the RBAC module is executed. If RBAC doesn’t allow the request, the request is denied.</li><li>If the request leads to a change in the persistence, e.g. create/update/delete a resource, Admission Controllers are executed (MutatingWebhook is only one of them). Read more about Admission Controllers <a href="https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/">here</a>.</li></ol><p>So depending on what exactly we want to deny, we now can implement authorization or admission OPA policies. Further information how this scenario is configured can be found here <a href="https://github.com/open-policy-agent/kubernetes-policy-controller">open-policy-agent/kubernetes-policy-controller (Authorization scenario)</a>.</p><h3>Examples</h3><p>This section shows how this setup is used to implement the use cases described above.</p><h4>Create/update/delete pods in every namespace except kube-system</h4><p>The basic idea is to grant create/update/delete rights on pods cluster-wide via RBAC and then OPA policies are used to deny access to pods in kube-system. First of all, we grant the group `user` the rights to create/update/delete pods:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/888494ae4f5e17f02b7e0d31db4adf66/href">https://medium.com/media/888494ae4f5e17f02b7e0d31db4adf66/href</a></iframe><p>Now every user in the group `user` is allowed to create/update/delete pods cluster-wide. To restrict these rights via OPA the following policy is deployed:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d020fa4dd17bf9265c0f9438e5c10530/href">https://medium.com/media/d020fa4dd17bf9265c0f9438e5c10530/href</a></iframe><p><strong>Notes:</strong></p><ul><li>We have to exclude `system:kube-controller-manager` and `system:kube-scheduler`, because both the Kubernetes controller manager as well as the scheduler have to be able to access pods.</li><li>By simply removing `resource.spec.resourceAttributes.resource = “pods”` from the policy, we could restrict access to all namespaced resources in `kube-system`.</li><li>We have to be careful to deny the correct verbs. A simple `delete` in RBAC allows `delete` and `deletecollection` (cf. <a href="https://kubernetes.io/docs/reference/access-authn-authz/authorization/">Authorization Overview</a>).</li><li>Open Policy Agent makes it also very easy to write unit tests for all our policies. For more information, see <a href="https://www.openpolicyagent.org/docs/how-do-i-test-policies.html">How Do I Test Policies?</a>.</li></ul><h4>Create/update/delete on specific StorageClasses</h4><p>In this example, we want to grant the user create/update/delete rights to all StorageClasses except `ceph`. As in the first example, we have to grant the user access via RBAC:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e995d767c8fe6da21b4f8c35f0aeb6e/href">https://medium.com/media/1e995d767c8fe6da21b4f8c35f0aeb6e/href</a></iframe><p>Now we’re denying access to the StorageClass `ceph` via OPA. So we’re deploying the following policy:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/587a48657d375575e8908f6f930d2cda/href">https://medium.com/media/587a48657d375575e8908f6f930d2cda/href</a></iframe><p>An unit test for this policy can be implemented like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/33a2a482cc786b562ff9ab718a19f660/href">https://medium.com/media/33a2a482cc786b562ff9ab718a19f660/href</a></iframe><h3>Conclusion</h3><p>In summary, OPA allows far more flexible policies compared to the built-in RBAC authorization, especially if no additional operator is used. In my opinion it would be nice to have direct integration for OPA as Authorization Module and Admission Controller, but in the meantime Kubernetes Policy Controller bridges the gap between Kubernetes and OPA. Some inspirations what can be implemented:</p><ul><li>Deny access to specific CustomResourceDefinitions, e.g. `calico`</li><li>Deny access to specific ClusterRoles, e.g. `cluster-admin`, `admin`, `edit`, `view`</li><li>Allow port-forward only to some specific pods in `kube-system`</li><li>Create a mapping which PodSecurityPolicies can be used in which namespaces</li><li>Allow access to ValidatingWebhookConfigurations except some pre-installed ones</li></ul><p>What do you think about Open Policy Agent as policy engine for Kubernetes? What are your use-cases and are they already covered by RBAC? If not, what would you like to implement via the Open Policy Agent?</p><p>If you’re planning to use policy enforcement via Open Policy Agent in production, I’ll recommend to also read <a href="https://itnext.io/optimizing-open-policy-agent-based-kubernetes-authorization-via-go-execution-tracer-7b439bb5dc5b">Optimizing Open Policy Agent-based Kubernetes Authorization via Go Execution Tracer</a>.</p><p>If there are any further questions, just write a comment or contact me via <a href="https://twitter.com/sbueringer">@sbueringer</a>.</p><p>Thanks to <a href="https://twitter.com/bavarian_bidi">Mario Constanti </a>and <a href="https://twitter.com/chrischdi">Christian Schlotter</a> for their help during the implementation and reviewing this Blogpost :). Thanks to all contributors of Open Policy Agent and Kubernetes Policy Controller especially to <a href="https://github.com/rite2nikhil">Nikhil Bhatia</a> and <a href="https://github.com/tsandall">Torin Sandall</a> for their support for our implementation of the authorization module integration of Open Policy Agent.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9455d9d5ceb" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/kubernetes-authorization-via-open-policy-agent-a9455d9d5ceb">Kubernetes Authorization via Open Policy Agent</a> was originally published in <a href="https://itnext.io">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Highlights of Open Source Summit 2018]]></title>
            <link>https://medium.com/@sbueringer/highlights-of-open-source-summit-2018-4120c20f852f?source=rss-4ae62690465a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4120c20f852f</guid>
            <category><![CDATA[linux-kernel]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Stefan Büringer]]></dc:creator>
            <pubDate>Sun, 18 Nov 2018 17:34:28 GMT</pubDate>
            <atom:updated>2018-11-18T17:34:28.556Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FdL-Bw7vALZQSJexnlvfxQ.jpeg" /></figure><p>I was at the Open Source Summit this week in Edinburgh. This blog post summarizes my personal highlights:</p><p>Linux:</p><ul><li>An introduction to control groups, Michael Kerrisk <a href="http://man7.org/conf/osseu2018/cgroups_introduction-OSS.eu-2018-Kerrisk.pdf">[Slides]</a></li><li>What’s new in control groups v2, Michael Kerrisk [<a href="http://man7.org/conf/osseu2018/cgroups_v2-OSS.eu-2018-Kerrisk.pdf">Slides</a>]</li><li>Understanding user namespaces, Michael Kerrisk <a href="http://man7.org/conf/osseu2018/understanding_user_namespaces-OSS.eu-2018-Kerrisk.pdf">[Slides]</a></li><li>Using seccomp to limit the kernel attack surface, Michael Kerrisk <a href="http://man7.org/conf/elce2018/seccomp-ELCE-2018-Kerrisk.pdf">[Slides]</a><a href="https://www.youtube.com/watch?v=-hmG5An2bN8&amp;t=0s&amp;list=PLbzoR-pLrL6qThA7SAbhVfuMbjZsJX1CY">[Video]</a></li><li>Improve Linux User-Space Core Libraries with Restartable Sequences, Mathieu Desnoyers</li><li>MM 101: Introduction to Linux Memory Management, Christoph Lameter</li><li>Fun with Dynamic Kernel Tracing Events, Steven Rostedt <a href="https://schd.ws/hosted_files/osseu18/14/oss-eu-2018-fun-with-dynamic-trace-events_steven%20rostedt.pdf">[Slides]</a></li><li>Modern Strace, Dmitry Levin</li><li>Super Fast Packet Filtering with eBPF and XDP, Helen Tabunshchyk <a href="https://schd.ws/hosted_files/osseu18/35/oss_ebpf_xdp.pdf">[Slides]</a></li><li>Kernel Analysis using eBPF, Daniel Thompson <a href="https://www.youtube.com/watch?v=AZTtTgni7LQ&amp;t=0s&amp;list=PLbzoR-pLrL6qThA7SAbhVfuMbjZsJX1CY">[Video]</a></li></ul><p>Kubernetes:</p><ul><li>Data mobility for Kubernetes Persistent Volumes</li><li>Thanos — High Availability and Long Term Storage of Prometheus Metrics, Bartek Plotka <a href="https://speakerdeck.com/bwplotka/thanos-prometheus-at-scale-os-summit-eu">[Slides]</a></li><li>What are my microservices doing?, Juraci Paixão Kröhling <a href="https://schd.ws/hosted_files/osseu18/c7/ossummit-eu-2018-what-are-my-microservices-doing.pdf">[Slides]</a></li><li>Full Stack Observability with Elastic: Logs, Metrics and Traces, Carlos Pérez-Aradros <a href="https://schd.ws/hosted_files/osseu18/39/Full%20Stack%20Visibility%20with%20Elastic_%20Logs%2C%20Metrics%20and%20Traces%20-%20OSS%20Europe%202018%20%282%29.pdf">[Slides]</a></li></ul><p>Misc:</p><ul><li>Hashicorp Terraform: Deep Dive with no Fear, Victor Turbinsky</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4120c20f852f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>