feat: gate ADCS ESC6/ESC9/ESC13 validation on KDC binding and harden vuln roles - #400
Merged
Merged
Conversation
**Added:** - KDC binding verification for ESC6 and ESC9 - Added `checkESC6KDCBinding`, `checkESC9KDCBinding`, `checkESC9Enforcement`, and `readKDCBinding` in `cli/internal/validate/checks.go` to read `StrongCertificateBindingEnforcement` on the DC of the certificate's issuing domain, since the CA-side flag alone does not prove a weakly-mapped certificate can authenticate (ESC6 passes only at 0, ESC9 at 0 or 1, an absent value means Full Enforcement per KB5014754) - ESC13 group-link verification - Added `checkESC13GroupLink` and `parseESC13GroupLink` to confirm the issuance policy OID carries an `msDS-OIDToGroupLink` and that exactly one OID object exists, distinguishing a truly configured template from one that only looks configured - KDC restart after binding change - Added a conditional `win_service` restart of the KDC in `vulns_adcs_esc10_case1/tasks/main.yml` (and its README) so the new binding mode actually takes effect, since the KDC only reads the value at service start - Test coverage - Added `esc6_kdc_test.go`, `esc9_kdc_test.go`, and `esc13_link_test.go` covering enforcement thresholds, cross-forest DC resolution, absent-value handling, and duplicate-OID parsing - Documentation - Added a "KDC binding is a hard gate" section to `docs/GOAD-vulnerabilities-comprehensive.md` with the enforcement-mode table and event-39 caveat, plus updated ESC6/ESC9 prerequisites and DC03's entry in `docs/domains-and-users.md` **Changed:** - ESC13 provisioning idempotency - Reworked `vulns_adcs_esc13/files/esc13.ps1` to reuse an existing issuance policy OID, converge duplicates left by prior lab resets, and verify the group link landed rather than silently no-op - ESC7 PSPKI install guard - Guarded the `Install-Module PSPKI` step in `vulns_adcs_esc7/tasks/main.yml` to skip the PSGallery call when the module is already present, avoiding a fatal on egress hiccups - Validator error handling - Switched most checks in `checks.go` from `runPSErr` to `runPS`, folding transport-error WARNs into the normal result paths and inlining `checkSingleACL` back into `checkACLPermissions` - Renamed the `found` result flag to `any` in several checks and changed the IIS "no upload directory" verdict from FAIL to INFO since IIS is optional in some labs - Simplified `TestNewValidator_Defaults` by dropping the impossible nil-return guard **Removed:** - Dropped the unused `labmap` import from `checks.go` and removed the redundant OID re-query block from `esc13.ps1`
l50
force-pushed
the
upstream/adcs-kdc-binding-validation
branch
from
August 3, 2026 20:19
ebc1d97 to
fbff7ab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key Changes:
StrongCertificateBindingEnforcementgating so ESC6 and ESC9 validation checks the DC of the certificate's own domain, correctly accounting for the KB5014754 (Feb 2025) default shift to Full EnforcementAdded:
kdcBinding,readKDCBinding, andcheckESC6KDCBindingincli/internal/validate/checks.goso an EDITF_ATTRIBUTESUBJECTALTNAME2 flag only passes when the validating DC's binding value is exactly 0, since a present security extension is rejected in both Compatibility (1) and Full Enforcement (2)checkESC9EnforcementandcheckESC9KDCBindingthat first confirm the template carriesCT_FLAG_NO_SECURITY_EXTENSION, then require a binding value below 2, correctly treating Compatibility mode as exploitable for ESC9 (unlike ESC6)checkESC13GroupLinkandparseESC13GroupLinkto confirm the issuance-policy OID carries anmsDS-OIDToGroupLinkand that exactly one OID object exists, with field-splitting parsing that avoidsCOUNT=10matchingCOUNT=1win_servicerestart of the KDC so the new binding mode actually takes effect, since the running KDC only reads the value at startup (ansible/roles/vulns_adcs_esc10_case1)msDS-OIDToGroupLinkthat throws if the link did not land, since a silent no-op otherwise looks identical to successesc6_kdc_test.go,esc9_kdc_test.go, andesc13_link_test.gocovering binding thresholds, cross-forest DC resolution, absent-value default behavior, transport errors, and probe parsing edge casesdocs/GOAD-vulnerabilities-comprehensive.mdwith a value/mode table, cross-referenced from the ESC6 and ESC9 entries, and updateddocs/domains-and-users.mdto note the weak KDC binding on DC03Changed:
esc13.ps1to reuse an existing issuance-policy OID and converge duplicate OID objects left by prior lab resets, rather than unconditionally creating a new OID and linking only one of them (ansible/roles/vulns_adcs_esc13/files/esc13.ps1)Install-Module PSPKIstep to skip and report unchanged when the module is already present, so an egress hiccup on a re-run no longer becomes fatal (ansible/roles/vulns_adcs_esc7/tasks/main.yml)TestNewValidator_Defaults, sinceNewValidatoralways returns a non-nil value (cli/internal/validate/validator_test.go)