Anchor the delegation in AdminSDHolder; document the mechanism

BUILTIN\Administrators is itself a protected group, so adding
Serveurs-Admins to it made m.legault transitively protected too: SDProp
then wiped both ACEs and reset adminCount. doctor caught it.

The durable fix is the one that works in a real domain: the ACE lives in
AdminSDHolder, which SDProp copies onto protected objects every hour, so it
is re-applied rather than deleted. The adminCount workaround is gone.

Lore gains a 2021 note explaining exactly this, in the voice of the
instructor who hit it: the delegation kept vanishing, the vendor explained
AdminSDHolder, the right was moved there and stopped disappearing.
This commit is contained in:
2026-10-24 13:49:08 -04:00
parent 23f4e1f060
commit 5e9be0a0b3
4 changed files with 27 additions and 11 deletions
+6 -2
View File
@@ -115,6 +115,7 @@ $plainAcl = Get-Acl ("AD:\" + (Get-ADUser m.legault).DistinguishedName)
"ace_plain=" + @($plainAcl.Access | Where-Object { $_.IdentityReference.Value -like "*svc_backup*" }).Count
"plain_enabled=" + (Get-ADUser m.legault).Enabled
"dcadmin=" + ((Get-ADGroupMember "S-1-5-32-544").Name -contains "Serveurs-Admins")
"sdh=" + @((dsacls.exe ("CN=AdminSDHolder,CN=System," + (Get-ADDomain).DistinguishedName) | Select-String "svc_backup")).Count
"admincount=" + (Get-ADUser t.smith -Properties adminCount).adminCount
"spn=" + @((Get-ADUser svc_backup -Properties ServicePrincipalNames).ServicePrincipalNames).Count
"preauth=" + (Get-ADUser j.contractor -Properties DoesNotRequirePreAuth).DoesNotRequirePreAuth
@@ -125,6 +126,7 @@ $plainAcl = Get-Acl ("AD:\" + (Get-ADUser m.legault).DistinguishedName)
"kali_res=" + @((Get-DhcpServerv4Reservation -ScopeId 10.10.10.0 -EA SilentlyContinue) | Where-Object { $_.IPAddress -eq "10.10.10.101" }).Count
' 2>/dev/null) || { _d_warn "cannot query DC01 for lab state"; return; }
local sdh_ok=0
while IFS='=' read -r key value; do
value=${value//$'\r'/}
case $key in
@@ -136,8 +138,10 @@ $plainAcl = Get-Acl ("AD:\" + (Get-ADUser m.legault).DistinguishedName)
else _d_fail "m.legault is disabled — the path is dead"; fi ;;
dcadmin) if [[ $value == True ]]; then _d_ok "Serveurs-Admins is DC local admin"
else _d_fail "Serveurs-Admins is not in BUILTIN\Administrators"; fi ;;
admincount) if [[ $value == 0 ]]; then _d_ok "t.smith outside SDProp (adminCount=0)"
else _d_warn "adminCount=$value: SDProp will delete the ACE within the hour"; fi ;;
sdh) if [[ $value -ge 1 ]]; then _d_ok "AdminSDHolder carries the delegation (SDProp-proof)"; sdh_ok=1
else _d_warn "delegation not anchored in AdminSDHolder"; fi ;;
admincount) if (( sdh_ok )) || [[ $value == 0 ]]; then _d_ok "protected objects cannot strip the ACE"
else _d_warn "adminCount=$value and no AdminSDHolder anchor"; fi ;;
spn) [[ $value -ge 1 ]] && _d_ok "service account: SPN present" || _d_fail "svc_backup has no SPN" ;;
preauth) [[ $value == True ]] && _d_ok "pre-auth disabled on j.contractor" || _d_fail "j.contractor still requires pre-auth" ;;
minage) [[ $value == 0 ]] && _d_ok "minimum password age: 0" || _d_fail "minimum password age is $value h" ;;