Control: 2.1 Ensure that Microsoft Defender for Servers is set to 'On'
Description
Enabling Microsoft Defender for App Service allows for greater defense-in-depth, with threat detection provided by the Microsoft Security Response Center (MSRC).
Remediation
From Console
Perform the following action to check Azure Defender is set to On for Servers:
- Go to
Microsoft Defender for Cloud
- Select
Environment Settings
blade - Click on the subscription name
- Select the
Defender plans
blade - On the line in the table for
App Service
SelectOn
underPlan
. - Select
Save
From Command Line
Command to enable Azure defender for servers
az account get-access-token --query "{subscription:subscription,accessToken:accessToken}" --out tsv | xargs -L1 bash -c 'curl -X PUT -H "Authorization: Bearer $1" -H "Content-Type: application/json" https://management.azure.com/subscriptions/$0/providers/Microsoft.Security/pricings/VirtualMachines?api-version=2018-06-01 -d@"input.json"'
Where input.json
contains the request body json data as mentioned below
{ "id":"/subscriptions/<Your_Subscription_Id>/providers/Microsoft.Security/pricings/ VirtualMachines", "name":"VirtualMachines", "type":"Microsoft.Security/pricings", "properties":{ "pricingTier":"Standard" }}
Usage
Run the control in your terminal:
powerpipe control run azure_compliance.control.cis_v140_2_1
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run azure_compliance.control.cis_v140_2_1 --share
SQL
This control uses a named query:
securitycenter_azure_defender_on_for_server