Escalate through explicit replication rights, not a protected group

The AdminSDHolder anchor worked but handed svc_backup GenericAll over every
protected object, including Domain Admins — a shortcut that undermined the
intended lesson.

New design, matching how backup products actually get AD access:
  svc_backup --GenericAll--> m.legault (plain user, never protected)
  m.legault in Sauvegarde-AD, which holds Replicating Directory Changes
  and ...All on the domain — the vendor requirement for AD-aware backups

Nothing on that path is a protected object, so SDProp has nothing to rewrite.
t.smith stays as the decoy whose ACE is reverted hourly.

The flag moves to C:\Sauvegarde, shared as Sauvegarde\$ readable by the
backup group: C\$ is admin-only, so a plain account could never fetch it.

web --sync now mirrors instead of merging (it used to leave deleted files
served forever) and clears the staging folder that smbclot only adds to.
Lore 2016/2021 rewritten around the replication requirement.
This commit is contained in:
2026-10-24 14:06:21 -04:00
parent 5e9be0a0b3
commit 122aeed6cb
7 changed files with 107 additions and 61 deletions
+14 -1
View File
@@ -51,6 +51,11 @@ _web_sync() {
tcp_open "$ip" 445 || die "fs01 SMB is not reachable — is it provisioned?"
have_cmd smbclient || die "smbclient is required to push the site"
# Clear the staging folder first: smbclient only adds, so an old file would
# otherwise come back on every sync.
backend_ready fs01 120 >/dev/null 2>&1 || true
backend_ps fs01 "Remove-Item -Recurse -Force -ErrorAction SilentlyContinue 'C:\\norbourg\\site'" >/dev/null 2>&1 || true
# Bulk copy goes over SMB: WinRM caps the command line at ~8 KB.
smbclient "//$ip/C\$" -W "$NETBIOS" \
-U "$LAB_USER%$LAB_ADMIN_PASSWORD" \
@@ -58,7 +63,15 @@ _web_sync() {
>/dev/null 2>&1 || true
backend_ready fs01 300 || die "fs01 did not answer"
backend_ps fs01 "Copy-Item -Path 'C:\\norbourg\\site\\*' -Destination 'C:\\inetpub\\wwwroot' -Recurse -Force; Test-Path 'C:\\inetpub\\wwwroot\\index.html'" \
# Mirror, not merge: remove everything except the web.config that fs01.ps1
# places in public/, otherwise files deleted from the repo keep being served.
backend_ps fs01 "
Get-ChildItem 'C:\inetpub\wwwroot' -Force | Where-Object { \$_.Name -ne 'public' } |
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
Get-ChildItem 'C:\inetpub\wwwroot\public' -Force | Where-Object { \$_.Name -ne 'web.config' } |
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
Copy-Item -Path 'C:\norbourg\site\*' -Destination 'C:\inetpub\wwwroot' -Recurse -Force
Test-Path 'C:\inetpub\wwwroot\index.html'" \
| grep -qi true || die "copy failed on fs01"
ok "site published to C:\\inetpub\\wwwroot"