Skip to content

Commit de03fd1

Browse files
authored
Merge pull request MicrosoftDocs#111634 from memildin/asc-melvyn-vmva
Custom policy metadata instructions
2 parents bc3a40d + 7b6fc1f commit de03fd1

File tree

2 files changed

+73
-4
lines changed

2 files changed

+73
-4
lines changed

articles/security-center/custom-security-policies.md

Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ manager: rkarlin
77

88
ms.service: security-center
99
ms.topic: conceptual
10-
ms.date: 03/25/2020
10+
ms.date: 04/22/2020
1111
ms.author: memildin
1212
---
1313

@@ -17,9 +17,9 @@ ms.author: memildin
1717

1818
To help secure your systems and environment, Azure Security Center generates security recommendations. These recommendations are based on industry best practices, which are incorporated into the generic, default security policy supplied to all customers. They can also come from Security Center's knowledge of industry and regulatory standards.
1919

20-
With this feature, you can add your own *custom* initiatives. You'll then receive recommendations if your environment doesn't follow the policies you create. Any custom initiatives you create will appear alongside the built-in initiatives in the regulatory compliance dashboard described in the tutorial [Improve your regulatory compliance](security-center-compliance-dashboard.md).
20+
With this feature, you can add your own *custom* initiatives. You'll then receive recommendations if your environment doesn't follow the policies you create. Any custom initiatives you create will appear alongside the built-in initiatives in the regulatory compliance dashboard, as described in the tutorial [Improve your regulatory compliance](security-center-compliance-dashboard.md).
2121

22-
As discussed [here](https://docs.microsoft.com/azure/governance/policy/concepts/definition-structure#definition-location) in the Azure Policy documentation, when you specify a location for your custom initiative, it must be a management group or a subscription.
22+
As discussed in [the Azure Policy documentation](https://docs.microsoft.com/azure/governance/policy/concepts/definition-structure#definition-location), when you specify a location for your custom initiative, it must be a management group or a subscription.
2323

2424
## To add a custom initiative to your subscription
2525

@@ -51,7 +51,7 @@ As discussed [here](https://docs.microsoft.com/azure/governance/policy/concepts/
5151
1. Select the policies to include and click **Add**.
5252
1. Enter any desired parameters.
5353
1. Click **Save**.
54-
1. In the Add custom initiatives page, click refresh and your new initiative will be shown as available.
54+
1. In the Add custom initiatives page, click refresh. Your new initiative will be shown as available.
5555
1. Click **Add** and assign it to your subscription.
5656

5757
> [!NOTE]
@@ -67,6 +67,75 @@ As discussed [here](https://docs.microsoft.com/azure/governance/policy/concepts/
6767

6868
[![Custom recommendations](media/custom-security-policies/custom-policy-recommendations.png)](media/custom-security-policies/custom-policy-recommendations-in-context.png#lightbox)
6969

70+
## Enhancing your custom recommendations with detailed information
71+
72+
The built-in recommendations supplied with Azure Security Center include details such as severity levels and remediation instructions. If you want to add this type of information to your custom recommendations so that it appears in the Azure portal or wherever you access your recommendations, you'll need to use the REST API.
73+
74+
The two types of information you can add are:
75+
76+
- **RemediationDescription** – String
77+
- **Severity** – Enum [Low, Medium, High]
78+
79+
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:
80+
81+
```json
82+
"metadata": {
83+
"securityCenter": {
84+
"RemediationDescription": "Custom description goes here",
85+
"Severity": "High",
86+
},
87+
```
88+
89+
Below is an example of a custom policy including the metadata/securityCenter property:
90+
91+
```json
92+
{
93+
"properties": {
94+
"displayName": "Security - ERvNet - AuditRGLock",
95+
"policyType": "Custom",
96+
"mode": "All",
97+
"description": "Audit required resource groups lock",
98+
"metadata": {
99+
"securityCenter": {
100+
"remediationDescription": "Resource Group locks can be set via Azure Portal -> Resource Group -> Locks",
101+
"severity": "High",
102+
},
103+
},
104+
"parameters": {
105+
"expressRouteLockLevel": {
106+
"type": "String",
107+
"metadata": {
108+
"displayName": "Lock level",
109+
"description": "Required lock level for ExpressRoute resource groups."
110+
},
111+
"allowedValues": [
112+
"CanNotDelete",
113+
"ReadOnly"
114+
]
115+
}
116+
},
117+
"policyRule": {
118+
"if": {
119+
"field": "type",
120+
"equals": "Microsoft.Resources/subscriptions/resourceGroups"
121+
},
122+
"then": {
123+
"effect": "auditIfNotExists",
124+
"details": {
125+
"type": "Microsoft.Authorization/locks",
126+
"existenceCondition": {
127+
"field": "Microsoft.Authorization/locks/level",
128+
"equals": "[parameters('expressRouteLockLevel')]"
129+
}
130+
}
131+
}
132+
}
133+
}
134+
}
135+
```
136+
137+
For another example of using the securityCenter property, see [this section of the REST API documentation](https://docs.microsoft.com/rest/api/securitycenter/assessmentsmetadata/createinsubscription#examples).
138+
70139

71140
## Next steps
72141

Loading

0 commit comments

Comments
 (0)