Skip to content

Commit e0b015c

Browse files
authored
Merge pull request #257217 from tejaswikolli-web/conditional
conditional access
2 parents 758ed1d + 503cb35 commit e0b015c

File tree

6 files changed

+220
-164
lines changed

6 files changed

+220
-164
lines changed

.openpublishing.redirection.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2770,6 +2770,11 @@
27702770
"redirect_url": "/azure/container-registry/tutorial-customer-managed-keys",
27712771
"redirect_document_id": false
27722772
},
2773+
{
2774+
"source_path_from_root": "/articles/container-registry/container-registry-enable-conditional-access-policy.md",
2775+
"redirect_url": "/azure/container-registry/container-registry-configure-conditional-access.md",
2776+
"redirect_document_id": false
2777+
},
27732778
{
27742779
"source_path": "articles/site-recovery/vmware-physical-secondary-disaster-recovery.md",
27752780
"redirect_url": "/azure/site-recovery/vmware-physical-secondary-architecture",
@@ -25794,5 +25799,6 @@
2579425799
"redirect_url": "https://azure.microsoft.com/updates/preview-ai-toolchain-operator-addon-for-aks/",
2579525800
"redirect_document_id": false
2579625801
}
25802+
2579725803
]
2579825804
}

articles/azure-resource-manager/bicep/private-module-registry.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ A Bicep registry is hosted on [Azure Container Registry (ACR)](../../container-r
5151
> [!IMPORTANT]
5252
> The private container registry is only available to users with the required access. However, it's accessed through the public internet. For more security, you can require access through a private endpoint. See [Connect privately to an Azure container registry using Azure Private Link](../../container-registry/container-registry-private-link.md).
5353
>
54-
> The private container registry must have the policy `azureADAuthenticationAsArmPolicy` set to `enabled`. If `azureADAuthenticationAsArmPolicy` is set to `disabled`, you'll get a 401 (Unauthorized) error message when publishing modules. See [Azure Container Registry introduces the Conditional Access policy](../../container-registry/container-registry-enable-conditional-access-policy.md).
54+
> The private container registry must have the policy `azureADAuthenticationAsArmPolicy` set to `enabled`. If `azureADAuthenticationAsArmPolicy` is set to `disabled`, you'll get a 401 (Unauthorized) error message when publishing modules. See [Azure Container Registry introduces the Conditional Access policy](../../container-registry/container-registry-configure-conditional-access.md).
5555
5656
## Publish files to registry
5757
@@ -92,7 +92,7 @@ You're now ready to reference the file in the registry from a Bicep file. For ex
9292
---
9393
## Working with Bicep registry files
9494

95-
When leveraging bicep files that are hosted in a remote registry, it's important to understand how your local machine will interact with the regsitry. When you first declare the reference to the registry, your local editor will try to communicate with the Azure Containter Registry and download a copy of the registry to your local cache.
95+
When leveraging bicep files that are hosted in a remote registry, it's important to understand how your local machine will interact with the registry. When you first declare the reference to the registry, your local editor will try to communicate with the Azure Container Registry and download a copy of the registry to your local cache.
9696

9797
The local cache is found in:
9898

articles/container-registry/TOC.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@
171171
href: allow-access-trusted-services.md
172172
- name: Access behind a firewall
173173
href: container-registry-firewall-access-rules.md
174-
- name: Enable conditional access policy
175-
href: container-registry-enable-conditional-access-policy.md
174+
- name: Configure conditional access to your Azure Container Registry.
175+
href: container-registry-configure-conditional-access.md
176+
- name: Disable authentication as ARM template
177+
href: container-registry-disable-authentication-as-arm.md
176178
- name: Authentication
177179
items:
178180
- name: Authentication overview
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: Configure conditional access to your Azure Container Registry.
3+
description: Learn how to configure conditional access to your registry by using Azure CLI and Azure portal.
4+
ms.author: tejaswikolli
5+
ms.service: container-registry
6+
ms.topic: tutorial #Don't change.
7+
ms.date: 11/02/2023
8+
9+
---
10+
11+
# Conditional Access policy for Azure Container Registry
12+
13+
Azure Container Registry (ACR) gives you the option to create and configure the *Conditional Access policy*. Conditional Access policies, which are typically associated with Azure Active Directory (Azure AD), are used to enforce strong authentication and access controls for various Azure services, including ACR.
14+
15+
The Conditional Access policy applies after the first-factor authentication to the Azure Container Registry is complete. The purpose of Conditional Access for ACR is for user authentication only. The policy enables the user to choose the controls and further blocks or grants access based on the policy decisions.
16+
17+
The [Conditional Access policy](../active-directory/conditional-access/overview.md) is designed to enforce strong authentication. The policy enables the security to meet the organizations compliance requirements and keep the data and user accounts safe.
18+
19+
>[!IMPORTANT]
20+
> To configure Conditional Access policy for the registry, you must disable [`authentication-as-arm`](container-registry-disable-authentication-as-arm.md) for all the registries within the desired tenant.
21+
22+
Learn more about [Conditional Access policy](../active-directory/conditional-access/overview.md), the [conditions](../active-directory/conditional-access/overview.md#common-signals) you'll take it into consideration to make [policy decisions.](../active-directory/conditional-access/overview.md#common-decisions)
23+
24+
In this tutorial, you learn how to:
25+
26+
> [!div class="checklist"]
27+
> * Create and configure Conditional Access policy for Azure Container Registry.
28+
> * Troubleshoot Conditional Access policy.
29+
30+
## Prerequisites
31+
32+
* [Install or upgrade Azure CLI](/cli/azure/install-azure-cli) version 2.40.0 or later. To find the version, run `az --version`.
33+
* Sign in to the [Azure portal](https://portal.azure.com).
34+
35+
## Create and configure a Conditional Access policy - Azure portal
36+
37+
ACR supports Conditional Access policy for Active Directory users only. It currently doesn't support Conditional Access policy for Service Principal. To configure Conditional Access policy for the registry, you must disable `authentication-as-arm` for all the registries within the desired tenant. In this tutorial, we'll create a basic Conditional Access policy for the Azure Container Registry from the Azure portal.
38+
39+
Create a Conditional Access policy and assign your test group of users as follows:
40+
41+
1. Sign in to the [Azure portal](https://portal.azure.com) by using an account with *global administrator* permissions.
42+
43+
1. Search for and select **Microsoft Entra ID**. Then select **Security** from the menu on the left-hand side.
44+
45+
1. Select **Conditional Access**, select **+ New policy**, and then select **Create new policy**.
46+
47+
:::image type="content" alt-text="A screenshot of the Conditional Access page, where you select 'New policy' and then select 'Create new policy'." source="media/container-registry-enable-conditional-policy/01-create-conditional-access.png":::
48+
49+
1. Enter a name for the policy, such as *demo*.
50+
51+
1. Under **Assignments**, select the current value under **Users or workload identities**.
52+
53+
:::image type="content" alt-text="A screenshot of the Conditional Access page, where you select the current value under 'Users or workload identities'." source="media/container-registry-enable-conditional-policy/02-conditional-access-users-and-groups.png":::
54+
55+
1. Under **What does this policy apply to?**, verify and select **Users and groups**.
56+
57+
1. Under **Include**, choose **Select users and groups**, and then select **All users**.
58+
59+
:::image type="content" alt-text="A screenshot of the page for creating a new policy, where you select options to specify users." source="media/container-registry-enable-conditional-policy/03-conditional-access-users-groups-select-users.png":::
60+
61+
1. Under **Exclude**, choose **Select users and groups**, to exclude any choice of selection.
62+
63+
1. Under **Cloud apps or actions**, choose **Cloud apps**.
64+
65+
1. Under **Include**, choose **Select apps**.
66+
67+
:::image type="content" alt-text="A screenshot of the page for creating a new policy, where you select options to specify cloud apps." source="media/container-registry-enable-conditional-policy/04-select-cloud-apps-select-apps.png":::
68+
69+
1. Browse for and select apps to apply Conditional Access, in this case *Azure Container Registry*, then choose **Select**.
70+
71+
:::image type="content" alt-text="A screenshot of the list of apps, with results filtered, and 'Azure Container Registry' selected." source="media/container-registry-enable-conditional-policy/05-select-azure-container-registry-app.png":::
72+
73+
1. Under **Conditions** , configure control access level with options such as *User risk level*, *Sign-in risk level*, *Sign-in risk detections (Preview)*, *Device platforms*, *Locations*, *Client apps*, *Time (Preview)*, *Filter for devices*.
74+
75+
1. Under **Grant**, filter and choose from options to enforce grant access or block access, during a sign-in event to the Azure portal. In this case grant access with *Require multifactor authentication*, then choose **Select**.
76+
77+
>[!TIP]
78+
> To configure and grant multi-factor authentication, see [configure and conditions for multi-factor authentication.](../active-directory/authentication/tutorial-enable-azure-mfa.md#configure-the-conditions-for-multi-factor-authentication)
79+
80+
1. Under **Session**, filter and choose from options to enable any control on session level experience of the cloud apps.
81+
82+
1. After selecting and confirming, Under **Enable policy**, select **On**.
83+
84+
1. To apply and activate the policy, Select **Create**.
85+
86+
:::image type="content" alt-text="A screenshot showing how to activate the Conditional Access policy." source="media/container-registry-enable-conditional-policy/06-enable-conditional-access-policy.png":::
87+
88+
We have now completed creating the Conditional Access policy for the Azure Container Registry.
89+
90+
## Troubleshoot Conditional Access policy
91+
92+
- For problems with Conditional Access sign-in, see [Troubleshoot Conditional Access sign-in](/entra/identity/conditional-access/troubleshoot-conditional-access).
93+
94+
- For problems with Conditional Access policy, see [Troubleshoot Conditional Access policy](/entra/identity/conditional-access/troubleshoot-conditional-access-what-if).
95+
96+
## Next steps
97+
98+
> [!div class="nextstepaction"]
99+
> [Azure Policy definitions](../governance/policy/concepts/definition-structure.md) and [effects](../governance/policy/concepts/effects.md).
100+
>[Common access concerns that Conditional Access policies can help with](../active-directory/conditional-access/concept-conditional-access-policy-common.md).
101+
> [Conditional Access policy components](../active-directory/conditional-access/concept-conditional-access-policies.md).
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
title: Disable authentication as ARM template
3+
description: "Disabling azureADAuthenticationAsArmPolicy will force the registry to use ACR audience token."
4+
ms.author: tejaswikolli
5+
ms.service: container-registry
6+
ms.topic: tutorial #Don't change.
7+
ms.date: 11/02/2023
8+
9+
---
10+
11+
# Disable authentication as ARM template
12+
13+
Azure AD Tokens are used when registry users authenticate with ACR. By default, Azure Container Registry (ACR) accepts Azure AD Tokens with an audience scope set for Azure Resource Manager (ARM), a control plane management layer for managing Azure resources.
14+
15+
By disabling ARM Audience Tokens and enforcing ACR Audience Tokens, you can enhance the security of your container registries during the authentication process by narrowing the scope of accepted tokens.
16+
17+
With ACR Audience Token enforcement, only Azure AD Tokens with an audience scope specifically set for ACR will be accepted during the registry authentication and sign-in process. This means that the previously accepted ARM Audience Tokens will no longer be valid for registry authentication, thereby enhancing the security of your container registries.
18+
19+
In this tutorial, you learn how to:
20+
21+
> [!div class="checklist"]
22+
> * Disable authentication-as-arm in ACR - Azure CLI.
23+
> * Disable authentication-as-arm in the ACR - Azure portal.
24+
25+
## Prerequisites
26+
27+
* [Install or upgrade Azure CLI](/cli/azure/install-azure-cli) version 2.40.0 or later. To find the version, run `az --version`.
28+
* Sign in to the [Azure portal](https://portal.azure.com).
29+
30+
## Disable authentication-as-arm in ACR - Azure CLI
31+
32+
Disabling `azureADAuthenticationAsArmPolicy` will force the registry to use ACR audience token. You can use Azure CLI version 2.40.0 or later, run `az --version` to find the version.
33+
34+
1. Run the command to show the current configuration of the registry's policy for authentication using ARM tokens with the registry. If the status is `enabled`, then both ACRs and ARM audience tokens can be used for authentication. If the status is `disabled` it means only ACR's audience tokens can be used for authentication.
35+
36+
```azurecli-interactive
37+
az acr config authentication-as-arm show -r <registry>
38+
```
39+
40+
1. Run the command to update the status of the registry's policy.
41+
42+
```azurecli-interactive
43+
az acr config authentication-as-arm update -r <registry> --status [enabled/disabled]
44+
```
45+
46+
## Disable authentication-as-arm in the ACR - Azure portal
47+
48+
Disabling `authentication-as-arm` property by assigning a built-in policy will automatically disable the registry property for the current and the future registries. This automatic behavior is for registries created within the policy scope. The possible policy scopes include either Resource Group level scope or Subscription ID level scope within the tenant.
49+
50+
You can disable authentication-as-arm in the ACR, by following below steps:
51+
52+
1. Sign in to the [Azure portal](https://portal.azure.com).
53+
54+
1. Refer to the ACR's built-in policy definitions in the [azure-container-registry-built-in-policy definition's](policy-reference.md).
55+
56+
1. Assign a built-in policy to disable authentication-as-arm definition - Azure portal.
57+
58+
### Assign a built-in policy definition to disable ARM audience token authentication - Azure portal.
59+
60+
You can enable registry's Conditional Access policy in the [Azure portal](https://portal.azure.com).
61+
62+
Azure Container Registry has two built-in policy definitions to disable authentication-as-arm, as below:
63+
64+
* `Container registries should have ARM audience token authentication disabled.` - This policy will report, block any non-compliant resources, and also sends a request to update non-compliant to compliant.
65+
* `Configure container registries to disable ARM audience token authentication.` - This policy offers remediation and updates non-compliant to compliant resources.
66+
67+
68+
1. Sign in to the [Azure portal](https://portal.azure.com).
69+
70+
1. Navigate to your **Azure Container Registry** > **Resource Group** > **Settings** > **Policies** .
71+
72+
:::image type="content" source="media/container-registry-enable-conditional-policy/01-azure-policies.png" alt-text="Screenshot showing how to navigate Azure policies.":::
73+
74+
1. Navigate to **Azure Policy**, On the **Assignments**, select **Assign policy**.
75+
76+
:::image type="content" source="media/container-registry-enable-conditional-policy/02-Assign-policy.png" alt-text="Screenshot showing how to assign a policy.":::
77+
78+
1. Under the **Assign policy** , use filters to search and find the **Scope**, **Policy definition**, **Assignment name**.
79+
80+
:::image type="content" source="media/container-registry-enable-conditional-policy/03-Assign-policy-tab.png" alt-text="Screenshot of the assign policy tab.":::
81+
82+
1. Select **Scope** to filter and search for the **Subscription** and **ResourceGroup** and choose **Select**.
83+
84+
85+
:::image type="content" source="media/container-registry-enable-conditional-policy/04-select-scope.png" alt-text="Screenshot of the Scope tab.":::
86+
87+
88+
1. Select **Policy definition** to filter and search the built-in policy definitions for the Conditional Access policy.
89+
90+
:::image type="content" source="media/container-registry-enable-conditional-policy/05-built-in-policy-definitions.png" alt-text="Screenshot of built-in-policy-definitions.":::
91+
92+
93+
1. Use filters to select and confirm **Scope**, **Policy definition**, and **Assignment name**.
94+
95+
1. Use the filters to limit compliance states or to search for policies.
96+
97+
1. Confirm your settings and set policy enforcement as **enabled**.
98+
99+
1. Select **Review+Create**.
100+
101+
:::image type="content" source="media/container-registry-enable-conditional-policy/06-enable-policy.png" alt-text="Screenshot to activate a Conditional Access policy.":::
102+
103+
104+
## Next steps
105+
106+
> [!div class="nextstepaction"]
107+
> [Create and configure a Conditional Access policy](container-registry-configure-conditional-access.md)

0 commit comments

Comments
 (0)