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/definition-structure.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,9 +136,8 @@ see [Tag support for Azure resources](../../../azure-resource-manager/management
136
136
137
137
The following Resource Provider modes are fully supported:
138
138
139
-
-`Microsoft.Kubernetes.Data` for managing your Kubernetes clusters on or off Azure. Definitions
140
-
using this Resource Provider mode use effects _audit_, _deny_, and _disabled_. Use
141
-
of the [EnforceOPAConstraint](./effects.md#enforceopaconstraint) effect is _deprecated_.
139
+
-`Microsoft.Kubernetes.Data` for managing your Kubernetes clusters on or off Azure, and for Azure Policy components that target [Azure Arc-enabled Kubernetes clusters](../../../aks/intro-kubernetes.md) components such as pods, containers, and ingresses. Definitions
140
+
using this Resource Provider mode use effects _audit_, _deny_, and _disabled_.
142
141
-`Microsoft.KeyVault.Data` for managing vaults and certificates in
143
142
[Azure Key Vault](../../../key-vault/general/overview.md). For more information on these policy
Copy file name to clipboardExpand all lines: articles/governance/policy/concepts/effects.md
+7-135Lines changed: 7 additions & 135 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,16 +23,15 @@ These effects are currently supported in a policy definition:
23
23
-[Manual (preview)](#manual-preview)
24
24
-[Modify](#modify)
25
25
26
-
The following effects are _deprecated_:
26
+
## Interchanging effects
27
27
28
-
-[EnforceOPAConstraint](#enforceopaconstraint)
29
-
-[EnforceRegoPolicy](#enforceregopolicy)
28
+
Sometimes multiple effects can be valid for a given policy definition. Parameters are often used to specify allowed effect values so that a single definition can be more versatile. However, it is important to note that not all effects are interchangeable. Resource properties and logic in the policy rule can determine whether a cerain effect is considered valid to the policy definition. For example, policy definitions with effect **AuditIfNotExists** require additional details in the policy rule which are not required for policies with effect **Audit**. The effects also behave differently. **Audit** policies will assess a resource's compliance based on its own properties, while **AuditIfNotExists** policies will assess a resource's compliance based on a child or extension resource's properties.
30
29
31
-
> [!IMPORTANT]
32
-
> In place of the**EnforceOPAConstraint** or **EnforceRegoPolicy**effects, use _audit_ and
33
-
> _deny_ with Resource Provider mode `Microsoft.Kubernetes.Data`. The built-in policy definitions
34
-
> have been updated. When existing policy assignments of these built-in policy definitions are
35
-
> modified, the _effect_ parameter must be changed to a value in the updated _allowedValues_ list.
30
+
The following is general guidance around interchangeable effects:
31
+
-**Audit**, **Deny**, and either**Modify** or **Append**are often interchangeable.
32
+
-**AuditIfNotExists** and **DeployIfNotExists** are often interchangeable.
33
+
-**Manual** is not interchangeable.
34
+
-**Disabled** is interchangeable with any effect.
36
35
37
36
## Order of evaluation
38
37
@@ -621,133 +620,6 @@ When **enforcementMode** is **Disabled**_**, resources are still evaluated. Logg
621
620
logs, and the policy effect don't occur. For more information, see
The new `manual` (preview) effect enables you to self-attest the compliance of resources or scopes. Unlike other policy definitions that actively scan for evaluation, the Manual effect allows for manual changes to the compliance state. To change the compliance of a resource or scope targeted by a manual policy, you'll need to create an [attestation](attestation-structure.md). The [best practice](attestation-structure.md#best-practices) is to design manual policies that target the scope which defines the boundary of resources whose compliance need attesting.
Copy file name to clipboardExpand all lines: articles/governance/policy/concepts/policy-applicability.md
+23-3Lines changed: 23 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,9 @@ Condition(s) in the `if` block of the policy rule are evaluated for applicabilit
21
21
> [!NOTE]
22
22
> 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.
23
23
24
-
## Applicability logic for Append/Modify/Audit/Deny/RP Mode specific effects
24
+
## Applicability logic for resource manager modes
25
+
26
+
### Append, Audit, Manual, Modify and Deny policy effects
25
27
26
28
Azure Policy evaluates only `type`, `name`, and `kind` conditions in the policy rule `if` expression and treats other conditions as true (or false when negated). If the final evaluation result is true, the policy is applicable. Otherwise, it's not applicable.
27
29
@@ -35,9 +37,27 @@ Following are special cases to the previously described applicability logic:
35
37
|When the `if` conditions consist of only `type` and `kind` or `type` and `name` conditions |Only type conditions are considered when deciding applicability |
36
38
|When any conditions (including deployment parameters) include a `location` condition |Will not be applicable to subscriptions |
37
39
38
-
## Applicability logic for AuditIfNotExists and DeployIfNotExists policy effects
40
+
### AuditIfNotExists and DeployIfNotExists policy effects
41
+
42
+
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 is not applicable.
43
+
44
+
## Applicability logic for resource provider modes
45
+
46
+
### Microsoft.Kubernetes.Data
47
+
48
+
The applicability of `Microsoft.Kubernetes.Data` policies is based off the entire `if` condition of the policy rule. When the `if` evaluates to false, the policy is not applicable.
49
+
50
+
### Microsoft.KeyVault.Data
51
+
52
+
Policies with mode `Microsoft.KeyVault.Data` are applicable if the `type` condition of the policy rule evaluates to true. The `type` refers to component type, such as:
53
+
- Microsoft.KeyVault.Data/vaults/certificates
54
+
- Microsoft.KeyVault.Data/vaults/keys
55
+
- Microsoft.KeyVault.Data/vaults/secrets
56
+
57
+
### Microsoft.Network.Data
39
58
40
-
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 is not applicable.
59
+
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:
Copy file name to clipboardExpand all lines: articles/governance/policy/how-to/get-compliance-data.md
+50-19Lines changed: 50 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -238,9 +238,18 @@ For details and steps, see
238
238
239
239
## How compliance works
240
240
241
-
In an assignment, a resource is **Non-compliant** if it doesn't follow policy or initiative rules
242
-
and isn't _exempt_. The following table shows how different policy effects work with the condition
243
-
evaluation for the resulting compliance state:
241
+
When initiative or policy definitions are assigned and evaluated, resulting compliance states are determined based on conditions in the policy rule and resources' adherence to those requirements.
242
+
243
+
Azure Policy supports the following compliance states:
244
+
- Non-compliant
245
+
- Compliant
246
+
- Conflict
247
+
- Exempted
248
+
- Unknown (preview)
249
+
250
+
### Compliant and non-compliant states
251
+
252
+
In an assignment, a resource is **non-compliant** if it is applicable to the policy assignment and does not adhere to conditions in the policy rule. The following table shows how different policy effects work with the condition evaluation for the resulting compliance state:
244
253
245
254
| Resource State | Effect | Policy Evaluation | Compliance State |
246
255
| --- | --- | --- | --- |
@@ -254,6 +263,8 @@ evaluation for the resulting compliance state:
254
263
> existence condition to be FALSE to be non-compliant. When TRUE, the IF condition triggers
255
264
> evaluation of the existence condition for the related resources.
256
265
266
+
#### Example
267
+
257
268
For example, assume that you have a resource group - ContsoRG, with some storage accounts
258
269
(highlighted in red) that are exposed to public networks.
259
270
@@ -270,6 +281,14 @@ audits the three non-compliant storage accounts, consequently changing their sta
270
281
Diagram showing images for five storage accounts in the Contoso R G resource group. Storage accounts one and three now have green checkmarks beneath them, while storage accounts two, four, and five now have red warning signs beneath them.
271
282
:::image-end:::
272
283
284
+
#### Understand non-compliance
285
+
286
+
When a resource is determined to be **non-compliant**, there are many possible reasons. To determine
287
+
the reason a resource is **non-compliant** or to find the change responsible, see
Besides **Compliant** and **Non-compliant**, policies and resources have four other states:
274
293
275
294
- **Exempt**: The resource is in scope of an assignment, but has a
@@ -280,11 +299,7 @@ Besides **Compliant** and **Non-compliant**, policies and resources have four ot
280
299
- **Not registered**: The Azure Policy Resource Provider hasn't been registered or the account
281
300
logged in doesn't have permission to read compliance data.
282
301
283
-
Azure Policy uses the **type**, **name**, or **kind** fields in the definition to determine whether
284
-
a resource is a match. When the resource matches, it's considered applicable and has a status of
285
-
either **Compliant**, **Non-compliant**, or **Exempt**. If either **name** or **kind** is the only
286
-
property in the definition, then all included and non-exempt resources are considered applicable and
287
-
are evaluated.
302
+
Azure Policy relies on several factors to determine whether a resource is considered [applicable](../concepts/policy-applicability.md), then to determine its compliance state.
288
303
289
304
The compliance percentage is determined by dividing **Compliant**, **Exempt**, and **Unknown** resources by _total
290
305
resources_. _Total resources_ is defined as the sum of the **Compliant**, **Non-compliant**,
@@ -300,7 +315,29 @@ The overall resource compliance is 95% (19 out of 20).
300
315
> pages in portal are different for enabled initiatives. For more information, see
There are several ways to view aggregated compliance results:
321
+
322
+
| Aggregate scope | Factors determining resulting compliance state |
323
+
| --- | --- |
324
+
| Initiative | All policies within |
325
+
| Initiative group or control | All policies within |
326
+
| Policy | All applicable resources |
327
+
| Resource | All applicable policies |
328
+
329
+
So how is the aggregate compliance state determined if multiple resources or policies have different compliance states themselves? This is done by ranking each compliance state so that one "wins" over another in this situation. The rank order is:
330
+
1. Non-compliant
331
+
1. Compliant
332
+
1. Conflict
333
+
1. Exempted
334
+
1. Unknown (preview)
335
+
336
+
This means that if there are both non-compliant and compliant states, the rolled up aggregate would be non-compliant, and so on. Let's look at an example.
337
+
338
+
Assume an initiative contains 10 policies, and a resource is exempt from one policy but compliant to the remaining nine. Because a compliant state has a higher rank than an exempted state, the resource would register as compliant in the rolled-up summary of the initiative. So, a resource will only show as exempt for the entire initiative if it is exempt from, or has unknown compliance to, every other single applicable policy in that initiative. On the other extreme, if the resource is non-compliant to at least one applicable policy in the initiative, it will have an overall compliance state of non-compliant, regardless of the remaining applicable policies.
339
+
340
+
## Compliance reporting through Azure Portal
304
341
305
342
The Azure portal showcases a graphical experience of visualizing and understanding the state of
306
343
compliance in your environment. On the **Policy** page, the **Overview** option provides details for
@@ -323,9 +360,6 @@ resources for the current assignment. The tab defaults to **Non-compliant**, but
323
360
Events (append, audit, deny, deploy, modify) triggered by the request to create a resource are shown
324
361
under the **Events** tab.
325
362
326
-
> [!NOTE]
327
-
> For an AKS Engine policy, the resource shown is the resource group.
328
-
329
363
:::image type="content" source="../media/getting-compliance-data/compliance-events.png" alt-text="Screenshot of the Events tab on Compliance Details page." border="false":::
330
364
331
365
<a name="component-compliance"></a>
@@ -344,13 +378,10 @@ log provides additional context and information about those events.
344
378
345
379
:::image type="content" source="../media/getting-compliance-data/compliance-activitylog.png" alt-text="Screenshot of the Activity Log for Azure Policy activities and evaluations." border="false":::
346
380
347
-
### Understand non-compliance
348
-
349
-
When a resource is determined to be **non-compliant**, there are many possible reasons. To determine
350
-
the reason a resource is **non-compliant** or to find the change responsible, see
0 commit comments