ms-csra 0.1.1

MS-CSRA (Certificate Services Remote Administration) primitives — GetCAProperty request builder, EditFlags/InterfaceFlags/CRLFlags decoders, and offline detectors for ESC6 (EDITF_ATTRIBUTESUBJECTALTNAME2), ESC7 (Manage-CA ACL), and CA-side ADCS misconfigurations.
Documentation
  • Coverage
  • 27.78%
    20 out of 72 items documented0 out of 14 items with examples
  • Size
  • Source code size: 41.9 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 396.8 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • icedracon

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 ms_csra::{
    build_get_config_entry_request, config_entry, detect_esc6, detect_esc11,
    EditFlags, InterfaceFlags, CSRA_D2_INTERFACE_UUID, GET_CONFIG_ENTRY_OPNUM,
};

// 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(
    "corp-CA-01",
    config_entry::EDIT_FLAGS_NODE,
    config_entry::EDIT_FLAGS_ENTRY,
);
// 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(value_from_response);
if let Some(finding) = detect_esc6("corp-CA-01", edit) {
    println!("{}: {}", finding.severity, finding.remediation);
}

What it gives you

  • build_get_config_entry_request — NDR-marshaled ICertAdminD2::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 against CSRA_D2_INTERFACE_UUID on \PIPE\cert and dispatch GET_CONFIG_ENTRY_OPNUM.
  • No template audit. Use ms-crtd.
  • No cert request submission. Use ms-icpr.
  • No GetCAProperty path. Every ESC6/ESC11-relevant value lives in the CA's registry-mapped config entries, reachable through GetConfigEntry — the standard CR_PROP_* reads aren't required.
  • No SetConfigEntry (no writeback). Detection only.

License

MIT