|
1 | 1 | ---
|
2 | 2 | title: Details of the Azure Policy attestation structure
|
3 | 3 | description: Describes the components of the Azure Policy attestation JSON object.
|
4 |
| -ms.date: 09/23/2022 |
| 4 | +ms.date: 07/01/2024 |
5 | 5 | ms.topic: conceptual
|
6 | 6 | ---
|
| 7 | + |
7 | 8 | # Azure Policy attestation structure
|
8 | 9 |
|
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. |
10 | 11 |
|
11 | 12 | > [!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). |
13 | 14 |
|
14 | 15 | ## Best practices
|
15 | 16 |
|
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. |
17 | 18 |
|
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`. |
19 | 20 |
|
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. |
21 | 22 |
|
22 | 23 | ## Example attestation
|
23 | 24 |
|
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: |
25 | 26 |
|
26 | 27 | ```http
|
27 | 28 | PUT http://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations/{name}?api-version=2019-10-01
|
28 | 29 | ```
|
29 | 30 |
|
30 | 31 | ## Request body
|
31 | 32 |
|
32 |
| -Below is a sample attestation resource JSON object: |
| 33 | +The following code is a sample attestation resource JSON object: |
33 | 34 |
|
34 | 35 | ```json
|
35 | 36 | "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 | + } |
56 | 57 | }
|
57 | 58 | ```
|
58 | 59 |
|
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. | |
70 | 71 |
|
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. |
72 | 73 |
|
73 | 74 | ## Next steps
|
74 | 75 |
|
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). |
0 commit comments