SlideShare a Scribd company logo
Best practices of securing
web applications running on
Azure Kubernetes Service
KARL OTS
Karl Ots
Chief Consulting Officer
karl.ots@zure.com
• Cloud & cybersecurity expert from Finland
• Community leader, speaker, author & patented inventor
• Working on Azure since 2011
• Helped to secure 100+ Azure applications, from startups to
Fortune 500 enterprises
• zure.ly/karl
@fincooper
What to expect in this session
• You will learn how to build, operate and architect secure web applications on
top of Azure Kubernetes Service.
• You will learn which security controls are available, how effective they are
and what will be the cost of implementing them.
• Resources to help you better secure your AKS environment, regardless of
your current level!
@fincooper
Before we go any further…
@fincooper
Azure Kubernetes Service
A fully managed Kubernetes cluster
Managed
Azure infrastructure services
Docker
Kubernetes
Managed Kubernetes
control pane
Application
architect
Infrastructure
architect
Applications
Operations
@fincooper
@fincooper
Securing web apps on AKS
CLUSTER SECURITY NETWORK
SECURITY
POD SECURITY DEPLOYMENT AND
AUTOMATION
@fincooper
Access control to Azure management pane
• To provision Azure infrastructure, the AKS resource will need the following
AAD entities:
• A service principal for the Kubernetes cluster to create new resources and modify
existing ones
• RBAC role assignment for the Service Principal
• A service principal for accessing the container registry
• In addition, you will need to configure:
• An app registration for acting as the AAD Server
• An app registration for acting as the AAD Client
@fincooper
Access control when connecting to cluster
• AKS can be configured to use Azure AD for user authentication.
@fincooper
Access control when connecting to cluster
@fincooper
Access control when connecting to cluster
• AKS can be configured to use Azure AD for user authentication.
• But what about az aks get-credentials --admin?
@fincooper
Access control when connecting to cluster
@fincooper
@fincooper
Access control one inside the cluster
• Once our users are authenticated through Azure AD, we can implement
proper access control.
• Kubernetes RBAC and Pod Security policies allow us to restrict which pods
our dev/ops can operate.
@fincooper
Often overlooked in AKS ops
• Azure automatically applies security patches to the Linux nodes in your
cluster on a nightly schedule.
• You are responsible for ensuring that those Linux nodes are rebooted as
required.
@fincooper
You are responsible for
ensuring AKS nodes are
rebooted as required
AKS is not PaaS
@fincooper
Often overlooked in AKS ops
• Azure automatically applies security patches to the Linux nodes in your
cluster on a nightly schedule.
• You are responsible for ensuring that those Linux nodes are rebooted as
required.
• Because AKS is free, no cost is available to reimburse, so AKS has no formal
SLA.
• AKS “seeks to maintain” availability of at least 99.5 percent for the
Kubernetes API server.
@fincooper
Control access to Kubernetes Master
• Disable Dashboard!
• (preview) Limit access to API server
• https://github.com/Azure/azure-cli-extensions/tree/master/src/aks-preview#enable-
apiserver-authorized-ip-ranges
• https://docs.microsoft.com/en-us/azure/aks/api-server-authorized-ip-ranges
@fincooper
Securing web apps on AKS
CLUSTER SECURITY NETWORK
SECURITY
POD SECURITY DEPLOYMENT AND
AUTOMATION
@fincooper
@fincooper
User
Admin
access
Azure SQL
Database
Application access
End user
access
k8s
@fincooper
User
AppAKSSubnet
Application VNET
Access only
over SSL
Admin
access
Azure SQL
Database
Access restricted
Access only from AppAKSSubnet
Access restricted
k8s
@fincooper
User
WAFSubnet 10.0.2.0/24
AppAKSSubnet 10.0.1.0/24
Application VNET 10.0.0.0/16
Web Application
Firewall
Frontend IP
Configuration
Public IP
Web Application
Firewall
Enabled, Prevention
mode
Access only
over SSL
IP restriction
Web Application
Firewall Frontend IP
only Admin
access
Azure SQL
Database
Access restricted
Access only from AppAKSSubnet
Access restricted
Access only over SSL
k8s
HTTP Listener
HTTPS
Port 443
Private SSL
certificate
Backend Pool
Kubernetes Internal
Load Balancer IP
address
HTTP Settings
HTTPS redirect
SSL: Public
Certificate
Health Probe
Kubernetes Internal
Load Balancer IP
address
@fincooper
Application Gateway Ingress Controller
@fincooper
Securing web apps on AKS
CLUSTER SECURITY NETWORK
SECURITY
POD SECURITY DEPLOYMENT AND
AUTOMATION
@fincooper
Network policies
• Control the flow of traffic between pods
in the AKS cluster
• ingress from / egress to
• namespaceSelector / podSelector
• Network policies are translated into sets
of allowed and disallowed IP pairs
• Kubernetes implements these pairs as
IPTable rules
@fincooper
AAD Pod identity
@fincooper
AAD Pod identity
@fincooper
Key Vault FlexVol
@fincooper
Securing web apps on AKS
CLUSTER SECURITY NETWORK
SECURITY
POD SECURITY DEPLOYMENT AND
AUTOMATION
@fincooper
Deployment
Release
Management
•Deploy the application
using Helm charts
Build Management
•Build Dockerfile
•Push to Azure Container
Registry
Code
•Developer makes changes
to code
•Developer checks in code
to source control
Infrastructure
deployment
•Deploy the cluster using
ARM templates
@fincooper
What about Web Application Firewall
certificates?
Release
Management
•Deploy the application
using Helm charts
Build Management
•Build Dockerfile
•Push to Azure Container
Registry
Code
•Developer makes changes
to code
•Developer checks in code
to source control
Infrastructure
deployment
•Deploy the cluster using
ARM templates
@fincooper
Deployment security
Make sure container images
deployed to Kubernetes are from a
trustworthy source
• If a Kubernetes Service runs an
untrusted container image (or an
untrusted nested image), it can
violate integrity of the
infrastructure.
Do not use the default cluster
namespace to deploy applications
• Resources/Applications in same
namespace will have same access
control (RBAC) policies.
• Users are granted permission on
default namespace if no other
namespace is provided in
rolebindings.
@fincooper
@fincooper
@fincooper
Laundry list of AKS security
Control access to Microsoft.ContainerService/managedClusters/listClusterAdminCredential/action
Cluster operators should authenticate with AAD to appropriate cluster RBAC role
Control ingress traffic to the cluster
Store secret in Azure Key Vault and access them at runtime
Ops is key – spend enough design time on how you deploy new services and maintain the cluster
Not the first web app in the cluster? Control cross-pod networking and access with Pod Identity
@fincooper
Take-aways
• Compared to PaaS, AKS allows for more security controls to be put in place
• This comes with more responsibilities!
• Every application is different
• You might not need all (or any) of the security controls listed in this session
• AKS is continuously evolving
• Check the backlog and challenge your (perceived) security requirements
• Use AzSK and Azure Policy to automatically scan the security posture of your
cluster and Azure environment
@fincooper
Resources
• My slides: zure.ly/karl/slides
• AKS Roadmap at https://github.com/Azure/AKS/projects/1
• The controls discussed today:
• docs.microsoft.com/en-us/azure/aks/api-server-authorized-ip-ranges
• github.com/Azure/kubernetes-keyvault-flexvol
• github.com/Azure/aad-pod-identity
• azure.github.io/application-gateway-kubernetes-ingress/
• docs.microsoft.com/en-us/azure/aks/concepts-security
• docs.microsoft.com/en-us/azure/aks/operator-best-practices-cluster-security
• docs.microsoft.com/en-us/azure/aks/developer-best-practices-pod-security
@fincooper
zure.ly/karl/kubevideo

