# Trust inter-forest count should be investigated

Inter-forest trusts (external trusts) connect different Active Directory forests and pose unique security risks:

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

<!-- 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-02
```

## Overview

Inter-forest trusts (external trusts) connect different Active Directory forests and pose unique security risks:

- **SID History Attacks**: External trusts may be vulnerable to SID history attacks where attackers inject privileged SIDs from the external domain
- **Less Visibility**: You have less control and visibility over security practices in external forests
- **Lateral Movement**: Compromised external domains can be used as pivot points for attacks
- **Trust Transitivity**: Understanding which trusts are external helps assess blast radius

Intra-forest trusts (within the same forest) generally have stronger security guarantees because they share a common schema and configuration.

#### Control Type

**Operational**

#### Security Recommendation

- **Minimize External Trusts**: Only create inter-forest trusts when absolutely necessary
- **Enable SID Filtering**: Always enable SID filtering (quarantine) on external trusts
- **Selective Authentication**: Consider using selective authentication for external trusts
- **Regular Review**: Review external trusts quarterly to ensure they are still required
- **Monitor Closely**: Enable enhanced logging for authentication events across external trusts
- **Documentation**: Maintain detailed documentation of why each external trust exists

#### How the Test Works

This test analyzes all trust objects and identifies those where `IntraForest` is `$false`. The test returns:

- Total count of trusts
- Count of inter-forest trusts
- Count of intra-forest trusts

#### Related Tests

- `Test-MtAdTrustQuarantinedCount` - Checks if external trusts have SID filtering enabled
- `Test-MtAdTrustNonQuarantinedDetails` - Lists external trusts without SID filtering
- `Test-MtAdTrustTotalCount` - Overall trust count
- `Test-MtAdTrustDetails` - Detailed trust configuration

## Details

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

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

</details>

## Source

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