Skip to main content

RunBook01 - Error MFA NPS Azure: Certificado de equipo caducado

Criticidad: ALTA — Impacta autenticación MFA RADIUS para VPN, Wi-Fi corporativo y aplicaciones on-prem que delegan en NPS.

Tiempo estimado de resolución: 15–30 min

Responsable: Equipo Infraestructura / Seguridad Perimetral


🎯 Síntoma

Usuarios reportan fallo de autenticación MFA al conectar por VPN (FortiClient / Pulse Secure / RRAS) o al acceder a Wi-Fi corporativo (802.1X).

Logs del servidor NPS (Event Viewer → Applications and Services Logs → Microsoft → Windows → NPS → Operational) muestran:

Event ID 6273 (Audit Failure)
Reason: The connection request was rejected because the certificate used for RADIUS authentication has expired.

O en el cliente VPN:

Error 734: The PPP link control protocol was terminated.
RADIUS server certificate validation failed.

🔍 Causa raíz

El servidor NPS (Windows Server con rol Network Policy Server) utiliza un certificado de equipo (Machine Certificate) para:

  1. Establecer el túnel RADIUS seguro (RADSEC / PEAP-MSCHAPv2 / EAP-TLS)
  2. Validarse frente a los clientes (VPN, APs Wi-Fi, switches)

El certificado expiró (fecha Not After superada). Windows no lo renueva automáticamente si:

  • La plantilla de certificado no tiene Autoenrollment habilitado
  • El servidor no contacta con la CA empresarial (AD CS) por GPO, red o permisos
  • El certificado fue emitido manualmente (no via plantilla)

✅ Prerrequisitos

RequisitoDetalle
AccesoRDP al servidor NPS (nps01.infra.plexus.local, nps02...) con cuenta de administrador de dominio
PermisosEnroll + Autoenroll en la plantilla RAS and IAS Server (o Machine) en la CA emisora
Herramientascertlm.msc, mmc (Certificados → Cuenta de equipo), certutil, PowerShell
Ventana de cambioVentana de mantenimiento estándar (bajo impacto: renovación es transparente si hay 2+ NPS en LB)

🛠️ Pasos de diagnóstico

1. Verificar certificado actual

