Querying and deleting certificate requests from an AD CS database

Certificate request information in an AD CS database is stored in 3 different tables The glue between those 3 tables is the RequestID in the Default table, that corresponds to the AttributeRequestID column in the Attrib table and the ExtensionRequestID column in the Ext table.

Whenever a certutil -view command is issued, it will default to the Default table, querying the Attrib and Ext tables requires them to be specified, e.g.:

certutil -view Attrib

will dump the content of the Attrib table


and

certutil -view Ext

will dump the content of the Ext table


Remember that certutil [Options], such as restrict and out, which can be used to filter the output of the queries above, must always be present before the -view command:

certutil [Options] -view

The default usage of certutil -view without specifying the table extracts data from the Default table, but it also includes the data contained in the Attrib and Ext tables, presenting it altogether in a convenient format.

if we query for a particular RequestID:

Note that the output includes a "Request Attributes" and a "Certificate Extensions". The information contained there is retrieved from the Attrib and Ext tables, which can also be queried separately:


So querying via certutil for a particular request without specifying any table will return the data contained for that particular request in all 3 tables (Default, Attrib and Ext).

Similarly, when a database row is deleted, using the -deleterow certutil command without specifying the table but just the RequestID, data will be deleted from all 3 tables:


In summary, when using certutil without specifying the database table to query or delete individual requests based on their RequestID, the command will return or delete data from all 3 tables that contain certificate request data in the AD CS database: Default, Attrib and Ext.

Comments

Popular posts from this blog

Decoding OCSP GET requests

Signing a CSR with an Enrollment Agent certificate

Compacting an AD CS database