# KRBTGT last logon should be investigated

The KRBTGT account is a service account that should never have interactive logons.

Source: https://maester.dev/docs/tests/AD-KRBTGT-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 · Account security · <a href="/docs/tests">All checks</a></p>

```powershell title="Run this check"
Invoke-Maester -TestId AD-KRBTGT-02
```

## Overview

The KRBTGT account is a service account that should never have interactive logons. It exists solely for the KDC service to use internally for Kerberos ticket operations. Any logon activity for this account may indicate:

**Security Concerns:**
- **Suspicious Activity**: Interactive logons suggest potential compromise or misuse
- **Account Misuse**: Administrators incorrectly attempting to use the account
- **Attack Indicators**: Attackers may attempt to activate or use the account

The KRBTGT account should:
- Always remain disabled (UAC = 514)
- Never have interactive logons
- Only be used internally by the KDC service

#### Control Type

**Operational**

#### Security Recommendation

1. **Never enable the KRBTGT account**:
   - Standard UAC should be 514 (disabled, normal account)
   - Enabling this account creates a significant security risk

2. **Monitor for logon attempts**:
   - Any logon activity should be investigated immediately
   - Check security logs for attempted logons to this account

3. **Audit account changes**:
   - Monitor for UAC changes
   - Alert on any modifications to the KRBTGT account

#### How the Test Works

This test retrieves the KRBTGT account and checks:
- Last logon timestamp (should be null/never)
- Account enabled status (should be disabled)
- Password last set date

#### Related Tests

- `Test-MtAdKrbtgtPasswordLastSet` - Checks KRBTGT password age
- `Test-MtAdKrbtgtNonStandardUacCount` - Validates KRBTGT UAC settings

## Details

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

| Field | Value |
| --- | --- |
| Test ID | AD-KRBTGT-02 |
| Severity | Info |
| Suite | Active Directory |
| Product | Active Directory |
| Feature | Account security |
| Area | Authentication |
| Resource type | User |
| MITRE ATT&CK | T1078.001 Default Accounts |
| PowerShell test | [Test-MtAdKrbtgtLastLogon](https://github.com/maester365/maester/blob/main/tests/ad/security/Test.AD-KRBTGT-02.ps1) |
| Services | ActiveDirectory |
| Permissions | ActiveDirectory:Ldap:user:ReadProperty |

</details>

## Source

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