# En el servidor NPS
Get-ChildItem Cert:\LocalMachine\My | Where-Object {
$_.EnhancedKeyUsageList.FriendlyName -like "*Server Authentication*" `
-or $_.Subject -like "*nps*"
} | Select-Object Subject, NotBefore, NotAfter, Thumbprint, Issuer
  • Confirmar NotAfter < hoyconfirmado caducado

2. Comprobar plantilla de autoenrollment

# En la CA (o desde NPS con RSAT)
certutil -Template

Buscar plantilla RAS and IAS Server (OID 1.3.6.1.4.1.311.21.8.3.1.1) o Machine:

  • ¿Tiene Autoenrollment = Enabled?
  • ¿Grupo Domain Controllers / RAS and IAS Servers con permisos Read, Enroll, Autoenroll?

3. Forzar renovación manual (si autoenroll falla)

# Opción A: Renovación via certreq (si plantilla OK)
certreq -enroll "RAS and IAS Server"

# Opción B: Solicitud manual con certlm.msc
# 1. certlm.msc → Personal → Certificates → Botón derecho → All Tasks → Request New Certificate
# 2. Seleccionar "Active Directory Enrollment Policy" → Next
# 3. Marcar "RAS and IAS Server" (o Machine) → Enroll

4. Verificar nuevo certificado

Get-ChildItem Cert:\LocalMachine\My | Where-Object { $_.NotAfter -gt (Get-Date) -and $_.Subject -like "*nps*" } | Select Subject, NotAfter, Thumbprint
  • Debe aparecer nuevo certificado con fecha futura

🔧 Pasos de resolución

A. Renovación rápida (producción con 2+ NPS detrás de LB)

  1. Drenar tráfico del NPS afectado (quitar del LB / FortiGate / Azure LB backend pool)
  2. Ejecutar paso 3 (forzar renovación)
  3. Reiniciar servicio NPS:
    Restart-Service IAS -Force
  4. Validar (ver sección Validación)
  5. Reintegrar al LB

Nota: Si solo hay 1 NPS, programa ventana de 5 min; la renovación es rápida y los clientes reintentan automáticamente.

B. Si la plantilla NO tiene autoenrollment / falla

  1. En la CA (ca01.infra.plexus.local):
    • Abrir certsrv.mscCertificate TemplatesManage
    • Duplicar RAS and IAS Server → Nombre: RAS and IAS Server v2
    • Pestaña Security → Añadir grupo RAS and IAS Servers (o Domain Controllers) → Permisos: Read, Enroll, Autoenroll
    • Pestaña Subject NameSupply in the request (si usa CN=FQDN) o Build from AD
    • OK → Cerrar
  2. En CA → Certificate TemplatesNewCertificate Template to Issue → Seleccionar RAS and IAS Server v2
  3. En NPS → certlm.mscRequest New Certificate → Debe aparecer la v2 → Enroll

C. Si la CA no es accesible (red/permisos)

  • Escalar a Equipo de PKI / AD CS (ticket urgente)
  • Workaround temporal: emitir certificado manual en CA web (https://ca01.infra.plexus.local/certsrv) → Request a certificateAdvanced → Plantilla RAS and IAS ServerSubmit → Exportar .pfx → Importar en NPS (certlm.mscPersonalImport)

✅ Validación post-cambio

ComprobaciónComando / AcciónResultado esperado
Certificado válidoGet-ChildItem Cert:\LocalMachine\My | ? NotAfter -gt (Get-Date) | ? Subject -like "*nps*"Nuevo cert con NotAfter > hoy + 1-2 años
Servicio NPS OKGet-Service IASRunning
Event Viewer limpioGet-WinEvent -LogName "Microsoft-Windows-NPS/Operational" -MaxEvents 20 | ? Id -eq 6273Cero eventos 6273 nuevos
Test RADIUS localradtest -x user@plexus.es password nps01 1812 testing123 (si freeradius-utils instalado)Access-Accept
Test real VPNConectar con FortiClient / Pulse Secure usuario de pruebaConexión exitosa, MFA push llega a Azure MFA / Authenticator
Test Wi-Fi 802.1XAsociar dispositivo corporativo a SSID Plexus-CorpAutenticación OK, IP asignada

🔄 Rollback

Si el nuevo certificado causa problemas (raro):

  1. Volver al certificado anterior (todavía en store aunque expirado):
    # Identificar thumbprint antiguo
    $old = (Get-ChildItem Cert:\LocalMachine\My | Where-Object { $_.NotAfter -lt (Get-Date) -and $_.Subject -like "*nps*" } | Sort-Object NotAfter -Descending)[0].Thumbprint
    # Cambiar binding NPS al cert antiguo (si NPS lo permite vía netsh)
    netsh nps set globalcertificatethumbprint $old
    Restart-Service IAS -Force
  2. Documentar en ticket y escalar a PKI para re-emisión correcta.

📋 Checklist de cierre

  • Certificado renovado y válido en todos los NPS del cluster
  • Event Viewer sin errores 6273 durante 15 min
  • Pruebas VPN + Wi-Fi + Apps RADIUS OK
  • Ticket actualizado con thumbprint nuevo, fecha expiración, pasos seguidos
  • Alerta de monitorización (Check_MK / Zabbix / SCOM) certificado NPS → verde
  • Notificar en #infra-ops : "✅ RunBook01 ejecutado — NPS cert renovado en nps01/nps02"

📚 Referencias


🏷️ Metadata

CampoValor
IDRB-001
Versión1.0
AutorEquipo Infraestructura
RevisiónTrimestral (coincide con caducidad cert ~1-2 años)
Próxima revisión(Get-Date).AddMonths(3).ToString('yyyy-MM-dd')
ClasificaciónInterno - Confidencial