CIS.M365.5.1.5.4 - (L1) Ensure password lifetime for applications does not exceed 180 days
Overviewβ
5.1.5.4 (L1) Ensure password lifetime for applications does not exceed 180 days
In Microsoft Entra ID, applications and service principals can authenticate using password credentials (also referred to as client secrets). This setting enforces a tenant-wide maximum lifetime for new password credentials added to any application registration or service principal. When enabled, any client secret created must have an expiration date that falls within the configured maximum, which for this recommendation is 180 days or less. The policy is implemented through the default app management policy and applies to all applications unless scoped exceptions are configured.
The setting does not retroactively shorten or invalidate existing password credentials; secrets created before the policy was enabled remain valid until they expire or are explicitly removed.
The recommended state is Restrict max password lifetime set to On: 180 days or less.
Rationaleβ
Long-lived client secrets extend the window of exploitation if a credential is compromised. A secret valid for multiple years that is never rotated remains usable even if it was leaked in source code, a build log, or a security breach long after the initial exposure. Enforcing a maximum lifetime of 180 days ensures that client secrets expire on a regular basis, limiting the period during which a stolen credential remains valid and reducing the blast radius of a compromise. This control also encourages teams to establish automated rotation practices, which further reduces reliance on static, long-lived credentials.
Impactβ
Any automated process, pipeline, or script that creates client secrets with a lifetime exceeding the configured maximum will fail once the policy is enabled, unless an exception is configured. Organizations will need to update secret creation workflows to specify expiration dates within the allowed range and establish rotation processes for secrets approaching expiry.
Remediation actionβ
To remediate using the UI:
- Navigate to Microsoft Entra admin center.
- Expand Entra ID and select Enterprise apps.
- Under Security select Application policies.
- Select Restrict max password lifetime.
- Set Status to On.
- Set the maximum lifetime to 180 days or less.
- Set Applies to to one of the following:
- All applications
- All applications with exclusions (if using exclusions, ensure they are reviewed annually).
- Set Only apply to apps created after to a desired date or leave it unconfigured.
- Select Save and close to apply the changes.
To remediate using the Microsoft Graph API:
Important: The PATCH request replaces the
passwordCredentialsarray in full. Retrieve the current policy first and include all existing entries in the request body to avoid overwriting other configured restrictions or exclusions.
- Execute a GET request to retrieve the current policy:
v1.0/policies/defaultAppManagementPolicy - Modify the returned JSON to reflect the following changes:
- Set
isEnabledtotrue. - Under
applicationRestrictions.passwordCredentials, locate the entry whererestrictionTypeispasswordLifetimeand set the following:statetoenabledmaxLifetimetoP180Dor a shorter duration.restrictForAppsCreatedAfterDateTimeto0001-01-01T00:00:00Zor a desired date.
- Under
servicePrincipalRestrictions.passwordCredentials, locate the entry whererestrictionTypeispasswordLifetimeand set the following:statetoenabledmaxLifetimetoP180Dor a shorter duration.restrictForAppsCreatedAfterDateTimeto0001-01-01T00:00:00Zor a desired date.
- Set
- Execute a PATCH request to the same URI with the modified JSON in the request body to apply the changes.
Note: Maester also checks that the restriction covers every existing application and service principal. Objects created before the Only apply to apps created after date (
restrictForAppsCreatedAfterDateTime) are exempt from the restriction, so the check fails while any exist. Leave the date unconfigured or set it to0001-01-01T00:00:00Z, or to a date before your oldest application and service principal.
Related linksβ
- Microsoft Entra admin center - Application policies
- Enforce app management policies in Microsoft Entra ID
- Update tenantAppManagementPolicy
- CIS Microsoft 365 Foundations Benchmark v7.0.0 - 5.1.5.4
Test Metadataβ
| Field | Value |
|---|---|
| Test ID | CIS.M365.5.1.5.4 |
| Severity | Medium |
| Suite | CIS |
| Product | Entra ID |
| Feature | Applications |
| Area | Applications and workload identities |
| Resource type | Tenant |
| User impact | Low |
| Implementation cost | Medium |
| MITRE ATT&CK | T1098.001 Additional Cloud Credentials |
| Supports benchmark | CIS Microsoft 365 Foundations Benchmark (version 7.0.0), requirement 5.1.5.4 |
| Benchmark level | L1 |
| Benchmark profiles | E3 Level 1 |
| Supports controls | cis-m365:5.1.5.4, nist-800-53-r5:IA-5 |
| PowerShell test | Test-MtCisAppPasswordLifetime |
| Services | Graph |
Sourceβ
- Test:
tests/cis/Test.CIS.M365.5.1.5.4.ps1 - Documentation:
tests/cis/Test.CIS.M365.5.1.5.4.md
