From fbb6ba6ea28748fe7a80087d93cb86ebe5e10fb4 Mon Sep 17 00:00:00 2001 From: Gerrrt Date: Fri, 27 Nov 2026 05:44:02 +0000 Subject: [PATCH] docs(lab): ADR-0144 runs no AD CS in the lab domain, so no LDAPS or PKINIT The leviathan audit found no certificate on either DC: 636 and 3269 listen with nothing behind them, and KDC 19/29, CertEnroll 86 and DS 1220 are logged at boot. The repository never said whether that was meant. ADR-0144 makes it deliberate. An enterprise CA would bring the ESC paths outside ADR-0083's switch model, and would complete the coercion relay path that ADR-0141 says does not exist. verify.yml now fails if an enrollment service or an NTAuth CA appears. The runbook calls the events expected. Co-Authored-By: Claude Opus 5.5 --- README.md | 4 +- ansible/verify.yml | 9 +++ ...in-the-lab-domain-so-no-ldaps-or-pkinit.md | 78 +++++++++++++++++++ docs/changelog.md | 11 +++ docs/runbooks/build-the-bloodhound-guest.md | 3 +- docs/runbooks/build-the-lab-domain.md | 6 +- 6 files changed, 107 insertions(+), 4 deletions(-) create mode 100644 docs/adr/0144-run-no-ad-cs-in-the-lab-domain-so-no-ldaps-or-pkinit.md diff --git a/README.md b/README.md index 17da9512..78079204 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ documents for different readers. at all. Every pinned digest is also scanned weekly for fixable HIGH and CRITICAL CVEs, and each image with findings has an open issue until a scan finds it clean. -- **Documented decisions and runbooks.** 141 ADRs covering what was chosen +- **Documented decisions and runbooks.** 142 ADRs covering what was chosen and what was rejected — including the costs accepted knowingly; 57 runbooks for the operations that are easy to get wrong at 1am, one of which is the handover page a successor reads first. Every critical alert links to @@ -236,7 +236,7 @@ inbound passes may still reach it. Data flow and the maintained Mermaid topology │ ├── architecture.md network.md hardware.md │ ├── observability.md security.md roadmap.md changelog.md │ ├── diagrams/ # the network diagram (SVG) and its predecessors -│ ├── adr/ # 141 ADRs — architecture decision records +│ ├── adr/ # 142 ADRs — architecture decision records │ ├── exercises/ # purple-team exercise records — see its README │ └── runbooks/ # 57 runbooks; successor-handover.md is the front door └── Makefile # make help diff --git a/ansible/verify.yml b/ansible/verify.yml index a1672016..7cd17552 100644 --- a/ansible/verify.yml +++ b/ansible/verify.yml @@ -180,6 +180,15 @@ $dsh = Get-ADObject -Identity ("CN=Directory Service,CN=Windows NT,CN=Services," + (Get-ADRootDSE).configurationNamingContext) -Properties dsHeuristics $r['dsHeuristics unset, as shipped'] = [string]::IsNullOrEmpty($dsh.dsHeuristics) + # ADR-0144: no AD CS, so no enterprise CA in the forest. A CA would + # bring the ESC paths outside the switch model. NTAuthCertificates + # does not exist until a CA publishes to it, and @($null).Count is + # 1, hence the filter. + $pks = "CN=Public Key Services,CN=Services,$((Get-ADRootDSE).configurationNamingContext)" + $ntauth = try { Get-ADObject -Identity "CN=NTAuthCertificates,$pks" -Properties cACertificate -ErrorAction Stop } catch { $null } + $r['no AD CS: no enrollment service and no NTAuth CA'] = (-not (Get-ADObject -SearchBase "CN=Enrollment Services,$pks" ` + -SearchScope OneLevel -Filter * -ErrorAction SilentlyContinue)) -and + (@($ntauth.cACertificate | Where-Object { $_ }).Count -eq 0) $src = (w32tm /query /source | Out-String).Trim() if ([bool]::Parse($IsPrimary)) { $r["clock from $Gateway"] = ($src -like "$Gateway*") diff --git a/docs/adr/0144-run-no-ad-cs-in-the-lab-domain-so-no-ldaps-or-pkinit.md b/docs/adr/0144-run-no-ad-cs-in-the-lab-domain-so-no-ldaps-or-pkinit.md new file mode 100644 index 00000000..e6f97662 --- /dev/null +++ b/docs/adr/0144-run-no-ad-cs-in-the-lab-domain-so-no-ldaps-or-pkinit.md @@ -0,0 +1,78 @@ +# ADR-0144: Run no AD CS in the lab domain, so no LDAPS or PKINIT + +**Status:** Accepted · 2026-11 · within +[ADR-0029](0029-size-the-lab-domain-and-separate-its-namespace-and-clock.md) +and [ADR-0083](0083-give-the-lab-domain-its-deliberate-weaknesses-as-switchable-tags.md) + +## Context + +A read-only audit of `leviathan` (2026-11-13 to 2026-11-26) found that neither +DC has a certificate, and the repository says nothing about it. On +2026-11-27 both DCs read the same: + +- `LocalMachine\My` and the NTDS store are empty, and the AD CS role is not + installed on either. The Configuration partition holds no enrollment + service, no AIA CA and an empty `NTAuthCertificates`, so there is no + enterprise CA anywhere in the forest. +- `636` and `3269` listen with nothing to serve. Directory Service event 1220 + says LDAP over SSL is unavailable. +- KDC events 19 and 29 (no certificate for smart-card logon and PKINIT) and + CertEnroll event 86 (no enrollment policy) are logged at each boot. In the + 30 days to 2026-11-27 that was 10 and 6 on `leviathan`, and 4 and 6 on + `bahamut`. + +Only one thing in the repository depends on this, and it already plans +around it: +[`build-the-bloodhound-guest.md`](../runbooks/build-the-bloodhound-guest.md) +says `bloodhound-ce-python` and `netexec` cannot collect, because signing +refuses plain LDAP and `636` has no certificate. SharpHound on a domain host +is the collector, and the `unsigned_ldap` switch of +[ADR-0141](0141-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md) +lets the Linux collectors in when an exercise needs them. + +ADR-0141 also relies on the missing CA. With signing enforced and no AD CS, +coercing a DC has no complete relay path. ADR-0083's negative test, a plain run +then `verify.yml` with no path to Domain Admin, holds only while that is true. + +## Decision + +**The lab domain runs no AD CS.** There is no enterprise CA, so the DCs get no +LDAPS certificate and the KDC gets none for PKINIT. LDAP stays on `389`, +signed and sealed, as Server 2025 ships it. + +**The certificate events are expected.** Directory Service 1220, KDC 19 and 29, +and CertEnroll 86 at a DC's boot are noise by this decision, not a finding. + +**`verify.yml` holds the domain to it.** On every DC, it fails if the +Configuration partition holds an enrollment service or a CA in +`NTAuthCertificates`. + +**An AD CS exercise is a new decision.** ESC1 to ESC8 are the techniques AD CS +would bring, and they are worth an exercise of their own. They come in under +ADR-0083's reopen clause: a member server for the CA, switchable templates, +and a plain run that removes them, so that the negative test still holds. +Until that ADR exists, no CA is installed. + +## Alternatives considered + +- **Install an enterprise CA for LDAPS.** It would give the DCs a certificate + and let the Linux collectors use `636`. It would also add the whole ESC + surface outside the switch model, including web enrollment relay, which + completes the coercion path ADR-0141 says does not exist. A plain run would + then no longer be the negative test. +- **Self-signed certificates on the DCs, for LDAPS only.** This gives `636` a + certificate with no CA. Nothing in the lab needs LDAPS: the `unsigned_ldap` + switch already lets the Linux collectors in. The certificates would also + need renewal, which nothing here would own. + +## Consequences + +- **`636` and `3269` stay open with nothing behind them.** That is how a DC + ships without a CA. They are in the §10 port table and are not removed + (§0). +- **No smart-card logon, no PKINIT, and no shadow-credential authentication + against the KDC.** `msDS-KeyCredentialLink` can still be written, but the + KDC cannot complete a PKINIT logon with it while it has no certificate. A + future AD CS ADR changes that, and has to say so. +- **A future audit should not raise the missing certificate.** It should check + that `verify.yml`'s "no AD CS" check still passes. diff --git a/docs/changelog.md b/docs/changelog.md index d7c1e29c..dc7ec486 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,17 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-27 +- **Lab domain: ADR-0144 records that the domain runs no AD CS, and + `verify.yml` holds it to that.** The `leviathan` audit found no + certificate on either DC: `LocalMachine\My` is empty, `636` and `3269` + listen with nothing behind them, and KDC 19/29, CertEnroll 86 and Directory + Service 1220 are logged at boot. The repository never said whether this was + meant. It is now deliberate. An enterprise CA would bring the ESC paths + outside ADR-0083's switch model, and would complete the coercion relay path + that ADR-0141 says does not exist. The events are expected noise. Both DCs + read the same on 2026-11-27: no enrollment service, no AIA CA and an empty + `NTAuthCertificates`. An AD CS exercise is a later ADR, as switches. + - **Lab domain: `roles/base` now removes `Panther\unattend.xml`, and `verify.yml` holds every guest to having none.** This corrects the 2026-10-09 #1099 entry, which says `SetupComplete.cmd` deletes the file. It diff --git a/docs/runbooks/build-the-bloodhound-guest.md b/docs/runbooks/build-the-bloodhound-guest.md index c7b2a3d9..dc276e52 100644 --- a/docs/runbooks/build-the-bloodhound-guest.md +++ b/docs/runbooks/build-the-bloodhound-guest.md @@ -490,7 +490,8 @@ containers to come back. They have `restart: unless-stopped`. remove it, because re-enabling protection does not clear an exclusion. - **The network collectors do not work here by default.** `bloodhound-ce-python` and `netexec` authenticate, but both DCs enforce - LDAP signing and have no LDAPS certificate (the lab runs no AD CS), so + LDAP signing and have no LDAPS certificate (the lab runs no AD CS, + [ADR-0144](../adr/0144-run-no-ad-cs-in-the-lab-domain-so-no-ldaps-or-pkinit.md)), so neither can collect: signing refuses plain LDAP, and `636` has no cert. SharpHound on a domain host is the path, because the Windows LDAP client signs and seals over `389` natively. Signing is lifted only by the diff --git a/docs/runbooks/build-the-lab-domain.md b/docs/runbooks/build-the-lab-domain.md index 6e7ba3d5..624b3045 100644 --- a/docs/runbooks/build-the-lab-domain.md +++ b/docs/runbooks/build-the-lab-domain.md @@ -906,7 +906,11 @@ Before the first one, two things: > enable it when the exercise is relay to LDAP, and the removal is recorded by > the run that enabled it. `dsHeuristics` is kept as shipped, unset, so > Directory Service events 3051 and 3054 at each DC boot are expected and -> `verify.yml` fails if it is ever set. +> `verify.yml` fails if it is ever set. The domain runs no AD CS +> ([ADR-0144](../adr/0144-run-no-ad-cs-in-the-lab-domain-so-no-ldaps-or-pkinit.md)), +> so the DCs have no LDAPS or PKINIT certificate. Directory Service 1220, KDC +> 19 and 29, and CertEnroll 86 at boot are expected too, and `verify.yml` fails +> if an enterprise CA appears. The loop, one weakness (here `kerberoast`) at a time: