dc01: make the delegated ACL the only way out, and stabilise the state
Three shortcuts and one race made the lab either easier than documented or non-deterministic: - Serveurs-Admins was nested in BUILTIN\Administrators on the DC, so m.legault was a de-facto domain-controller admin (C$, NTDS.dit) and the whole ACL lesson could be skipped. It also made SDProp treat her as protected: an hour after provisioning, the intended GenericAll ACE was wiped. Removed the nesting; adminCount is explicitly reset. - the t.smith decoy ACE gave a working path to Domain Admin until SDProp ran (up to an hour after a fresh build). The role now grants it and revokes it immediately, so the state is deterministic. - the replication-rights grant stacked duplicate ACEs on every re-run; it now removes its own ACEs first. - up/reset/save returned as soon as WinRM answered, while the directory was still starting; doctor right after could report a missing ACE and missing replication rights on a healthy lab. They now wait for Get-ADDomain on dc01. doctor: a decoy ACE that is still present is now a failure, not a success. The deck's wording matches the new behaviour.
This commit is contained in:
@@ -129,7 +129,25 @@ _start_lab() {
|
||||
notready=1
|
||||
fi
|
||||
done
|
||||
return $(( notready ))
|
||||
if (( notready )); then
|
||||
warn "skipping the directory check: not every guest answered"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# WinRM answers before the directory does. A doctor run right after up saw
|
||||
# "stable path missing" and "replication rights missing" on a healthy lab
|
||||
# because the DC was still starting AD.
|
||||
step "wait for the domain"
|
||||
local deadline=$(( SECONDS + 240 ))
|
||||
while (( SECONDS < deadline )); do
|
||||
if backend_ps dc01 'Import-Module ActiveDirectory; (Get-ADDomain).DNSRoot' >/dev/null 2>&1; then
|
||||
ok "directory services answer"
|
||||
return 0
|
||||
fi
|
||||
sleep 5
|
||||
done
|
||||
warn "the domain did not answer in time — check with ./lab.sh doctor"
|
||||
return 1
|
||||
}
|
||||
|
||||
cmd_up() {
|
||||
|
||||
@@ -131,8 +131,8 @@ $plainAcl = Get-Acl ("AD:\" + (Get-ADUser m.legault).DistinguishedName)
|
||||
while IFS='=' read -r key value; do
|
||||
value=${value//$'\r'/}
|
||||
case $key in
|
||||
ace) if [[ $value -ge 1 ]]; then _d_ok "delegated right: svc_backup has an ACE on t.smith (decoy)"
|
||||
else _d_warn "decoy ACE on t.smith reverted by SDProp (expected)"; fi ;;
|
||||
ace) if [[ $value -ge 1 ]]; then _d_fail "decoy ACE still on t.smith — a Domain Admin shortcut until SDProp runs"
|
||||
else _d_ok "decoy ACE absent on t.smith (protected object, as designed)"; fi ;;
|
||||
ace_plain) if [[ $value -ge 1 ]]; then _d_ok "stable path: svc_backup has an ACE on m.legault"
|
||||
else _d_fail "stable path missing (ACE on m.legault)"; fi ;;
|
||||
plain_enabled) if [[ $value == True ]]; then _d_ok "m.legault account enabled"
|
||||
|
||||
Reference in New Issue
Block a user