Skip to content

verify.yml false-negatives the rbcd present-check (reads computed PrincipalsAllowedToDelegateToAccount) #1075

Closed

Description

@Gerrrt

What is true

During the #449 deliberate-weakness loop (run 2026-10-08, results comment), five of the six weaknesses enabled → verified-present → disabled → verified-absent cleanly. rbcd was the exception: its enable applied, but verify.yml -e weakness_rbcd_state=present failed its assertion:

fatal: [bahamut]: FAILED! => assertion: verify_failed | length == 0
    msg: 'bahamut fails: rbcd matches its toggle'

It is a false negative, not a failed enable:

  • The enable play reported changed=2 (svc-rbcd created + the trust written).
  • The subsequent disable reported changed=2 and then a plain verify.yml passed — i.e. the disable had a real titan trust to clear. If the attribute had never been written, the disable would have had nothing to clear.

So the RBCD attribute was set on titan; only the present-check mis-read it.

Where

ansible/verify.yml:296-307 — the rbcd branch reads the computed property and compares DistinguishedNames:

$rp = Get-ADUser  -Filter "SamAccountName -eq '$($Weak.rbcd_account)'" ...
$rc = Get-ADComputer -Identity $Weak.rbcd_resource -Properties PrincipalsAllowedToDelegateToAccount ...
$trusted = @($rc.PrincipalsAllowedToDelegateToAccount | ForEach-Object { $_.DistinguishedName })
$bHave   = ($trusted -contains $rp.DistinguishedName)
$r['rbcd matches its toggle'] = ($bHave -eq ($Weak.rbcd_state -eq 'present'))

Identifiers (ansible/inventory/group_vars/all.yaml:144-146): lab_weakness_rbcd_account: svc-rbcd (a user with an SPN, per the comment there — deliberately not a computer), lab_weakness_rbcd_resource: TITAN.

Likely cause

PrincipalsAllowedToDelegateToAccount is a synthetic property AD derives from the raw msDS-AllowedToActOnBehalfOfOtherIdentity security descriptor by resolving the SIDs in it back to principal objects. The role writes the SD (from svc-rbcd's SID); the check reads it back through this computed view and compares DNs. Two plausible reasons it comes back empty/non-matching here specifically:

  1. The principal is a user, not a computer. PrincipalsAllowedToDelegateToAccount's round-trip / DN resolution is reliable for computer principals; a user-with-SPN principal can resolve differently (or not populate the computed list as expected), so the -contains $rp.DistinguishedName compare misses even though the SID is present in the SD.
  2. Read timing / DC view immediately after the write under --limit dc_primary.

The other five weaknesses pass, and the two that touch delegation differently — cd (reads allowedToDelegateTo, a plain attribute) and ucd (reads a UAC flag) — both verify cleanly, which fits a problem specific to the computed PrincipalsAllowedToDelegateToAccount/DN path.

Suggested fix

Verify rbcd the same way it is written: read the raw msDS-AllowedToActOnBehalfOfOtherIdentity SD on titan and test whether it grants svc-rbcd's SID, rather than DN-comparing the computed PrincipalsAllowedToDelegateToAccount. e.g.

$rp = Get-ADUser -Filter "SamAccountName -eq '$($Weak.rbcd_account)'" -Properties objectSid
$sd = (Get-ADComputer -Identity $Weak.rbcd_resource -Properties msDS-AllowedToActOnBehalfOfOtherIdentity).'msDS-AllowedToActOnBehalfOfOtherIdentity'
$bHave = [bool]$sd -and ($sd.Access.IdentityReference -contains $rp.SID) # or compare raw SD bytes / SIDs

Match the exact write the role performs so enable and verify agree.

Done when

  • With rbcd enabled, ansible-playbook verify.yml -e weakness_rbcd_state=present passes (rbcd matches its toggle holds) on the live domain.
  • A plain verify.yml still passes with rbcd disabled (no regression to the absent check).

Refs #449, ADR-0083. Found during the 2026-10-08 weakness loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglabstacks/lab on alexander (VLAN 30)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions