# Trust configuration details should be investigated

Comprehensive trust documentation is essential for security operations:

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

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

## Overview

Comprehensive trust documentation is essential for security operations:

- **Security Audits**: Auditors require detailed trust configuration information
- **Incident Response**: Understanding trust relationships helps during security incidents
- **Change Management**: Tracking trust configurations supports change control processes
- **Risk Assessment**: Detailed trust information enables proper risk evaluation
- **Compliance**: Many frameworks require documentation of trust relationships

Trust details reveal critical security properties including:
- **Direction**: Who can access whose resources
- **Type**: External vs Forest trust (different security models)
- **SID Filtering**: Whether the trust has strong SID filtering
- **Selective Authentication**: Whether authentication is restricted
- **Trust Classification**: Derived `IsForest`, `IsExternal`, and `SidFilteringWeak` properties

#### Control Type

**Operational**

#### Security Recommendation

**Configuration Best Practices:**

1. **Use Forest Trusts**: Prefer forest trusts over external trusts for better security
2. **Enable SID Filtering**: Always enable SID filtering on external trusts
3. **Selective Authentication**: Use selective authentication when possible
4. **Inbound Only**: Prefer inbound trusts over bidirectional when possible
5. **Document Everything**: Maintain detailed documentation of each trust's purpose

**Trust Properties to Monitor:**
- `Quarantined`: Should be `$true` for external trusts (SID filtering enabled)
- `SidFilteringWeak`: Should be `$false` for both external and forest trusts
- `SelectiveAuthentication`: Consider enabling for sensitive environments
- `Direction`: Bidirectional trusts have higher risk
- `IsForest` / `IsExternal`: Helps identify which SID filtering rules apply

#### How the Test Works

This test retrieves all trust properties from LDAP and derives display values:

- **Quarantined**: Derived from `trustAttributes` bit `0x4` (`QUARANTINED_DOMAIN`)
- **Selective Authentication**: Derived from `trustAttributes` bit `0x10` (`CROSS_ORGANIZATION`)
- **Intra-Forest**: Derived from `trustAttributes` bit `0x20` (`WITHIN_FOREST`)
- **IsForest**: Derived from `trustAttributes` bit `0x8` (`FOREST_TRANSITIVE`)
- **IsExternal**: Derived from `trustType` in `1,2` and absence of `FOREST_TRANSITIVE` / `WITHIN_FOREST`
- **SidFilteringWeak**: External trusts weak when `QUARANTINED_DOMAIN` not set; forest trusts weak when `TREAT_AS_EXTERNAL` (`0x40`) is set
- **Trust Type**: Mapped from numeric `trustType` (1=External Downlevel, 2=Domain Uplevel, 3=MIT Kerberos, 4=DCE)
- **Direction**: Mapped from numeric `trustDirection` (1=Inbound, 2=Outbound, 3=Bidirectional)

#### Related Tests

- `Test-MtAdTrustTotalCount` - Overall trust count
- `Test-MtAdTrustInterForestCount` - External trust identification
- `Test-MtAdTrustQuarantinedCount` - SID filtering status
- `Test-MtAdTrustStaleCount` - Trust validation status

## Details

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

| Field | Value |
| --- | --- |
| Test ID | AD-TRUST-05 |
| 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-MtAdTrustDetails](https://github.com/maester365/maester/blob/main/tests/ad/trust/Test.AD-TRUST-05.ps1) |
| Services | ActiveDirectory |
| Permissions | ActiveDirectory:Ldap:trustedDomain:ReadProperty |

</details>

## Source

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