Event-Flut ID 16944 und 16945 von Quelle Microsoft-Windows-Directory-Services-SAM

Hallo, hier wieder einmal Rol, mit einem weiteren Beitrag vom PKI Experten und Kollegen Marius.
Bei diesem Fall hatte der Kunde eine neue Root CA eingeführt und dazu sogar  eine eigene OID (Object IDentifier) bei der IANA (Internet Assigned Numbers Authority, www.iana.org) registriert.
(OID und zugehörige Namen haben wir natürlich anonymisiert).
Die technische Verwendung der entsprechenden Zertifikate machte zwar keine Probleme, allerdings wurden die System Eventlogs der Windows Server 2008 R2 DCs mit folgendem Event geflutet:

Log Name: System Source: Microsoft-Windows-Directory-Services-SAM Event ID: 16944 Task Category: None
Level: Information Keywords:
User: SYSTEM
Computer: DC_name
Description:
The certificate that is used for authentication does not have an issuance policy descriptor corresponding to OID 1.2.3.4.5.6.7.8.9 in the Active Directory database.
This certificate will not be associated with a corresponding security identifier (SID), and the user may be denied access to some resources if you have resources whose access is restricted based on this issuance policy.

The error is 3221226021.

Wie das Event schon sagt, wurde keine Issuance Policy definiert. Wie kann man das nun bewerkstelligen, um das lästige Event 16944 loszuwerden?

Lösung zu Event 16944:

Wir verwenden CERTUTIL , um eine Issuance Policy für die neue OID 1.2.3.4.5.6.7.8.9 zu definieren, und zwar noch entsprechend den Sprach-Codes Deutsch und English:

certutil -f -oid 1.2.3.4.5.6.7.8.9 "Test Authentication Policy" 1033 2
1.2.3.4.5.6.7.8.9 -- Unknown ObjectId

Localized name added to DS store.
0: 1033,Test Authentication Policy
CertUtil: -oid command completed successfully.

certutil -f -oid 1.2.3.4.5.6.7.8.9 "Test Authentisierungs Richtilinie" 1031 2
1.2.3.4.5.6.7.8.9 -- Test Authentication Policy
pwszName = Test Authentication Policy
CRYPT_POLICY_OID_GROUP_ID (8)
AlgId = 0
Algorithm Class: 0x0(0) ALG_CLASS_ANY
Algorithm Type: 0x0(0) ALG_TYPE_ANY
Algorithm Sub-id: 0x0(0) ALG_SID_ANY
0: 1033,Test Authentication Policy

Localized name added to DS store.

0: 1031,Test Authentisierungs Richtilinie
1: 1033,CP Test Authentication Policy
CertUtil: -oid command completed successfully.

Somit haben wir die Issuance Policy “Test Authentication Policy” (pwszName = Test Authentication Policy) nun einmal für englischsprachigen Code 1033 und den deutschsprachigen Code 1031 registriert. Wird nur Englisch benötigt, reicht der erste Schritt.

Nun war zwar das Event 16944 verschwunden, nun wurde aber ein Event 16945 ständig aufgezeichnet:

The certificate issuance policy that is represented by OID CN=9.8AA8FEC4682ACAA680955E0AB04F9C4E,CN=OID,CN=Public Key Services,CN=Services,CN=Configuration,DC=contoso,DC=local does not have a link to a security identifier (SID), or this link cannot be read. The link is represented by the attribute msDS-OIDToGroupLink on the msPKI-Enterprise-Oid object that represents the issuance policy. This certificate will not be associated with a corresponding SID, and the user may be denied access to some resources if you have resources whose access is restricted based on this issuance policy.
Das im Event angegebene Objekt "CN=9.8AA8FEC4682ACAA680955E0AB04F9C4E,CN=OID,CN=Public Key Services,CN=Services,CN=Configuration,DC=contoso,DC=local" entspricht dem AD Objekt, daß wir zuvor für die OID  1.2.3.4.5.6.7.8.9 angelegt haben.

Glücklicherweise gibt es nun eine Anleitung, das Event 16945 ebenfalls loszuwerden, und zwar im TechNet Artikel

Authentication Mechanism Assurance for AD DS in Windows Server 2008 R2 Step-by-Step Guide; https://technet.microsoft.com/en-us/library/dd378897(WS.10).aspx

Von dort kopieren und verwenden wir auch die im Folgenden angegebenen Scripts get-IssuancePolicy.ps1 und set-IssuancePolicyToGroupLink.ps1 .

Lösung zu Event 16945:

