THE SCENARIO We got linux edge devices (i.e. our "smart oven mitten") That needs to talk to our Kubernetes cluster ...securely ...live on stage @vpetersson wott.io
CONCEPTS OVERVIEW TLS vs Mutual TLS Zero Trust Networking vs Perimeter based security Public Key Infrastructure (PKI) and root of trust @vpetersson wott.io
PERIMETER SECURITY VS ZERO TRUST Perimeter based security Defend the moat with firewalls Example: Infra from the 90s Zero Trust Networking Assume everything is hostile (even internal traffic) Encrypt and verify everything Example: Istio and BeyondCorp Read "Zero Trust Networks" by Doug Barth and Evan Gilman for more details @vpetersson wott.io
PUBLIC KEY INFRASTRUCTURE (PKI) Where you get your SSL certificates Let's Encrypt, Commodo, Verisign Browsers trust "public CAs"* The CA is your "root of trust" Don't use a "public CA" for zero trust networking** @vpetersson wott.io * This is a bit complicated and out of scope ** Recommendation from "Zero trust Network" by Doug Barth and Evan Gilman
TODAY'S GOAL Use Mutual TLS (mTLS) for transport layer Rotate the keys periodically in an automated fashion* Access control using cryptographic identity No use of API keys or username+password @vpetersson wott.io * Performed automatically by the WoTT Agent
KUBERNETES SETUP Preparation before the talk Spun up a GKE k8s cluster Nginx Ingress Controller SSL cert from Let's Encrypt with Certbot (from Jetstack) @vpetersson wott.io
APP OVERVIEW Python Flask app Uses headers from Nginx for access control This is a PoC with known attack vectors, so don't blindly use this in production as-is @vpetersson wott.io
APP OVERVIEW @vpetersson wott.io Did we receive a cert? Is that cert in the whitelist? Generate whitelist 1 2 3 THIS IS A PROOF OF CONCEPT DON'T USE IN PRODUCTION
NGINX CONFIGURATION @vpetersson wott.io That gives us these HTTP headers to consume in the appserver: HTTP_SSL_CLIENT_VERIFY HTTP_SSL_CLIENT_SUBJECT_DN
APP OVERVIEW @vpetersson wott.io Did we receive a cert? Is that cert in the whitelist? Generate whitelist 1 2 3 THIS IS A PROOF OF CONCEPT DON'T USE IN PRODUCTION