Library / Case Studies
Athenz: Fine-Grained, Role-Based Access Control at Yahoo
yahoocs: By Lee Boynton, Henry Avetisyan, Ken Fox, Itsik Figenblat, Mujib Wahab, Gurpreet Kaur, Usha Parsa, and Preeti Somal Today, we are pleased to offer Athenz, an open-source platform for fine-grained access control, to the community. Athenz is a role-based access control (RBAC) solution, providing trusted…
By Yahoo engineers · Yahoo · Added 2026-10-12
All content belongs to Yahoo engineers / Yahoo. We only link to it and give credit. Report a problem
Learn this case study
About 37 min left. Your work is saved as you go.
What you are about to study
Yahoo explains a real system. You should know the basics: caching, queues and replication.
Ideas you will meet
- Distributed Systems
- Consensus, time, failure and the fundamentals of scale-out.
- Web Security
- OWASP risks, XSS, CSRF, CORS and secure design.
What we already know about this
Our own lessons on these ideas. Read them here before you start, so it makes sense.
Networking and Web Security Deep Dive · 13 minThe OWASP Top 10 and secure designA map of the most common web application risks, what each means in practice and a short review checklist you can apply to any design.Read here
What the Top 10 is
OWASP (the Open Worldwide Application Security Project) publishes an awareness list of the most critical web application risks, updated every few years from real data. Treat it as a checklist of categories to think about, not a complete standard. The names and order change between editions, so below the themes are described in stable terms with the current style of names in brackets.
The recurring risk categories
100%Figure SDA-NSD-05-1 · The risk categories as a review map · © forcsguy.com
Category In plain words Typical prevention Broken access control Users can act outside their permissions (view others' data, call admin features) Check authorisation on the server for every request and object; deny by default; test with two users Cryptographic failures Sensitive data exposed (no TLS, weak or home-made crypto, plaintext storage) TLS everywhere, strong standard algorithms, hash passwords with a slow salted hash, manage keys properly Injection Input interpreted as code or commands Parameterised queries, validation, least privilege (see the attacks lesson) Insecure design The design itself lacks controls Threat modelling, abuse cases, secure patterns, limits on resources Security misconfiguration Default passwords, open storage buckets, verbose errors, missing headers Hardened baselines, infrastructure as code, regular scans Vulnerable and outdated components Known flaws in libraries or platforms Inventory dependencies, update, use automated advisories Identification and authentication failures Weak passwords, no MFA, bad session handling MFA, rate limiting, safe recovery, strong session management Software and data integrity failures Untrusted updates, insecure CI/CD, unsafe deserialisation Signed artefacts, protected pipelines, verify dependencies Security logging and monitoring failures Attacks go unnoticed Log security events, alert, practise incident response Server-side request forgery The server fetches attacker-chosen URLs Allow-lists, block internal ranges, isolation Authentication, authorisation, encryption, hashing
- Authentication answers "who are you?"; authorisation answers "what may you do?". Do both on the server, every request.
- Encryption is reversible with a key (protect data in transit and at rest). Hashing is one-way (verify without storing the original): for passwords use a slow, salted algorithm such as Argon2, bcrypt or scrypt, never plain SHA of the password. A salt is a unique random value per password that defeats precomputed tables. (Details in the passwords lesson.)
- Never invent your own cryptography.
Secure design in practice
- Threat model early. Draw the data flows, list assets, ask "who might attack this and how?" (a simple method: for each component consider spoofing, tampering, repudiation, information disclosure, denial of service and elevation of privilege).
- Least privilege everywhere: users, services, database accounts, cloud roles.
- Defence in depth: several independent controls.
- Secure defaults: deny first; features off until needed.
- Fail safe: on error, do not grant access; do not leak details.
- Minimise data: do not collect or keep what you do not need.
- Automate: dependency scanning, static analysis, secret scanning, container scanning in CI.
- Test: unit tests for authorisation rules, automated scans, periodic penetration tests.
- Prepare for incidents: logs, alerts, runbooks, key rotation, backups.
A short review checklist for any feature
- Who is allowed to do this, and where is that checked?
- What input comes from users, and how is it validated and encoded?
- What secrets and personal data are involved, and how are they protected and logged?
- What can an attacker abuse in volume (rate limits, size limits, cost)?
- What third-party code or services does it add, and are they maintained?
- How would we notice if it were abused?
Where this fits
Security is a property of the whole system: network edge (previous lessons), application code (attacks lesson), identity (SSO and passwords lessons), data (encryption) and operations (monitoring and incident response). Make it a routine part of design reviews, not a final gate.
Real-world reading
Related reading
- OWASP Cheat Sheet SeriesOWASP · OWASP FoundationDocumentation
- AWS Security BlogAmazon Web Services engineers · Amazon Web ServicesBlogs
- Google Security BlogGoogle engineers · GoogleBlogs
- OWASP Top 10OWASP · OWASP FoundationDocumentation
Show 6 moreShow fewer
- Building Secure and Reliable SystemsGoogle engineers · O'Reilly / GoogleBooks
- Athenz: Fine-Grained, Role-Based Access Control at YahooYahoo engineers · YahooCase Studies
- Scalable IAM Architecture to Secure Access to 100 AWS Accounts at SegmentSegment engineers · SegmentCase Studies
- Security Development Lifecycle at SlackSlack engineers · SlackCase Studies
- Centralized Application Logging at eBayeBay engineers · eBayCase Studies
- Enterprise Key Management at SlackSlack engineers · SlackCase Studies
Go deeper on this
A path through videos, articles, other case studies and code on the same ideas as Athenz: Fine-Grained, Role-Based Access Control at Yahoo.
Warm upGet the vocabulary first.
Books · Free from the author
Concurrent and Distributed Systems (Cambridge lecture notes)
Eight lectures on time, broadcast, replication, consensus and transactions, with notes, slides and video. Free from the author under CC BY-SA.
University of CambridgeIntermediate
Books · Free from the author
Computer Networks: A Systems Approach
How networks are built and why: protocols, routing, congestion control and the internet's architecture. The authors publish it free online under CC BY 4.0.
Systems ApproachIntermediate
WatchHow others solve the same problem, on video.
Videos belong to their creators and play from YouTube. More on YouTube (opens in a new tab)
ReadEngineers explain it in their own words.
Blogs · Free from the author · Read here
Scalable Web Architecture and Distributed Systems
A full chapter on the building blocks of large websites: availability, performance, reliability, scalability, caches, proxies, indexes, load balancers and queues. Free to read here under CC BY 3.0.
The Architecture of Open Source ApplicationsBeginner40 min
Papers · Read here
Facebook’s photo storage
This paper describes Haystack, an object storage system optimized for Facebook’s Photos application. Facebook currently stores over 260 billion images, which translates to over 20 petabytes of data.
USENIXIntermediate
See it in another companyThe same ideas, a different system.
Case Studies · Read here
Clock Skew when Syncing Password Payloads at Drobbox
How Dropbox Passwords fixed sync errors from clock skew by replacing a two-way timestamp merge with a three-way merge against a base payload.
DrobboxIntermediate
Case Studies · Read here
OAuth Audit Toolbox at Indeed
Integrating third party apps with GSuite can be risky. Indeed's OAudit Toolbox allows you to educate your users and improve application security.
IndeedIntermediate
Read the codeSee how it looks when it is real.
GitHub
Engineering Blogs
A huge directory of company engineering blogs to learn from real production systems.
kilimchoiIntermediate
GitHub
Awesome Scalability
Curated reading list of articles on the architecture of scalable, reliable systems.
binhnguyennusIntermediate
Keep learning
Loading community…