Skip to content

Commit 30e62e1

Browse files
authored
Merge pull request #2522 from ElazarK/wi554039-Secure-Kubernetes-Deployments
WI554039 secure kubernetes deployments
2 parents 81c1c13 + dd0c16b commit 30e62e1

5 files changed

Lines changed: 64 additions & 5 deletions

File tree

articles/defender-for-cloud/TOC.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,10 +823,16 @@
823823
- name: Overview
824824
href: runtime-gated-overview.md
825825
- name: Enable gated deployment
826+
displayName: gated deployment, enable
826827
href: enablement-guide-runtime-gated.md
828+
- name: Gated deployment for Infrastructure as Code
829+
displayName: gated deployment, infrastructure as code, IaC
830+
href: gated-deployment-infrastructure-as-code.md
827831
- name: Troubleshooting
832+
displayName: troubleshooting, gated deployment
828833
href: troubleshooting-runtime-gated.md
829834
- name: Frequently asked questions
835+
displayName: faq, frequently asked questions, gated deployment
830836
href: faq-runtime-gated.md
831837
- name: Protect clusters with AKS Security Dashboard
832838
displayName: k8s, containers
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: Gated deployment for Infrastructure as Code
3+
description: Learn how to deploy gated deployment infrastructure as code for managed cluster API.
4+
#customer intent: As a Kubernetes administrator, I want to deploy gated deployment infrastructure as code so that I can automate the setup and ensure consistent configuration across environments.
5+
author: Elazark
6+
ms.author: elkrieger
7+
ms.date: 02/16/2026
8+
ms.topic: how-to
9+
---
10+
11+
# Gated deployment for Infrastructure as Code
12+
13+
Microsoft Defender for Cloud's gated deployment agent is a Kubernetes admission controller that enforces container image security policies at deployment time. Gated deployment acts as a gatekeeper for container images for known security problems at deployment time and decides whether they're allowed to run.
14+
15+
The gated deployment agent requires read access to all of your Azure Container Registries (ACRs) associated with the cluster. These registries store the container images alongside the vulnerability assessment artifacts generated by Defender for Containers. To enable this access, configure a Managed Service Identity (MSI) with the required ACR read permissions and assign it to the agent.
16+
17+
## Prerequisites
18+
19+
- An Azure subscription with Microsoft Defender for Cloud enabled.
20+
- You must [enable gated deployment in Defender for Containers](enablement-guide-runtime-gated.md) with the defender sensor and registry access extensions turned on.
21+
- You must enable on your Azure Kubernetes Service (AKS) cluster:
22+
- [An OpenID Connect (OIDC) issuer](/azure/aks/use-oidc-issuer#create-an-aks-cluster-with-the-oidc-issuer).
23+
- [An Azure Workload Identity](/azure/aks/workload-identity-deploy-cluster?tabs=new-cluster).
24+
25+
> [!NOTE]
26+
> Security gating only needs to be installed once. The first time you enable the security gating toggle, it installs security gating.
27+
> After that, security gating is already installed. When the installation runs again, the system detects this and does nothing.
28+
> If you try to install it again through the API, it fails because security gating already exists.
29+
>
30+
> :::image type="content" source="media/gated-deployment-infrastructure-as-code/security-gating-on.png" alt-text="Screenshot that shows security gating is turned to on." lightbox="media/gated-deployment-infrastructure-as-code/security-gating-on.png":::
31+
32+
## Deploy the gated agent
33+
34+
1. [Create a Managed Service Identity (MSI) that the gated deployment agent uses](/entra/identity/managed-identities-azure-resources/manage-user-assigned-managed-identities-azure-portal).
35+
36+
1. [Assign the AcrPull role (or equivalent read role)](/azure/container-registry/container-registry-rbac-built-in-roles-overview?tabs=registries-configured-with-rbac-registry-abac-repository-permissions) to the MSI on all ACRs the cluster uses.
37+
38+
1. [Add a Federated Identity Credential (FIC) to the MSI](/graph/api/resources/federatedidentitycredentials-overview?view=graph-rest-1.0) that allows the gated deployment agent to authenticate by using AKS Workload Identity, with the following FIC parameters:
39+
40+
- **Issuer**: The AKS OIDC issuer URL
41+
- **Subject**: The service account used by the gated deployment agent `system:serviceaccount:kube-system:defender-admission-controller-serviceaccount`.
42+
- **Audience**: api://AzureADTokenExchange
43+
44+
1. Under the [securityGating section of the managed cluster API configuration](https://learn.microsoft.com/azure/templates/microsoft.containerservice/managedclusters?pivots=deployment-language-arm-template#resource-format-1), set the [MSI’s objectId in the identities parameter](https://learn.microsoft.com/azure/templates/microsoft.containerservice/managedclusters?pivots=deployment-language-arm-template#managedclustersecurityprofiledefendersecuritygating-1) under the security gating section of the managed cluster API configuration.
45+
46+
:::image type="content" source="media/gated-deployment-infrastructure-as-code/identities.png" alt-text="Screenshot that shows the section of the securityGating section of the managed cluster API configuration, where the code is located." lightbox="media/gated-deployment-infrastructure-as-code/identities.png":::
47+
48+
This ensures the gated deployment agent can use the MSI at runtime.
49+
50+
## Next step
51+
52+
> [!div class="nextstep"]
53+
> [Troubleshoot gated deployment in Kubernetes](troubleshooting-runtime-gated.md)
21.4 KB
Loading
11.9 KB
Loading

articles/defender-for-cloud/runtime-gated-overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ description: Enforce container image security in Kubernetes with gated deploymen
44
#customer intent: As a Kubernetes administrator, I want to enforce security policies for container images so that I can prevent the deployment of vulnerable workloads.
55
author: Elazark
66
ms.author: elkrieger
7-
ms.date: 10/29/2025
7+
ms.date: 02/16/2026
88
ms.topic: overview
99
---
1010

1111
# Gated deployment for Kubernetes container images
1212

13-
Microsoft Defender for Containers supports **gated deployment**, which enforces container image security policies at deployment time in Kubernetes environments, including Azure Kubernetes Service (AKS), Amazon Elastic Kubernetes Service (EKS), and Google Kubernetes Engine (GKE). Enforcement uses vulnerability scan results from supported container registries, including Azure Container Registry (ACR), Amazon Elastic Container Registry (ECR), and Google Artifact Registry.
13+
Microsoft Defender for Containers supports **gated deployment**, which enforces container image security policies at deployment time in Kubernetes environments. Supported environments include Azure Kubernetes Service (AKS), Amazon Elastic Kubernetes Service (EKS), and Google Kubernetes Engine (GKE). Enforcement uses vulnerability scan results from supported container registries, including Azure Container Registry (ACR), Amazon Elastic Container Registry (ECR), and Google Artifact Registry.
1414

15-
Gated deployment integrates with the Kubernetes admission controller to ensure that only container images that meet your organization's security requirements run in your Kubernetes environment. It evaluates container images against defined security rules before they're admitted into the cluster, enabling security teams to block vulnerable workloads and maintain compliance.
15+
Gated deployment integrates with the Kubernetes admission controller to ensure that only container images that meet your organization's security requirements run in your Kubernetes environment. It evaluates container images against defined security rules before they're admitted into the cluster. By using gated deployment, security teams can block vulnerable workloads and maintain compliance.
1616

1717
## Benefits
1818

@@ -30,7 +30,7 @@ Many customers already use Microsoft Defender for Containers vulnerability scann
3030
| Audit | Lets deployment continue and generates admission events for vulnerable images that violate security rules |
3131
| Deny | Blocks deployment of images that violate security rules |
3232

33-
Start in Audit mode to assess impact, then move to Deny mode to enforce rules.
33+
Start in audit mode to assess impact, then move to deny mode to enforce rules.
3434

3535
## How it works
3636

@@ -41,7 +41,7 @@ Start in Audit mode to assess impact, then move to Deny mode to enforce rules.
4141

4242
## Key features
4343

44-
- Use the default Audit rule that automatically flags image deployments with High or Critical vulnerabilities on eligible clusters
44+
- Use the default audit rule that automatically flags image deployments with high or critical vulnerabilities on eligible clusters.
4545
- Set time-bound, scoped exemptions.
4646
- Target rules granularly by cluster, namespace, pod, or image.
4747
- Monitor admission events via Defender for Cloud.

0 commit comments

Comments
 (0)