# Trust quarantined count should be investigated

Strong SID filtering is a critical security control for inter-forest trusts:

Source: https://maester.dev/docs/tests/AD-TRUST-03

<!-- 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 · Trusts · <a href="/docs/tests">All checks</a></p>

```powershell title="Run this check"
Invoke-Maester -TestId AD-TRUST-03
```

## Overview

Strong SID filtering is a critical security control for inter-forest trusts:

- **Prevents Privilege Escalation**: Blocks malicious SID history from being honored across trust boundaries
- **Limits Blast Radius**: Contains the impact of a compromised external domain
- **Security Best Practice**: Microsoft recommends SID filtering for all external trusts
- **Compliance Requirement**: Many security frameworks require SID filtering on external trusts

Without strong SID filtering, an attacker who compromises a domain in a trusting forest could inject SIDs from the trusted forest's privileged groups (like Domain Admins or Enterprise Admins) into their own account, effectively gaining privileged access across the trust boundary.

#### Control Type

**Operational**

#### Security Recommendation

- **Enable SID Filtering**: Enable SID filtering (quarantine) on ALL external trusts
- **Disable SID History**: Disable SID history on ALL forest trusts
- **Audit Regularly**: Regularly verify that external trusts remain quarantined and forest trusts do not have SID history enabled
- **Document Exceptions**: If strong SID filtering cannot be enabled, document the risk and compensating controls
- **Use Forest Trusts**: When possible, use forest trusts instead of external trusts as they provide better security controls
- **Monitor Changes**: Alert on any changes to trust SID filtering status

#### How the Test Works

This test derives trust classification and SID filtering status from the `trustAttributes` LDAP attribute and `trustType`:

- **External trusts**: `trustType` in `1,2` and `trustAttributes` does not have `FOREST_TRANSITIVE` (`0x8`) or `WITHIN_FOREST` (`0x20`)
- **Forest trusts**: `trustAttributes` has `FOREST_TRANSITIVE` (`0x8`)
- **Strong external trusts**: `QUARANTINED_DOMAIN` (`0x4`) is set
- **Strong forest trusts**: `TREAT_AS_EXTERNAL` (`0x40`) is not set (SID history disabled)

The test returns:
- Total count of trusts
- Count of external/forest trusts evaluated
- Count of trusts with strong SID filtering
- Count of trusts with weak SID filtering

#### Related Tests

- `Test-MtAdTrustNonQuarantinedDetails` - Lists specific trusts without SID filtering
- `Test-MtAdTrustInterForestCount` - Identifies external trusts that should be quarantined
- `Test-MtAdTrustDetails` - Shows quarantine status for all trusts

#### Related links

- [Microsoft Learn: Security considerations for trusts](https://learn.microsoft.com/previous-versions/windows/it-pro/windows-server-2003/cc755321%28v=ws.10%29)
- [ANSSI Active Directory checkpoints: Unfiltered outbound domain trust relationship](https://www.cert.ssi.gouv.fr/uploads/ad_checklist.html#vuln_trusts_domain_notfiltered)

## Details

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

| Field | Value |
| --- | --- |
| Test ID | AD-TRUST-03 |
| Severity | Info |
| Suite | Active Directory |
| Product | Active Directory |
| Feature | Trusts |
| Area | External access and sharing |
| Resource type | Trust |
| MITRE ATT&CK | T1134.005 SID-History Injection |
| PowerShell test | [Test-MtAdTrustQuarantinedCount](https://github.com/maester365/maester/blob/main/tests/ad/trust/Test.AD-TRUST-03.ps1) |
| Services | ActiveDirectory |
| Permissions | ActiveDirectory:Ldap:trustedDomain:ReadProperty |

</details>

## Source

- Test: [`tests/ad/trust/Test.AD-TRUST-03.ps1`](https://github.com/maester365/maester/blob/main/tests/ad/trust/Test.AD-TRUST-03.ps1)
- Documentation: [`tests/ad/trust/Test.AD-TRUST-03.md`](https://github.com/maester365/maester/blob/main/tests/ad/trust/Test.AD-TRUST-03.md)
