# Computer delegation count should be retrievable

Kerberos delegation allows a service to impersonate users when accessing other resources.

Source: https://maester.dev/docs/tests/AD-COMP-09

<!-- This file is generated by website/scripts/generate-test-docs.mjs. Do not edit manually. -->

<div class="test-byline"><div class="test-byline-avatars"><a class="test-byline-avatar test-byline-avatar--author" href="/contributors/soulemike" title="Michael Soule · Original author"><img src="https://github.com/soulemike.png" alt="Michael Soule" width="28" height="28" loading="lazy" decoding="async" /></a></div><div class="test-byline-meta"><span class="test-byline-text">Contributed by <a href="/contributors/soulemike">Michael Soule</a></span><a class="test-byline-link" href="/contributors">All contributors →</a></div></div>

<p class="test-part">Part of <a href="/docs/tests/ad">Active Directory</a> · Active Directory · Computers · <a href="/docs/tests">All checks</a></p>

```powershell title="Run this check"
Invoke-Maester -TestId AD-COMP-09
```

## Overview

Kerberos delegation allows a service to impersonate users when accessing other resources. While necessary for some applications, delegation—especially unconstrained delegation—creates significant security risks:

- **Unconstrained delegation**: The service can impersonate users to ANY service on ANY system (highest risk)
- **Constrained delegation**: Limited to specific services, but still requires careful management
- **Protocol transition**: Allows S4U2Self/S4U2Proxy operations that can be exploited
- **Lateral movement**: Attackers can abuse delegation for privilege escalation and lateral movement

#### Control Type

**Detective**

#### Security Recommendation

- **Minimize unconstrained delegation**: Use it only when absolutely necessary, and never on tier 0 systems
- **Prefer constrained delegation**: Limit services to only those they need to access
- **Use resource-based constrained delegation**: More secure alternative in modern environments
- **Regular audits**: Periodically review which computers have delegation enabled
- **Remove unused delegation**: Disable delegation on systems that no longer require it
- **Consider Group Managed Service Accounts (gMSA)**: These provide better security for service accounts

#### How the Test Works

This test counts computers with different delegation configurations:
- `TrustedForDelegation` (unconstrained delegation)
- `TrustedToAuthForDelegation` (constrained delegation with protocol transition)

#### Related Tests

- `Test-MtAdComputerDelegationDetails` - Provides detailed breakdown of delegation per computer
- `Test-MtAdComputerDormantCount` - Identifies stale accounts that may have delegation enabled

## Details

<details>
<summary>Every attribute of this check</summary>

| Field | Value |
| --- | --- |
| Test ID | AD-COMP-09 |
| Severity | Info |
| Suite | Active Directory |
| Product | Active Directory |
| Feature | Computers |
| Area | Authentication |
| Resource type | Computer |
| MITRE ATT&CK | T1558 Steal or Forge Kerberos Tickets, T1550.003 Pass the Ticket |
| PowerShell test | [Test-MtAdComputerDelegationCount](https://github.com/maester365/maester/blob/main/tests/ad/computer/Test.AD-COMP-09.ps1) |
| Services | ActiveDirectory |
| Permissions | ActiveDirectory:Ldap:computer:ReadProperty |

</details>

## Source

- Test: [`tests/ad/computer/Test.AD-COMP-09.ps1`](https://github.com/maester365/maester/blob/main/tests/ad/computer/Test.AD-COMP-09.ps1)
- Documentation: [`tests/ad/computer/Test.AD-COMP-09.md`](https://github.com/maester365/maester/blob/main/tests/ad/computer/Test.AD-COMP-09.md)
