You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/governance/policy/concepts/assignment-structure.md
+27-6Lines changed: 27 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Details of the policy assignment structure
3
3
description: Describes the policy assignment definition used by Azure Policy to relate policy definitions and parameters to resources for evaluation.
4
-
ms.date: 05/12/2022
4
+
ms.date: 09/21/2022
5
5
ms.topic: conceptual
6
6
ms.author: timwarner
7
7
author: timwarner-msft
@@ -87,7 +87,7 @@ _common_ properties used by Azure Policy. Each `metadata` property has a limit o
87
87
value. However, the scope isn't locked to the value and it can be changed to another scope.
88
88
89
89
The following example of `parameterScopes` is for a _strongType_ parameter named
90
-
**backupPolicyId** that sets a scope for resource selection when the assignment is edited in the
90
+
`backupPolicyId` that sets a scope for resource selection when the assignment is edited in the
91
91
Portal.
92
92
93
93
```json
@@ -102,12 +102,33 @@ _common_ properties used by Azure Policy. Each `metadata` property has a limit o
102
102
any.
103
103
-`updatedOn` (string): The Universal ISO 8601 DateTime format of the assignment update time, if
104
104
any.
105
+
-`evidenceStorages` (object): An array of storage containers that holds attestation evidence for policy assignments with a `manual` effect. The `displayName` property is the name of the storage account. The `evidenceStorageAccountID` property is the resource ID of the storage account. The `evidenceBlobContainer` property is the blob container name in which you plan to store the evidence.
105
106
106
-
## Enforcement Mode
107
+
```json
108
+
{
109
+
"properties": {
110
+
"displayName": "A contingency plan should be in place to ensure operational continuity for each Azure subscription."
commonly referred to as "What If" and aligns to safe deployment practices. **enforcementMode** is
112
133
different from the [Disabled](./effects.md#disabled) effect, as that effect prevents resource
113
134
evaluation from happening at all.
@@ -204,7 +225,8 @@ same policy definition is reusable with a different set of parameters for a diff
204
225
reducing the duplication and complexity of policy definitions while providing flexibility.
205
226
206
227
## Identity
207
-
For policy assignments with effect set to **deployIfNotExisit** or **modify**, it is required to have an identity property to do remediation on non-compliant resources. When using identity, the user must also specify a location for the assignment.
228
+
229
+
For policy assignments with effect set to **deployIfNotExist** or **modify**, it is required to have an identity property to do remediation on non-compliant resources. When using identity, the user must also specify a location for the assignment.
208
230
209
231
> [!NOTE]
210
232
> A single policy assignment can be associated with only one system- or user-assigned managed identity. However, that identity can be assigned more than one role if necessary.
@@ -231,4 +253,3 @@ For policy assignments with effect set to **deployIfNotExisit** or **modify**, i
231
253
- Learn how to [remediate non-compliant resources](../how-to/remediate-resources.md).
232
254
- Review what a management group is with
233
255
[Organize your resources with Azure management groups](../../management-groups/overview.md).
- Defines any parameters and values to pass to the Constraint. Each value must exist in the
199
202
Constraint template CRD.
@@ -275,7 +278,7 @@ related resources to match.
275
278
- Doesn't apply if **type** is a resource that would be underneath the **if** condition resource.
276
279
- For _ResourceGroup_, would limit to the **if** condition resource's resource group or the
277
280
resource group specified in **ResourceGroupName**.
278
-
- For _Subscription_, queries the entire subscription for the related resource. Assignment scope should be set at subscription or higher for proper evaluation.
281
+
- For _Subscription_, queries the entire subscription for the related resource. Assignment scope should be set at subscription or higher for proper evaluation.
279
282
- Default is _ResourceGroup_.
280
283
-**EvaluationDelay** (optional)
281
284
- Specifies when the existence of the related resources should be evaluated. The delay is only
@@ -451,7 +454,7 @@ location of the Constraint template to use in Kubernetes to limit the allowed co
451
454
## DeployIfNotExists
452
455
453
456
Similar to AuditIfNotExists, a DeployIfNotExists policy definition executes a template deployment
454
-
when the condition is met. Policy assignments with effect set as DeployIfNotExists require a [managed identity](../how-to/remediate-resources.md) to do remediation.
457
+
when the condition is met. Policy assignments with effect set as DeployIfNotExists require a [managed identity](../how-to/remediate-resources.md) to do remediation.
@@ -497,7 +500,7 @@ related resources to match and the template deployment to execute.
497
500
- Doesn't apply if **type** is a resource that would be underneath the **if** condition resource.
498
501
- For _ResourceGroup_, would limit to the **if** condition resource's resource group or the
499
502
resource group specified in **ResourceGroupName**.
500
-
- For _Subscription_, queries the entire subscription for the related resource. Assignment scope should be set at subscription or higher for proper evaluation.
503
+
- For _Subscription_, queries the entire subscription for the related resource. Assignment scope should be set at subscription or higher for proper evaluation.
501
504
- Default is _ResourceGroup_.
502
505
-**EvaluationDelay** (optional)
503
506
- Specifies when the existence of the related resources should be evaluated. The delay is only
@@ -742,13 +745,108 @@ Example: Gatekeeper v2 admission control rule to allow only the specified contai
742
745
}
743
746
```
744
747
748
+
## Manual (preview)
749
+
750
+
The new `manual` (preview) effect enables you to define and track your own custom attestation
751
+
resources. Unlike other Policy definitions that actively scan for evaluation, the Manual effect
752
+
allows for manual changes to the compliance state. To change the compliance for a manual policy,
753
+
you'll need to create an attestation for that compliance state.
754
+
755
+
> [!NOTE]
756
+
> During Public Preview, support for manual policy is available through various Microsoft Defender
757
+
> for Cloud regulatory compliance initiatives. If you are a Microsoft Defender for Cloud [Premium tier](https://azure.microsoft.com/pricing/details/defender-for-cloud/) customer, refer to their experience overview.
758
+
759
+
The following example targets Azure subscriptions and sets the initial compliance state to `Unknown`.
760
+
761
+
```json
762
+
{
763
+
"if": {
764
+
"field": "type",
765
+
"equals": "Microsoft.Resources/subscriptions"
766
+
},
767
+
"then": {
768
+
"effect": "manual",
769
+
"details": {
770
+
"defaultState": "Unknown"
771
+
}
772
+
}
773
+
}
774
+
```
775
+
776
+
The `defaultState` property has three possible values:
777
+
778
+
-**Unknown**: The initial, default state of the targeted resources.
779
+
-**Compliant**: Resource is compliant according to your manual policy standards
780
+
-**Non-compliant**: Resource is non-compliant according to your manual policy standards
781
+
782
+
The Azure Policy compliance engine evaluates all applicable resources to the default state specified
783
+
in the definition (`Unknown` if not specified). An `Unknown` compliance state indicates that you
784
+
must manually attest the resource compliance state. If the effect state is unspecified, it defaults
785
+
to `Unknown`. The `Unknown` compliance state indicates that you must attest the compliance state yourself.
786
+
787
+
The following screenshot shows how a manual policy assignment with the `Unknown`
788
+
state appears in the Azure portal:
789
+
790
+

791
+
792
+
When a policy definition with `manual` effect is assigned, you have the option to include **evidence**, which refers to optional supplemental information which supports the custom compliance attestation. Evidence itself is stored in Azure Storage, and you can specify the storage blob container in the [policy assignment's metadata](../concepts/assignment-structure.md#metadata) under the property `evidenceStorages`. Further details of the evidence file are described in the attestation JSON resource.
793
+
794
+
### Attestations
795
+
796
+
`Microsoft.PolicyInsights/attestations`, called an Attestation resource, is a new proxy resource type
797
+
that sets the compliance states for targeted resources in a manual policy. You can only have one
798
+
attestation on one resource for an individual policy. In preview, Attestations are available
799
+
only through the Azure Resource Manager (ARM) API.
800
+
801
+
Below is an example of creating a new attestation resource:
802
+
803
+
```http
804
+
PUT http://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/attestations/{name}?api-version=2019-10-01
805
+
```
806
+
807
+
#### Request body
808
+
809
+
Below is a sample attestation resource JSON object:
|policyAssignmentId |Required assignment ID for which the state is being set. |
835
+
|policyDefinitionReferenceId |Optional definition reference ID, if within a policy initiative. |
836
+
|complianceState |Desired state of the resources. Allowed values are `Compliant`, `NonCompliant`, and `Unknown`. |
837
+
|owner |Optional Azure AD object ID of responsible party. |
838
+
|comments |Optional description of why state is being set. |
839
+
|evidence |Optional link array for attestation evidence. |
840
+
841
+
Because attestations are a separate resource from policy assignments, they have their own lifecycle. You can PUT, GET and DELETE attestations by using the ARM API. See the [Policy REST API Reference](/rest/api/policy) for more details.
842
+
745
843
## Modify
746
844
747
845
Modify is used to add, update, or remove properties or tags on a subscription or resource during
748
846
creation or update. A common example is updating tags on resources such as costCenter. Existing
749
847
non-compliant resources can be remediated with a
750
848
[remediation task](../how-to/remediate-resources.md). A single Modify rule can have any number of
751
-
operations. Policy assignments with effect set as Modify require a [managed identity](../how-to/remediate-resources.md) to do remediation.
849
+
operations. Policy assignments with effect set as Modify require a [managed identity](../how-to/remediate-resources.md) to do remediation.
752
850
753
851
The following operations are supported by Modify:
754
852
@@ -772,7 +870,7 @@ The following operations are supported by Modify:
772
870
Modify evaluates before the request gets processed by a Resource Provider during the creation or
773
871
updating of a resource. The Modify operations are applied to the request content when the **if**
774
872
condition of the policy rule is met. Each Modify operation can specify a condition that determines
775
-
when it's applied. Operations with conditions that are evaluated to _false_ are skipped.
873
+
when it's applied. Operations with _false_ condition evaluations are skipped.
776
874
777
875
When an alias is specified, the following additional checks are performed to ensure that the Modify
778
876
operation doesn't change the request content in a way that causes the resource provider to reject
0 commit comments