ms-csra
MS-CSRA (Certificate Services Remote Administration) primitives for CA-side ADCS misconfiguration detection, in pure Rust.
ms-crtd audits templates statically. ms-icpr submits requests. Neither can see the CA's own EditFlags — and that's where ESC6 (EDITF_ATTRIBUTESUBJECTALTNAME2) and ESC11 (missing IF_ENFORCEENCRYPTICERTREQUEST) live. This crate closes that gap.
use ;
// Wire the request through your dcerpc layer against \PIPE\cert, binding
// to ICertAdminD2 (UUID CSRA_D2_INTERFACE_UUID) at opnum GET_CONFIG_ENTRY_OPNUM (44).
let stub = build_get_config_entry_request;
// let response = dcerpc.call(CSRA_D2_INTERFACE_UUID, GET_CONFIG_ENTRY_OPNUM, &stub).await?;
// let value = parse_long_variant_response(&response)?; // caller's dcerpc layer
// Then detect.
let edit = EditFlags;
if let Some = detect_esc6
What it gives you
build_get_config_entry_request— NDR-marshaledICertAdminD2::GetConfigEntry(pwszAuthority, pwszNodePath, pwszEntry)request stub.config_entry::{EDIT_FLAGS_NODE, EDIT_FLAGS_ENTRY, INTERFACE_FLAGS_NODE, INTERFACE_FLAGS_ENTRY, CRL_FLAGS_NODE, CRL_FLAGS_ENTRY}— the registry-mapped paths for the values that carry ESC6 / ESC11 signal.EditFlags/InterfaceFlags/CrlFlags— bitfield decoders with named-flag introspection (.describe(),.has_esc6(),.has_esc11()).detect_esc6/detect_esc11— one-shot audit checks with severity + remediation string.CSRA_INTERFACE_UUID(ICertAdminD,…312f4) /CSRA_D2_INTERFACE_UUID(ICertAdminD2,…3141e) /GET_CONFIG_ENTRY_OPNUM— constants for the RPC layer.
What it doesn't do
- No RPC transport. Wire through
dcerpc— bind againstCSRA_D2_INTERFACE_UUIDon\PIPE\certand dispatchGET_CONFIG_ENTRY_OPNUM. - No template audit. Use
ms-crtd. - No cert request submission. Use
ms-icpr. - No
GetCAPropertypath. Every ESC6/ESC11-relevant value lives in the CA's registry-mapped config entries, reachable throughGetConfigEntry— the standardCR_PROP_*reads aren't required. - No
SetConfigEntry(no writeback). Detection only.
License
MIT