<?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[Permit.io - Medium]]></title>
        <description><![CDATA[Permit.io transforms the authorization experience by providing developers (and all stakeholders) with a comprehensive, easy-to-use authorization framework — allowing them to connect people and systems in a faster, easier, and more secure way. - Medium]]></description>
        <link>https://medium.com/permit-io?source=rss----954b89c36226---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Permit.io - Medium</title>
            <link>https://medium.com/permit-io?source=rss----954b89c36226---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 16 May 2026 02:00:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/permit-io" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Access Management - from scary to simple with one open-source tool]]></title>
            <link>https://medium.com/permit-io/access-management-from-scary-to-simple-with-one-open-source-tool-5112830fe79f?source=rss----954b89c36226---4</link>
            <guid isPermaLink="false">https://medium.com/p/5112830fe79f</guid>
            <category><![CDATA[open-policy-agent]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[access-control]]></category>
            <category><![CDATA[authorization]]></category>
            <dc:creator><![CDATA[Filip]]></dc:creator>
            <pubDate>Wed, 29 Mar 2023 09:53:53 GMT</pubDate>
            <atom:updated>2023-03-29T09:53:52.960Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*77f8POMyL7kSbufrV7uu6w.png" /></figure><p>TLDR; Open source code promotes innovation, collaboration, and transparency in software development. OPA is a powerful policy engine that helps manage access control in microservice architectures, and has been adopted by major companies such as Netflix. However, OPA alone may not be sufficient for some policy enforcement needs. OPAL, an open-source project, complements OPA by addressing these limitations and is already being used by companies like Tesla, Cisco, and the NBA.</p><h3>Why Open Source?</h3><p>Open source code plays a crucial role in the world of software development. It allows developers from around the globe to access, modify, and contribute to the source code of various projects, resulting in a powerful knowledge-sharing ecosystem. By making software freely available, open source promotes the rapid evolution of technology and ensures that solutions are accessible to a broader audience. This collaborative approach helps accelerate problem-solving, encourages the development of better and more reliable software, and drives the growth of vibrant developer communities. Furthermore, open source enables individuals and organizations to build upon existing solutions, reducing the duplication of effort, lowering entry barriers, and empowering even small teams to create powerful, feature-rich applications.</p><h3>Access Control is Hard</h3><p>Developing access control is not an easy task, especially considering <a href="https://www.permit.io/blog/achieving-modern-authorization">today’s microservice architectures</a>: many authorization points are required by design, and changing requirements and regulations from various departments constantly challenge the solution. Moreover, <strong>even a minor bug in this sensitive layer can have a devastating effect</strong> on your organization.</p><p>To successfully build an access control layer, it is necessary to embrace some <a href="https://www.permit.io/blog/5-best-practices-for-building-cloud-native-permissions">best practices</a> — One of which is to decouple policy from code. This can be done using <strong>a policy engine </strong>such as <a href="https://www.permit.io/blog/introduction-to-opa">Open Policy Agent (OPA)</a>.</p><h3>OPA: Separating policy from code</h3><p>OPA, an all-purpose policy engine OSS project, was introduced several years back to reinvent how we enforce permissions throughout the stack. Since its inception, OPA became a CNCF graduate (alongside Kubernetes) and was battle-tested by major players like Goldman Sachs and <a href="https://www.permit.io/blog/netflix-authz">Netflix</a>.</p><p>OPA is very efficient and built for performance — It keeps the policy and data for which it needs to evaluate the rules in the cache, and supports having multiple instances as sidecars to every microservice, thus avoiding network latency.</p><p>OPA’s policy rules are written in Rego — a high-level declarative (Datalog-like) language. Here is an example:</p><pre>default allow = false<br>allow = true { <br> input.type == &quot;writer&quot;<br>     input.action == &quot;create&quot;<br>     input.resource == &quot;article&quot;<br>}</pre><p>Here is a high-level overview of how OPA works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S2Fubzabw1U9Pt6fZRC_jA.png" /></figure><p>OPA is really powerful and can solve a lot of policy-related issues. Having said that, for some policies, OPA isn’t enough, and another solution is needed.</p><h3>Taking OPA to the next level</h3><p>While OPA is a strong candidate for all permissions-related needs, there are cases where OPA might not be enough.</p><p>For example, let’s say that our policy requires that a user will be a subscriber to see parts of our site. In this case, to make a policy decision, we need to know the user’s subscription status from our billing service (e.g. PayPal or Stripe) and know every time it is changing: a new subscriber expects immediate access to our site, and a churned user should lose access on the spot.</p><p>To make the data accessible to OPA, we will need to develop a pushing mechanism that will update OPA in real-time, which requires additional planning and development.</p><p>There are additional cases for which OPA isn’t enough:</p><ul><li>When your policy relies on multiple data sources for decisions, you need to use the <a href="https://www.openpolicyagent.org/docs/latest/external-data/#option-3-bundle-api">bundle API</a>, which is not really straightforward to implement.</li><li>When you have multiple OPA instances, you need to build your tools to keep them in sync.</li></ul><p>OPA was adopted by giants like Netflix, and they faced the same challenges. Let’s take a look at how they overcame their issues.</p><h3>Learning from giants — Netflix &amp; OPA</h3><p>There are three things that Netflix implemented in their architecture that utilize OPA, which allowed them to have an effective solution.</p><ol><li><strong>Running Multiple OPA Instances Simultaneously</strong>: Netflix’s architecture incorporates numerous OPA instances, each operating locally on a service’s pod and equipped with its own authorization agent. By doing so, they significantly reduce network latency when querying OPA, ensuring a smoother and more efficient authorization process.</li><li><strong>Real-time Policy and Data Synchronization</strong>: Netflix’s authorization system relies on certain inputs not included in OPA’s data, such as employee-department associations. To address this, they developed a microservice called an “Aggregator” that gathers data from various sources and keeps it up to date in real-time. Additionally, they implemented another microservice, the “Distributor,” which ensures that all OPA instances remain synchronized and current.</li><li><strong>Empowering Developers with Self-service Policy Creation</strong>: As a large organization, Netflix needed a scalable solution that granted developers the autonomy to define policies for their respective services. To achieve this, they designed the “Policy Portal” — a user-friendly website that automatically generates Rego code based on user-defined rules. Once a policy is created or updated, it’s versioned and stored in a dedicated policy database.</li></ol><p>There is one issue with this solution — Netflix never made it public.</p><h3>That’s what OPAL is here for!</h3><p><a href="https://github.com/permitio/opal">Open Policy Administration Layer (OPAL)</a> is an OSS project invented to aid with OPA management, essentially open-sourcing Netflix’s solution. OPAL is an administration layer for the OPA agents, which keeps them updated in real-time with data and policy updates. Since its creation, OPAL has been adopted by major players such as Tesla, Cisco, Palo Alto Networks, multiple banks and even the NBA as the administration layer for their OPA agents.</p><p>OPAL offers two remarkable features that have garnered widespread appreciation among numerous organizations:</p><ul><li>The ability to <strong>monitor a specific policy repository</strong> (like GitHub, GitLab, or Bitbucket) for updates. It does this by either using a webhook or checking for changes every few seconds. This makes the system act as a Policy Administration Point (PAP), which sends the policy changes to OPA, the Policy Decision Point (PDP) in this case. This ensures that OPA is always up to date.</li><li>The ability to <strong>track any relevant data source</strong> (API, Database, external service) for updates via a REST API, and fetch up-to-date data back into OPA.</li></ul><p>Designing access control and managing permissions for cloud-native or microservice-based products can be a complex endeavor. The inherent nature of distributed applications and microservices demands numerous authorization points, while evolving requirements from different departments continuously put pressure on every authorization solution. Furthermore, even the slightest oversight in the authorization layer may result in severe consequences for your application, leading to security vulnerabilities and potential privacy or compliance issues. Therefore, it is vital to diligently approach and handle these challenges to ensure robust and secure applications.</p><p>You can join <a href="https://permit-io.slack.com/">OPAL’s Slack community</a> to chat with other devs who use OPAL for their projects, <a href="https://github.com/permitio/opal">contribute to the Open-source project</a>, or<a href="https://twitter.com/opal_ac"> follow OPAL on Twitter </a>for the latest news and updates.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5112830fe79f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/permit-io/access-management-from-scary-to-simple-with-one-open-source-tool-5112830fe79f">Access Management - from scary to simple with one open-source tool</a> was originally published in <a href="https://medium.com/permit-io">Permit.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build authorization like Netflix with Open Source?]]></title>
            <link>https://medium.com/permit-io/how-to-build-authorization-like-netflix-with-open-source-a67aa117203a?source=rss----954b89c36226---4</link>
            <guid isPermaLink="false">https://medium.com/p/a67aa117203a</guid>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[open-policy-agent]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Daniel Bass]]></dc:creator>
            <pubDate>Thu, 16 Mar 2023 13:40:53 GMT</pubDate>
            <atom:updated>2023-03-16T13:40:53.078Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QgfZW1Bbuot3G8rTjGa_bQ.jpeg" /></figure><p><em>This blog is based on the video “</em><a href="https://www.youtube.com/watch?v=zsYdGrdDoDE"><strong><em>Build Authorization like Netflix with Open Source</em></strong></a><em>”</em></p><p>Netflix has over 220 million active users and is worth over 100 billion dollars. With such an enormous user base, they are responsible for managing a vast amount of personal information. A big part of that is ensuring relevant people have the permissions required to access that information, while others do not.</p><p>How does Netflix handle the challenge of <strong>managing its authorization</strong>? Where does <strong>open-source</strong> come in? How can you adopt this solution? (Or build something <strong>even better</strong>) Let’s find out.</p><h3>With Great Power -</h3><p>In 1997, Netflix was little more than an upstart DVD rental company. Fast forward two decades, and Netflix has become one of the biggest TV and movie studios in the world.</p><p>As a company grows, the responsibility it has towards its customers grows as well, and security becomes increasingly important with every new user joining the platform.</p><p>The first challenge is authenticating users when they log into the system — that’s <strong>authentication</strong>. Once users are in the system, the second step is to decide what they have access to — that’s where <strong>authorization </strong>comes in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/0*4e0YYRgoT0FxMI1N" /></figure><h3>Why is authorization critical?</h3><p>Authorization (Not to be <a href="https://www.permit.io/blog/authn-vs-authz">confused with authentication</a>) is the process of managing access to <strong>resources</strong> based on a user’s <strong>identity</strong> and the <strong>permissions</strong> assigned to that identity. This is typically done by comparing a user’s credentials against a set of rules (policies) to determine what they are allowed to access.</p><p><strong>Authorization is crucial for Netflix</strong> — not only to make sure only paying customers have access to shows but also as <strong>a means of maximizing potential revenue</strong>. How, you may ask? By being able to tailor shows based on specific countries or user interests, by offering purchasing power parity — adjusting their prices in accordance with income levels per country, and more.</p><h3>Authorization is a complicated task</h3><p>Writing authorization policies is quite a complex task. To address this issue, Netflix chose <a href="https://github.com/open-policy-agent/opa">Open Policy Agent</a> (OPA) — an open-source general-purpose policy engine that unifies policy enforcement across the stack.</p><p>OPA provides a high-level declarative language called <strong>Rego </strong>that lets you write policy as code, along with a simple API to offload policy decision-making from your software (As pairing authorization logic with application logic <a href="https://www.permit.io/blog/four-mistakes-you-make-when-building-permissions#2-mixing-up-app-logic-and-authorization">is a bad idea</a>). OPA can be used to enforce policies in microservices, Kubernetes, CI/CD pipelines, API gateways, and more.</p><p>The thing is — Rego is quite hard to master, thus limiting the ability to manage policies to a very small chunk of people. Netflix encountered a problem where <strong>very few people in the organization could actually write Rego policies</strong>, yet they wanted to distribute the ability to create and manage policies across the organization.</p><h3>How did Netflix solve its authorization problem?</h3><p>Netflix built a UI on top of OPA, which allowed them to create Rego policies and simplify the process. That solved the issue, but then another problem emerged:</p><p><strong>Once the policy was in place, did they actually capture its intent? </strong>They knew in plain English what they wanted to achieve with the policy, and they proceeded to define it in the UI, but they didn’t know if it would actually perform. To solve this issue, Netflix ended up building <strong>unit-testing mechanisms</strong> for the UI.</p><p>You want a policy to be implemented in the system? Write it, write a test for it, and make sure that the test passes. Before you save and the policy change gets pushed, all the tests are run, and then if they all pass, the changes get applied to production. Voila.</p><p>This allowed Netflix to create a solution on top of open-source components, saving them much of the effort it would take to build a homebrew authorization layer from scratch. Unfortunately — Netflix kept this solution to themselves, never exposing it to a wider audience.</p><p><em>A great video by the CNCF where Manish Mehta and Torin Sandall from Netflix tell the story of how Netflix solved authorization with OPA in much more technical depth:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YyXf-n5Tktf3VTIg" /></figure><p><a href="https://www.youtube.com/watch?v=R6tUNpRpdnY"><strong>How Netflix Is Solving Authorization Across Their Cloud [I] — Manish Mehta &amp; Torin Sandall, Netflix</strong></a></p><h3>How can I implement this solution?</h3><p>While Netflix never open-sourced their solution, the solution they built on top of OPA inspired another open-source project: <a href="https://github.com/permitio/opal">OPAL</a></p><p>OPAL (Open Policy Administration Layer) is an open-source administration layer for OPA that allows you to easily keep your authorization layer up-to-date in real-time. As you push updates to your application’s stores (e.g. Git, DBs, S3, SaaS services) OPAL will make sure your services are always in sync with the authorization data and policy they need.</p><p>A similar high-level architecture to Netflix’s is expressed within OPAL:</p><p>The <strong>Aggregator </strong>is the OPAL server, the <strong>Distributor </strong>is the split between a server and a client, and the <strong>Updater </strong>is the OPAL client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RJK6tTNEMcOcb_zD" /></figure><p><em>You can learn more about OPAL’s architecture </em><a href="https://docs.opal.ac/overview/architecture"><em>here</em></a></p><p>Using this inspired approach allows OPAL to aggregate policy and data from different sources, and integrate them seamlessly into the authorization layer in real-time. The project is free and available to everyone as a public project and is already being used by companies like <strong>Tesla, Cisco, Palo Alto Networks, </strong>and <strong>Walmart</strong>.</p><p>If you want to go even further, <a href="https://www.permit.io/">Permit.io</a> provides a no-code UI that allows you to create, manage and enforce Rego policies and is based on <a href="https://www.permit.io/blog/opal-opa-vs-xacml">a combination of OPA and OPAL</a>. Allowing you to implement complex RBAC and ABAC policies into your application, and manage them with a simple UI anyone in your organization can use.</p><h3>Help OPAL grow</h3><p>OPAL is an ongoing open-source project which is already keeping hundreds of policy agents updated in real-time. You can join <a href="https://permit-io.slack.com/">OPAL’s Slack community </a>to chat with other devs who use OPAL for their projects, <a href="https://github.com/permitio/opal">contribute to the open-source project</a>, or <a href="https://twitter.com/opal_ac">follow OPAL on Twitter</a> for the latest news and updates.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a67aa117203a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/permit-io/how-to-build-authorization-like-netflix-with-open-source-a67aa117203a">How to build authorization like Netflix with Open Source?</a> was originally published in <a href="https://medium.com/permit-io">Permit.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to choose an Authorization Service?]]></title>
            <link>https://medium.com/permit-io/how-to-choose-an-authorization-service-6947d6c7d2d5?source=rss----954b89c36226---4</link>
            <guid isPermaLink="false">https://medium.com/p/6947d6c7d2d5</guid>
            <category><![CDATA[policy-as-code]]></category>
            <category><![CDATA[permission]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[authorization]]></category>
            <dc:creator><![CDATA[Or Weis]]></dc:creator>
            <pubDate>Mon, 09 Jan 2023 08:18:58 GMT</pubDate>
            <atom:updated>2023-01-09T08:18:58.440Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CHgnquly408tYMENl2IrbQ.jpeg" /><figcaption>Every developer building an application has encountered the challenge of authorization</figcaption></figure><p>Before we start breaking the decision process of picking an authorization service, let’s, just for the sake of clarity, define what it is first –</p><h3>What is Authorization as a Service</h3><p><a href="https://www.permit.io/blog/what-is-authorization">Authorization</a> as a service (or better-named ‘Permissions as a Service’ to differentiate from ‘Authentication as a Service’) enables software developers to build applications that can request and receive permissions to access certain resources or perform certain actions on behalf of an end-user. These permissions are typically granted by the end users themselves.</p><p>By using a ‘Permissions as a Service’ provider, developers can focus on building their application’s core functionality rather than spending time and resources building and maintaining their own authorization and permission management systems.</p><h3>Don’t Confuse with Authentication</h3><p>Every developer, when presented with the question: “<em>Do you know the difference between Authentication and Authorization</em>”? Will undoubtedly reply: “<em>Of course!</em>” In reality, you’d be surprised how often they confuse the two.<br> <br>Authorization as a service really (and I mean really) shouldn’t be confused with authentication as a service; which deals with verifying identities (as opposed to checking what they can do or not, once verified).</p><p>Some authentication services come with role and/or user management — making you think they include permissions, but these always just translate to claims in your JWT, which still require you to write code to enforce alongside more data points (e.g., billing status, anomaly detection); or worse — they translate into a simple API you query in their cloud — both killing your application’s performance with latency and limiting your ability to upgrade to more complex policies (e.g., moving from RBAC to ABAC).</p><h3>Why Should You Use an Authorization Service</h3><p>Building permissions as a service is at a critical junction of requiring advanced knowledge in cryptography, cybersecurity, the intricacies of policy models (e.g., <a href="https://www.permit.io/blog/implement-rbac-using-opa">RBAC</a>, <a href="https://www.permit.io/blog/implement-abac-using-opa">ABAC</a>), and high-performance real-time distributed systems — all while not being unique to any product.</p><p>Authorization requirements have a tendency to grow exponentially with the application; starting easy at first (e.g., Admin / Not admin — hardcoded into the app) but quickly becoming complex with the various requirements from customers, security, compliance, and 3rd party integrations. With new requirements often leading to a full refactor every 3–6 months.</p><p>The bottom line is that you should use an authorization service to avoid wasting time reinventing the wheel and avoid making mistakes that can easily translate into vulnerabilities or critical performance issues.</p><h3>The Key Factors for Choosing an Authorization Service</h3><h3>Compatibility:</h3><p>Let’s face it, you probably already have something in place (even if it’s just a single DB table with a user role column). So make sure that the solution is compatible with your existing systems and infrastructure. This includes compatibility with your cloud environment, programming language, and data sources.</p><p>In addition, you should make sure that the transition to the new solution can be a gradual and fast one (or at least gradual). Gradual means the ability to run the new solution side by side with your existing one and test it behaves as you expect.</p><h3>Best Practices:</h3><p>Anyone can build a service that just returns a list of roles (and many developers do at some point or another in their careers) — but without <a href="https://www.permit.io/blog/5-best-practices-for-building-cloud-native-permissions">the best practices</a> baked into the solution, maintaining it, and ultimately refactoring or replacing it would be painstaking and time-consuming.</p><p>Policy as Code, event-driven updates, Gitops, control-plane back office, and customer-facing experiences are some of the best practices you will need and really shouldn’t compromise on.</p><h3>Latency and locality:</h3><p>The average microservice-based application triggers three authorization queries per request. If each takes more than 50–100ms, the performance of your application is basically dead before it even starts to handle its own core logic. Latency across cloud services is basically unavoidable (the service provider might be able to reduce it somewhat but not remove it altogether — especially under heavy workload scenarios).<br>Hence it is best to avoid authorization services that provide only remote querying options and that haven’t taken latency into account.</p><h3>Policy Model Support:</h3><p>As your application evolves to meet new demands, so will your authorization layer — so while everyone often starts with Admin/Not-admin, RBAC, ABAC, ReBAC, and variants of them are most likely in your app’s future. Different solutions would support different models and varying levels.</p><p>For example, Google-Zanzibar-inspired solutions are a great way to implement ReBAC but are often impossible to implement or impractical for ABAC.</p><h3>Scalability:</h3><p>Consider the scalability of the solution. If you expect your user base to grow significantly over time, you’ll want a solution that can handle the increased load and complexity (e.g., of policy or application structure).</p><h3>Security and compliance:</h3><p>Security is always an important consideration, especially regarding access control. When picking a service provider, you should aim for one that has cybersecurity as part of its DNA, building with security by design (and not adding it as layers later). You should ask your provider how they intend to work with your sensitive data for authorization without increasing your attack surface and risk of data leakage.</p><h3>Ease of use:</h3><p>Choose a solution that is easy to use and set up. This will make it easier for you to manage permissions and reduce the risk of errors. Remember that this tool isn’t going to be just for your own use — your fellow stakeholders (e.g., product managers, security teams, compliance, support, sales, …) will need to work with this as well. The better you can delegate usage to them, the less of a bottleneck you’d have to be. Prefer solutions that provide user interfaces, as opposed to just APIs and infrastructure.</p><h3>Support:</h3><p>Make sure the solution has good customer support in case you have any issues or questions.<br>I’d recommend taking their support for a spin, asking a question in the solutions community or support forum, seeing how quickly you get a response; or at least glance at how quickly other people’s questions get answered.</p><h3>TL;DR</h3><p>Authorization as a Service, also known as permissions as a service, enables developers to build applications that can securely gate access to certain resources or perform certain actions on behalf of an end-user. Using an authorization service allows developers to focus on building their core application functionality rather than spending time and resources building and maintaining infrastructure, APIs, and human interfaces that aren’t unique to any application. When choosing an authorization service, compatibility with existing systems and infrastructure, best practices, latency and locality, scalability, and cost should all be considered. It is important to use an authorization service to avoid reinventing the wheel and to avoid mistakes that can lead to vulnerabilities or performance issues.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6947d6c7d2d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/permit-io/how-to-choose-an-authorization-service-6947d6c7d2d5">How to choose an Authorization Service?</a> was originally published in <a href="https://medium.com/permit-io">Permit.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The four mistakes you make building permissions]]></title>
            <link>https://medium.com/permit-io/the-four-mistakes-you-make-building-permissions-21b70fe28c0?source=rss----954b89c36226---4</link>
            <guid isPermaLink="false">https://medium.com/p/21b70fe28c0</guid>
            <category><![CDATA[identity-management]]></category>
            <category><![CDATA[iam-roles]]></category>
            <category><![CDATA[authz]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[app-permissions]]></category>
            <dc:creator><![CDATA[Daniel Bass]]></dc:creator>
            <pubDate>Sun, 21 Aug 2022 15:45:06 GMT</pubDate>
            <atom:updated>2022-08-22T09:45:39.806Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NKPdxu6YhFnTr36LU81ARg.png" /></figure><p>Access control is a must in almost any application, yet most developers end up building and rebuilding it repeatedly — forced to refactor with new customer, product, or security demands coming in.</p><p>Why? Usually, <strong>they make one or more of four crucial mistakes </strong>that prevent them from having a flexible access control layer that can be upgraded without having to rebuild it every time a new product demand comes in.</p><p>Before we dive into these, we first need to acknowledge that <strong>Permissions are hard</strong>, <strong>and they’re becoming harder</strong> as the world moves into cloud-native ecosystems and microservices. Let’s try and understand why -</p><h3>What makes permissions complex?</h3><h4>Moving from monoliths to distributed microservices</h4><p>Back when applications were structured as monoliths, the decision-making process of who connects to what within an application could be baked into one place, usually by using a specific framework such as Spring, Django, or Python.</p><p>When working with <strong>distributed microservices,</strong> especially in a polyglot structure, these solutions are no longer applicable, so you end up having to sprinkle a bit of access control into every little microservice and component you’re building. This creates an issue where <strong>we struggle to upgrade, add capabilities and monitor the code overall as it is replicated between different microservices</strong>.</p><h4>Connecting to 3rd party services</h4><p>It’s not just about the services you provide anymore: The ability to connect your application to 3rd party services (Like authentication, billing, analytics, machine learning agents, or databases) has become a crucial aspect of building any application — this requires us to manage access control for <strong>elements outside our own cloud</strong>.</p><h4>New, complex permission models</h4><p>The policies, rules, and models we want to enforce permissions with are also becoming more complex. Applications often start with an Admin / Non-Admin model and quickly move to increasingly complex models such as <strong>RBAC</strong>, <strong>ReBAC</strong>, and <strong>ABAC</strong>. Our expectations for applications and the different ways we can collaborate within them have never been higher, creating a need for ever-evolving complex policies.</p><h4>Security and Compliance</h4><p>If back in the day, doing SOC 2, ISO, or meeting GDPR or CCPA standards was out of the ordinary, today, these standards are common for basically any B2B (and often B2C) application.</p><p>These standards, along with HIPPA and PCI, all have lots of requirements related to <strong>having checks and balances for your application’s access control.</strong></p><p>We can significantly reduce the amount of hardship we need to go through to meet compliance standards by implementing good access control. Having a feature like auditing, combined with visibility into your access control level, which you can share with your auditors, security, and compliance, is expected from almost any solution being built — maybe not on day one, but probably quickly down the road.</p><p>If that’s not enough, there’s a lot of security friction and vulnerabilities surfacing from challenges in building access control. It’s no surprise that<strong> </strong><a href="https://owasp.org/Top10/A01_2021-Broken_Access_Control/"><strong>broken access control is the top A1 item on OWASP’s list of vulnerability sources</strong></a>, with the highest occurrence across all the surveys.</p><p>Permissions are not only a problem in how we manage and build things, but it is also <strong>creating security issues in our production</strong>, which we may face as <strong>security incidents</strong>.</p><p>Now that we understand the depth of the problem, let’s jump into the common anti-patterns that people often end up implementing into the access control that they’re building, creating security vulnerabilities.</p><h3>The Antipatterns</h3><h4>1. Mixing ‘Auths’ — Authentication VS Authorization</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rHlRWOhob-Mn2knPsc5rLA.png" /><figcaption>The IAM Waterfall</figcaption></figure><p>Mixing up <strong>authentication </strong>and <strong>authorization </strong>is probably the most common pitfall out there. Despite both belonging to the IAM space, the two are very different. In short — the IAM space consists of three parts:<strong> Identity Management</strong> (IM), <strong>Authentication </strong>(AuthN), and <strong>Authorization </strong>(AuthZ).</p><ul><li><strong>Identity management</strong> solutions like OKTA and Azure Active Directory are used on the <strong>organization side,</strong> defining different organizational identities and their relationships.</li><li><strong>Authentication</strong> is done on the product side, where you <strong>verify identities before allowing them into the product</strong> (Log in).</li><li><strong>Authorization </strong>is the layer that lets us<strong> enforce and check permissions</strong> <strong>within the product</strong>.</li></ul><p>These three steps trickle down into one another, but we must understand their differences.</p><p><strong>Role translation</strong></p><p>One source of confusion between identity management, authentication, and authorization stems from their use of <strong>Roles</strong>. The concept of Roles exists through the IAM space, <strong>but the meaning varies in each part</strong>.</p><p>Identity Management Roles indicate a role within an organization (Like “Head of Marketing” or “Member of Security Team”). These roles are drastically different from those used on the application level (Like “Admin,” “Reader,” or “Viewer”). Translating IM organizational roles into application-level Authorization roles is not always a straightforward process, but it is an issue that clearly needs to be addressed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*aMyy6oZ4k55phKWh0tK0UA.png" /></figure><p>The result of this translation (For example — Deciding that our Head of marketing, who is part of the marketing team, should have an editor role for the CMS) <strong>should be saved as part of the JSON web token (JWT) produced by the authentication layer</strong>.</p><p>What else should JWTs be used for? Glad you asked.</p><p><strong>Using JWTs</strong></p><p>Basically, <strong>the translation of the IM role into an authorization layer role </strong>(Or — the translation from an organizational role into an application level role) <strong>should be the only thing included in the JWTs.</strong></p><p>Developers often tend to overuse JWTs, sometimes going as far as storing all the routes that a user should access within them. That is a bad idea for several reasons:</p><ul><li>Mixing the authentication and authorization layers messes up our code.</li><li>Changing roles requires the user to log out and log in again, which can hinder the user experience and overall application performance.</li><li>As the JWT is sent for every request with a RESTful API, GraphQL, or any other HTTP-based solution, creating a bloated JWT would significantly slow down the application’s performance.</li><li>There is a limit to how much data can be stored within a JWT. If we keep adding more rules, we will eventually run out of storage space.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*uy0p-mg7qzxsQlTzhsJ7ng.jpeg" /></figure><p>The best way to avoid this is to have the JWT<strong> only include the claims and scopes for the user’s identity and their relationship within the organization</strong> and keep all other authorization-related information in a separate layer within the application.</p><p>Speaking of creating a separate layer for authorization, the next common mistake devs make is mixing up <strong>application logic</strong> with <strong>authorization logic</strong>.</p><h3>2. Mixing up App-logic and Authorization</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/0*UbAQ5ABScT2_EfFA" /><figcaption>A delicious bowl of spaghetti</figcaption></figure><p>When building an application, we have the logic of <strong>what the application is supposed to do</strong>, and we have the logic for <strong>who is allowed to perform which actions within it</strong>.</p><p>The combination of these two logic sets could easily result in us having spaghetti code composed of a mix of unrelated elements. If we will need to upgrade the application or the authorization layer (Which is rather likely to happen at some point), we’ll end up having to cherry-pick different elements of code, trying to figure out which are application related and which are authorization related.</p><p>When these two logic sets are combined, they inevitably grow organically and become increasingly cumbersome, <strong>turning any future effort of separating, editing, updating, or upgrading them into a nightmare</strong>.</p><p>There’s also an issue of performance here — Let’s say our application checks a user’s payment status to approve or deny access to certain features. Checking this every time as part of the application flow could significantly hinder the application’s performance.</p><p>A much better way to approach this issue is to <a href="https://www.permit.io/blog/5-best-practices-for-building-cloud-native-permissions#the-5-best-practices"><strong>decouple our policy from our code</strong></a>. This way, the authorization layer can run in the background and monitor the user’s payment status. Whenever we want to check that status, it will already be available in the authorization layer, eliminating the need to fetch it every time.</p><h3>3. Mixing up your Access control layers</h3><p>Every application requires multiple layers of access control -</p><ul><li><strong>Physical access control</strong>, like having locks on our doors and windows.</li><li><strong>Network level access control</strong>, like firewalls, VPNs, and zero trust networks.</li><li><strong>Infrastructure level access control</strong>, like limitations on which services can talk to each other.</li><li>And lastly, <strong>application level access control</strong>.</li></ul><p>Each of these layers has <strong>different demands, requirements, policies, and models</strong>. Ideally, we would have a unified interface/back-office where we can view, manage and audit all these different layers. The ability to manage them as code would be even better, as it allows us to manage and run tests on them as part of our source control.</p><p>The main mistake we often see developers making in this aspect is <strong>combining their application-level access control </strong>with a tool that was <strong>built to manage infrastructure access control, like AWS IAM</strong>.</p><p>Initially, this might look like a great idea — AWS IAM is a very powerful tool that can map many things into objects, which is why engineers use it to map their application-level access control. So why is this not a good idea? Let’s look at a specific example.</p><p>We often encounter engineers mapping their application-level access control using SS3 buckets in AWS. Because their data is stored in a bucket anyway, they feel they might as well use the access control for the bucket for the application itself. Although this may sound great on the surface, it’s easy to see when things start to go wrong -</p><p>The moment you’ll want to move to a different cloud or even a different storage layer within the same cloud, there’s a good chance you won’t want to use the buckets anymore — you’ll want to use RDS, Redshift, or Snowflake. Just because the requirements for your application have changed, <strong>you will have to completely refactor your access control because it was coupled into that specific cloud component infrastructure</strong>.</p><p>It can also be a major problem to rely too much on how things are built for these specific components. A lot of people rely on the way you configure the API gateway to do enforcements for your application. Sadly, AWS encourages you to put routes inside the JWT — a practice devs end up adopting as something they can take into production in scale and end up regretting in the long run.</p><p>Ultimately, it’s important to remember that different access layers have different needs. If we ignore these needs, we might regret it later and end up having to refactor large parts of our applications.</p><h3>4. Thinking that you can solve it once and for all</h3><p>The last major mistake developers tend to make when thinking about permission building is more of a conceptual one — Thinking they can solve it once and for all.</p><p>Many young companies fall for this misconception and end up rebuilding their access control over and over again instead of developing crucial new features in the application itself. The worst thing about that is that <strong>every time</strong> <strong>they do it, they think this time will be the last</strong>. In reality — if you follow even just some of the anti-patterns we described here, there’s a good chance that every time a new requirement comes in from a customer, partner, security, or compliance, <strong>you just might have to throw out everything you’ve built and start from scratch</strong>.</p><p>The only way to avoid this scenario <strong>is to plan for it</strong>. Building an ever-growing, ever-developing application, you have to assume that you will have to evolve your authorization layer to support more policies and complex roles. You have to assume you will move from RBAC to ABAC or other even more complicated models and provide interfaces on top of them.</p><p>This doesn’t mean you should try and build a perfect, future-proof permission management system from day one — especially if you are working in a startup company. You’ll just never finish. Instead, focus on setting the right groundwork — <strong>if you plan ahead</strong> and <strong>avoid the mistakes we discussed in this post</strong>, you will be able to upgrade your permission layer with much more flexibility — instead of having to rebuild it from scratch every three to six months.</p><p>Most companies go through the same steps — they initially build good schemas for their data layers and authorizations, but gradually, as they move forward, these schemas stop working, and they start facing performance issues. The only way to avoid this is to <strong>decouple your authorization layer from your application’s logic</strong> and <strong>be ready to update it gradually as demands come in</strong>.</p><h3>Let’s sum everything up -</h3><p>Whether it’s the <strong>move to distributed microservices from monoliths</strong>, the requirement to <strong>integrate 3rd party services into your application</strong>, the necessity of <strong>using complex permission models</strong>, or the rise of <strong>security and compliance requirements</strong>, permissions have become more complex than ever.</p><p>All of these changes require us to<strong> </strong><a href="https://www.permit.io/blog/5-best-practices-for-building-cloud-native-permissions"><strong>adopt new best practices</strong></a> and <strong>avoid common mistakes </strong>developers make when thinking about authorization:</p><p><strong>Mixing Authentication and Authorization</strong>, especially when it comes to the somewhat confusing translation of organizational roles into application level ones and the correct usage of JWTs, <strong>mixing up application logic with authorization logic</strong>, using tools designed for <strong>infrastructure access control</strong> (like AWS IAM) <strong>to manage application level access control</strong>, and thinking that we can solve our authorization problems once and for all on day one.</p><p>Most importantly, it’s important to understand that developing a good authorization layer in a constantly changing application requires planning ahead and building a flexible solution that can be upgraded without having to rebuild it every time a new product demand comes in.</p><p>Building authorization? Got questions? Come talk to hundreds of developers working on solving their IAM challenges in our <a href="http://www.bit.ly/permitcommunity">Slack community</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21b70fe28c0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/permit-io/the-four-mistakes-you-make-building-permissions-21b70fe28c0">The four mistakes you make building permissions</a> was originally published in <a href="https://medium.com/permit-io">Permit.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Ways to Improve your AWS IAM Roles and Policies]]></title>
            <link>https://medium.com/permit-io/5-ways-to-improve-your-aws-iam-roles-and-policies-24eb47e45ff9?source=rss----954b89c36226---4</link>
            <guid isPermaLink="false">https://medium.com/p/24eb47e45ff9</guid>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws-iam]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Raz Co.]]></dc:creator>
            <pubDate>Sun, 21 Aug 2022 11:21:26 GMT</pubDate>
            <atom:updated>2022-08-21T11:21:26.395Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PzkE7ccm0sFByCTi" /></figure><p>IAM Abuse is a real deal, and cases like <a href="https://fortune.com/2018/02/20/tesla-hack-amazon-cloud-cryptocurrency-mining/">“Tesla Hackers Hijacked Amazon Cloud Account to Mine Cryptocurrency”</a> can be life-threatening for every company using a cloud provider. Taking care of this aspect of cloud account management can be the difference between successfully managing your cloud resources and losing them all.</p><p>As a DevOps Engineer, I personally began learning about AWS Identity and Access Management (IAM) solutions as my first step within the AWS space in general. I’ve been hearing about the pain of configuring IAM the right way for years now.</p><p>What’s causing this pain?</p><p>That’s a bit tricky. There are two sides to the IAM “coin”:</p><p>On the one hand, looser IAM policies make it easier for developers to do their jobs, but they also pose a serious security risk. On the other hand, while solving the security risks, overly strict IAM rules will make things difficult for developers on a daily basis.</p><p>A careful balance needs to be struck between enabling a good experience for the development team and minimizing security risks. This fine balance is unique for every company, and finding it and adjusting it over time is the key.</p><p>In this post, I aim to help you better understand this balance and set down a few best practices for achieving it. To do so, I’ll include some core scenarios of using Roles, monitoring role usage, how to use OIDC (OpenID Connect) with your Kubernetes or Github, as well as a few other tips.</p><p>Before we dive in, let’s go over some of the basics of managing IAM on AWS.</p><h3>AWS IAM: A basic introduction</h3><p>With AWS’s Identity and Access Management, we, the developers (and users), can decide what resources a user, a group, or a role can view or change. In other words: Who can perform what Action on Which Resource? We’ll start with talking about the smallest building block of the IAM — AWS Policies:</p><h4>Policy Structure</h4><p>Policy JSON documents are comprised of the following elements:</p><p>Effect — Allow or Deny access to the resource is decided by Effect (Allow/Deny)</p><p>Action — A set of service-specific parameters (like “iam: CreateUser”).</p><p>Resource<em> </em>— Resource names (like “arn:aws:s3:::conf-* “)</p><p>Condition (Optional) — Grant conditions (like “aws: RequestedRegion”: “ap-south-1”)</p><p>Here’s an example of a JSON policy document:</p><pre>{<br>   Version: &quot;2012-10-17&quot;,<br>   Statement: [<br>       {<br>           Effect: &quot;Allow&quot;,<br>           Action: [<br>               &quot;route53:ChangeResourceRecordSets&quot;<br>           ],<br>           Resource: [<br>               &quot;arn:aws:route53:::hostedzone/*&quot;<br>           ]<br>       },<br>       {<br>           Effect: &quot;Allow&quot;,<br>           Action: [<br>               &quot;route53:ListHostedZones&quot;,<br>               &quot;route53:ListResourceRecordSets&quot;<br>           ],<br>           Resource: [<br>               &quot;arn:aws:route53:::hostedzone/*&quot;<br>           ]<br>       }<br>   ]<br>}</pre><p><em>Note: This policy allows changing record sets for all Route53 zones; however, “create” permissions do not entitle the user to “read” or “list,” so I added the ability to list all hosted zones and record sets to the policy.</em></p><h4>Policy Attachment</h4><p>Each policy can be attached to a user, a group, or a role.</p><p>Policies attached to users and groups are quite basic and easy to understand — each AWS user or a group can have many policies (It’s also helpful to note that policies are reusable!), while Groups are simply a bunch of users that will share the same policies.</p><p>The same goes for roles: A role can have many policies attached to it. What makes roles a bit trickier is that unlike users and groups, which can be accessed via basic authentication or tokens, roles only work with a role assumption mechanism.</p><h3>AWS IAM: 5 Best Practices</h3><p>As mentioned before, achieving a balance between flexibility and security when managing your IAM solution is crucial in keeping our application secure while enabling infrastructure for our engineers. This can, however, be quite challenging.</p><p>Let’s dig in with some best practices for leveraging the power of IAM and Roles in particular.</p><h3>1. Assuming Roles — Avoiding Premature Privilege Escalations</h3><p>Roles are a critical part of AWS IAM because they allow us to manage permissions between services and resources and automate actions in AWS.</p><p>Roles basically function as a policy administration layer, as many policies can be attached to each role, and roles are assumed by various entities. This extra layer allows us to control and manage our IAM much more efficiently using the tools which AWS IAM provides us:</p><p>“Trust Relationship” policies allow us to secure who can use the role, CloudTrail allows us to monitor who’s assuming which role, and OIDC lets us allow 3rd party services delegate AWS permissions. In the next following segments, we will dive into how to use these tools to enhance our organization’s IAM rules and make sure they are secure and flexible.</p><p>In the absence of roles as an extra administrative layer for managing policies, premature privilege and permission escalations are likely to occur. These can manifest as unmanaged policies and users, unmanaged 3rd party services policies, and many more potentially harmful administrative gaps, resulting in serious security breaches for your organization.</p><p>When talking about assuming roles, we will be using the AWS Security Token Service (STS), which is a web service that enables you to request temporary limited-privilege credentials for AWS IAM.</p><p>By using the AWS STS, we can invoke the <em>AssumeRole</em> action that returns a set of temporary security credentials that may be used to access AWS resources you would not normally have access to. To simplify that, we can say that this action places you ‘in the guise’ of the role you choose to assume. So if I choose to “assume” my new “ExampleRole,” the policies contained in “ExampleRole” will simply be delegated to me.</p><p>In order to use the role you created, you must use the STS API to “assume” it.</p><p>Fortunately, most of the 3rd party services like Github, K8s, Terraform, and many more offer an easy way to assume roles, thus making the usage of roles much more flexible and convenient, which is essential when talking about developer experience.</p><h3>2. Using Roles in Real-Life Scenarios</h3><p>When roles should be used is a tricky question. We can better demonstrate the usage of roles by explaining and understanding Why roles should be used in the first place. There are several explanations to why we should use roles — we’ll divide them into 4 parts that will also include examples of using roles in the real world.</p><h4>Easier Policy Management, Auditing, and Tracking</h4><p>⁠Let’s say, for example, that we need to share the ability to delete EC2 instances. We can easily create a proper policy and attach it to a user, or even better, to a group. In this made-up scenario, we’ll suppose the demand for deleting EC2 instances is very common.</p><p>The thing is, deleting EC2 instances is a very sensitive permission to have. We can’t just give it to any user. So how can we solve this problem?</p><p>We can create a role called “EC2DeleteRole” (attached with the policy of deleting EC2 instances), and make sure that having this role is the only way you can get this permission.</p><p>We, the IAM administrators, will be able to track and manage our identities’ permissions much more effectively by assigning this permission to a specific role. Imagine a situation where we want to remove the EC2 instance ‘delete policy’ from every identity on our AWS account. Rather than going through every identity and deleting this policy, we can simply do it by deleting the “EC2DeleteRole” we created earlier.</p><p>Roles are basically a toolbox for managing policies in a very flexible way, so don’t be afraid to use them!</p><h4>De-Risking Automations and 3rd party services</h4><p>Occasionally, we will need to delegate permissions to third-party services or automation to operate on AWS. There are high risks associated with this (Such as<a href="https://www.paloaltonetworks.com/blog/2021/09/cloud-supply-chain-attacks/"> supply-chain attacks</a>), which is why we must ensure that all the components of our infrastructure are highly secure so that an attacker cannot gain access to our infrastructure through a weak or unsecured component.</p><p>When it comes to delegating permissions for automation or third-party services, the only available options are providing authentication tokens and passwords per dedicated user or using Roles.</p><p>The option of sharing authentication tokens and passwords is the easiest to implement; just throw in your password as a variable, and that’s it. Sadly this can expose the organization to a lot of maintenance issues and security risks, as passwords can be accidentally shared or accessed by an unwanted threat.</p><p>This is where the thin line between flexible and secured IAM is crossed, and we must be sure that both are well implemented without compromise.</p><p>To achieve this, the best option is to use roles!</p><p>We can easily provide our 3rd party automation or service a role ARN to assume in order to get the permissions it needs. The same goes for managing permissions for infrastructure-as-code tools such as Terraform, Pulumi, and Terragrunt and even more robust systems such as Kubernetes or Hashicorp Nomad.</p><p>This can be achieved using the OpenID provider, which we will discuss further.</p><h4>Delegating permissions between accounts -</h4><p>Say our organization has several AWS accounts — one account for each SDLC environment (Development, staging, and production, for example), and for some reason, we are asked to give a service that is located in the staging account, the ability to reach an S3 bucket on our development AWS account.</p><p>Roles enable us to accomplish that, as roles can be assumed between accounts.</p><p>When creating a new role, we can choose that the “trusted entity” of this role will be a different AWS account; this way, the role will be assumable by a different account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/752/0*WLPBnnq6sz917jJR" /></figure><p>There is only one other option, which is to create a dedicated user and pass the password as a raw variable, which is highly insecure.</p><h4>Service Roles -</h4><p>Many AWS services require you to use roles in order to control access. A role that a service assumes to perform actions is called a Service Role. When a role serves a specialized purpose for a service, it can be categorized as a service role for EC2 instances or a service-linked role.</p><p>It’s useful to clearly distinguish between internal and external services, as each one of them will require a different set of roles. For example, AWS core services such as Amazon Data Lifecycle Manager will require a specific set of policies in order to operate properly, so we would keep this “Service Role” static as we don’t want to break the service’s operations.</p><p>On the contrary, managing roles for external services such as Kubernetes will require much more maintenance and monitoring from our side, as these kinds of roles are much more dynamic in their needs, which may lead to security issues and potential human error.</p><p>Consider marking the external services differently than the internal ones in your cloud architectural design, then design each of them separately. This will help you better understand which roles require more attention, as external service roles may be unsafe for our organization in some cases.</p><h3>3. Monitoring role usage using AWS CloudTrail</h3><p>When a large number of roles accumulates, it can be difficult to manage them effectively. In this case, AWS CloudTrail can come in handy.</p><p>Imagine a situation where a user gets access to a role that you don’t even remember exists or a scenario when multiple roles have the same policies. IAM and effective permissions on AWS should not be managed that way.</p><p>In order to avoid such scenarios (and worse ones), we can use AWS CloudTrail.</p><p>With this great AWS service, we can monitor and capture the activity of our organization’s users and the API usage across AWS regions and accounts on a single centralized interface.</p><p>AWS CloudTrail gives a lot of information about everything related to auditing the cloud activity and monitoring this data, and with that, we can watch for any unwanted activity of role assumptions and much more.</p><p>CloudTrail could be useful when monitoring who is reading secrets from our AWS Secret Manager. There’s no doubt that reading secrets should be a well-monitored action on our account since we want to ensure that only very specific users and groups can read secrets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*32J_YzNnCOcU38G0" /></figure><p><em>We can monitor who’s reading which secret, which role the identity is assuming, its IP, the event time, and much more.</em></p><h3>4. Restrict role assumption with Trust Relationship policies</h3><p>Should all roles be available to everyone? Clearly not. Roles are important entities that should always be kept safe from potential threats. Every role has a special policy called a “trust relationship policy”. This policy looks very similar to any other, and we can specify who can assume the role using it.</p><pre>{<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;: {<br>        &quot;AWS&quot;: &quot;arn:aws:iam::111122223333:root&quot;<br>      },<br>      &quot;Action&quot;: &quot;sts:AssumeRole&quot;,<br>      &quot;Condition&quot;: {}<br>    }<br>  ]<br>}</pre><p>In the above example, we attached a trust-relationship policy to our role that specifies that only the root user of the “111122223333” AWS account can assume this role, as indicated in the Action statement: “sts:AssumeRole”.</p><p>Trust Relationship policies are like whitelists or blacklists for roles. Imagine a situation where we create a role that has the permission to delete EC2, and everyone in the organization can assume this role. Obviously, this is not a good idea, so we must specify which entities are allowed to use this role and which ones aren’t.</p><h3>5. Streamlining permissions with 3rd party entities: OpenID Connect</h3><p>What is OpenID Connect (OIDC)?</p><p>OIDC is an open authentication protocol that profiles and extends OAuth 2.0 to add an identity layer. It allows clients to confirm an end user’s identity using authentication by an identity management server.</p><p>The OIDC standard is used by many well-known services to delegate access and authentication securely. Luckily for us, AWS IAM supports OIDC as a valid identity provider.</p><p>As we mentioned previously, flexibility is extremely important when talking about IAM, as we want to ensure that our engineers are able to have a frictionless working experience with the infrastructure. Fortunately, using OIDC as an identity provider for AWS makes the authentication for AWS much more flexible and secure, as it allows us to integrate our 3rd party services with AWS IAM seamlessly.</p><p>In my day-to-day usage, I use the OIDC identity provider for Github Actions. This gives Github Actions the ability to interact with AWS without any passwords or tokens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/0*CQqNy3x-m52AjFMI" /></figure><p>Using OIDC with Kubernetes is also great, as it helps integrate K8s’ service accounts with AWS IAM. For example, using OIDC allows us to give our Kubernetes service accounts the ability to assume roles from AWS.</p><p>My favorite live example is configuring ExternalDNS in EKS (Elastic Kubernetes Service powered by AWS) to work with our Route53 DNS records using OIDC integration. In short, ExternalDNS synchronizes exposed Kubernetes Services and Ingresses with DNS providers.</p><p>AWS provides the OpenID Connect Provider Issuer out-of-the-box when creating an EKS cluster, so in order to integrate our Kubernetes cluster with the OIDC, we just need to create the OIDC provider, and the following resources:</p><h4>1. Kubernetes Service Account</h4><pre>apiVersion: v1<br>kind: ServiceAccount<br>metadata:<br>  name: external-dns<br>  annotations:<br>    eks.amazonaws.com/role-arn: arn:aws:iam::ACCOUNT-ID:role/IAM-SERVICE-ROLE-NAME</pre><h4>2. AWS Role with the following trust relationship</h4><pre>{<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;: {<br>        &quot;Federated&quot;: &quot;arn:aws:iam::${ACCOUNT_ID}:oidc-provider/${OIDC_PROVIDER}&quot;<br>      },<br>      &quot;Action&quot;: &quot;sts:AssumeRoleWithWebIdentity&quot;,<br>      &quot;Condition&quot;: {<br>        &quot;StringEquals&quot;: {<br>          &quot;${OIDC_PROVIDER}:aud&quot;: &quot;sts.amazonaws.com&quot;,<br>          &quot;${OIDC_PROVIDER}:sub&quot;: &quot;system:serviceaccount:my-namespace:my-service-account&quot;<br>        }<br>      }<br>    }<br>  ]<br>}</pre><p>You can check out more information on Creating an IAM role and policy for your Kubernetes service account; read <a href="https://docs.aws.amazon.com/eks/latest/userguide/create-service-account-iam-policy-and-role.html">here</a>.</p><p>Not using OIDC may require engineers to use raw passwords and tokens, which are extremely insecure and inflexible, and mostly add a lot of friction to the process.</p><h3>Good IAM is a must</h3><p>Managing IAM for our organization can be a big deal; as we showed above, on the one hand, loose IAM can be a real danger to the whole company and can expose the company to many risks, but on the other hand, IAM policies that are too strict can make our engineer’s lives much harder.</p><p>Following the mentioned best practices, such as assuming roles, using AWS CloudTrail to monitor users and API activity, restricting role assumptions using trust relationship policies, and using OpenID Connect as a way to integrate your 3rd parties to AWS, you can make your IAM administration and operations much easier, flexible, and secure. In this age of cloud computing, that’s a must!</p><p>Want to discuss more policy permission models? — hit me up on <a href="https://permit-io.slack.com/">Permit’s Slack community</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24eb47e45ff9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/permit-io/5-ways-to-improve-your-aws-iam-roles-and-policies-24eb47e45ff9">5 Ways to Improve your AWS IAM Roles and Policies</a> was originally published in <a href="https://medium.com/permit-io">Permit.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Implement Multitenancy in Cloud Computing]]></title>
            <link>https://medium.com/permit-io/how-to-implement-multitenancy-in-cloud-computing-36e343f21e7b?source=rss----954b89c36226---4</link>
            <guid isPermaLink="false">https://medium.com/p/36e343f21e7b</guid>
            <category><![CDATA[multitenancy]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Or Weis]]></dc:creator>
            <pubDate>Thu, 04 Aug 2022 12:01:52 GMT</pubDate>
            <atom:updated>2022-08-04T12:01:51.934Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_5ywDY3XxqshE4SD" /><figcaption>Cloud-based SaaS solutions, as well as most other solutions, need multi-tenancy. Let’s quickly review what Multitenancy is, what we can gain from it, and how to easily implement it with two simple layers.</figcaption></figure><h3>What is Multitenancy</h3><p>At its core, multi-tenancy allows every part of the service (i.e., every microservice) to cater to multiple customers without deploying separate instances for each.</p><p>For a SaaS solution to scale affordably, meet customer demands, and be elastic in doing so (i.e., cost-effective in cloud resources), it has to support multi-tenancy.</p><p>A multitenant architecture provides many great and often essential features:</p><ul><li>Allowing the application to serve multiple customers at once while sharing the underlying infrastructure and services</li><li>Secure and compliant access separation</li><li>Load balancing and scaling</li></ul><h3>The two layers of Multitenancy</h3><p>At the end of the day, multi-tenancy is easy once you understand it, and it basically requires only two things: Application level access control and managing data schemas.</p><p>Let’s break it down into two planes:</p><ul><li>The data plane is all about how you transmit, store and manage the siloed data (i.e., How the underlying infra avoids mixing up the data of different tenants). Multi-tenancy for the data plane is often implemented as partitions on the data layers — e.g., separate partitions, tables, columns, identifiers, and/or labels on the data storage schema (how you save it in the database) and topics (e.g., Kafka topics), tags, domains, sockets, and/or ports, for the data at transit.</li></ul><figure><img alt="Example of DB tables with simple column-based tenant separation" src="https://cdn-images-1.medium.com/max/804/0*WgixKWJ4jfXKeVmB" /><figcaption><em>Example of DB tables with simple column-based tenant separation</em></figcaption></figure><ul><li>The application plane is about how you silo context and access within the logical layer, i.e., have the same code work for different tenants. Authorization is the component within the application plane implementing multi-tenancy.</li></ul><figure><img alt="Example application route enforcing multitenancy with Permit.io’s SDK" src="https://cdn-images-1.medium.com/max/568/0*C7MrzVS5KgZZho57" /><figcaption><em>Example application route enforcing multitenancy with Permit.io’s SDK (</em><a href="https://github.com/permitio/permit-demo-todos-nodejs/blob/8fc58cf62e8c9afe43891ea65f666e71c0875ff7/src/api-with-permit/src/routes/api/boards.ts#L96"><em>check it out on Github</em></a><em>)</em></figcaption></figure><h3>Implementing multi-tenancy</h3><p>An authorization layer is the fastest and most reliable way to upgrade from a single-tenant application to a multi-tenant one safely. In addition, the authorization layer can implement separation without requiring changes to the services themselves by applying a policy across all relevant services.</p><p>Choosing the right policy model can simplify this transition even further, with classic models like RBAC + Tenancy, ReBAC + Hierarchy (tenants becoming root-level relationships), or plain vanilla ABAC (with tenancy as an attribute).</p><p>The great thing is we don’t need to implement multi-tenancy authorization on our own, and instead can enjoy ready-made open-source tools and services.</p><h3>Implementing multi-tenancy with OPA + OPAL (Open-Source)</h3><p>Open source is a great option to start implementing your authorization layer for multi-tenancy. While there are multiple options, Open Policy Agent (OPA) is among the most promising.<br>OPA acts as an authorization microservice that we can add to our application and use to enforce access with rules written in its proprietary <a href="https://www.permit.io/blog/implement-rbac-using-opa">Rego language</a>.</p><p>Combining <a href="http://opal.ac/">OPA with OPAL</a> (Open Policy Administration Layer) enables us to manage our authorization layer in scale, using Pub/Sub topics to keep our agents up to date with policy (Rego code) and data (JSON documents). The topics, for example, can be our tenant names or IDs, allowing us to sync our agents with changes per tenant.</p><h3>Implementing multi-tenancy with Permit.io (Service)</h3><p>App authorization solutions (Such as <a href="https://www.linkedin.com/company/permitio/">Permit.io</a> 😇 ) solve the application aspect out of the box and layer easily on-top of the data plane by providing (or correlating according to) unique identifiers that can be used to partition the data plane.</p><p>Permit builds on top of <a href="http://opal.ac/">OPA and OPAL</a>, adding management interfaces, including a tenants list, tenant resource management, and per tenant user management.</p><figure><img alt="Switching between tenants in Permit.io’s dashboard" src="https://cdn-images-1.medium.com/max/1024/0*sp2-SATZxk81JQtK" /><figcaption><em>Switching between tenants in Permit.io’s dashboard</em></figcaption></figure><h3>To sum things up -</h3><p>Multi-tenancy allows our application to cater to multiple customers without deploying separate instances for each. Multi-tenancy enforcement in gist consists of two planes: data and application. One of the best ways to achieve Multi-tenancy is by creating an authorization layer that can implement separation without requiring changes to the services themselves. Although you can build your own authorization layer, there are also open-source options (Such as OPA + OPAL) and Services (Such as Permit.io) that allow you to implement one in your application — making the critical shift into multi-tenancy more accessible.</p><p>Considering multitenancy for your app? Got questions? <a href="https://www.permit.io/blog/bit.ly/permitcommunity">Join our Slack community</a> and chat with fellow developers building authorization!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36e343f21e7b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/permit-io/how-to-implement-multitenancy-in-cloud-computing-36e343f21e7b">How to Implement Multitenancy in Cloud Computing</a> was originally published in <a href="https://medium.com/permit-io">Permit.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OPAL + OPA VS XACML]]></title>
            <link>https://medium.com/permit-io/opal-opa-vs-xacml-9ba55d4918e9?source=rss----954b89c36226---4</link>
            <guid isPermaLink="false">https://medium.com/p/9ba55d4918e9</guid>
            <category><![CDATA[opal]]></category>
            <category><![CDATA[open-policy-agent]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Daniel Bass]]></dc:creator>
            <pubDate>Thu, 19 May 2022 13:06:54 GMT</pubDate>
            <atom:updated>2022-05-19T13:06:54.712Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lCoxoASF4R3Zy9EcrlHskQ.png" /></figure><h3>Introduction</h3><p>Way back in 2013, various devs were either <a href="https://www.forrester.com/blogs/13-05-07-xacml_is_dead/">announcing</a> or <a href="https://www.kuppingercole.com/blog/kuppinger/another-dead-body-in-it-or-is-xacml-still-alive">debating</a> the death of XACML — yet XACML’s goal to promote a common terminology and interoperability between authorization implementations remains valid, and it still serves as a solid base to describe the structure of authorization architectures.</p><p>The IAM landscape, authorization included, has <a href="https://www.permit.io/blog/authorization-is-changing">evolved drastically in the past couple of years</a> and allowed for new XACML alternatives to be created. This significant shift was a result of the rising demand for increasingly advanced authorization, which was generated by the growing complexity of applications and their migration to microservices and cloud-native structures. With advancements in technology, the emergence of shift-left and low/no-code developers, and the need for event-driven dynamic authorization — a replacement for XACML had to evolve.</p><p>One such XACML alternative is OPA + OPAL. <a href="https://www.openpolicyagent.org/">Open Policy Agent</a> (OPA) is an open-source project created as a general-purpose policy engine to serve any policy enforcement requirements that unifies policy enforcement across the stack without being dependent on implementation details. It can be used with any language and network protocol, supports any data type, and evaluates and returns answers quickly. OPA’s policy rules are written in Rego — a high-level declarative (Datalog-like) language. You can find a more detailed introduction to OPA <a href="https://www.permit.io/blog/introduction-to-opa">here</a>. It’s important to note that OPA itself only provides an alternative to XACML’s PDP (More on that further). OPA is enhanced by <a href="http://opal.ac">OPAL</a> (Open Policy Administration Layer) — another open-source solution that allows you to easily keep your authorization layer up-to-date in real-time. More information about the project is available <a href="https://www.permit.io/blog/introduction-to-opal">here</a>. The combination of OPA and OPAL provides a solid alternative for XACML.</p><p>To better understand this alternative, we’ll compare the traditional XACML architecture authorization flow with the one provided by OPA + OPAL and then discuss the differences. It’s important to note that while being a primarily Attribute-Based Access Control (ABAC) system XACML can also be used to describe Role-Based Access Control (RBAC) and other models.</p><h3>A few basic terms to understand the flow:</h3><p>The architecture of XACML consists of a few different modules that make up the process of making authorization decisions. Let’s take a look at those different parts: <strong>PEP — “Policy Enforcement Point”: </strong>The PEP intercepts a user’s access to a resource, and either grants or denies access to the resource requested by the user. PEPs don’t make the decisions; they enforce them. PEPs can potentially also adjust requests or their results before passing them through (aka data-filtering). Examples of PEPs are in-code control flow (i.e. “if”), middleware, reverse proxies, and API gateways</p><p><strong>PDP — “Policy Decision Point”:</strong> The PDP evaluates authorization requests against relevant policies and a data snapshot aggregated from the distributed data layer and makes an authorization decision.</p><p><strong>PAP — “Policy Administration Point”:</strong> ⁠The PAP is in charge of managing all relevant policies to be used by the PDP.</p><p><strong>PIP — “Policy Information Point”:</strong> The PIP is any data source (Internal or external) that contains attributes that are relevant for making policy decisions. <strong>PRP — “Policy Retrieval Point”: ⁠</strong>The PAP is the main source of policies — it stores all relevant policies to be used by the PDP, and is managed by the PAP (In OPA it’s a bundle-server, and in OPAL this is often a Git repository or an HTTP bundle server).</p><h3>Traditional XACML Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/0*PjV4wlPJ4pRGb6kC" /><figcaption>XACML Architecture</figcaption></figure><p>Let’s start by reviewing the architecture of traditional XACML and its authorization flow:</p><ol><li><strong>Everything starts with a user (or automated entity) interacting with an application. </strong>The user sends a <strong>request</strong> to access and perform an action on any sort of resource within the application. Before being submitted to the application logic, the request passes through the PEP. The PEP is in charge of either granting or denying a user’s request for access to the resource.</li><li>The PEP translates the user’s request into an XACML authorization request. It is important to note that one user request can trigger multiple authorization queries (as it interacts with multiple resources).</li><li>To know whether the request should be approved or rejected, the PEP sends the authorization request to the PDP.</li><li>The PDP makes make authorization decisions based on pre-configured XACML formatted policies.</li><li>The policies are stored in the PRP and are managed by the PAP.</li><li>If needed — the PDP queries relevant PIPs <strong>per query </strong>for any additional relevant information.</li><li>The PDP reaches a decision (Permit / Deny / etc.) and returns it to the PEP.</li><li>The user is either granted or denied access to the resource by the PEP, based on the PDP’s decision. ⁠</li></ol><h3>OPA + OPAL Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/0*s3YHUiVxGKN-NhC_" /><figcaption>OPA + OPAL Architecture</figcaption></figure><p>While based on similar principles, OPA and OPAL provide a slightly different authorization model with significant benefits:</p><ol><li>The first step is identical to XACML — the user / automated entity sends a request and it passes through the PEP.</li><li>The PEP converts the user’s request into queries for the PDP (In this case — OPA).</li><li>The queries are submitted by the PEP to the PDP (OPA) to know whether the request should be approved or rejected. So far so good — here is where things are a bit different. First of all, OPA stores all relevant policies within its cache. Second — the policies are represented as code (In Rego), unlike XACML where they are represented as configuration (as XML schema).</li><li>The PAP (In this case — the OPAL Server) serves a dual function. It both functions as a Policy Administration Point and a Policy Information Administration Point. 4.1 <strong>As a Policy Administration Point</strong> — The OPAL server is in charge of managing all relevant policies and supplying them to OPA, within the PDP. Policies are stored as code in a GIT repository (default option, though others exist), which acts as the PRP. The OPAL Server receives policy updates from the PRP and instructs the OPAL clients to update OPAs’ caches accordingly. Every time a change in a policy happens in GIT, it is pulled by the OPAL Server and pushed into OPA’s cache via the OPAL clients which listen to the server (based on topics) and are located next to the OPA instances. By leveraging GIT and policy as code, OPAL allows us to use Gitops best practices (e.g. tests, code-review, benchmarking) <strong>In this manner, OPA always stays up to date with the latest policy changes in real-time without the need for redeployment.</strong> 4.2<strong> As a Policy Information Administration Point</strong> — the OPAL server informs the OPAL Client within the PDP on changes to data within the PIPs according to selected topics. With the updates to the client, the server sends instructions on how to query the PIPs, and the OPAL Client fetches the data directly from the PIPs (according to the instructions) and updates OPA with the most recent information. As this process is continuous, <strong>the information stored in the PDP cache is always up to date with the latest data needed to make access decisions in the most accurate way possible</strong>.</li><li>The PDP (OPA) reaches a decision (Permit / Deny / etc.) and returns it to the PEP.</li><li>Based on the decision made by the PDP (OPA), the PEP either grants or denies the user’s access to the resource. ⁠</li></ol><h3>The differences</h3><p>From the differences in the authorization flow between the traditional XACML and OPA+OPAL, we can note three significant benefits which the latter provides:</p><ol><li>The OPAL server’s ability to receive updates from GIT (Or any other policy source) keeps OPA up to date with the most recent policies — <strong>allowing us to make policy changes on the fly and have them utilized by the PDP with minimal latency</strong>. Leveraging policy as code within a GIT repository enables the adoption of configuration as code and Gitops in general.</li><li>The OPAL server not only manages the policies themselves, but also the PIPs from which additional data is often required to make a policy decision. The OPAL Client constantly listens to changes in relevant PIPs (Internal or external databases) and uses data fetchers to keep OPA’s cache constantly up to date with the latest information needed to reach an authorization decision. Because this is an ongoing process and not done per query, <strong>OPA can have all the relevant information in its cache to make policy decisions even if the PIP is not available</strong> — preventing the PDP from making the authorization decision.</li><li>While not evident from the authorization flow which we described, it is important to note that policy in <strong>Rego is much more accessible and easier to read/maintain than in XACML</strong>. Check out this example: (For a more detailed explanation of this example <a href="https://www.permit.io/blog/implement-rbac-using-opa">check out this guide</a><a href="https://media.graphassets.com/resize=width:1684,height:726/wNvKngm5SZKzJw353WY2">)⁠</a>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYMXs7oWsO01nTFjgNXOqg.png" /><figcaption><a href="https://media.graphassets.com/resize=width:1684,height:726/wNvKngm5SZKzJw353WY2"><em>Same policy side to side — Rego and XACML</em></a></figcaption></figure><p>The differences between Traditional XACML and OPA+OPAL highlight the drastic changes in the authorization space that occurred in recent years. OPAL’s ability to receive both data and policy updates in real-time allows for the creation of event-driven dynamic authorization. At the same time, OPA provides the ability to define more complex authorization structures fit for microservices and cloud-native structures, and its policy language Rego is easier to read/maintain and provides accessibility to low/no-code developers. OPAL is a mature open-source project which is already keeping hundreds of policy agents updated in real-time. You can join <a href="https://permit-io.slack.com/">OPAL’s Slack community</a> to chat with other devs who use OPAL for their projects, <a href="https://github.com/permitio/opal">contribute to the open-source project</a>, or<a href="https://twitter.com/opal_ac"> follow OPAL on Twitter </a>for the latest news and updates.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ba55d4918e9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/permit-io/opal-opa-vs-xacml-9ba55d4918e9">OPAL + OPA VS XACML</a> was originally published in <a href="https://medium.com/permit-io">Permit.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Permitting an Interconnected Future]]></title>
            <link>https://medium.com/permit-io/permitting-an-interconnected-future-e0c0abf73fc0?source=rss----954b89c36226---4</link>
            <guid isPermaLink="false">https://medium.com/p/e0c0abf73fc0</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[access-control]]></category>
            <category><![CDATA[permission]]></category>
            <category><![CDATA[authorization]]></category>
            <dc:creator><![CDATA[Or Weis]]></dc:creator>
            <pubDate>Wed, 16 Feb 2022 09:47:36 GMT</pubDate>
            <atom:updated>2022-02-16T09:47:36.317Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Sa106niSIY6FP9QM" /><figcaption>Launch!</figcaption></figure><h4>Launching Permit.io</h4><p>Throughout our long (~20 years) careers both Asaf (my awesome co-founder) and I found ourselves constantly rebuilding access control for our products.</p><p>At my previous company Rookout- We ended up rebuilding access control over five times; at every turn, we were met with unexpected demands for more roles, features, performance, compliance, security, and overall complexity.</p><p>As developers who are passionate about developer tools, we knew that things had to change. Authorization, just like billing, authentication, and databases — is not something one should be building from scratch.</p><p>We realized this was a unique point in time where multiple events intersected to create the opportunity that is now Permit.io possible. The explosion of microservices combined with the growing maturity of DevSecOps and authentication (with standards like JWTs) have set the stage for the next step in the <a href="https://www.permit.io/blog/what-is-authorization#The%20IAM%20Waterfall">IAM waterfall</a> — fullstack authorization and permissions.</p><h3>Fullstack Permissions</h3><p>As the space evolves, trends, <a href="https://www.permit.io/blog/5-best-practices-for-building-cloud-native-permissions">best practices</a>, and open-source standards (e.g. OPA, <a href="https://github.com/permitio/opal">OPAL</a>) began to emerge. At Permit we adopt and support these, being strong believers in decoupling policy and code. We also understand that it is not only about decoupling the technology — developers and their fellow stakeholders need end-to-end experiences. Access is the most critical experience of any product — and everyone needs to be able to affect and take part in it.</p><p>Fullstack permissions mean empowering developers and users, it means adding UI and low-code next to deep-code and APIs, and most importantly it means you can trust us to make authorization work for you, exactly how you want it — and not just throw some APIs your way.</p><h3>An Interconnected Future</h3><p>While a major part of our story is about making developers’ life better — we also note that’s just the beginning, as glimpses of the future through companies like Facebook and Google hint at even greater complexities around the corner.<br>With more and more applications being used by other applications rather than by human users (Think of Apple’s Siri triggering IFFT to turn on your Xiamoi smart light-bulb), and machine learning agents on the rise, it is clear the matrix of access is only getting more complex.</p><p>And as more and more things become interconnected more rapidly, only by creating new standards for authorization, and layering artificial intelligence on top, will we be able to keep up with the needed pace.</p><h3>The beginning of an amazing journey</h3><p><a href="https://techcrunch.com/2022/02/15/permit-io-raises-6m-to-make-permissions-easier/">Today we’re excited to launch Permit.io out of stealth mode</a>, with the support of our amazing investors NFX and Rainfall, as well a long list of angels and advisors — all coming from the developer-tools space. <br>Our growing team is already supporting a large open-source project and SaaS service- running in the production environments of industry leaders. And is eager to bring permissions to support the future of software and the internet as an interconnected whole.</p><p>To read more about our vision for the future check out the <a href="https://permit.io/blog">Permit.io blog</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0c0abf73fc0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/permit-io/permitting-an-interconnected-future-e0c0abf73fc0">Permitting an Interconnected Future</a> was originally published in <a href="https://medium.com/permit-io">Permit.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 best practices for building cloud-native permissions]]></title>
            <link>https://medium.com/permit-io/5-best-practices-for-building-cloud-native-permissions-e5352c9b4e7b?source=rss----954b89c36226---4</link>
            <guid isPermaLink="false">https://medium.com/p/e5352c9b4e7b</guid>
            <category><![CDATA[identity-management]]></category>
            <category><![CDATA[cloud-native]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[access-control]]></category>
            <dc:creator><![CDATA[Or Weis]]></dc:creator>
            <pubDate>Mon, 14 Feb 2022 13:32:33 GMT</pubDate>
            <atom:updated>2022-02-14T13:33:31.693Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jmS1xRIxZLUeN-_lzN5AXg.png" /></figure><p>Cloud-native / microservice-based products are complex, and so is building access-control and managing permissions for these products — it’s only getting worse by the pull request. Most developers end up building authorization or access-control for their products multiple times — forced to refactor with new customer, product, or security demands coming in. To make our lives a little easier, let’s go over the unique challenges that building cloud-native permissions poses before us, and cover the five best-practices for building them that can save you a lot of hassle.</p><h3>Things have changed</h3><p>We used to build authorization by using monolithic frameworks like Django or Spring that came with authorization or access-control baked-in, but these are no longer applicable when we create applications in the cloud-native space. There are a few reasons for that — Firstly, applications themselves are no longer monoliths — they’re based on microservices and are becoming highly distributed. This becomes even more critical when you need to incorporate devices or instances that are deployed at the edge, which often need access-control too. Second, cloud-native applications tend to require integration of third-party services (Such as billing, authentication, databases, analytics, etc.) and the ability to control access to them in addition to your own application’s microservices. Third, more dynamic and distributed applications require us to use a bunch of different authorization models (e.g. RBAC, ReBAC, ABAC), that are based on multiple data sources, and increasingly complex rules. Lastly, security, privacy, and compliance demands are also rising (in the face of increasingly complex cyber threats) and becoming really complex. We find ourselves not only managing who should access the data but also how it is propagated between different services.</p><h3>The reality of modern authorization</h3><p>All of these new needs require us to adopt a different mindset when thinking about authorization:</p><ul><li>Authorization can no longer come as an afterthought — we have to plan it in advance.</li><li>Authorization is an ongoing endeavor — not something you solve once. It’s got to keep evolving along with your product.</li><li>Authorization is key in a customer’s experience — as it affects how users connect and invite others to the product. They won’t like it if it’s bad.</li><li>Authorization is connected to the bigger space of IAM</li></ul><h3>The 5 best practices</h3><p>To handle all of these changes, we want to share five of the best practices that will aid you in building cloud-native permissions — and leave you time to actually develop features, rather instead of just running around permissions all day 👍</p><h3>Decoupling policy and code:</h3><p>One of the most important and recently popular practices in building cloud-native permissions is decoupling of policy and code. Having the code of the authorization layer mixed in with the application code itself can be very problematic. Most importantly, it creates a situation where we struggle to upgrade, add capabilities and monitor the code overall as it is replicated between different microservices. Each change would require us to refactor large areas of code that only drift further from one another as these microservices develop. This can be avoided by decoupling our policy from our code by (ideally) creating a separate microservice for authorization, that will be used by the other services in order to fulfill their authorization needs. Open-source policy/permissions engines such as <a href="https://github.com/open-policy-agent/opa">OpenPolicyAgent (OPA)</a> or <a href="https://github.com/authzed/spicedb">SpiceDB</a> for example allow us to manage authorization in a separate service.</p><h3>Being event-driven:</h3><p>We want the application that we are building to be dynamic. Applications often utilize abilities such as user invites, role assignment, or the usage of 3rd party data sources — all of which require to be managed in a real-time fashion. Without it, our ability to make authorization decisions will be significantly reduced. This requires us to design our authorization layer to be event-driven**. We want to create a reality where every time an event that affects authorization happens, it is immediately put through the system to make sure the authorization layer learns about it and remains in sync with the application and any relevant 3rd party data service. Ideally, to achieve this we’d decouple the authorization data from the application data (as not all the data that is relevant for the application is relevant for authorization and vice versa), creating a lean model in our authorization layer and then keeping it in sync with our application and additional sources through real-time events. <a href="https://opal.ac/">OPAL</a> (Open Policy Administration Layer), for example, is an open-source project that enables making OPA event-driven. This allows you to respond to policy and data changes, push live updates to your agents, and bring open-policy up to the speed needed by live applications.</p><h3>Backoffice for stakeholders:</h3><p>The authorization layer is part of the product itself, and in product-focused companies, there are various stakeholders that need to be able to connect to the access-control experience. These include (alongside developers) dev-ops, product managers, security, compliance, sales, marketing, etc. While building the authorization layer we want to provide controls and interfaces to these various stakeholders through a back-office. This requires us to consider what different stakeholders would need from the access-control interface to our product from day one — that should keep everyone happy.</p><h3>Interfaces for customers:</h3><p>In a similar fashion to the stakeholder’s requirements, we also need to think of our end-users/customers. Authorization is not only relevant in managing the product, but also for the product’s end-user. If, for example, users require access to their own audit logs (Something almost every B2B application user would ask) they should be able to see what they have done within the product with ease. Recognizing this need in advance calls for building the authorization layer in a way that enables it to latch on to different interfaces that cater to the needs of the end-users. The list of possible interfaces here is extremely long (and you can probably name a dozen you’ve seen in multiple products). <a href="https://www.permit.io/">Permit.io</a> ,which, empowers developers to bake in permissions and access-control into any product, provides many of these interfaces.</p><h3>GitOps:</h3><p>So we’ve created a separate microservice to manage permissions, and we are able to deliver updates to it in an event-driven fashion. Now, how do we get around to managing those changes, applying versions, applying various checks and balances, and making sure that the code and data for the microservices comply with our demands and requirements? The answer is GitOps. Using GitOps allows us to create a pull request for every version change. Then, as our developers are updating the product and its access-control, they can push a new commit with new code, have those go through the necessary tests and checks, and apply them to the authorization layer.</p><h3>The future of permissions</h3><p>With complexity on the rise and a constant stream of customer and security demands, building your product’s access-control in a way that will be ready for the future, and won’t require heavy refactors or rewrites is critical. Creating a separate microservice for authorization, designing it to be event-driven, providing controls and interfaces to various stakeholders and customers, and using GitOps allows us to create a product that is as ‘Future proof’ as possible for authorization, and prevents us from having to rebuild our authorization layer over and over (and over) again — no matter the requirements.</p><p>Want to learn more? Check out <a href="https://youtu.be/UbGb_iNVSFk">this video</a>:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUbGb_iNVSFk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUbGb_iNVSFk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUbGb_iNVSFk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f473e48e081bf460b37ee68685dc414b/href">https://medium.com/media/f473e48e081bf460b37ee68685dc414b/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5352c9b4e7b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/permit-io/5-best-practices-for-building-cloud-native-permissions-e5352c9b4e7b">5 best practices for building cloud-native permissions</a> was originally published in <a href="https://medium.com/permit-io">Permit.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Achieving modern authorization]]></title>
            <link>https://medium.com/permit-io/achieving-modern-authorization-17fd5a730e44?source=rss----954b89c36226---4</link>
            <guid isPermaLink="false">https://medium.com/p/17fd5a730e44</guid>
            <category><![CDATA[permission]]></category>
            <category><![CDATA[identityaccess-management]]></category>
            <category><![CDATA[authorization]]></category>
            <category><![CDATA[auth]]></category>
            <category><![CDATA[ami]]></category>
            <dc:creator><![CDATA[Daniel Bass]]></dc:creator>
            <pubDate>Sun, 13 Feb 2022 11:29:34 GMT</pubDate>
            <atom:updated>2022-02-13T11:53:11.184Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>How authorization is changing, and how we can harness the benefits</strong></p><p>The landscape of authorization has changed drastically in the last few years — Today’s applications require complex authorization systems and call for well-designed, adaptive solutions. In this post we will try to answer what changed, both in terms of the challenges and the solutions, and how we can adapt to these changes.</p><p>But first, before we dive into this — let’s establish the space that we’re going to be discussing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*WC7xxKbsZKHn3jLaH0RyLQ.png" /></figure><h3>The IAM landscape</h3><p><strong>IAM (Identity Access Management)</strong> is composed of three separate parts: <strong>Identity management</strong>, <strong>Authentication</strong> (AuthN), and <strong>Authorization</strong> (AuthZ).</p><h3>Identity management</h3><p>⁠⁠Identity management is about being able to tell who’s part of your organization, what attributes they have, and which departments they belong to. This allows you to <strong>create identities</strong> that can be aggregated and managed in a unified interface.</p><h3>Authentication</h3><p>⁠⁠Authentication is all about <strong>verifying the identity</strong> of the person connecting to your product. These are designated to monitor who has access to the product itself.</p><h3>Authorization</h3><p>⁠⁠Once a user has logged in to the product, authorization handles deciding <strong>who</strong> can do <strong>what</strong> and in <strong>what context</strong> within the product.</p><p>As you can see, each stage relies on information gathered from the previous one. ⁠A more detailed introduction to the IAM waterfall can be found <a href="https://www.permit.io/blog/what-is-authorization">here</a>.</p><h3>Building (and re-building) authorization</h3><p>Up until recently, developers have mostly been building authorization by themselves from scratch. As a developer, you might think -</p><p>“Ok, so I’ll start off with two types of users: Admin, and non-admin, and make decisions based on this distinction”.</p><p>Then, a user comes in and asks you to create an editor role.<br>⁠So you rebuild your authorization system to allow an editor role.</p><p>Later, stakeholders from your company ask you for access to audit logs, and the ability to monitor them on their side.<br>So you rebuild your authorization system to allow that as well.</p><p>Then sales approach you and ask you to create an impersonation tool that allows them to see the system from a different perspective. <br>And you rebuild again.</p><p>Another stakeholder asks you for their own back-office that will allow them to manage new users they onboard into the system.<br> <br>You see where we’re going with this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kybb57oTmG1G3Gjzm8_tKw.png" /></figure><p>As your product evolves, building authorization yourself requires you to keep rebuilding it time after time in order to adapt it. From the very beginning, you have to ask yourself — Who can access my application, work with it at the infrastructure level, manage it as the developer or work with it as a user? The answer to this question will help you determine how complex the authorization building process will be.</p><h3>How microservices changed AuthZ</h3><p>If you look at this issue in the context of the emergence of microservices, it becomes even more complicated. When you built a monolith application, you had the ability to bake in the decision-making process of who connects to what within the application into just one place — usually by using a specific framework such as Spring, Django, or Python. As you start breaking an application into multiple services, you end up having to replicate the authorization code across each and every microservice. And each time you want to restructure, change something, or add another feature, you have to do it in each microservice separately.<br> <br>The rising demand for increasingly advanced authorization, the rising complexity of the applications themselves, and their migration to microservices and cloud-native structures magnified the pain of building authorization into the application itself.</p><p>The good news is that the field of authorization is adapting, and new solutions to resolve these issues are beginning to develop. These become available now thanks to the overall evolution of the cloud space, both in technology and mindset.</p><h3>Rethinking services, new technology, and a shift-left midset.</h3><p>There have been a couple of major developments that allow us to view authorization differently: <strong>An advancement in technology</strong>, a <strong>change of approach towards microservices</strong>, and the emergence of <strong>shift-left and low/no-code developers</strong>.</p><p>In terms of <strong>technology</strong>, to create significant changes in authorization we needed the previous layers — identity management and authentication to be working well. Until we had SAML and SSO connect between identity management and authentication, that entire area wasn’t stable enough to build upon. The maturity of those standards enabled the entire Authentication space to blossom almost a decade ago, and now again with Passwordless. Before we had standards like the JSON Web Token in the authentication layer, it was basically impossible to connect to it in a standardized way. JSON Web Tokens (JWT), which only became mature in recent years, are a great way to communicate from the authentication layer into the application, and specifically into the authorization layer.</p><p>The authentication process ends when the JWT is handed to the application — specifically, to the authorization layer within it. While the authentication layer provides claims that affect the access policy, it’s still up to the authorization layer to translate and enforce those claims based on the JWT and, often, additional context data.</p><p>In terms of thinking about <strong>services</strong>, if you go back five years, people were still thinking things like billing, authentication, or databases, being core and critical, require developers to implement them themselves. Thanks to companies like Stripe, Auth0, and MongoDB, developers have realized how complex these issues are, and how problematic it is to try and build them yourself. Thus, a mindset of adopting critical services as part of an application you’re building became legitimate. Moreover — it became a consensus that you <strong>have to</strong> adapt these kinds of solutions since the risk of making mistakes when trying to build them yourself just isn’t worth it.<br> <br>The overall trend of <strong>shift-left</strong>, which has been discussed in the security sphere ad nauseam, and the increasing number of people who are becoming <strong>low/no-code</strong> developers (eg. product, security, compliance) makes it critical for us to enable them to work on such fundamental experiences as access control.</p><p>So what can be done about this?</p><h3>Modern authorization, finally.</h3><p>This new reality has created an understanding that new solutions to resolve these issues should be built. Thankfully, the developer community has started creating these solutions with open source projects (e.g. <a href="https://www.openpolicyagent.org/">OPA</a>, <a href="https://opal.ac/">OPAL</a>). This way, you can adopt them as building blocks into your application without paying anything, and more importantly, they allow you to implement practices that prevent you from repeating the mistakes of the past.</p><p>The most important matter here is that while building applications, we <strong>understand the complexities</strong> that come with creating a functional authorization layer, and <a href="https://www.permit.io/blog/5-best-practices-for-building-cloud-native-permissions">the best practices</a> that should be implemented while building it in order to avoid constantly having to rebuild them.</p><p>There are already <strong>good ready-made solutions</strong> (e.g. <a href="http://permit.io/">Permit.io</a>) out there — as open-source or as services that you can build upon while avoiding common mistakes. You can also approach this by building it yourself, but if you choose to do so, you have to do it right.</p><h3>Summary</h3><p>The drastic changes in the landscape of authorization over the last few years make it necessary for us to change our mindset and adopt new best practices in order to avoid constantly rebuilding authorization. The advancement in technology, a change of approach towards microservices, and the emergence of shift-left and low/no-code developers created an environment in which we can adopt existing solutions and use them as building blocks for our applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17fd5a730e44" width="1" height="1" alt=""><hr><p><a href="https://medium.com/permit-io/achieving-modern-authorization-17fd5a730e44">Achieving modern authorization</a> was originally published in <a href="https://medium.com/permit-io">Permit.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>