More Related Content

PDF
IglooConf 2020: Best practices of securing web applications running on Azure ...
PDF
CloudBurst Malmö: Best practices of securing web applications running on Azur...
PDF
IT Camp 19: Top Azure security fails and how to avoid them
PDF
DevSum - Top Azure security fails and how to avoid them
PDF
Techorama Belgium 2019 - Building an Azure Governance model for the Enterprise
PDF
ISC2 Secure Summit EMEA - Top Microsoft Azure security fails and how to avoid...
PDF
Techorama Belgium 2019: top Azure security fails and how to avoid them
PDF
FAUG Jyväskylä 28.5.2019 - Azure Monitoring
IglooConf 2020: Best practices of securing web applications running on Azure ...
CloudBurst Malmö: Best practices of securing web applications running on Azur...
IT Camp 19: Top Azure security fails and how to avoid them
DevSum - Top Azure security fails and how to avoid them
Techorama Belgium 2019 - Building an Azure Governance model for the Enterprise
ISC2 Secure Summit EMEA - Top Microsoft Azure security fails and how to avoid...
Techorama Belgium 2019: top Azure security fails and how to avoid them
FAUG Jyväskylä 28.5.2019 - Azure Monitoring

What's hot (18)

PDF
TechDays Finland 2020: Azuren tietoturva haltuun!
PDF
Building an Enterprise-Grade Azure Governance Model
PDF
IglooConf 2019 Secure your Azure applications like a pro
PDF
Practical Guide to Securing Kubernetes
PPTX
AWS Security Strategy
PDF
Azure In The Enterprise - Governance & Organization
PPTX
Containerization with Azure
PDF
All Your Containers Are Belong To Us
PPTX
Stephane Lapointe: Governance in Azure, keep control of your environments
PDF
Azure Saturday: Security + DevOps + Azure = Awesomeness
PDF
Haal de mist uit de monitoring van je cloud met System Center 2012 R2 Operati...
PPTX
Build modern and intelligent applications using Azure Database for PostgreSQL
PPTX
Azure Security Fundamentals
PPTX
Azure Security Center
PPTX
AWS Security Week | Getting to Continuous Security and Compliance Monitoring ...
PDF
DerbyCon 2019: Prepare to be Boarded! A Tale of Kubernetes, Plunder, and Cryp...
PPTX
Lacework Kubernetes Meetup | August 28, 2018
PDF
Azure DDoS Protection Standard
TechDays Finland 2020: Azuren tietoturva haltuun!
Building an Enterprise-Grade Azure Governance Model
IglooConf 2019 Secure your Azure applications like a pro
Practical Guide to Securing Kubernetes
AWS Security Strategy
Azure In The Enterprise - Governance & Organization
Containerization with Azure
All Your Containers Are Belong To Us
Stephane Lapointe: Governance in Azure, keep control of your environments
Azure Saturday: Security + DevOps + Azure = Awesomeness
Haal de mist uit de monitoring van je cloud met System Center 2012 R2 Operati...
Build modern and intelligent applications using Azure Database for PostgreSQL
Azure Security Fundamentals
Azure Security Center
AWS Security Week | Getting to Continuous Security and Compliance Monitoring ...
DerbyCon 2019: Prepare to be Boarded! A Tale of Kubernetes, Plunder, and Cryp...
Lacework Kubernetes Meetup | August 28, 2018
Azure DDoS Protection Standard
Ad

