Microsoft 365 tenant · Applications, consent & AI agents

Disable or delete inactive, test and demo applications

When it fails: Unused, test or demo applications remain enabled in the tenant. Forgotten applications keep their permissions and credentials, are reviewed by nobody and are an easy place for an attacker to hide.

CB-M365-APPS-016lowactivemanualprofile hardened

Description

Application registrations and service principals with no sign-in for {{ app_inactivity_days }} days, and applications whose name or notes show a test, demo or proof-of-concept purpose, are disabled and then deleted after confirmation with their owner. Test applications live in a separate development tenant.

Rationale

Each enabled application is an identity with permissions and possibly credentials. Unused ones bring no value and are rarely monitored, which makes them attractive for persistence: adding a secret to a dormant application raises less suspicion than creating a new one. Test applications are often created with broad permissions and weak settings.

Impact

An application used only once a year (annual campaign, disaster recovery) may look inactive. Disable before deleting, and keep a short documented exception list. Deleted applications stay restorable for 30 days.

Parameters

ParameterBaselineHardenedBounds
app_inactivity_daysinteger, days. Number of days without sign-in after which an application is considered inactive.9090at least 30

The value used is your override (tailoring file), else the profile's, else the one of the profile it extends, else the default. Bounds limit what an override may set.

Audit

  1. Sign in to the Microsoft Entra admin center (https://entra.microsoft.com) as at least a Global Reader.
  2. Browse to Entra ID > Overview > Recommendations and open Remove unused applications; note each active item.
  3. Browse to Entra ID > Monitoring & health > Usage & insights and review sign-in activity per application and service principal.
  4. In Microsoft Graph (scope AuditLog.Read.All, beta), read GET https://graph.microsoft.com/beta/reports/servicePrincipalSignInActivities for the last sign-in of each application.
  5. Search application display names for terms such as test, demo, poc, sandbox, temp.
  6. Fail if an enabled application has had no sign-in for {{ app_inactivity_days }} days, or a test or demo application exists in the production tenant, without a documented exception.

Remediation

  1. Contact the owner of each flagged application.
  2. Disable sign-in first: Enterprise apps > the application > Properties > Enabled for users to sign-in? = No (Graph: Update-MgServicePrincipal -AccountEnabled:$false).
  3. After an observation period with no complaint, delete the application under App registrations > the application > Delete (or Enterprise apps > Properties > Delete for third-party service principals).
  4. Role required: Cloud Application Administrator or Application Administrator.

Rollback

Re-enable sign-in, or restore the application from App registrations > Deleted applications within 30 days.

References

Mappings

FrameworkIDRelation
NIST SP 800-53 Rev. 55.1.1AC-2(3)related
NIST SP 800-53 Rev. 55.1.1CM-7related

How this control relates to the other framework's: equivalent, stricter, looser, partial or related.

People and lifecycle

Authors
Introduced inv0.1.0
Created, updated2026-10-24, 2026-10-24
Translationsfr