Keen documentation
Open Keen ↗

Administering Keen

Microsoft Entra ID and Azure

Chapter 15 of 40

Microsoft Entra ID and Azure

Microsoft posture reads one Entra tenant through Microsoft Graph and its Azure subscriptions through Azure Resource Manager, with read-only access, and records the tenant's sign-ins and directory audits and each subscription's activity log. Results appear on the Microsoft vendor's Cloud posture tab, one section for the tenant and one per subscription (see Cloud vendor posture).

Keen signs in as an app registration with the client credentials flow, through its validated HTTP client, and follows paging links only on the host that issued them. The tenant is the app registration's own, and Azure must confirm that each subscription belongs to it before Keen reads the subscription.

Checks

ScopeCheckActionMet when
TenantMFA for usersposture.identity.mfaEvery member has registered a strong method the authentication methods policy allows (Microsoft's MFA capable).
TenantMFA for administratorsposture.identity.admin_mfaEvery member holding an Entra administrator role is MFA capable.
TenantMFA enforcementposture.identity.mfa_enforcedSecurity defaults are on, or an enabled Conditional Access policy requires MFA of all users for all cloud apps, with no alternative control and no location, platform, client app, device or risk condition. Users every such policy excludes by name are listed.
TenantAdministratorsposture.identity.adminsReported for information: the users, groups and apps holding a privileged Entra role across the whole tenant.
TenantGuest accountsposture.identity.guestsReported for information: how many guests the tenant holds, and how many are yet to accept.
TenantUnused accountsposture.identity.inactiveNo enabled account has gone without a successful sign-in for KEEN_CLOUD_INACTIVE_DAYS.
TenantApp registration secrets and certificatesposture.credentials.key_ageNo app registration holds a live client secret or certificate older than KEEN_CLOUD_KEY_AGE_DAYS. The detail also counts those expiring within 30 days.
SubscriptionOwnersposture.identity.adminsReported for information: the principals holding Owner or User Access Administrator on the subscription, directly or from above it.
SubscriptionActivity log exportposture.logging.audit_trailA diagnostic setting sends the subscription's Administrative activity log to a Log Analytics workspace, storage account, event hub or partner solution.
SubscriptionPublic blob accessposture.storage.public_accessNo storage account allows anonymous public access to blobs.
SubscriptionSSH and RDP open to the internetposture.network.admin_portsNo network security group attached to a network interface or subnet lets TCP port 22 or 3389 in from the internet (*, Internet, Any, 0.0.0.0/0 or ::/0).
SubscriptionDatabases open to the internetposture.network.databasesNo Azure SQL server or PostgreSQL or MySQL flexible server with public network access has a firewall rule from 0.0.0.0 to 255.255.255.255.
SubscriptionDefender for Cloud recommendationsposture.findingsNo unhealthy recommendation of high severity; the detail also gives the secure score and the medium and low counts.

Network security group rules apply in priority order, the first rule matching the port and source decides, and Azure's default rules deny the internet. Privileged Entra roles are those Microsoft labels privileged, apart from the reader roles; assignments scoped to an administrative unit and eligible Privileged Identity Management assignments are left out. Group and role exclusions in a Conditional Access policy are counted in the detail, since their members are not expanded. MFA for users and Unused accounts need Microsoft Entra ID P1 or P2; without it they read Not established and the other checks carry on.

The vendor page lists the tenant's users with their administrator roles, MFA and last sign-in, and guests.

Activity

Keen records the tenant's sign-ins as SignIn, with whether MFA was required, its directory audits under their own activity names, such as Add member to role, and each subscription's completed Administrative, Security and Policy activity under its Resource Manager operation, such as Microsoft.Authorization/roleAssignments/write. Entra keeps audits and sign-ins for 7 days on the free tier and 30 days with P1 or P2, and sign-in logs need P1 or P2; Azure keeps the activity log for 90 days. Each read stops 30 minutes before the present.

1. Register the app and grant its access

  1. In the Microsoft Entra admin centre, open Applications → App registrations → New registration. Name it, for example Keen posture, keep Accounts in this organisational directory only, and register it. Note the Application (client) ID and Directory (tenant) ID.
  2. Under Certificates & secrets → Client secrets, choose New client secret, set an expiry and copy the secret's Value at once: the admin centre shows it only once.
  3. Under API permissions, choose Add a permission → Microsoft Graph → Application permissions, add the permissions below, then Grant admin consent, which needs a Privileged Role Administrator or Global Administrator.
  4. For each subscription, or once on a management group above them, open Access control (IAM) → Add → Add role assignment, choose Reader, then User, group, or service principal, and select the app registration. Repeat with Security Reader.
Permission or roleNeeded by
AuditLog.Read.AllMFA for users and administrators, Unused accounts, sign-ins and directory audits
Policy.Read.AllMFA enforcement
User.Read.AllMFA enforcement, Administrators, Guest accounts, Unused accounts and naming subscription owners
RoleManagement.Read.DirectoryAdministrators
Application.Read.AllApp registration secrets and certificates
Reader roleEvery subscription check and the activity log, on each subscription
Security Reader roleDefender for Cloud recommendations, on each subscription

2. Configure Keen

SettingPurpose
KEEN_AZURE_ENABLEDTurns Microsoft posture on.
AZURE_POSTURE_TENANT_ID, AZURE_POSTURE_CLIENT_ID, AZURE_POSTURE_CLIENT_SECRETThe tenant ID, client ID and secret value from step 1. The _POSTURE_ names keep Azure SDKs, which read AZURE_CLIENT_SECRET, from using them.
KEEN_AZURE_SUBSCRIPTIONSThe subscription IDs to read, separated by commas; up to 100. Leave it blank to read every subscription of the tenant the app registration can see.

3. Verify

Recreate the API, worker and beat containers and choose Admin → Ingest runners → Run Microsoft Entra ID and Azure, then open the Microsoft vendor's Cloud posture tab. A check that reads Not established names its reason: not allowed means a Graph permission is missing or lacks admin consent, or the app registration lacks Reader or Security Reader on the subscription; the plan does not include it means the tenant has no Microsoft Entra ID P1 or P2; not set up, or the credentials were not accepted covers a missing setting, an expired secret, and a listed subscription that belongs to another tenant or cannot be found.

4. Rotate or revoke

Add a new client secret before the old one expires, update AZURE_POSTURE_CLIENT_SECRET, recreate the containers and delete the old secret. To disconnect, turn Microsoft posture off and delete the app registration's secrets and role assignments, or the app registration.