Skip to main content
Version: 2.2.1-preview

MT.1198 - App registration certificates should not have excessive validity periods.

Overviewโ€‹

This test checks if any app registration uses a certificate that was issued with an excessive validity period.

Certificates are the recommended alternative to client secrets, but a certificate that is valid for several years reintroduces the risk it was meant to remove: a stolen private key stays usable for the entire remaining validity period, and long-lived credentials are rarely rotated or reviewed.

An app management policy does not close this gap on its own. Credential restrictions carry a restrictForAppsCreatedAfterDateTime property and only apply to credentials added after the policy takes effect, so certificates that already exist are grandfathered in and are never re-evaluated. A tenant can therefore pass the app management policy test and still authenticate with multi-year certificates.

Certificates that have already expired can no longer be used to authenticate and are not reported by this test.

Remediation actionโ€‹

  1. Open the app registration listed below in the Microsoft Entra admin center and select Certificates & secrets.
  2. Request or generate a replacement certificate with a shorter validity period and upload it under Certificates.
  3. Update the workload that authenticates with the app registration to use the new certificate.
  4. Once the workload has been confirmed to work, delete the long-lived certificate.
  5. Configure the default app management policy with an asymmetricKeyLifetime restriction so that new certificates cannot be added with an excessive validity period.
  6. Where possible, replace certificate authentication with a managed identity or workload identity federation, which removes the credential entirely.

Learn moreโ€‹

Test Metadataโ€‹

FieldValue
Test IDMT.1198
SeverityMedium
SuiteMaester
CategoryApp
PowerShell testTest-MtAppRegistrationCertificateLifetime
TagsApp, Entra, Graph, LongRunning, Maester, MT.1198

Sourceโ€‹

  • Pester test: tests/Maester/Entra/Test-AppRegistrations.Tests.ps1
  • PowerShell source: powershell/public/maester/entra/Test-MtAppRegistrationCertificateLifetime.ps1