Expand description
ms-csra — MS-CSRA (Certificate Services Remote Administration) primitives for CA-side ADCS misconfiguration detection.
§Why this crate
ms-crtd audits templates statically. ms-icpr submits requests.
Neither can see the CA’s own configuration flags — and the highest-
impact ADCS misconfigurations live there:
- ESC6 —
EDITF_ATTRIBUTESUBJECTALTNAME2set on the CA. Turns every request-attribute SAN into an issued-cert SAN, regardless of what the template allows. - ESC7 — Manage-CA or Manage-Certificates rights delegated to a non-tier-0 principal. Manage-CA can flip ESC6 remotely.
- ESC11 — RPC interface flags allow unauthenticated / no-integrity binds to the CA’s cert-request interface.
All three flags live in registry-mapped config entries reachable via
MS-CSRA ICertAdminD2::GetConfigEntry (opnum 44).
§What this crate ships
build_get_config_entry_request— NDR-marshaled input stub forICertAdminD2::GetConfigEntry(pwszAuthority, pwszNodePath, pwszEntry)at opnum 44 — the registry-mapped reads that carryEditFlags/InterfaceFlags/CRLFlags, which is where ESC6 and ESC11 live.EditFlags/InterfaceFlags/CrlFlags— bitfield decoders +describe()helpers that surface the exact ESC-relevant flags.Esc6Finding/Esc11Finding— audit-shaped decoded findings with severity + remediation.
§What this crate does not do
- No RPC transport. Callers plug this into
dcerpc(opnum-driven\PIPE\cert, binding toICertAdminD2at UUID7fe0d935-dda6-11d1-a71f-00c04fc3141ev0.0 — the interface that carriesGetConfigEntry). - No LDAP-side template audit (that lives in
ms-crtd).
Modules§
- config_
entry - Well-known registry-mapped config entry paths that
GetConfigEntryreads.EditFlags,InterfaceFlags,CRLFlags— all the ESC6 / ESC11 -relevant CA config lives here, not inCR_PROP_*.
Structs§
- CrlFlags
- CA
CRLFlags. Not ESC-critical; ship as decoder for parity with the two above. - Edit
Flags - CA
EditFlags(registry-side value that MS-CSRA exposes viaGetCAProperty(EditFlags)). Values fromcertca.h. - Esc6
Finding - Audit finding: an ESC6-exposed CA.
- Esc11
Finding - Audit finding: an ESC11-exposed CA.
- Interface
Flags - CA
InterfaceFlags(IF_*). Missing bits (e.g. absence ofIF_ENFORCEENCRYPTICERTREQUEST) can indicate ESC11 exposure.
Enums§
Constants§
- CSRA_
D2_ INTERFACE_ UUID - MS-CSRA
ICertAdminD2interface UUID (7fe0d935-dda6-11d1-a71f-00c04fc3141e, v0.0). Extension interface; carriesGetConfigEntry,GetCASecurity,SetConfigEntry, and the other post-Windows-2000 admin methods. - CSRA_
INTERFACE_ UUID - MS-CSRA
ICertAdminDinterface UUID (d99e6e73-fc88-11d0-b498-00a0c90312f4, v0.0). Distinct from the MS-WCCEICertRequestDinterface (…312f3) — same UUID prefix, trailing byte differs. This crate does not currently issue calls againstICertAdminD; useCSRA_D2_INTERFACE_UUIDfor theGetConfigEntrypath. - GET_
CONFIG_ ENTRY_ OPNUM GetConfigEntryopnum on theICertAdminD2interface. Reads registry-mapped config entries — the path toEditFlags/InterfaceFlags. Bind againstCSRA_D2_INTERFACE_UUID, notCSRA_INTERFACE_UUID.
Functions§
- build_
get_ config_ entry_ request - Build the NDR-marshaled
[in]stub forICertAdminD2::GetConfigEntry(pwszAuthority, pwszNodePath, pwszEntry). Use this to readEditFlags/InterfaceFlags— see theconfig_entrymodule for the well-known paths. - detect_
esc6 - Given a decoded
EditFlagsvalue and the CA it came from, produce anEsc6Findingif the ESC6 bit is set. ReturnsNoneif the CA is not exposed. - detect_
esc11 - Given a decoded
InterfaceFlagsvalue and the CA it came from, produce anEsc11Findingif the enforce-encryption bit is missing.