1) Hierzu überlegen wir uns zunächst eine Universelle Gruppe für die OID im AD als auch eine OU, Beispiel “Authorization Group 1” und OU "OU_For_Storage_Of_Authorization_Groups". Bequemerweise lassen wir diese später vom Script anlegen.

2) Wir sehen uns in der POWERSHELL den Zustand der OIDs und den inssuance policies an:

PS C:\> .\get-IssuancePolicy.ps1 -LinkedToGroup:All

*********************************************************
The following Issuance Policies are NOT linked to groups:
*********************************************************
displayName : Low Assurance
Name : 400.090E281618E9C402DC9119533AABE2B6
distinguishedName : CN=400.090E281618E9C402DC9119533AABE2B6,CN=OID,CN=Public Key Services,CN=Services,CN=Configuration,DC=contoso,DC=local
displayName : Medium Assurance
Name : 401.D08ECF6AEF3570E5A8CE329654C644DE
distinguishedName : CN=401.D08ECF6AEF3570E5A8CE329654C644DE,CN=OID,CN=Public Key Services,CN=Services,CN=Configuration,DC=contoso,DC=local
displayName : High Assurance
Name : 402.7A5CF395250D4F760B041FDB6F77B997
distinguishedName : CN=402.7A5CF395250D4F760B041FDB6F77B997,CN=OID,CN=Public Key Services,CN=Services,CN=Configuration,DC=contoso,DC=local
displayName :
Name : 9.8AA8FEC4682ACAA680955E0AB04F9C4E
distinguishedName : CN=9.8AA8FEC4682ACAA680955E0AB04F9C4E,CN=OID,CN=Public Key Services,CN=Services,CN=Configuration,DC=contoso,DC=local

3) Nun verlinken wir die OID mit der im Schritt 1 erstellten Gruppe:

PS C:\> .\set-IssuancePolicyToGroupLink.ps1 -IssuancePolicyName "9.8AA8FEC4682ACAA680955E0AB04F9C4E" -groupOU "OU_For_Storage_Of_Authorization_Groups" -groupName "Authorization Group 1"

An Issuance Policy with name or display name " 10.CD126552EECB7AEF8C1B1DD3567F46DA" was succesfully found:
CN=10.CD126552EECB7AEF8C1B1DD3567F46DA,CN=OID,CN=Public Key Services,CN=Services,CN=Configuration,DC=contoso,DC=local

Warning: The Organizational Unit that you specified does not exist. Do you want to create it?
( (y)es / (n)o )y

Organizational Unit "OU_For_Storage_Of_Authorization_Groups" successfully created.
Warning: The group that you specified does not exist. Do you want to create it?
( (y)es / (n)o )y
cmdlet New-ADGroup at command pipeline position 1
Supply values for the following parameters:
Name: Authorization Group 1
Univeral Security group "Authorization Group 1" successfully created.
The certificate issuance policy was successfully linked to the specified group.

4) Nun können wir uns den Status der OID Issuance Policies und die Verlinkung der Universellen Gruppe ansehen:

PS C:\>.\get-IssuancePolicy.ps1 -LinkedToGroup:All

*****************************************************
The following Issuance Policies are linked to groups:
*****************************************************
displayName :
Name : 9.8AA8FEC4682ACAA680955E0AB04F9C4E
distinguishedName : CN=9.8AA8FEC4682ACAA680955E0AB04F9C4E,CN=OID,CN=Public Key
Services,CN=Services,CN=Configuration,DC=contoso,DC=local
Linked Group Name: Authorization Group 1

Linked Group DN: CN=Authorization Group 1,OU=OU_For_Storage_Of_Authorization_Grops,DC=contoso,DC=local *********************************************************
The following Issuance Policies are NOT linked to groups:
*********************************************************
displayName : Low Assurance
Name : 400.090E281618E9C402DC9119533AABE2B6
distinguishedName : CN=400.090E281618E9C402DC9119533AABE2B6,CN=OID,CN=Public Key Services,CN=Services,CN=Configuration,DC=contoso,DC=local
displayName : Medium Assurance
Name : 401.D08ECF6AEF3570E5A8CE329654C644DE
distinguishedName : CN=401.D08ECF6AEF3570E5A8CE329654C644DE,CN=OID,CN=Public Key Services,CN=Services,CN=Configuration,DC=contoso,DC=local
displayName : High Assurance
Name : 402.7A5CF395250D4F760B041FDB6F77B997
distinguishedName : CN=402.7A5CF395250D4F760B041FDB6F77B997,CN=OID,CN=Public Key Services,CN=Services,CN=Configuration,DC=contoso,DC=local

 

Schließlich sind wir so nun sowohl die Events 16944 als auch 16945 losgeworden.

Damit danke an Marius und euch gutes Gelingen!
Rol