Securing Microservices at API Gateway using Cloud Native Solutions

Securing Microservices at API Gateway using Cloud Native Solutions

Authentication and authorization in a microservices environment is non-trivial to implement correctly. This becomes especially true when identity and authorization controls are distributed across different applications. There has been multiple cases where authorization controls implemented for one application was missed for another application with similar feature and data access resulting in a breach.

We present a solution along with a proof of concept implementation for the problem described above — To be able to perform authentication and authorization for microservices in the API Gateway itself.


Abhisek Datta

June 06, 2020


  1. Securing Microservices at API Gateway Using Cloud Native Solutions Abhisek

    Datta Head, Security Products Appsecco
  2. Nullcon Webinars

  3. About Me – Abhisek Datta • Head, Security Products (

    • Application & Cloud Security • Kubernetes Cluster Security Assessments • TechWing @ null0x00 ( • An Open Security Community • Security Researcher • Discovered vulnerabilities in enterprise software and credited with CVE • Open Source Contributor • @abh1sek
  4. 1. The need for centralized Authentication and Authorization 2. Understand

    the role of API Gateway as a Security Gate 3. Proof of Concept Implementation using Traefik as API Gateway and Open Policy Agent (OPA) for policy management and evaluation Key Take Away
  5. This is not an introduction to Microservices We will look

    at an approach for securing Microservices using API Gateway as a Security Gate Learn more about Microservices
  6. AuthN & AuthZ in Microservices Identity Provider Client Oauth2 +

    OIDC Reverse Proxy Identity (JWT) Services Authentication & Authorization Established Trust
  7. API Gateway How do the clients of a Microservices- based

    application access the individual services?
  8. 1. Authenticate a request 2. Authorize a request 3. Route

    the request to backend microservice AuthN and AuthZ in API Gateway
  9. • API Gateway • Traefik • Policy Management and

    Enforcement • Open Policy Agent Our Choice of Technology
  10. What we want to achieve

  11. Demo • This is a minimal proof of concept implementation

    for demonstration • It should not be considered for production use as is.
  12. Let's look inside the code

  13. • Use as a reverse proxy • Use dynamic configuration

    discovery • Routing and Load Balancing • Middlewares • Learning Traefik API Gateway
  14. • Introduction to Open Policy Agent • • Rego

    Playground • • Running Open Policy Agent (Lib/Server/Interactive) • • Open Policy Agent for Kubernetes Admission Control • Learning Open Policy Agent
  15. • Proof of Concept Implementation • • Microservices Authorization

    using Open Policy Agent and Traefik (API Gateway) • open-policy-agent-and-traefik-api-gateway-ae30f3bf2846 Resources
  16. Questions? That’s all for now.. @abh1sek