Blog · 03

Auditar la higiene de Entra ID: huecos de MFA y cuentas olvidadasAuditing Entra ID hygiene: MFA gaps and forgotten accounts

Administradores sin MFA, miembros inactivos e invitados obsoletos, en una sola pasada.Admins without MFA, inactive members and stale guests, found in one pass.

El problema

La deuda de identidad crece sin hacer ruido: un administrador que nunca registró MFA, una baja cuya cuenta sigue activa, invitados de un proyecto que acabó hace un año.

Qué he hecho

Una auditoría que señala cuatro cosas:

  • Administradores sin MFA.
  • Miembros sin MFA.
  • Miembros sin actividad en más de 90 días.
  • Cuentas de invitado obsoletas.

Cómo está hecho

scripts/Export-EntraUsers.ps1 lee los usuarios, su signInActivity y el informe de registro de MFA por Microsoft Graph, con User.Read.All y AuditLog.Read.All. La actividad de inicio de sesión requiere Entra ID P1 o P2, y el README lo dice. Python hace el análisis y el informe. Siete tests.

Qué aprendí

Casi todo el trabajo está en decidir qué significa "inactivo" y "obsoleto" y dejarlo escrito, para poder defender el informe cuando alguien pregunte por qué sale su cuenta.

Siguientes pasos

  • Dar permisos de solo lectura en Graph (User.Read.All, AuditLog.Read.All) en un tenant con Entra ID P1 o P2.
  • Acordar con seguridad qué significan "inactivo" y "obsoleto" en tu organización y fijar esos umbrales.
  • Ejecutarlo cada mes y guardar cada informe como evidencia para las revisiones de acceso.

¿Quieres llevarlo a tu entorno o adaptarlo a tu caso? Escríbeme y lo vemos.

The problem

Identity debt builds up quietly: an admin who never registered MFA, a leaver whose account is still enabled, guests invited for a project that ended a year ago.

What I built

An audit that flags four things:

  • Admins without MFA.
  • Members without MFA.
  • Members inactive for more than 90 days.
  • Stale guest accounts.

How it is built

scripts/Export-EntraUsers.ps1 reads users, their signInActivity and the MFA registration report through Microsoft Graph, with User.Read.All and AuditLog.Read.All. Sign-in activity needs Entra ID P1 or P2, and the README says so. Python does the analysis and the report. Seven tests.

What I learned

Most of the work is deciding what "inactive" and "stale" mean and writing it down, so the report can be defended when someone asks why their account is on it.

Next steps

  • Grant read-only Graph permissions (User.Read.All, AuditLog.Read.All) on a tenant with Entra ID P1 or P2.
  • Agree with security what "inactive" and "stale" mean in your organisation and set those thresholds.
  • Run it monthly and keep each report as evidence for access reviews.

Want to bring it to your environment or adapt it to your case? Get in touch and we can look at it together.

Tech Career Lab · newsletter

¿Te ha servido? Cada dos semanas envío una idea práctica para perfiles IT: LinkedIn, proyectos, networking y procesos de selección.Found this useful? Every two weeks I send one practical idea for IT professionals: LinkedIn, projects, networking and hiring processes.

Apúntate y llévate las 33 ideasSign up and get the 33 ideas →