A cloud-based identity and access management service for securing user authentication and resource access
Hey Nisha, it looks like you want near real-time ingestion of identity-risk alerts (riskySignIns, riskDetections, riskyUsers) plus directory audit events—without over-polling—and you need a 14-day backfill on day one. Here’s what I’d recommend:
- Use a hybrid pipeline • Identity Protection events (riskySignIns, riskDetections, riskyUsers) are only exposed via Microsoft Graph. There’s no direct Event Hub export for those. • Directory audit logs (and Sign-In logs) can be routed via Diagnostic Settings → Event Hub for continuous streaming.
- Historical backfill (first 14 days) • For Identity Protection endpoints and auditLogs/directoryAudits: call the Graph API
/identityProtection/...and/auditLogs/directoryAuditswith acreatedDateTime ge {T-14d}filter to pull the last 14 days in a single or paged run. • Store the highestcreatedDateTimeorlastUpdatedDateTimeyou see, then switch to incremental. - Ongoing real-time ingestion • Audit & Sign-In logs: let Event Hub deliver them as they occur. In Diagnostic Settings, select only “AuditLogs” (and “SignInLogs” if you want raw sign-ins) so you don’t stream extra data. Filter further downstream if you only care about risky sign-ins. • Identity Protection: schedule a short-interval Graph poll (e.g. every 5 – 15 minutes) against
/identityProtection/riskySignIns,/identityProtection/riskDetections,/identityProtection/riskyUsersusing a filter on your last checkpoint timestamp. - Avoid unnecessary polling • In Diagnostic Settings you choose exactly which log categories go to Event Hub. • In your Graph poller, keep state (lastProcessedTime) so each run only requests new records via a
createdDateTimeorlastUpdatedDateTimefilter.
Putting it all together:
• Day 1: backfill both auditLogs and identityProtection events via Graph (14 days)
• Ongoing:
– AuditLogs/SignInLogs via Event Hub → your consumer → SIEM or data lake
– Identity Protection via scheduled Graph polling with time filters
This gives you near real-time, no surplus data, and a one-time historical pull.
— Reference list —
- Stream Entra activity logs to Event Hub: https://learn.microsoft.com/entra/identity/monitoring-health/howto-stream-logs-to-event-hub
- Audit log activity details & latency: https://learn.microsoft.com/entra/identity/monitoring-health/reference-audit-activities https://learn.microsoft.com/entra/identity/monitoring-health/reference-log-latency
- Graph Identity Protection endpoints: https://learn.microsoft.com/graph/api/resources/identityprotection-root (see
/identityProtection/riskySignIns,/riskDetections,/riskyUsers) - Graph directory audit logs: https://learn.microsoft.com/graph/api/directoryaudit-list
- Diagnostic Settings for routing logs: https://learn.microsoft.com/azure/active-directory/reports-monitoring/concept-activity-logs-azure-monitor
Note: This content was drafted with the help of an AI system. Please verify the information before relying on it for decision-making.