- Cloud Native Applications
- Application Security
- Application Security
- Web Application Security
- Application Security Posture Management (ASPM)
- Microsegmentation
- Python Security
- SaaS Security
- Node.JS Security
- PHP Security
- AI in Cyber Security
- Cybersecurity for Financial Services
- The Principle of Least Privilege (PoLP)
- Identity and Access Management
- Cybersecurity in Banking
- Threat Detection and Response
- Cyber Kill Chain
- Threat Hunting
- Zero Trust Security
- Zero Trust Architecture
- Fileless Attacks
- DSPM
- Container Scanning
- Kubernetes
- Kubernetes
- Kubernetes Alternatives
- Kubernetes Namespace
- Kubernetes Architecture
- Kubernetes Cluster
- Kubernetes Nodes
- Kubernetes Pods
- Kubernetes Jobs
- Kubernetes Workloads
- Kubernetes Monitoring
- Kubernetes Security
- Kubernetes RBAC
- Secret Scanning
- Kubernetes Security Posture Management (KSPM)
- Kubernetes on AWS
- Kubernetes on VMware
- Kubernetes Vulnerability Scanning
- Managing Containers in Kubernetes
- K3s
- eBPF in Kubernetes
- Kubernetes Dashboard
- Kubernetes Operators
- Kubernetes Services
- Kubernetes Devops
- Kubernetes Networking
- Kubernetes ConfigMap
- Kubernetes Management
- Kubernetes Helm
- Kubernetes as a Service
- Kubernetes Serverless
- Kubernetes Tutorials
- Cloud Attacks
- Cloud Attacks
- Malware Attacks
- Zero Day Attack
- Top 10 Cyber Security Threats
- Arbitrary Code Execution
- Cryptojacking
- AI Attacks
- Prompt Injection
- Backdoor Attacks
- Reverse Shell Attack
- Remote Code Execution
- Defense Evasion
- Honeypots in Cybersecurity
- Malware Analysis
- AI Malware
- Lateral Movement
- Advanced Malware Protection
- CNAPP
- AI Security
- Container Platforms
- Containerized Architecture
- Containerized Architecture
- Docker Secrets
- Container Runtime Interface
- Container Images
- Image Scanning
- Container Compliance
- Docker Security Best Practices
- Container Security
- Container Security Best Practices
- Container Security Tools
- ECS Security
- Network Segmentation
- Istio security
- runC
- Service Mesh
- Image Repository
- Container Escape
- Container Runtime
- Docker Container
- OSS Container Image Scanning Tools
- What Is a Container?
- Docker Images
- Containerization 101
- VM vs. Container
- Containerization vs. Virtualization
- Containerized Applications
- Microservices and Containerization
- Registry Scanning
- Docker CVEs
- Docker Monitoring
- Securing Containers with Docker Scanning
- Docker CIS Benchmark
- Seccomp
- Docker Alpine
- Docker API
- Docker Tools
- 100 Best Docker Tutorials
- Docker Alternatives
- Docker Swarm
- Docker Containers vs. Virtual Machines (VMs)
- Docker Architecture
- Docker Networking
- Docker Registries
- Docker Orchestration
- OpenShift vs Docker
- Container Cloud Computing
- Container DevOps
- Docker in Production
- Container Monitoring
- Container Advantages
- Docker Hub
- Serverless Architecture
- Supply Chain Security
- Supply Chain Compliance
- SolarWinds Attack
- Supply Chain Security
- Secure Software Development Lifecycle
- Software Supply Chain Attacks
- Dependency Confusion Attack
- SLSA
- SSDF
- Software Composition Analysis
- Security Misconfigurations
- Repojacking
- Privilege Escalation
- CI/CD Security
- SAST Security
- GitLab Security
- GitHub Secret Scanning
- OWASP Dependency-Check
- Software Bill of Materials
- SBOM Tools
- NPM Vulnerabilities
- Log4j Vulnerability
- Text4Shell
- Secrets Management
- Jenkins Security
- Yarn vs. NPM
- Source Code Leaks
- Container Image Signing
- Open Source Licenses
- Vulnerability Management
- Vulnerability Management Tools
- Vulnerability Scanning Process
- Vulnerability Management
- Vulnerability Scanning
- Vulnerability Prioritization
- Open Source Vulnerability Scanning
- Vulnerability Remediation
- Vulnerability Scanner
- Risk-Based Vulnerability Management
- Vulnerability Exploitability eXchange (VEX)
- Malware Detection
- Fileless Malware
- Attack Vectors
- Malicious Code
- Risk Posture
- Alert Fatigue in Cybersecurity
- Cyber Security Posture
- MITRE ATT&CK
- MITRE ATT&CK Framework
- LLM Security
- Code Scanning
- Attack Surface
- Attack Surface Management
- What Are Indicators of Compromise (IoC)?
- Secure Code
- Configuration Drift
- Trivy
- DevSecOps
- DevSecOps
- DevSecOps Pipeline
- DevSecOps Best Practices
- DevSecOps vs SecDevOps
- Threat Modeling
- Mean Time to Repair (MTTR)
- eBPF Linux
- Cloud DevOps
- DevOps Tools
- GitOps vs DevOps
- Code Security
- Secure Code Review
- DevOps Security
- Infrastructure as Code (IaC) Security
- Infrastructure as Code DevOps
- Executive Order 14028 (U.S. Cybersecurity Executive Order)
- Open Source Security
- Shift-Left Security
- Shift Right Testing and Security
- What Is SecOps (Security Operations)?
- SecDevOps
- DevSecOps Tools
- Linux Security
- Rocky Linux
- Azure DevOps
- Cloud Security
- Cloud Security
- Cloud Security Challenges
- Cloud Security Tools
- Code to Cloud
- Cloud Protection
- Cloud Security Frameworks
- Cloud Security Standards
- Cloud Security Controls
- Cloud Security Posture Management (CSPM)
- AI Workloads
- Cloud Digital Forensics
- Cloud Computing Security Architecture
- What Is Enterprise Cloud Security?
- Virtualized Security
- CSPM Tools
- Vulnerabilities in Cloud Computing
- Top 7 Risks of Cloud Computing
- Cloud Security Assessment
- Cloud Visibility
- Cloud Governance
- Cloud Security Strategy
- Cloud Security Policy
- DFIR
- Cloud Workloads
- Public Cloud Security
- Private Cloud vs. Public Cloud
- Runtime Security
- Azure Cloud Security
- Azure Security Best Practices
- Azure Security vs. AWS Security
- AWS GovCloud: Basics & How It Compares to Azure & GCP
- S3 Security
- Cloud Misconfiguration
- Terraform Security
- Hybrid Cloud Security
- Multi-Cloud Strategy
- Agentless vs. Agent-Based Security & Monitoring
- Cloud Infrastructure Security
- Gartner CSPM
- Cloud Security Scanner
- AWS CIS Benchmark
- Cloud Configuration Management
- Cloud Workload Protection (CWP)
- Cloud Workload Protection Platforms (CWPP)
- Cloud Workload Security
- Cloud Vulnerabilities and Tools that Can Help
- Google Cloud Security
- Shared Responsibility Model
- AWS Shared Responsibility Model
- AWS Cloud Security
- Multi Cloud Security
- Cloud Compliance
- Kubernetes in Production
- Cloud Detection And Response
Securing Production K8s Clusters in AKS
What Is Azure Kubernetes Service (AKS) Security?
Azure Kubernetes Service (AKS) is a container platform that offers simplified Kubernetes deployment in Azure. It is a fully-managed service that manages Azure-based Kubernetes clusters. This service, however, does not handle all security responsibilities.
AKS handles control plane maintenance and health monitoring, but you, as the Kubernetes administrator or operator, need to manage and maintain worker nodes.
AKS asks you to define how to create and manage clusters and set up security for your clusters. You are responsible for secure configuration, and building security into the architecture using best practices that protect your clusters and pods. You are also responsible for secure network communication within your cluster.
In this article:
Baseline Security for Azure Kubernetes Service (AKS)
Let’s review how to secure production Kubernetes clusters using AKS built-in security features and policies. For more detailed guidelines on securing AKS clusters, see the Center for Internet Security (CIS) Benchmark for Azure AKS and the Microsoft AKS Security Baseline.
Cluster and Pod Security
Azure provides predefined security policies you can use to improve the health and security posture of AKS clusters and pods. These include:
- OPA Gatekeeper—a key best practice is to limit access to container operations and prevent root/privilege escalations. An Azure Policy add-on for AKS lets you install a managed instance of Gatekeeper, an open-source Kubernetes admission controller. Gatekeeper checks each request that involves creating or updating a resource.
- Initiatives—an initiative is a set of policies that support an organization’s compliance goals. There are currently two built-in initiatives: baseline and restricted. Both can help you lock down host file system, networking, and ports.
- Protect access to API server—Kubernetes RBAC can integrate with Azure Active Directory (AD) or other identity providers. This allows fine-grained access, similar to how you control access to other Azure resources. It also lets you perform logging and auditing on all API server operations.
The diagram below illustrates how to protect access to the API server using Azure AD:
Network Security
Just like AKS provides built-in security policies for clusters and pods, it also provides ready-made policies for Kubernetes networks. Here are some of the primary policies you can use:
- Filtering network traffic—use policies that only allow network traffic from authorized networks based on IP address or namespace.
- Ingress controllers—leverage ingress controllers to control access to internal IP addresses, meaning that internal IPs are accessible only from your internal network.
- Network security groups—achieve finer-grained control by applying security groups to AKS resources, allowing specific ports and protocols based on source/destination. By default, AKS creates a subnet-level security group for your cluster. Security groups change automatically when you add services such as load balancers, port mappings, and ingress routing.
- Web application firewall (WAF)—leverage the Azure WAF solution, together with an egress firewall, to manage predefined routes in and out of an AKS environment.
The diagram below shows how to deploy a WAF and egress firewall to protect an AKS cluster.
Regularly Update to the Latest Version of Kubernetes
Kubernetes regularly releases updates, including new features, bug fixes, and security fixes. The update release cycle is built to enable a quicker pace than traditional infrastructure platforms. Here is how the process generally works:
- AKS Preview—new features and fixes move through these phases before becoming stable.
- Generally available—features and fixes that become stable are made generally available and suitable for production.
This update release cycle enables you to update your Kubernetes version without experiencing breaking changes or having to adjust your templates and deployments.
Kubernetes releases minor version updates periodically. AKS supports three minor K8s versions, retiring support for old minor versions and patch releases when Kubernetes introduces new minor patch versions.
You must update Kubernetes to the latest version to ensure the security of your AKS cluster. You can set up a governance system to look for necessary upgrades and ensure you continue using supported versions.
Secure Your Cluster with Azure Policy
You can use Azure Policy to set up and enforce your Azure Kubernetes Service (AKS) cluster security policies. Azure Policy allows you to enforce industry standards and organizational policies, helping you evaluate your organization’s compliance. Once installed, the Azure Policy add-on for AKS lets you apply policy definitions, either in groups (policy sets) or individually, to your cluster.
Installing the Azure Policy Add-On for AKS
Before you install the Azure Policy add-on or enable any of its features, you must ensure your subscription supports resource providers for Microsoft policy insights:
1. Ensure you’ve installed and set up Azure CLI (version 2.12.0 or later). Run the az –version to check the version. If necessary, install or update the Azure CLI.
2. Register the preview features and resource providers:
- For the Azure portal, register your Microsoft.PolicyInsights providers.
- For Azure CLI, use Cloud Shell or the az login to login and enter the Microsoft.PolicyInsights namespace for the provider register.
3. If you installed limited definitions for preview policies, go to the Policies page and use the Disable button to remove the add-on on the AKS cluster.
4. Make sure the AKS cluster is version 1.14 or above. To check the AKS cluster version, use this script:
Use az login unless using Cloud Shell
# Search the value in the kubernetesVersion
az-aks list
5. Install Azure CLI (2.12.0 or above). See the Install the Azure CLI page for further information.
Once you’ve completed the prerequisite steps above, you can install the Azure Policy add-on in your chosen AKS cluster:
- In the Azure portal:
- Select All services to launch the AKS service and search for/select your Kubernetes services.
- Choose an AKS cluster.
- Click on Policies under Kubernetes services.
- Click on Enable add-on on the main page.
- For the Azure CLI, enter the following script:
# Log in with az-login unless Cloud Shell is used
az-aks to enable-addons --addon azure-policy --MyAKSCluster name --resource-group is ResourceGroup1
Use this command to verify if the add-on installed successfully and ensure the Gatekeeper and Azure Policy and pods run correctly:
# look for azure-policy pods installed in the kube-system namespace
kubectl to get pods in the kube-system
# look for gatekeeper pods installed in the gatekeeper-system namespace
kubectl to get pods in the gatekeeper-system
- Finally, use the following CLI command to check if the last add-on was successfully installed, specifying the name of your resource group and AKS cluster:
az aks to show --query addonProfiles.azurePolicy -g <RESOURCE GROUP> -n <CLUSTER NAME>.
- Container Platforms: 6 Best Practices and 15 Top Solutions
- Container Engines: How They Work and Top 7 Options
- Container as a Service: The Basics and Top 4 Providers
- Google Kubernetes Engine: 5 Key Features and Getting Started
- What Is AWS Fargate?
- What Is VMware Tanzu?
- What Is AWS EKS?
- What Is AWS ECS?
- Azure Container Registry: The Basics and Critical Security Best Practices
- Azure Red Hat OpenShift
- containerd: What You Should Know
- Container Deployment: Making the Move
- AWS Containers: The Basics and How to Secure Containers on Amazon
- Azure OpenShift
- Show more
Aqua Cloud Native Application Protection Platform (CNAPP)
Go cloud native with the experts!