Skip to content

Commit 609cffd

Browse files
authored
Merge pull request #279841 from davidsmatlak/ds-update-policy-doc-20240701
Azure Policy freshness updates
2 parents bb91a3b + ee13fd5 commit 609cffd

File tree

2 files changed

+70
-69
lines changed

2 files changed

+70
-69
lines changed
Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,78 @@
11
---
22
title: Details of the Azure Policy attestation structure
33
description: Describes the components of the Azure Policy attestation JSON object.
4-
ms.date: 09/23/2022
4+
ms.date: 07/01/2024
55
ms.topic: conceptual
66
---
7+
78
# Azure Policy attestation structure
89

9-
Attestations are used by Azure Policy to set compliance states of resources or scopes targeted by [manual policies](effects.md#manual). They also allow users to provide additional metadata or link to evidence which accompanies the attested compliance state.
10+
Attestations are used by Azure Policy to set compliance states of resources or scopes targeted by [manual policies](effect-manual.md). They also allow users to provide more metadata or link to evidence that accompanies the attested compliance state.
1011

1112
> [!NOTE]
12-
> Attestations can be created and managed only through Azure Policy [Azure Resource Manager (ARM) API](/rest/api/policy/attestations), [PowerShell](/powershell/module/az.policyinsights) or [Azure CLI](/cli/azure/policy/attestation).
13+
> Attestations can be created and managed only through Azure Policy [Azure Resource Manager (ARM) API](/rest/api/policy/attestations), [PowerShell](/powershell/module/az.policyinsights) or [Azure CLI](/cli/azure/policy/attestation).
1314
1415
## Best practices
1516

16-
Attestations can be used to set the compliance state of an individual resource for a given manual policy. This means that each applicable resource requires one attestation per manual policy assignment. For ease of management, manual policies should be designed to target the scope which defines the boundary of resources whose compliance state needs to be attested.
17+
Attestations can be used to set the compliance state of an individual resource for a given manual policy. Each applicable resource requires one attestation per manual policy assignment. For ease of management, manual policies should be designed to target the scope that defines the boundary of resources whose compliance state needs to be attested.
1718

18-
For example, suppose an organization divides teams by resource group, and each team is required to attest to development of procedures for handling resources within that resource group. In this scenario, the conditions of the policy rule should specify that type equals `Microsoft.Resources/resourceGroups`. This way, one attestation is required for the resource group, rather than for each individual resource within. Similarly, if the organization divides teams by subscriptions, the policy rule should target `Microsoft.Resources/subscriptions`.
19+
For example, suppose an organization divides teams by resource group, and each team is required to attest to development of procedures for handling resources within that resource group. In this scenario, the conditions of the policy rule should specify that type equals `Microsoft.Resources/resourceGroups`. This way, one attestation is required for the resource group, rather than for each individual resource within. Similarly, if the organization divides teams by subscriptions, the policy rule should target `Microsoft.Resources/subscriptions`.
1920

20-
Typically, the provided evidence should correspond with relevant scopes of the organizational structure. This pattern prevents the need to duplicate evidence across many attestations. Such duplications would make manual policies difficult to manage, and indicate that the policy definition targets the wrong resource(s).
21+
Typically, the provided evidence should correspond with relevant scopes of the organizational structure. This pattern prevents the need to duplicate evidence across many attestations. Such duplications would make manual policies difficult to manage, and indicate that the policy definition targets the wrong resources.
2122

2223
## Example attestation
2324

24-
Below is an example of creating a new attestation resource which sets the compliance state for a resource group targeted by a manual policy assignment:
25+
The following example creates a new attestation resource that sets the compliance state for a resource group targeted by a manual policy assignment:
2526

2627
```http
2728
PUT http://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations/{name}?api-version=2019-10-01
2829
```
2930

3031
## Request body
3132

32-
Below is a sample attestation resource JSON object:
33+
The following code is a sample attestation resource JSON object:
3334

3435
```json
3536
"properties": {
36-
"policyAssignmentId": "/subscriptions/{subscriptionID}/providers/microsoft.authorization/policyassignments/{assignmentID}",
37-
"policyDefinitionReferenceId": "{definitionReferenceID}",
38-
"complianceState": "Compliant",
39-
"expiresOn": "2023-07-14T00:00:00Z",
40-
"owner": "{AADObjectID}",
41-
"comments": "This subscription has passed a security audit. See attached details for evidence",
42-
"evidence": [
43-
{
44-
"description": "The results of the security audit.",
45-
"sourceUri": "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011"
46-
},
47-
{
48-
"description": "Description of the attached evidence document.",
49-
"sourceUri": "https://storagesamples.blob.core.windows.net/sample-container/contingency_evidence_adendum.docx"
50-
},
51-
],
52-
"assessmentDate": "2022-11-14T00:00:00Z",
53-
"metadata": {
54-
"departmentId": "{departmentID}"
55-
}
37+
"policyAssignmentId": "/subscriptions/{subscriptionID}/providers/microsoft.authorization/policyassignments/{assignmentID}",
38+
"policyDefinitionReferenceId": "{definitionReferenceID}",
39+
"complianceState": "Compliant",
40+
"expiresOn": "2023-07-14T00:00:00Z",
41+
"owner": "{AADObjectID}",
42+
"comments": "This subscription has passed a security audit. See attached details for evidence",
43+
"evidence": [
44+
{
45+
"description": "The results of the security audit.",
46+
"sourceUri": "https://gist.github.com/contoso/9573e238762c60166c090ae16b814011"
47+
},
48+
{
49+
"description": "Description of the attached evidence document.",
50+
"sourceUri": "https://contoso.blob.core.windows.net/contoso-container/contoso_file.docx"
51+
},
52+
],
53+
"assessmentDate": "2022-11-14T00:00:00Z",
54+
"metadata": {
55+
"departmentId": "{departmentID}"
56+
}
5657
}
5758
```
5859

59-
|Property |Description |
60-
|---------|---------|
61-
|`policyAssignmentId` |Required assignment ID for which the state is being set. |
62-
|`policyDefinitionReferenceId` |Optional definition reference ID, if within a policy initiative. |
63-
|`complianceState` |Desired state of the resources. Allowed values are `Compliant`, `NonCompliant`, and `Unknown`. |
64-
|`expiresOn` |Optional date on which the compliance state should revert from the attested compliance state to the default state |
65-
|`owner` |Optional Azure AD object ID of responsible party. |
66-
|`comments` |Optional description of why state is being set. |
67-
|`evidence` |Optional array of links to attestation evidence. |
68-
|`assessmentDate` |Date at which the evidence was assessed. |
69-
|`metadata` |Optional additional information about the attestation. |
60+
| Property | Description |
61+
| ---- | ---- |
62+
| `policyAssignmentId` | Required assignment ID for which the state is being set. |
63+
| `policyDefinitionReferenceId` | Optional definition reference ID, if within a policy initiative. |
64+
| `complianceState` | Desired state of the resources. Allowed values are `Compliant`, `NonCompliant`, and `Unknown`. |
65+
| `expiresOn` | Optional date on which the compliance state should revert from the attested compliance state to the default state. |
66+
| `owner` | Optional Microsoft Entra ID object ID of responsible party. |
67+
| `comments` | Optional description of why state is being set. |
68+
| `evidence` | Optional array of links to attestation evidence. |
69+
| `assessmentDate` | Date at which the evidence was assessed. |
70+
| `metadata` | Optional additional information about the attestation. |
7071

71-
Because attestations are a separate resource from policy assignments, they have their own lifecycle. You can PUT, GET and DELETE attestations using the ARM API. Attestations are removed if the related manual policy assignment or policyDefinitionReferenceId are deleted, or if a resource unique to the attestation is deleted. See the [Policy REST API Reference](/rest/api/policy) for more details.
72+
Because attestations are a separate resource from policy assignments, they have their own lifecycle. You can PUT, GET, and DELETE attestations using the Azure Resource Manager API. Attestations are removed if the related manual policy assignment or `policyDefinitionReferenceId` are deleted, or if a resource unique to the attestation is deleted. For more information, go to [Policy REST API Reference](/rest/api/policy) for more details.
7273

7374
## Next steps
7475

75-
- Review [Understanding policy effects](effects.md).
76-
- Study the [initiative definition structure](./initiative-definition-structure.md)
77-
- Review examples at [Azure Policy samples](../samples/index.md).
76+
- [Azure Policy definitions effect basics](effect-basics.md).
77+
- [Azure Policy initiative definition structure](./initiative-definition-structure.md).
78+
- [Azure Policy samples](../samples/index.md).

articles/governance/policy/concepts/policy-applicability.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
---
22
title: Azure Policy applicability logic
33
description: Describes the rules Azure Policy uses to determine whether the policy is applied to its assigned resources.
4-
ms.date: 09/22/2022
4+
ms.date: 07/01/2024
55
ms.topic: conceptual
66
---
7+
78
# What is applicability in Azure Policy?
89

9-
When a policy definition is assigned to a scope, Azure Policy determines which resources in that scope should be considered for compliance evaluation. A resource will only be assessed for compliance if it's considered **applicable** to the given policy assignment.
10+
When a policy definition is assigned to a scope, Azure Policy determines which resources in that scope should be considered for compliance evaluation. A resource is only assessed for compliance if it's considered **applicable** to the given policy assignment.
1011

11-
Applicability is determined by several factors:
12+
Several factors determine applicability:
1213
- **Conditions** in the `if` block of the [policy rule](../concepts/definition-structure-policy-rule.md#conditions).
1314
- **Mode** of the policy definition.
1415
- **Excluded scopes** specified in the assignment.
1516
- **Resource selectors** specified in the assignment.
1617
- **Exemptions** of resources or resource hierarchies.
1718

18-
Condition(s) in the `if` block of the policy rule are evaluated for applicability in slightly different ways based on the effect.
19+
Conditions in the `if` block of the policy rule are evaluated for applicability in slightly different ways based on the effect.
1920

2021
> [!NOTE]
2122
> Applicability is different from compliance, and the logic used to determine each is different. If a resource is **applicable** that means it is relevant to the policy. If a resource is **compliant** that means it adheres to the policy. Sometimes only certain conditions from the policy rule impact applicability, while all conditions of the policy rule impact compliance state.
2223
2324
## Resource Manager modes
2425

25-
### -IfNotExists policy effects
26+
### ifNotExists policy effects
2627

2728
The applicability of `AuditIfNotExists` and `DeployIfNotExists` policies is based off the entire `if` condition of the policy rule. When the `if` evaluates to false, the policy isn't applicable.
2829

@@ -32,16 +33,16 @@ Azure Policy evaluates only `type`, `name`, and `kind` conditions in the policy
3233

3334
Following are special cases to the previously described applicability logic:
3435

35-
|Scenario |Result |
36-
|---------|---------|
37-
|Any invalid aliases in the `if` conditions |The policy isn't applicable |
38-
|When the `if` conditions consist of only `kind` conditions |The policy is applicable to all resources |
39-
|When the `if` conditions consist of only `name` conditions |The policy is applicable to all resources |
40-
|When the `if` conditions consist of only `type` and `kind` conditions |Only `type` conditions are considered when deciding applicability |
41-
|When the `if` conditions consist of only `type` and `name` conditions |Only `type` conditions are considered when deciding applicability |
42-
|When the `if` conditions consist of `type`, `kind`, and other conditions |Both `type` and `kind` conditions are considered when deciding applicability |
43-
|When the `if` conditions consist of `type`, `name`, and other conditions |Both `type` and `name` conditions are considered when deciding applicability |
44-
|When any conditions (including deployment parameters) include a `location` condition |Won't be applicable to subscriptions |
36+
| Scenario | Result |
37+
| ---- | ---- |
38+
| Any invalid aliases in the `if` conditions | The policy isn't applicable |
39+
| When the `if` conditions consist of only `kind` conditions | The policy is applicable to all resources |
40+
| When the `if` conditions consist of only `name` conditions | The policy is applicable to all resources |
41+
| When the `if` conditions consist of only `type` and `kind` conditions | Only `type` conditions are considered when deciding applicability |
42+
| When the `if` conditions consist of only `type` and `name` conditions | Only `type` conditions are considered when deciding applicability |
43+
| When the `if` conditions consist of `type`, `kind`, and other conditions | Both `type` and `kind` conditions are considered when deciding applicability |
44+
| When the `if` conditions consist of `type`, `name`, and other conditions | Both `type` and `name` conditions are considered when deciding applicability |
45+
| When any conditions (including deployment parameters) include a `location` condition | Isn't applicable to subscriptions |
4546

4647

4748
## Resource provider modes
@@ -52,34 +53,33 @@ The applicability of `Microsoft.Kubernetes.Data` policies is based off the entir
5253

5354
### Microsoft.KeyVault.Data, Microsoft.ManagedHSM.Data, Microsoft.DataFactory.Data, and Microsoft.MachineLearningServices.v2.Data
5455

55-
Policies with these RP Modes are applicable if the `type` condition of the policy rule evaluates to true. The `type` refers to component type.
56+
Policies with these resource provider modes are applicable if the `type` condition of the policy rule evaluates to true. The `type` refers to component type.
5657

5758
Key Vault component types:
58-
- Microsoft.KeyVault.Data/vaults/certificates
59-
- Microsoft.KeyVault.Data/vaults/keys
60-
- Microsoft.KeyVault.Data/vaults/secrets
59+
- `Microsoft.KeyVault.Data/vaults/certificates`
60+
- `Microsoft.KeyVault.Data/vaults/keys`
61+
- `Microsoft.KeyVault.Data/vaults/secrets`
6162

62-
Managed HSM component type:
63-
- Microsoft.ManagedHSM.Data/managedHsms/keys
63+
Managed Hardware Security Module (HSM) component type:
64+
- `Microsoft.ManagedHSM.Data/managedHsms/keys`
6465

6566
Azure Data Factory component type:
66-
- Microsoft.DataFactory.Data/factories/outboundTraffic
67+
- `Microsoft.DataFactory.Data/factories/outboundTraffic`
6768

6869
Azure Machine Learning component type:
69-
- Microsoft.MachineLearningServices.v2.Data/workspaces/deployments
70+
- `Microsoft.MachineLearningServices.v2.Data/workspaces/deployments`
7071

7172
### Microsoft.Network.Data
7273

7374
Policies with mode `Microsoft.Network.Data` are applicable if the `type` and `name` conditions of the policy rule evaluate to true. The `type` refers to component type:
74-
- Microsoft.Network/virtualNetworks
75+
- `Microsoft.Network/virtualNetworks`
7576

7677
## Not Applicable Resources
7778

7879
There could be situations in which resources are applicable to an assignment based on conditions or scope, but they shouldn't be applicable due to business reasons. At that time, it would be best to apply [exclusions](./assignment-structure.md#excluded-scopes) or [exemptions](./exemption-structure.md). To learn more on when to use either, review [scope comparison](./scope.md#scope-comparison)
7980

8081
> [!NOTE]
81-
> By design, Azure Policy does not evaluate resources under the `Microsoft.Resources` resource provider (RP) from
82-
policy evaluation, except for subscriptions and resource groups.
82+
> By design, Azure Policy does not evaluate resources under the `Microsoft.Resources` resource provider from policy evaluation, except for subscriptions and resource groups.
8383
8484
## Next steps
8585

0 commit comments

Comments
 (0)