Open Sourcing Athenz: Fine-Grained, Role-Based Access Control
<p><figure data-orig-width="250" data-orig-height="53"><img src="https://66.media.tumblr.com/76b62f9ddd3012aa4cd5876fab1f9c3d/tumblr_inline_opp8gdEDQR1rma199_540.png" alt="image" data-orig-width="250" data-orig-height="100" width="250" height="53"/></figure></p><p>By Lee Boynton, Henry Avetisyan, Ken Fox, Itsik Figenblat, Mujib Wahab, Gurpreet Kaur, Usha Parsa, and Preeti Somal</p><p>Today, we are pleased to offer <a href="http://t.umblr.com/redirect?z=https%3A%2F%2Fgithub.com%2Fyahoo%2Fathenz&t=ZDM5M2ViYTg3MGNiODE0Mzg5MDFhNzE5Y2Q4OTdmYjUwN2QzZDlmMyxUckI3WlZpOA%3D%3D&b=t%3AHaiI2WONanJV7htKsFJyFw&p=https%3A%2F%2Fathenz-rbac.tumblr.com%2Fpost%2F160482404029%2Fopen-sourcing-athenz-fine-grained-role-based&m=1">Athenz</a>, an open-source platform for fine-grained access control, to the community. Athenz is a role-based access control (RBAC) solution, providing trusted relationships between applications and services deployed within an organization requiring authorized access.<b><br/></b></p><p>If you need to grant access to a set of resources that your applications or services manage, Athenz provides both a centralized <i>and a decentralized</i> authorization model to do so. Whether you are using container or VM technology independently or on bare metal, you may need a dynamic and scalable authorization solution. Athenz supports moving workloads from one node to another and gives new compute resources authorization to connect to other services within minutes, as opposed to relying on IP and network ACL solutions that take time to propagate within a large system. Moreover, in very high-scale situations, you may run out of the limited number of network ACL rules that your hardware can support.</p><p>Prior to creating Athenz, we had multiple ways of managing permissions and access control across all services within Yahoo. To simplify, we built a fine-grained, role-based authorization solution that would satisfy the feature and performance requirements our products demand. Athenz was built with open source in mind so as to share it with the community and further its development.</p><p>At Yahoo, Athenz authorizes the dynamic creation of compute instances and containerized workloads, secures builds and deployment of their artifacts to our Docker registry, and among other uses, manages the data access from our centralized key management system to an authorized application or service.</p><p>Athenz provides a REST-based set of APIs modeled in <a href="http://t.umblr.com/redirect?z=https%3A%2F%2Fardielle.github.io%2F&t=OGVlZTI2NWEyOWU2MDMwN2ViNTA1YmRiZmJiY2NkOTI0Njk1NjQ0MyxUckI3WlZpOA%3D%3D&b=t%3AHaiI2WONanJV7htKsFJyFw&p=https%3A%2F%2Fathenz-rbac.tumblr.com%2Fpost%2F160482404029%2Fopen-sourcing-athenz-fine-grained-role-based&m=1">Resource Description Language (RDL)</a> to manage all aspects of the authorization system, and includes Java and Go client libraries to quickly and easily integrate your application with Athenz. It allows product administrators to manage what roles are allowed or denied to their applications or services in a centralized management system through a self-serve UI.</p><p><b>Access Control Models</b></p><p>Athenz provides two authorization access control models based on your applications’ or services’ performance needs. More commonly used, the centralized access control model is ideal for provisioning and configuration needs. In instances where performance is absolutely critical for your applications or services, we provide a unique decentralized access control model that provides on-box enforcement of authorization. </p><p>Athenz’s authorization system utilizes two types of tokens: principal tokens (N-Tokens) and role tokens (Z-Tokens). The principal token is an identity token that identifies either a user or a service. A service generates its principal token using that service’s private key. Role tokens authorize a given principal to assume some number of roles in a domain for a limited period of time. Like principal tokens, they are signed to prevent tampering. The name “Athenz” is derived from “Auth” and the ‘N’ and ‘Z’ tokens.</p><p><b>Centralized Access Control: </b>The centralized access control model requires any Athenz-enabled application to contact the Athenz Management Service directly to determine if a specific authenticated principal (user and/or service) has been authorized to carry out the given action on the requested resource. At Yahoo, our internal continuous delivery solution uses this model. A service receives a simple Boolean answer whether or not the request should be processed or rejected. In this model, the Athenz Management Service is the only component that needs to be deployed and managed within your environment. Therefore, it is suitable for provisioning and configuration use cases where the number of requests processed by the server is small and the latency for authorization checks is not important.<br/><br/>The diagram below shows a typical control plane-provisioning request handled by an Athenz-protected service.<br/></p><figure data-orig-width="1204" data-orig-height="484"><img src="https://66.media.tumblr.com/c87849251e3f4386a01b9974bb2f25bc/tumblr_inline_opp8h4iKQ71rma199_540.png" alt="image" data-orig-width="1204" data-orig-height="484"/></figure><center>Athenz Centralized Access Control Model</center><p><b>Decentralized Access Control:</b> This approach is ideal where the application is required to handle large number of requests per second and latency is a concern. It’s far more efficient to check authorization on the host itself and avoid the synchronous network call to a centralized Athenz Management Service. Athenz provides a way to do this with its decentralized service using a local policy engine library on the local box. At Yahoo, this is an approach we use for our centralized key management system. The authorization policies defining which roles have been authorized to carry out specific actions on resources, are asynchronously updated on application hosts and used by the Athenz local policy engine to evaluate the authorization check. In this model, a principal needs to contact the Athenz Token Service first to retrieve an authorization role token for the request and submit that token as part of its request to the Athenz protected service. The same role token can then be re-used for its lifetime.<b><br/></b></p><p>The diagram below shows a typical decentralized authorization request handled by an Athenz-protected service.</p><figure data-orig-width="1204" data-orig-height="484"><img src="https://66.media.tumblr.com/865956a4e93270f39204606f70491a9d/tumblr_inline_opp8hprVst1rma199_540.png" alt="image" data-orig-width="1204" data-orig-height="484"/></figure><center>Athenz Decentralized Access Control Model</center><p>With the power of an RBAC system in which you can choose a model to deploy according your performance latency needs, and the flexibility to choose either or both of the models in a complex environment of hosting platforms or products, it gives you the ability to run your business with agility and scale.<b><br/></b></p><p><b>Looking to the Future</b></p><p>We are actively engaged in pushing the scale and reliability boundaries of Athenz. As we enhance Athenz, we look forward to working with the community on the following features:</p><ul><li>Using local CA signed TLS certificates</li><li>Extending Athenz with a generalized model for service providers to launch instances with bootstrapped Athenz service identity TLS certificates</li><li>Integration with public cloud services like AWS. For example, launching an EC2 instance with a configured Athenz service identity or obtaining AWS temporary credentials based on authorization policies defined in ZMS.</li></ul><p>Our goal is to integrate Athenz with other open source projects that require authorization support and we welcome contributions from the community to make that happen. It is available under Apache License Version 2.0. To evaluate Athenz, we provide both <a href="http://t.umblr.com/redirect?z=https%3A%2F%2Fgithub.com%2Fyahoo%2Fathenz%2Fblob%2Fmaster%2Fdocs%2Fsetup_aws.md&t=OWFlOTNmYjVkODE4ODFlN2VmMjZkYjExNzgxYzlkYTM5NWNkMWZhMixUckI3WlZpOA%3D%3D&b=t%3AHaiI2WONanJV7htKsFJyFw&p=https%3A%2F%2Fathenz-rbac.tumblr.com%2Fpost%2F160482404029%2Fopen-sourcing-athenz-fine-grained-role-based&m=1">AWS AMI</a> and <a href="http://t.umblr.com/redirect?z=https%3A%2F%2Fgithub.com%2Fyahoo%2Fathenz%2Fblob%2Fmaster%2Fdocs%2Fsetup_docker.md&t=MDYyOGJmYmViMGYxYjc0YzgwNjk5MTVlY2YwZWRjMDgyMjVhNDE5YixUckI3WlZpOA%3D%3D&b=t%3AHaiI2WONanJV7htKsFJyFw&p=https%3A%2F%2Fathenz-rbac.tumblr.com%2Fpost%2F160482404029%2Fopen-sourcing-athenz-fine-grained-role-based&m=1">Docker</a> images so that you can quickly have a test development environment up and running with ZMS (Athenz Management Service), ZTS (Athenz Token Service), and UI services. Please join us on the path to making application authorization easy. Visit <a href="http://t.umblr.com/redirect?z=http%3A%2F%2Fwww.athenz.io%2F&t=ZWRkZjc0MDUyOTg1YWU5OWQxNTgzN2RkMjIyYTdhODk3Y2UyOTY4NSxUckI3WlZpOA%3D%3D&b=t%3AHaiI2WONanJV7htKsFJyFw&p=https%3A%2F%2Fathenz-rbac.tumblr.com%2Fpost%2F160482404029%2Fopen-sourcing-athenz-fine-grained-role-based&m=1">http://www.athenz.io</a> to get started!</p>