Azure Introduction
Azure Pricing
Azure Threats
No Security Contact Email Set
More Info:
At least one security contact email should be set.
Risk Level
Low
Address
Security
Compliance Standards
CISAZURE, CBP
Triage and Remediation
Remediation
To remediate the misconfiguration of “No Security Contact Email Set” in Azure, you can follow these steps:
- Log in to the Azure portal (https://portal.azure.com/).
- Click on the “Security Center” icon from the left-hand menu.
- In the Security Center, click on “Security policy” from the left-hand menu.
- Under the “Policy Management” section, click on the policy that is not compliant with the email set requirement.
- In the policy details, click on the “Edit” button.
- In the “Edit policy” window, scroll down to the “Notifications” section.
- Ensure that the “Send email notifications” toggle is set to “On”.
- In the “Security contact email” field, enter the email address that should receive the security notifications.
- Click on the “Save” button to save the changes.
- Verify that the policy is now compliant by checking the “Compliance” status in the policy details.
By following these steps, you have now remediated the misconfiguration of “No Security Contact Email Set” in Azure.
To remediate the “No Security Contact Email Set” misconfiguration in Azure using Azure CLI, follow these steps:
-
Open the Azure CLI on your local machine or in the Azure portal.
-
Run the following command to set the security contact email:
az security contact create --email <email_address> --name "Security Contact"
Replace <email_address>
with the email address you want to set as the security contact. You can also replace “Security Contact” with a different name for the contact.
- Verify that the email address has been set by running the following command:
az security contact show
This command will display the details of the security contact, including the email address.
- If you need to update the security contact email address in the future, you can use the following command:
az security contact update --email <new_email_address> --name "Security Contact"
Replace <new_email_address>
with the new email address you want to use for the security contact.
By following these steps, you can remediate the “No Security Contact Email Set” misconfiguration in Azure using Azure CLI.
To remediate the misconfiguration of “No Security Contact Email Set” in Azure using Python, you can follow the steps below:
- Import the necessary libraries:
from azure.identity import DefaultAzureCredential
from azure.mgmt.security import SecurityCenter
from azure.mgmt.resource import ResourceManagementClient
- Authenticate with Azure using the
DefaultAzureCredential
class:
credential = DefaultAzureCredential()
- Create a
SecurityCenter
client object:
security_center_client = SecurityCenter(
credential=credential,
subscription_id="<your-subscription-id>"
)
- Get the security contact email for the subscription:
resource_client = ResourceManagementClient(
credential=credential,
subscription_id="<your-subscription-id>"
)
subscription = resource_client.subscriptions.get("<your-subscription-id>")
security_contact_email = subscription.security_contact_email
- If the security contact email is not set, set it to a valid email address:
if not security_contact_email:
subscription.security_contact_email = "<your-email-address>"
resource_client.subscriptions.create_or_update(
subscription_id="<your-subscription-id>",
parameters=subscription
)
- Verify that the security contact email has been set:
subscription = resource_client.subscriptions.get("<your-subscription-id>")
security_contact_email = subscription.security_contact_email
print(f"Security contact email: {security_contact_email}")
Note: Replace <your-subscription-id>
and <your-email-address>
with your own values.
By following the above steps, you can remediate the misconfiguration of “No Security Contact Email Set” in Azure using Python.