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
title: Create custom security standards and recommendations for AWS/GCP resources in Microsoft Defender for Cloud
3
-
description: Learn how to create custom security standards and recommendations for AWS/GCP resources in Microsoft Defender for Cloud
2
+
title: Create custom security standards and recommendations
3
+
description: Learn how to create custom security standards and recommendations for all clouds in Microsoft Defender for Cloud.
4
4
ms.topic: how-to
5
5
ms.date: 03/26/2023
6
6
---
7
7
8
-
# Create custom security standards and recommendations (AWS/GCP)
8
+
# Create custom security standards and recommendations in Microsoft Defender for Cloud
9
9
10
10
[Security recommendations](security-policy-concept.md) in Microsoft Defender for Cloud help you to improve and harden your security posture. Recommendations are based on assessments against [security standards](security-policy-concept.md) defined for Azure subscriptions, AWS accounts, and GCP projects that have Defender for Cloud enabled.
11
11
12
12
This article describes how to:
13
13
14
-
- Create custom recommendations for AWS accounts and GCP projects with a KQL query.
14
+
- Create custom recommendations for all clouds (Azure, AWS, and GCP) with a KQL query.
15
15
- Assign custom recommendations to a custom security standard.
16
16
17
17
## Before you start
18
18
19
-
- Defender for Cloud currently supports creating custom recommendations for AWS accounts and GCP projects only.
20
19
- You need Owner permissions on the subscription to create a new security standard.
21
-
- You need Security Admin permissions to create custom recommendations
22
-
- To create custom recommendations, you must have the [Defender CSPM plan](concept-cloud-security-posture-management.md) enabled.
20
+
- You need Security Admin permissions to create custom recommendations.
21
+
- To create custom recommendations based on KQL, you must have the [Defender CSPM plan](concept-cloud-security-posture-management.md) enabled. All customers can create custom recommendations based on Azure Policy.
23
22
-[Review support in Azure clouds](support-matrix-cloud-environment.md) for custom recommendations.
24
23
25
24
We recommend watching this episode of [Defender for Cloud in the field](https://techcommunity.microsoft.com/t5/microsoft-defender-for-cloud/creating-custom-recommendations-amp-standards-for-aws-gcp/ba-p/3810248) to learn more about the feature, and dig into creating KQL queries.
@@ -30,7 +29,7 @@ Watch this episode of [Defender for Cloud in the field](https://techcommunity.mi
30
29
31
30
Create custom recommendations, including steps for remediation, severity, and the standards to which the recommendation should be assigned. You add recommendation logic with KQL. You can use a simple query editor with built-in query templated that you can tweak as needed, or you can write your KQL query from scratch.
32
31
33
-
1. In the Defender for Cloud portal > **Environment settings**, select the relevant AWS account or GCP project.
32
+
1. In the Defender for Cloud portal > **Environment settings**, select the relevant scope.
@@ -59,7 +58,7 @@ We recommend using the query editor to create a recommendation query.
59
58
60
59
:::image type="content" source="./media/create-custom-recommendations/query-editor.png" alt-text="Screenshot showing how to use the query editor." lightbox="./media/create-custom-recommendations/query-editor.png":::
61
60
62
-
1. Select **Run query** to test the query you've created.
61
+
1. Select **Run query** to test the query you created.
63
62
1. When the query is ready, cut and paste it from the editor into the **Recommendations query** pane.
64
63
65
64
## Create a custom standard
@@ -70,17 +69,173 @@ Custom recommendations can be assigned to one or more custom standards.
70
69
71
70
1. Navigate to **Microsoft Defender for Cloud** > **Environment settings**.
1. In **Create new standard**, enter a name, description and select recommendations from the drop-down menu.
76
+
1. In **Recommendations**, select the recommendations that you want to add to the custom standard. For Azure subscriptions, you can see the source as well.
78
77
79
-
:::image type="content" source="media/create-custom-recommendations/create-standard-aws.png" alt-text="Screenshot of the window for creating a new standard.":::
78
+
:::image type="content" source="media/custom-security-policies/select-recommendations.png" alt-text="Screenshot that shows the list of all of the recommendations that are available to select for the custom standard." lightbox="media/custom-security-policies/select-recommendations.png":::
80
79
81
80
1. Select **Create**.
82
81
83
-
## Next steps
82
+
## Create and enhance custom recommendations with Azure Policy (legacy)
83
+
84
+
For Azure subscriptions, you can create custom recommendations and standards, and enhance them, using Azure Policy. This is a legacy feature, and we recommend using the new custom recommendations feature.
85
+
86
+
### Create a custom recommendation/standard (legacy)
87
+
88
+
You can create custom recommendations and standards in Defender for cloud by creating policy definitions and initiatives in Azure Policy, and onboarding them in Defender for Cloud.
89
+
90
+
Here's how you do that:
91
+
92
+
1. Create one or more policy definitions in the [Azure Policy portal](../governance/policy/tutorials/create-custom-policy-definition.md), or [programatically](../governance/policy/how-to/programmatically-create.md).
93
+
1.[Create a policy initiative](../governance/policy/concepts/initiative-definition-structure.md) that contains the custom policy definitions.
94
+
95
+
### Onboard the initiative as a custom standard (legacy)
96
+
97
+
[Policy assignments](../governance/policy/concepts/assignment-structure.md) are used by Azure Policy to assign Azure resources to a policy or initiative.
98
+
99
+
To onboard an initiative to a custom security standard in Defender for you, you need to include `"ASC":"true"` in the request body as shown here. The `ASC` field onboards the initiative to Microsoft Defender for Cloud.
100
+
101
+
Here's an example of how to do that.
102
+
103
+
#### Example to onboard a custom initiative
104
+
105
+
```json
106
+
PUT
107
+
PUT https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName}?api-version=2021-06-01
108
+
109
+
Request Body (JSON)
110
+
111
+
{
112
+
"properties": {
113
+
"displayName": "Cost Management",
114
+
"description": "Policies to enforce low cost storage SKUs",
115
+
"metadata": {
116
+
"category": "Cost Management"
117
+
"ASC":"true"
118
+
},
119
+
"parameters": {
120
+
"namePrefix": {
121
+
"type": "String",
122
+
"defaultValue": "myPrefix",
123
+
"metadata": {
124
+
"displayName": "Prefix to enforce on resource names"
The built-in recommendations supplied with Microsoft Defender for Cloud include details such as severity levels and remediation instructions. If you want to add this type of information to custom recommendations for Azure, use the REST API.
172
+
173
+
The two types of information you can add are:
174
+
175
+
-**RemediationDescription** – String
176
+
-**Severity** – Enum [Low, Medium, High]
177
+
178
+
The metadata should be added to the policy definition for a policy that is part of the custom initiative. It should be in the 'securityCenter' property, as shown:
For another example for using the securityCenter property, see [this section of the REST API documentation](/rest/api/defenderforcloud/assessments-metadata/create-in-subscription#examples).
237
+
238
+
## Related content
84
239
85
240
You can use the following links to learn more about Kusto queries:
0 commit comments