AAD | Enumerate valid emails/accounts

Hi!

Previous article: AAD | Enabled or not?

In this article, I will show you how you can enumerate valid emails/accounts of an Azure Active Directory. By making the POST request to ‘https://login.microsoftonline.com/common/GetCredentialType‘ with a JSON body containing the email id its possible to analyze the valid email id. If the « IfExistsResult » key value is 0 it means the user exists. Invalid accounts will return a 1.

Example in python:

import requests
body = '{"Username":"random.name@XYZ.com"}'
response = requests.post("https://login.microsoftonline.com/common/GetCredentialType", data=body).json()
if response["IfExistsResult"] == 0:
    print("Valid User")

To automate this enumeration, I will use o365creeper. This script takes either a single email address or a list of email addresses as input, sends a request to Office 365 without a password.

python o365creeper.py -e user@yourdomain.com

Maxime.

Key Auto-Rotation in Azure Key Vault

Hi!

In this article, I will share with you a new preview feature of Azure Key Vault. The goal of this feature is to automate the key rotation.

Automated key rotation in Key Vault allows users to configure Key Vault to automatically generate a new key version at a specified frequency. You can use rotation policy to configure rotation for each individual key. Microsoft recommendation is to rotate encryption keys at least every two years to meet cryptographic best practices.

Key Vault key rotation feature requires key management permissions. You can assign a « Key Vault Administrator » role to manage rotation policy and on-demand rotation. If you use an access policies permission model, it is required to set ‘Rotate’, ‘Set Rotation Policy’, and ‘Get Rotation Policy’ key permissions to manage rotation policy on keys.

The key rotation policy allows users to configure rotation interval, expiration interval for rotated keys, and near expiry notification period for monitoring expiration using event grid notifications.

Key rotation policy settings:

  • Expiry time: key expiration interval. It is used to set expiration date on newly rotated key. It does not affect a current key.
  • Enabled/disabled: flag to enable or disable rotation for the key
  • Rotation types:
    • Automatically renew at a given time after creation (default)
    • Automatically renew at a given time before expiry. It requires ‘Expiry Time’ set on rotation policy and ‘Expiration Date’ set on the key.
  • Rotation time: key rotation interval, the minimum value is 7 days from creation and 7 days from expiration time
  • Notification time: key near expiry event interval for event grid notification. It requires ‘Expiry Time’ set on rotation policy and ‘Expiration Date’ set on the key.

Configure the key rotation policy:

In the following screenshot, we can see an access permission error: the « Get Rotation Policy » is not enabled in this key vault’s access policy.

In this step, we will give the rotation policy permissions in the access policy defined for the user max.coq….

When it’s done, we can define the rotation policy for the key.

Key rotation on-demand:

In this step, we will see how we can rotate on-demand a key. In the rotation policy pane, please click on « Rotate Now ».

Click on « Ok » to confirm the key roration.

In the screenshot below we can see the new key version.

Maxime.