Similar to TechDays Finland 2020: Best practices of securing web applications running on Azure Kubernetes Service (20)

PPTX
AKS Scurity - Cluster & Kubelet Access to services
PPTX
EKS security best practices
PDF
Accelerate Application Innovation Journey with Azure Kubernetes Service
PPTX
Kubernetes Security Act Now Before It’s Too Late
PDF
k8s-on-azure
PPTX
AWS EKS Security Best Practices
PDF
Azure Kubernetes Service 2019 ふりかえり
PPTX
Kubernetes security with AWS
PPTX
653493625-Azure-Kubernetes-Services-Booklet.pptx
PPTX
PDF
Best Practices with Azure Kubernetes Services
PPTX
Best Practices to Secure Your Kubernetes Cluster
PDF
Kubernetes - Security Journey
PPTX
10 tips for Cloud Native Security
PDF
Container Security Deep Dive & Kubernetes
PDF
Running Containers on Azure
PDF
Best Practices To Secure Kubernetes Cluster
PPTX
DevSecOps in a cloudnative world
PPTX
Kubernetes Security
PPTX
Kubernetes #3 security
AKS Scurity - Cluster & Kubelet Access to services
EKS security best practices
Accelerate Application Innovation Journey with Azure Kubernetes Service
Kubernetes Security Act Now Before It’s Too Late
k8s-on-azure
AWS EKS Security Best Practices
Azure Kubernetes Service 2019 ふりかえり
Kubernetes security with AWS
653493625-Azure-Kubernetes-Services-Booklet.pptx
Best Practices with Azure Kubernetes Services
Best Practices to Secure Your Kubernetes Cluster
Kubernetes - Security Journey
10 tips for Cloud Native Security
Container Security Deep Dive & Kubernetes
Running Containers on Azure
Best Practices To Secure Kubernetes Cluster
DevSecOps in a cloudnative world
Kubernetes Security
Kubernetes #3 security
Ad

