From aeadcd6d2913c5d81bf2e3a7baf3d1ad6217714b Mon Sep 17 00:00:00 2001 From: Gerrrt Date: Thu, 26 Nov 2026 14:48:10 +0000 Subject: [PATCH] fix(lab): keep the DCs' root hints removed across a DNS restart dns_forwarder removed the hints from memory only; the service reloads them from cache.dns at start. Leave the file holding one comment line and have verify.yml check it. Also renumber #1765's ADR to 0141, since #1762 took 0140 first and check_docs.py fails on main. Refs #449 Co-Authored-By: Claude Opus 5.5 --- README.md | 4 ++-- ansible/README.md | 6 +++--- ansible/inventory/group_vars/all.yaml | 6 +++--- ansible/lab-domain.yml | 2 +- ansible/roles/dns_forwarder/tasks/main.yml | 14 +++++++++++++- ansible/roles/weakness_maq/defaults/main.yml | 2 +- ansible/roles/weakness_maq/tasks/main.yml | 2 +- .../roles/weakness_spooler/defaults/main.yml | 2 +- ansible/roles/weakness_spooler/tasks/main.yml | 2 +- .../weakness_unsigned_ldap/defaults/main.yml | 2 +- .../roles/weakness_unsigned_ldap/tasks/main.yml | 4 ++-- ansible/verify.yml | 13 ++++++++----- ...main-and-separate-its-namespace-and-clock.md | 2 +- ...-deliberate-weaknesses-as-switchable-tags.md | 2 +- ...s-shipped-defaults-and-keep-dsheuristics.md} | 2 +- docs/changelog.md | 17 +++++++++++++++++ docs/roadmap.md | 2 +- docs/runbooks/build-the-bloodhound-guest.md | 2 +- docs/runbooks/build-the-lab-domain.md | 12 +++++++++--- 19 files changed, 68 insertions(+), 30 deletions(-) rename docs/adr/{0140-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md => 0141-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md} (99%) diff --git a/README.md b/README.md index 9c0d8b422..17da95121 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.** 140 ADRs covering what was chosen +- **Documented decisions and runbooks.** 141 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/ # 140 ADRs — architecture decision records +│ ├── adr/ # 141 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/README.md b/ansible/README.md index 41c093375..7a8c892ff 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -145,7 +145,7 @@ covered in the runbook's [*Run it from `phoenix`*][run] section. The `tiers`, `shares` and `soc` tags (#448) apply the rest of §5's skeleton and §11's agents. The nine from `kerberoast` to `spooler` are [#449](https://github.com/Gerrrt/HomeLab/issues/449)'s deliberate weaknesses -([ADR-0083], and [ADR-0140] for the last three), each off until asked for: +([ADR-0083], and [ADR-0141] for the last three), each off until asked for: `weakness__state` is `absent` by default, so a plain run leaves none of them present. The last three are shipped defaults on the DCs, so for `maq` and `spooler` a plain run is the change: it sets the quota to 0 and disables @@ -161,7 +161,7 @@ ansible-playbook verify.yml # all ni ``` A plain `ansible-playbook verify.yml` asserts every one of these nine weakness -primitives is absent, and that `dsHeuristics` is still unset ([ADR-0140]) — the per-primitive negative test. It does not walk the +primitives is absent, and that `dsHeuristics` is still unset ([ADR-0141]) — the per-primitive negative test. It does not walk the domain's authorization graph, so it does not by itself prove *no* path to Domain Admin exists; that graph-level check is a BloodHound collector run with the tags off ([#451](https://github.com/Gerrrt/HomeLab/issues/451)) — the "run @@ -226,7 +226,7 @@ guest. [ADR-0077]: ../docs/adr/0077-configure-the-lab-domain-with-ansible-from-phoenix.md [ADR-0080]: ../docs/adr/0080-record-the-lab-domain-with-sysmon-and-capture-on-demand-with-pktmon.md [ADR-0083]: ../docs/adr/0083-give-the-lab-domain-its-deliberate-weaknesses-as-switchable-tags.md -[ADR-0140]: ../docs/adr/0140-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md +[ADR-0141]: ../docs/adr/0141-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md [ADR-0085]: ../docs/adr/0085-check-the-lab-domains-host-keys-against-keys-read-through-the-guest-agent.md [runbook]: ../docs/runbooks/build-the-lab-domain.md [run]: ../docs/runbooks/build-the-lab-domain.md#run-it-from-phoenix diff --git a/ansible/inventory/group_vars/all.yaml b/ansible/inventory/group_vars/all.yaml index a47b1fb83..ef0965068 100644 --- a/ansible/inventory/group_vars/all.yaml +++ b/ansible/inventory/group_vars/all.yaml @@ -115,7 +115,7 @@ soc_agents_velociraptor_msi_url: >- # never this tree, and the dedicated accounts share it. A role refuses to # enable a weakness while it is unset. Nothing is enabled by default: a plain # run leaves all nine absent, which is #449's negative test. The last three -# (ADR-0140) are shipped defaults on the DCs: a plain run turns MAQ and Spooler +# (ADR-0141) are shipped defaults on the DCs: a plain run turns MAQ and Spooler # off, and leaves LDAP signing enforced. lab_weak_password: "{{ lookup('ansible.builtin.env', 'LAB_WEAK_PASSWORD') }}" # The dedicated accounts model Tier 1 service identities, so they live in the @@ -150,12 +150,12 @@ lab_weakness_rbcd_account: svc-rbcd lab_weakness_rbcd_spn: "HOST/svc-rbcd.{{ lab_domain }}" lab_weakness_rbcd_resource: TITAN -# unsigned_ldap (ADR-0140): Server 2025 enforces LDAP signing while this value +# unsigned_ldap (ADR-0141): Server 2025 enforces LDAP signing while this value # is unset. present writes it as 0; absent removes it. lab_weakness_unsigned_ldap_key: HKLM:\SYSTEM\CurrentControlSet\Services\NTDS\Parameters lab_weakness_unsigned_ldap_value: LdapServerEnforceIntegrity -# maq (ADR-0140): ms-DS-MachineAccountQuota on the domain head. present is +# maq (ADR-0141): ms-DS-MachineAccountQuota on the domain head. present is # Windows' shipped 10; absent is 0. lab_weakness_maq_present: 10 lab_weakness_maq_absent: 0 diff --git a/ansible/lab-domain.yml b/ansible/lab-domain.yml index d8cd54e6c..83330da45 100644 --- a/ansible/lab-domain.yml +++ b/ansible/lab-domain.yml @@ -203,7 +203,7 @@ # Enable one, watch the SOC see it, disable it, watch the signal go. ADR-0083, # and the identifiers are in group_vars/all.yaml. The first six are directory # writes, so they run on the PDC emulator like tiers and population. The last -# three (ADR-0140) are shipped defaults on the DCs, where absent is the +# three (ADR-0141) are shipped defaults on the DCs, where absent is the # hardened side: a plain run sets MAQ to 0 and disables Spooler on both DCs. - name: Kerberoast — an SPN on a crackable account hosts: dc_primary diff --git a/ansible/roles/dns_forwarder/tasks/main.yml b/ansible/roles/dns_forwarder/tasks/main.yml index bb334ba89..008e7fcfd 100644 --- a/ansible/roles/dns_forwarder/tasks/main.yml +++ b/ansible/roles/dns_forwarder/tasks/main.yml @@ -3,6 +3,12 @@ # DNS recurses against the root servers whenever the forwarder is slow, and the # domain's resolution path quietly diverges from the rest of the house (§3). # No delegation is made on Unbound, ever: ADR-0029. +# +# Remove-DnsServerRootHint clears them from memory only. With the directory's +# root-hint zone empty, the service reloads them from cache.dns at its next +# start, so they came back after every restart (found 2026-11-26). The file is +# left holding one comment: absent, the service logs 1000/1004/1501 errors at +# every start; with a comment only, it starts clean with no hints. - name: Forward to the gateway, with no root hints ansible.windows.win_powershell: script: | @@ -10,7 +16,7 @@ # where $Ansible.CheckMode keeps it read-only. Without it --check reported a # change here on every run instead of looking (#448's first run). [CmdletBinding(SupportsShouldProcess)] - param([string]$Forwarder) + param([string]$Forwarder, [string]$CacheFile) $changed = $false $f = Get-DnsServerForwarder if ((@($f.IPAddress.IPAddressToString) -join ',') -ne $Forwarder -or $f.UseRootHint) { @@ -25,6 +31,12 @@ # -InputObject @() does not clear them; piping does (§3). if (-not $Ansible.CheckMode) { $hints | Remove-DnsServerRootHint -Force } } + $cache = Join-Path $env:windir 'System32\dns\cache.dns' + if (-not (Test-Path $cache) -or (Get-Content -Raw $cache).Trim() -ne $CacheFile) { + $changed = $true + if (-not $Ansible.CheckMode) { Set-Content -LiteralPath $cache -Value $CacheFile -Encoding Ascii } + } $Ansible.Changed = $changed parameters: Forwarder: "{{ lab_dns_forwarder }}" + CacheFile: "; No root hints: this DC forwards to the gateway only (ADR-0029)." diff --git a/ansible/roles/weakness_maq/defaults/main.yml b/ansible/roles/weakness_maq/defaults/main.yml index ed964a621..7bcfec416 100644 --- a/ansible/roles/weakness_maq/defaults/main.yml +++ b/ansible/roles/weakness_maq/defaults/main.yml @@ -4,5 +4,5 @@ # ansible-playbook lab-domain.yml --tags maq -e weakness_maq_state=present # and disable by applying the same tag with the default (or =absent). The two # values are in inventory/group_vars/all.yaml, shared with verify.yml -# (ADR-0083, ADR-0140). +# (ADR-0083, ADR-0141). weakness_maq_state: absent diff --git a/ansible/roles/weakness_maq/tasks/main.yml b/ansible/roles/weakness_maq/tasks/main.yml index 317839a15..e151c2fa6 100644 --- a/ansible/roles/weakness_maq/tasks/main.yml +++ b/ansible/roles/weakness_maq/tasks/main.yml @@ -1,5 +1,5 @@ --- -# ADR-0140: ms-DS-MachineAccountQuota on the domain head. At the shipped 10, +# ADR-0141: ms-DS-MachineAccountQuota on the domain head. At the shipped 10, # any domain user can create computer accounts, the first step of RBCD and # shadow-credential chains that need no other switch. present restores 10; # absent sets 0. Nothing the build does needs it: every join runs as diff --git a/ansible/roles/weakness_spooler/defaults/main.yml b/ansible/roles/weakness_spooler/defaults/main.yml index 1a0352b03..633442e03 100644 --- a/ansible/roles/weakness_spooler/defaults/main.yml +++ b/ansible/roles/weakness_spooler/defaults/main.yml @@ -3,5 +3,5 @@ # to Windows' shipped Automatic and running) with # ansible-playbook lab-domain.yml --tags spooler -e weakness_spooler_state=present # and disable by applying the same tag with the default (or =absent) -# (ADR-0083, ADR-0140). +# (ADR-0083, ADR-0141). weakness_spooler_state: absent diff --git a/ansible/roles/weakness_spooler/tasks/main.yml b/ansible/roles/weakness_spooler/tasks/main.yml index 2996a66d7..0cff45920 100644 --- a/ansible/roles/weakness_spooler/tasks/main.yml +++ b/ansible/roles/weakness_spooler/tasks/main.yml @@ -1,5 +1,5 @@ --- -# ADR-0140: Print Spooler on the domain controllers. A DC is trusted for +# ADR-0141: Print Spooler on the domain controllers. A DC is trusted for # unconstrained delegation by default, so a running spooler lets any domain # user coerce the DC's machine account into authenticating to a host of their # choosing. present leaves it as Windows ships it; absent stops and disables diff --git a/ansible/roles/weakness_unsigned_ldap/defaults/main.yml b/ansible/roles/weakness_unsigned_ldap/defaults/main.yml index 76bca99f5..e285ca890 100644 --- a/ansible/roles/weakness_unsigned_ldap/defaults/main.yml +++ b/ansible/roles/weakness_unsigned_ldap/defaults/main.yml @@ -3,5 +3,5 @@ # ansible-playbook lab-domain.yml --tags unsigned_ldap -e weakness_unsigned_ldap_state=present # and disable by applying the same tag with the default (or =absent). The # registry location is in inventory/group_vars/all.yaml, shared with verify.yml -# (ADR-0083, ADR-0140). +# (ADR-0083, ADR-0141). weakness_unsigned_ldap_state: absent diff --git a/ansible/roles/weakness_unsigned_ldap/tasks/main.yml b/ansible/roles/weakness_unsigned_ldap/tasks/main.yml index 08dc886cd..2e3a70e7e 100644 --- a/ansible/roles/weakness_unsigned_ldap/tasks/main.yml +++ b/ansible/roles/weakness_unsigned_ldap/tasks/main.yml @@ -1,5 +1,5 @@ --- -# ADR-0140: LDAP signing, off on demand. Server 2025 DCs enforce signing while +# ADR-0141: LDAP signing, off on demand. Server 2025 DCs enforce signing while # LdapServerEnforceIntegrity is unset. present writes it as 0, so the DC takes # unsigned simple and SASL binds, which makes NTLM relay to LDAP possible. absent # removes the value, and the DC returns to the 2025 default. @@ -29,7 +29,7 @@ if ($Want -eq 'present') { if ([int]$p.LDAPServerIntegrity -ne 1) { throw ("LDAPServerIntegrity is '$($p.LDAPServerIntegrity)', not the shipped 1: " + - 'signing would stay required. ADR-0140.') + 'signing would stay required. ADR-0141.') } if ($null -eq $p.$Name -or [int]$p.$Name -ne 0) { if (-not $Ansible.CheckMode) { diff --git a/ansible/verify.yml b/ansible/verify.yml index 2d2e4d0d9..f0eaa39c4 100644 --- a/ansible/verify.yml +++ b/ansible/verify.yml @@ -51,7 +51,7 @@ rbcd_state: "{{ weakness_rbcd_state | default('absent') }}" rbcd_account: "{{ lab_weakness_rbcd_account }}" rbcd_resource: "{{ lab_weakness_rbcd_resource }}" - # ADR-0140's three, on the DCs. + # ADR-0141's three, on the DCs. unsigned_ldap_state: "{{ weakness_unsigned_ldap_state | default('absent') }}" unsigned_ldap_key: "{{ lab_weakness_unsigned_ldap_key }}" unsigned_ldap_value: "{{ lab_weakness_unsigned_ldap_value }}" @@ -157,7 +157,10 @@ $f = Get-DnsServerForwarder $r["forwards to $Gateway only"] = ((@($f.IPAddress.IPAddressToString) -join ',') -eq $Gateway) $r['no root hints'] = -not (Get-DnsServerRootHint) - # ADR-0140: dsHeuristics kept as Server 2025 ships it, unset. The + # cache.dns is where the service reloads them from at start. + $r['no root hints in cache.dns'] = -not (Get-Content (Join-Path $env:windir 'System32\dns\cache.dns') ` + -ErrorAction SilentlyContinue | Where-Object { $_ -notmatch '^\s*(;|$)' }) + # ADR-0141: dsHeuristics kept as Server 2025 ships it, unset. The # 3051/3054 events at boot are expected; a value here is a hardening. $dsh = Get-ADObject -Identity ("CN=Directory Service,CN=Windows NT,CN=Services," + (Get-ADRootDSE).configurationNamingContext) -Properties dsHeuristics @@ -382,7 +385,7 @@ } $r['rbcd matches its toggle'] = ($bHave -eq ($Weak.rbcd_state -eq 'present')) - # maq (ADR-0140): the quota on the domain head, 10 or 0, and + # maq (ADR-0141): the quota on the domain head, 10 or 0, and # nothing between. $q = (Get-ADObject -Identity $wbase -Properties 'ms-DS-MachineAccountQuota').'ms-DS-MachineAccountQuota' $qWant = if ($Weak.maq_state -eq 'present') { $Weak.maq_present } else { $Weak.maq_absent } @@ -390,7 +393,7 @@ } if ($onDc) { - # unsigned_ldap (ADR-0140): present is the enforcement value at 0 + # unsigned_ldap (ADR-0141): present is the enforcement value at 0 # over the shipped LDAPServerIntegrity of 1; absent is the value # unset, Server 2025's enforced default. $lp = Get-ItemProperty -Path $Weak.unsigned_ldap_key -ErrorAction SilentlyContinue @@ -399,7 +402,7 @@ $r['unsigned_ldap matches its toggle'] = if ($Weak.unsigned_ldap_state -eq 'present') { $lHave } else { ($null -eq $lv) } - # spooler (ADR-0140): running and Automatic, or stopped and Disabled. + # spooler (ADR-0141): running and Automatic, or stopped and Disabled. $spl = Get-Service Spooler -ErrorAction SilentlyContinue $r['spooler matches its toggle'] = if ($Weak.spooler_state -eq 'present') { [bool]($spl -and $spl.Status -eq 'Running' -and $spl.StartType -eq 'Automatic') diff --git a/docs/adr/0029-size-the-lab-domain-and-separate-its-namespace-and-clock.md b/docs/adr/0029-size-the-lab-domain-and-separate-its-namespace-and-clock.md index 81aa79696..ff4022349 100644 --- a/docs/adr/0029-size-the-lab-domain-and-separate-its-namespace-and-clock.md +++ b/docs/adr/0029-size-the-lab-domain-and-separate-its-namespace-and-clock.md @@ -6,7 +6,7 @@ > [ADR-0077](0077-configure-the-lab-domain-with-ansible-from-phoenix.md) amends the "join none of the estate's loops" > consequence. The text here is left as written, per ADR-0001 and ADR-0115. > -> [ADR-0140](0140-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md) amends "LDAP signing on the two DCs" in the +> [ADR-0141](0141-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md) amends "LDAP signing on the two DCs" in the > list of hardening deliberately removed: it is removed on demand, by the > `unsigned_ldap` switch, and stays enforced as shipped otherwise. The text > here is left as written, per ADR-0001 and ADR-0115. diff --git a/docs/adr/0083-give-the-lab-domain-its-deliberate-weaknesses-as-switchable-tags.md b/docs/adr/0083-give-the-lab-domain-its-deliberate-weaknesses-as-switchable-tags.md index 386521ae8..b4c9410f5 100644 --- a/docs/adr/0083-give-the-lab-domain-its-deliberate-weaknesses-as-switchable-tags.md +++ b/docs/adr/0083-give-the-lab-domain-its-deliberate-weaknesses-as-switchable-tags.md @@ -7,7 +7,7 @@ secret in `phoenix.env`) and (the weaknesses it said would come) > [!NOTE] -> [ADR-0140](0140-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md) adds three switches in this model, `unsigned_ldap`, +> [ADR-0141](0141-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md) adds three switches in this model, `unsigned_ldap`, > `maq` and `spooler`, under the reopen clause below. For `maq` and `spooler` > `absent` is the hardened side, so applying them with the defaults changes > the DCs, where this ADR's six changed nothing on merge. The text here is diff --git a/docs/adr/0140-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md b/docs/adr/0141-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md similarity index 99% rename from docs/adr/0140-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md rename to docs/adr/0141-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md index 737504dbb..d0706df10 100644 --- a/docs/adr/0140-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md +++ b/docs/adr/0141-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md @@ -1,4 +1,4 @@ -# ADR-0140: Switch three of the DCs' shipped defaults, and keep dsHeuristics as shipped +# ADR-0141: Switch three of the DCs' shipped defaults, and keep dsHeuristics as shipped **Status:** Accepted · 2026-11 · amends [ADR-0029](0029-size-the-lab-domain-and-separate-its-namespace-and-clock.md) diff --git a/docs/changelog.md b/docs/changelog.md index d20803ed3..d151cea59 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,23 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-26 +- **Correction to the entry below, "what the `bahamut` audit found, + decided (ADR-0140)".** That decision is + [ADR-0141](adr/0141-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md). + #1762 merged three minutes earlier with its own ADR-0140, so two ADRs held + the number and `check_docs.py` failed on `main`; the one that landed second + was renumbered. ADR-0140 is #1762's, on Domain Admins network logon. +- **Lab domain: the DCs' root hints came back after every DNS restart.** + `verify.yml`'s "no root hints" check failed on both DCs during the `bahamut` + audit. `roles/dns_forwarder` removed the hints from memory only, and the + service reloads them from `cache.dns` at start. A restart on `leviathan` took + it from 0 hints to 13; with `cache.dns` set aside it came back with 0. The + role now leaves `cache.dns` holding one comment line (a missing file loads + no hints too, but logs errors 1000, 1004 and 1501 at every start), and + `verify.yml` checks the file. Tested on `leviathan`: applied, a second run + changed nothing, and a restart kept 0 hints with resolution working. + `bahamut` changes on the next run. What cleared both DCs' in-memory hints + between two reads that morning is not known. - **Lab domain: what the `bahamut` audit found, decided (ADR-0140).** The read-only audit of the PDC emulator (2026-11-13 to 2026-11-25, with `leviathan` read for the same points) found four things on the DCs that the diff --git a/docs/roadmap.md b/docs/roadmap.md index 1f52fe815..6293fda9e 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -100,7 +100,7 @@ Ansible, Sysmon and BloodHound each closed with its issue, and the record is in sub-issue per weakness: #1475 kerberoast, #1476 AS-REP roast, #1477 DCSync, #1478 resource-based constrained delegation, #1479 unconstrained delegation and #1480 constrained delegation. It closes when all six are recorded, each - with a detection outcome. The three switches of ADR-0140 (`unsigned_ldap`, + with a detection outcome. The three switches of ADR-0141 (`unsigned_ldap`, `maq`, `spooler`) are off by default and are not among the six. → [runbook](runbooks/build-the-lab-domain.md) ## last diff --git a/docs/runbooks/build-the-bloodhound-guest.md b/docs/runbooks/build-the-bloodhound-guest.md index 8201dc6e7..c7b2a3d95 100644 --- a/docs/runbooks/build-the-bloodhound-guest.md +++ b/docs/runbooks/build-the-bloodhound-guest.md @@ -495,7 +495,7 @@ containers to come back. They have `restart: unless-stopped`. 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 `unsigned_ldap` switch - ([ADR-0140](../adr/0140-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md), + ([ADR-0141](../adr/0141-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md), `build-the-lab-domain.md` §5a). While it is present the Linux collectors work, but the graph that answers "no path with every switch off" is SharpHound's, collected with it absent. diff --git a/docs/runbooks/build-the-lab-domain.md b/docs/runbooks/build-the-lab-domain.md index 153b53517..e7e50c87a 100644 --- a/docs/runbooks/build-the-lab-domain.md +++ b/docs/runbooks/build-the-lab-domain.md @@ -717,8 +717,14 @@ Then the forwarder and the root hints, on `bahamut`: ```powershell Set-DnsServerForwarder -IPAddress 10.0.30.1 -UseRootHint $false Get-DnsServerRootHint | Remove-DnsServerRootHint -Force # -InputObject @() does not clear them +Set-Content $env:windir\System32\dns\cache.dns '; No root hints: this DC forwards to the gateway only (ADR-0029).' -Encoding Ascii ``` +The last line is what makes it last. `Remove-DnsServerRootHint` clears the hints +from memory only, and the service reloads them from `cache.dns` at its next +start. Deleting the file instead works too, but the service then logs errors +1000, 1004 and 1501 at every start; one comment line loads clean. + > [!CAUTION] > **Disable root hints, and it is not housekeeping.** Left on, Windows DNS falls > back to recursing against the root servers whenever the forwarder is slow — so @@ -800,8 +806,8 @@ Set-DnsClientServerAddress -InterfaceAlias Ethernet -ServerAddresses 10.0.30.50, This is the one place the §2 rule ("every guest points at .50 and .51") does not apply: a DC uses its partner then loopback, which is Microsoft's own guidance and what keeps either DC resolving with the other down. Also remove -the root hints on `leviathan`, exactly as on `bahamut` above — the promotion -command here only sets the forwarder. +the root hints on `leviathan`, exactly as on `bahamut` above, `cache.dns` +included — the promotion command here only sets the forwarder. Confirm replication before moving on, because a second DC that is not replicating is worse than no second DC: @@ -870,7 +876,7 @@ The six weaknesses #449 asks for — `kerberoast`, `asreproast`, `dcsync`, `ucd` it ([ADR-0083](../adr/0083-give-the-lab-domain-its-deliberate-weaknesses-as-switchable-tags.md)). Three more, `unsigned_ldap`, `maq` and `spooler`, switch shipped defaults on the DCs the same way -([ADR-0140](../adr/0140-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md)). +([ADR-0141](../adr/0141-switch-three-of-the-dcs-shipped-defaults-and-keep-dsheuristics.md)). A plain run leaves all nine absent. > [!IMPORTANT]