Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Centralizing security policies with the Kong AP...

Centralizing security policies with the Kong API Gateway

When a company grows, the number of systems grows with it, and generally it becomes harder and harder to get homogeneous security features across the various services or applications. In this talk we'll discuss how an API Gateway (Kong) can help bringing that back to a maintainable state.

Avatar for Jean-Baptiste Barth

Jean-Baptiste Barth

September 27, 2018
Tweet

More Decks by Jean-Baptiste Barth

Other Decks in Programming

Transcript

  1. The origins: a Majestic Monolith © Current Web Architecture: sandbox

    Majestic Monolith rate- limit logs authz auth Heavy Business Logic Shiny Features https mainte nance IP limit
  2. Load Balancer / Reverse Proxy More tools, more services Current

    Web Architecture: sandbox Historical Monolith rate- limit logs authz auth Heavy Business Logic Shiny Features mainte nance IP limit Shiny New Service authz auth More Features https Admin tool authz auth Useful Tooling! Internal tool auth CI Jobs IP limit waf dos
  3. Kong API Gateway Target architecture Load Balancer Historical Monolith rate-

    limit logs authz mainte nance IP limit Shiny New Service https Admin tool Internal tool waf dos kongdb 5" authz auth
  4. Bundling third party plugins # Dockerfile FROM kong:0.14.1 ENV USER=root

    PATH=$PATH:/usr/local/openresty/bin ENV KONG_CUSTOM_PLUGINS=external-oauth <... deps ...> ADD ./plugins /plugins RUN cd /plugins/external-oauth && luarocks make
  5. Sample architecture Kong API Gateway rate- limit kongdb auth Sample

    app Kong Demo app.internal:8080 kong-admin:8001 kong-demo.yeah:80 kong-proxy:80
  6. Add service % curl -X POST http://kong-admin:8001/services/ \ --data "name=kong-demo"

    \ --data "url=http://app.internal:8080" {"host":"app.internal","created_at":1537871796,"connect_timeout":60000,"id": "5ca1605b-304b-4c50-9ae0-8639d7c7185e","protocol":"http","name":"kong-demo", "read_timeout":60000,"port":8080,"path":null,"updated_at":1537871796,"retrie s":5,"write_timeout":60000}
  7. Add route % curl -X POST http://kong-admin:8001/services/kong-demo/routes \ --data "hosts[]=kong-demo.yeah"

    \ --data "preserve_host=true" {"created_at":1537872153,"strip_path":true,"hosts":["kong-demo.yeah"],"prese rve_host":true,"regex_priority":0,"updated_at":1537872153,"paths":null,"serv ice":{"id":"5ca1605b-304b-4c50-9ae0-8639d7c7185e"},"methods":null,"protocols ":["http","https"],"id":"b5aff8ee-028e-4e5d-a5d3-26d05210b1a3"}