More from Karl Ots (18)

PDF
Azure Low Lands 2018: Monitoring real life Azure applications when to use wha...
PDF
UpdateConf 2018: Monitoring real-life Azure applications: When to use what an...
PDF
UpdateConf 2018: Top 18 Azure security fails and how to avoid them
PDF
Top Azure security fails and how to avoid them
PDF
Top 18 azure security fails and how to avoid them
PDF
FAUG #9: Azure security architecture and stories from the trenches
PDF
Monitoring real-life Azure applications: When to use what and why
PDF
Navigating in the sea of containers in azure when to choose which service and...
PDF
Kubernetes in Azure
PDF
Azure security architecture
PDF
Azure security architecture / FAUG JKL 15.2.2018
PDF
Securing Azure Infrastructure
PDF
CloudBrew 2017 - Security + DevOps + Azure = Awesomeness
PDF
Monitoring advanced Azure PaaS workloads in the enterprise - Level: 200
PDF
Building globally scalable media solutions with Azure Media Services part 2
PDF
Security + DevOps + Azure = Awesomeness
PPTX
Sovellusmodernisoinnin webinaarisarja, osa 3: modernisoidun sovelluksen integ...
PPTX
Sovellusmodernisoinnin webinaarisarja, osa 2: liiketoimintasovelluksen modern...
Azure Low Lands 2018: Monitoring real life Azure applications when to use wha...
UpdateConf 2018: Monitoring real-life Azure applications: When to use what an...
UpdateConf 2018: Top 18 Azure security fails and how to avoid them
Top Azure security fails and how to avoid them
Top 18 azure security fails and how to avoid them
FAUG #9: Azure security architecture and stories from the trenches
Monitoring real-life Azure applications: When to use what and why
Navigating in the sea of containers in azure when to choose which service and...
Kubernetes in Azure
Azure security architecture
Azure security architecture / FAUG JKL 15.2.2018
Securing Azure Infrastructure
CloudBrew 2017 - Security + DevOps + Azure = Awesomeness
Monitoring advanced Azure PaaS workloads in the enterprise - Level: 200
Building globally scalable media solutions with Azure Media Services part 2
Security + DevOps + Azure = Awesomeness
Sovellusmodernisoinnin webinaarisarja, osa 3: modernisoidun sovelluksen integ...
Sovellusmodernisoinnin webinaarisarja, osa 2: liiketoimintasovelluksen modern...

Recently uploaded (20)

PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
KodekX | Application Modernization Development
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
cuic standard and advanced reporting.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Encapsulation theory and applications.pdf
PPTX
Spectroscopy.pptx food analysis technology
PPTX
sap open course for s4hana steps from ECC to s4
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Network Security Unit 5.pdf for BCA BBA.
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
Building Integrated photovoltaic BIPV_UPV.pdf
Electronic commerce courselecture one. Pdf
Chapter 3 Spatial Domain Image Processing.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
KodekX | Application Modernization Development
Programs and apps: productivity, graphics, security and other tools
cuic standard and advanced reporting.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation theory and applications.pdf
Spectroscopy.pptx food analysis technology
sap open course for s4hana steps from ECC to s4
MIND Revenue Release Quarter 2 2025 Press Release
“AI and Expert System Decision Support & Business Intelligence Systems”
20250228 LYD VKU AI Blended-Learning.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Network Security Unit 5.pdf for BCA BBA.
The AUB Centre for AI in Media Proposal.docx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
NewMind AI Weekly Chronicles - August'25 Week I

TechDays Finland 2020: Best practices of securing web applications running on Azure Kubernetes Service

  • 1. Best practices of securing web applications running on Azure Kubernetes Service KARL OTS
  • 2. Karl Ots Chief Consulting Officer karl.ots@zure.com • Cloud & cybersecurity expert from Finland • Community leader, speaker, author & patented inventor • Working on Azure since 2011 • Helped to secure 100+ Azure applications, from startups to Fortune 500 enterprises • zure.ly/karl
  • 3. @fincooper What to expect in this session • You will learn how to build, operate and architect secure web applications on top of Azure Kubernetes Service. • You will learn which security controls are available, how effective they are and what will be the cost of implementing them. • Resources to help you better secure your AKS environment, regardless of your current level!
  • 4. @fincooper Before we go any further…
  • 5. @fincooper Azure Kubernetes Service A fully managed Kubernetes cluster Managed Azure infrastructure services Docker Kubernetes Managed Kubernetes control pane Application architect Infrastructure architect Applications Operations
  • 7. @fincooper Securing web apps on AKS CLUSTER SECURITY NETWORK SECURITY POD SECURITY DEPLOYMENT AND AUTOMATION
  • 8. @fincooper Access control to Azure management pane • To provision Azure infrastructure, the AKS resource will need the following AAD entities: • A service principal for the Kubernetes cluster to create new resources and modify existing ones • RBAC role assignment for the Service Principal • A service principal for accessing the container registry • In addition, you will need to configure: • An app registration for acting as the AAD Server • An app registration for acting as the AAD Client
  • 9. @fincooper Access control when connecting to cluster • AKS can be configured to use Azure AD for user authentication.
  • 10. @fincooper Access control when connecting to cluster
  • 11. @fincooper Access control when connecting to cluster • AKS can be configured to use Azure AD for user authentication. • But what about az aks get-credentials --admin?
  • 12. @fincooper Access control when connecting to cluster
  • 14. @fincooper Access control one inside the cluster • Once our users are authenticated through Azure AD, we can implement proper access control. • Kubernetes RBAC and Pod Security policies allow us to restrict which pods our dev/ops can operate.
  • 15. @fincooper Often overlooked in AKS ops • Azure automatically applies security patches to the Linux nodes in your cluster on a nightly schedule. • You are responsible for ensuring that those Linux nodes are rebooted as required.
  • 16. @fincooper You are responsible for ensuring AKS nodes are rebooted as required AKS is not PaaS
  • 17. @fincooper Often overlooked in AKS ops • Azure automatically applies security patches to the Linux nodes in your cluster on a nightly schedule. • You are responsible for ensuring that those Linux nodes are rebooted as required. • Because AKS is free, no cost is available to reimburse, so AKS has no formal SLA. • AKS “seeks to maintain” availability of at least 99.5 percent for the Kubernetes API server.
  • 18. @fincooper Control access to Kubernetes Master • Disable Dashboard! • (preview) Limit access to API server • https://github.com/Azure/azure-cli-extensions/tree/master/src/aks-preview#enable- apiserver-authorized-ip-ranges • https://docs.microsoft.com/en-us/azure/aks/api-server-authorized-ip-ranges
  • 19. @fincooper Securing web apps on AKS CLUSTER SECURITY NETWORK SECURITY POD SECURITY DEPLOYMENT AND AUTOMATION
  • 22. @fincooper User AppAKSSubnet Application VNET Access only over SSL Admin access Azure SQL Database Access restricted Access only from AppAKSSubnet Access restricted k8s
  • 23. @fincooper User WAFSubnet 10.0.2.0/24 AppAKSSubnet 10.0.1.0/24 Application VNET 10.0.0.0/16 Web Application Firewall Frontend IP Configuration Public IP Web Application Firewall Enabled, Prevention mode Access only over SSL IP restriction Web Application Firewall Frontend IP only Admin access Azure SQL Database Access restricted Access only from AppAKSSubnet Access restricted Access only over SSL k8s HTTP Listener HTTPS Port 443 Private SSL certificate Backend Pool Kubernetes Internal Load Balancer IP address HTTP Settings HTTPS redirect SSL: Public Certificate Health Probe Kubernetes Internal Load Balancer IP address
  • 25. @fincooper Securing web apps on AKS CLUSTER SECURITY NETWORK SECURITY POD SECURITY DEPLOYMENT AND AUTOMATION
  • 26. @fincooper Network policies • Control the flow of traffic between pods in the AKS cluster • ingress from / egress to • namespaceSelector / podSelector • Network policies are translated into sets of allowed and disallowed IP pairs • Kubernetes implements these pairs as IPTable rules
  • 30. @fincooper Securing web apps on AKS CLUSTER SECURITY NETWORK SECURITY POD SECURITY DEPLOYMENT AND AUTOMATION
  • 31. @fincooper Deployment Release Management •Deploy the application using Helm charts Build Management •Build Dockerfile •Push to Azure Container Registry Code •Developer makes changes to code •Developer checks in code to source control Infrastructure deployment •Deploy the cluster using ARM templates
  • 32. @fincooper What about Web Application Firewall certificates? Release Management •Deploy the application using Helm charts Build Management •Build Dockerfile •Push to Azure Container Registry Code •Developer makes changes to code •Developer checks in code to source control Infrastructure deployment •Deploy the cluster using ARM templates
  • 33. @fincooper Deployment security Make sure container images deployed to Kubernetes are from a trustworthy source • If a Kubernetes Service runs an untrusted container image (or an untrusted nested image), it can violate integrity of the infrastructure. Do not use the default cluster namespace to deploy applications • Resources/Applications in same namespace will have same access control (RBAC) policies. • Users are granted permission on default namespace if no other namespace is provided in rolebindings.
  • 36. @fincooper Laundry list of AKS security Control access to Microsoft.ContainerService/managedClusters/listClusterAdminCredential/action Cluster operators should authenticate with AAD to appropriate cluster RBAC role Control ingress traffic to the cluster Store secret in Azure Key Vault and access them at runtime Ops is key – spend enough design time on how you deploy new services and maintain the cluster Not the first web app in the cluster? Control cross-pod networking and access with Pod Identity
  • 37. @fincooper Take-aways • Compared to PaaS, AKS allows for more security controls to be put in place • This comes with more responsibilities! • Every application is different • You might not need all (or any) of the security controls listed in this session • AKS is continuously evolving • Check the backlog and challenge your (perceived) security requirements • Use AzSK and Azure Policy to automatically scan the security posture of your cluster and Azure environment
  • 38. @fincooper Resources • My slides: zure.ly/karl/slides • AKS Roadmap at https://github.com/Azure/AKS/projects/1 • The controls discussed today: • docs.microsoft.com/en-us/azure/aks/api-server-authorized-ip-ranges • github.com/Azure/kubernetes-keyvault-flexvol • github.com/Azure/aad-pod-identity • azure.github.io/application-gateway-kubernetes-ingress/ • docs.microsoft.com/en-us/azure/aks/concepts-security • docs.microsoft.com/en-us/azure/aks/operator-best-practices-cluster-security • docs.microsoft.com/en-us/azure/aks/developer-best-practices-pod-security