The observed GA → 0xD01F01FF and GR → 0x80120089 expansion cannot currently be certified as a supported least-privilege contract because Microsoft does not publish the Microsoft Software KSP’s GENERIC_MAPPING or its object-specific authorization bits.
What the readback establishes
Generic rights are placeholders whose meanings depend on the securable-object type. GENERIC_ALL is 0x10000000 and GENERIC_READ is 0x80000000; an object maps them to standard and object-specific rights ^1^. The lower 16 mask bits are object-specific, while the generic bits occupy the high-order region ^2^.
Therefore:
- The changed ACE bytes are consistent with generic-right expansion.
- They do not prove that
0xD01F01FFand0x80120089are the documented Software KSP mappings. - File-system mappings must not be substituted. Those mappings are explicitly for files and directories, not persisted CNG-key objects ^3^.
-
MapGenericMaskcannot solve this independently: it requires the caller to supply the correctGENERIC_MAPPING; it does not discover one from the object or provider ^4^.
No cited public contract assigns meanings to the additional Software KSP-specific bits or gives a Windows-version range for those exact masks. Consequently, neither byte equality nor a locally inferred mapping is a supportable authorization boundary.
Rights required by individual NCrypt operations
The public API references document operations, flags, and status values, but not an access-mask requirement table for Software KSP keys:
-
NCryptOpenKeydocuments scope selection throughNCRYPT_MACHINE_KEY_FLAG, but has no desired-access parameter and does not identify the ACL bits required to open a key ^5^. -
NCryptGetPropertydocuments retrieval ofNCRYPT_SECURITY_DESCR_PROPERTY, including owner, group, DACL, and SACL selectors, but does not map ordinary public-property reads to specific key rights ^6^. -
NCryptSignHashdocuments signing inputs and flags, but no ACL bit required for signing ^7^. -
NCryptDeleteKeysimilarly does not identify which key-object access bit authorizes deletion ^8^. -
NCryptSetPropertydocuments how to select owner, group, DACL, SACL, or mandatory-label changes, but not the provider-specific rights check behind those changes ^9^.
The standard meanings of DELETE, READ_CONTROL, WRITE_DAC, and WRITE_OWNER are documented ^10^, but that alone does not establish the complete Software KSP authorization rules or prove that signing is represented by any particular low-order bit.
Supported security boundary
For a boundary that does not depend on undocumented mask semantics, do not grant the restricted service a persisted-key handle. Put the key behind a narrowly scoped broker that:
- Runs under a distinct identity whose service SID is the only non-SYSTEM SID granted key access.
- Accepts only the bounded challenge format.
- Hashes or validates the challenge according to the protocol.
- Calls
NCryptSignHash. - Returns only the signature and required public material.
- Exposes no delete, property-set, export, arbitrary-hash, or arbitrary-key-name operation.
Service SIDs are expressly intended to isolate resources by placing the service SID in the resource ACL ^11^. A restricted service SID is also placed in the token’s restricted SID list ^12^.
If direct key access remains mandatory, the current evidence supports only an empirically qualified configuration, not a documented least-privilege contract. Qualify it on every supported Windows build under the real restricted token, testing successful open/property-read/sign and failed delete/security-descriptor mutation/export. Do not translate those outcomes into undocumented bit meanings.
Export-policy transitions
The documented policy values are:
-
0: non-exportable -
1: export allowed -
2: plaintext export allowed -
4/8: one-time archival variants ^13^
Microsoft explicitly documents only the special lifetime rule for archival policies: AllowArchiving and AllowPlaintextArchiving apply only to the original key handle and cease to be usable after that handle closes ^14^. Your reopened-handle AllowArchiving result therefore cannot test ACL enforcement.
The available documentation does not state a general guarantee that a finalized Software KSP key can never transition from None to AllowExport or AllowPlaintextExport, nor does it document the authorization and state preconditions for such a transition. Creation parameters initialize export policy before finalization ^15^, but that is not an immutability statement.
Do not claim post-finalization immutability from NTE_BAD_KEY_STATE or NTE_NOT_SUPPORTED. A normative answer requires a Microsoft protocol/provider specification or a Microsoft Support statement covering the Software KSP and applicable Windows builds.
Verification
AccessCheck is not independently usable here because it requires the object’s correct GENERIC_MAPPING, and its desired mask must already have generic bits mapped ^16^.
Use two separate checks:
- Structural readback: retrieve owner, group, DACL, and control information through
NCRYPT_SECURITY_DESCR_PROPERTY; verify the protected-DACL state, expected SIDs, ACE types, and absence of unexpected trustees. - Authority verification: exercise each permitted and prohibited NCrypt operation under the actual service token and a different service SID. Treat this as build-qualified behavioral testing—not proof of undocumented mask equivalence.
For a formally supported direct-access ACL contract, open a Microsoft Support case requesting the Software KSP’s generic mapping, object-specific rights definitions, operation-rights matrix, post-finalization export-policy rules, and applicable build range. Without that provider contract, a validator cannot reliably distinguish legitimate normalization from excessive provider-specific rights.
References
- Generic access rights
- Access Mask Format
- File security and access rights
- MapGenericMask function (securitybaseapi.h)
- NCryptOpenKey function (ncrypt.h)
- NCryptGetProperty function (ncrypt.h)
- NCryptSignHash function (ncrypt.h)
- NCryptDeleteKey function (ncrypt.h)
- NCryptSetProperty function (ncrypt.h)
- Standard access rights
- Service Changes for Windows Vista
- SERVICE_SID_INFO structure (winsvc.h)
- CngExportPolicies Enum-Definition
- Key Storage Property Identifiers
- CngKeyCreationParameters Class-Definition
- AccessCheck function (securitybaseapi.h)