--- title: "Issue and evidence a governed certificate" description: "Issue a private TLS certificate with the delegated team's token, then prove its profile, business unit, issuer, owners, and metadata from inventory and audit evidence." source_url: https://dev.digicert.com/solutions/governed-tls-issuance/phase-5-governed-issuance.html --- # Issue and evidence a governed certificate Issue a private TLS certificate with the delegated team's token, then prove its profile, business unit, issuer, owners, and metadata from inventory and audit evidence. ## Phase metadata - Phase: 5 - Workstream: Profile and issuance — Step 2 of 2 - Product: Trust Lifecycle Manager - Goal: A certificate issued with the delegated team's token validates to the approved root, and its inventory record and audit events show the expected profile, business unit, issuer, owners, and metadata. - Estimated time: 40 minutes - Inputs: service_api_token, admin_api_token, account_id, business_unit_id, profile_id, ica_id, service_user_id, environment_attribute_id, criticality_attribute_id, app_service_attribute_id, business_owner_id, technical_owner_id, technical_owner_email, server_name, root-ca.pem, issuing-ca.pem - Prerequisite: [Publish the governed issuance profile](https://dev.digicert.com/md/solutions/governed-tls-issuance/phase-4-governed-profile.md) Issue a private TLS certificate through the governed profile with the delegated team's token, then verify it as the central PKI team in DigiCert® Trust Lifecycle Manager. In this validation run, you act as both teams. - **Delegated team:** runs [Issue the certificate as the delegated identity](#step-51-issue-the-certificate-as-the-delegated-identity), and its pipeline repeats it for every certificate it needs. - **Central PKI team:** runs every other step. It maps the mandatory metadata to each certificate and repeats the verification steps at each review, including path validation with the CA certificates from DigiCert® Private CA. ## Phase prerequisites The central PKI team hands the delegated team everything it needs to [issue the certificate as the delegated identity](#step-51-issue-the-certificate-as-the-delegated-identity). Make sure the delegated team has: - The `profile_id` from [Publish the governed issuance profile](https://dev.digicert.com/md/solutions/governed-tls-issuance/phase-4-governed-profile.md). - The `service_api_token` from [Create the delegated issuance identity](https://dev.digicert.com/md/solutions/governed-tls-issuance/phase-3-delegated-identity.md), delivered through its secret manager. In this validation run, your session already holds it from that phase. - The `business_owner_id` and `technical_owner_id` from [Define the governance boundary](https://dev.digicert.com/md/solutions/governed-tls-issuance/phase-1-governance-boundary.md). - The approved namespace and a server name inside it, such as `api.payments.example.com`. For the verification steps, make sure the central PKI team has: - The `account_id`, `business_unit_id`, and the technical owner's email address from [Define the governance boundary](https://dev.digicert.com/md/solutions/governed-tls-issuance/phase-1-governance-boundary.md). - The `ica_id`, `root-ca.pem`, and `issuing-ca.pem` from [Approve the private CA source](https://dev.digicert.com/md/solutions/governed-tls-issuance/phase-2-approved-ca-source.md). - The `service_user_id` from [Create the delegated issuance identity](https://dev.digicert.com/md/solutions/governed-tls-issuance/phase-3-delegated-identity.md). - The `environment_attribute_id`, `criticality_attribute_id`, and `app_service_attribute_id` from [Define the governance boundary](https://dev.digicert.com/md/solutions/governed-tls-issuance/phase-1-governance-boundary.md), and the service's `environment`, `criticality`, and application values. - A setup credential with the Trust Lifecycle Manager **Manager** and **Custom attribute manager** roles. ## Endpoints used | Method | Path | Purpose | |--------|------|---------| | POST | `/mpki/api/v1/certificate` | Issue the certificate through the governed profile with the delegated team's token. | | GET | `/mpki/api/v1/certificate/{serial_number}` | Verify the inventory record's profile, business unit, and issuer. | | PUT | `/mpki/api/v1/custom-attributes/certificate/{id}` | Map the mandatory metadata to the certificate. | | GET | `/mpki/api/v1/certificate-search` | Confirm that owner and metadata searches find the certificate. | | PUT | `/mpki/api/v1/certificate-owners/certificate/{id}` | Add the owners to a certificate when the request didn't name them. | | GET | `/mpki/api/v1/audit-log` | Retrieve the issuance event for the evidence pack. | ## Step 5.1: Issue the certificate as the delegated identity The delegated team runs this step with `service_api_token`. Request the certificate exactly as the delegated team's pipeline does: with the delegated team's token, through the governed profile, and with the mandatory owners in the request. ### Generate the key and CSR Generate the private key on the service host, where it stays. Only the CSR goes to Trust Lifecycle Manager. Use a key type and size that the profile's `key_size` allows. For this validation, use the working directory. These are local OpenSSL commands, the same for both the cURL and Python paths: ```bash SERVER_NAME="api.payments.example.com" openssl req -new -newkey rsa:3072 -nodes \ -keyout server.key -out server.csr \ -subj "/CN=${SERVER_NAME}" \ -addext "subjectAltName=DNS:${SERVER_NAME}" ``` ### Submit the request The request names the profile, sends `server.csr`, and sets the owners and a provenance tag: | Field | Value | Source | |-------|-------|--------| | `seat.seat_id` | The server name | The profile maps seat IDs to the common name. | | `attributes.subject.common_name`, `attributes.extensions.san.dns_names` | The server name | Use the same name in both. The profile requires exactly one SAN DNS name and checks it against the FQDN allow-list. | | `tags` | A provenance tag | The pipeline or repository that requested the certificate | | `cert_owner_ids` | `business_owner_id` and `technical_owner_id` | The owners registered for the service | The request doesn't send custom attributes, because the profile attaches none. The central PKI team maps them to the certificate in [Apply the mandatory metadata](#step-53-apply-the-mandatory-metadata). Issue the certificate with the delegated team's token. Replace the server name and tag with your own: **cURL** ```bash SERVER_NAME="api.payments.example.com" jq -n \ --arg profile_id "${PROFILE_ID}" \ --arg server_name "${SERVER_NAME}" \ --rawfile server_csr server.csr \ --arg business_owner_id "${BUSINESS_OWNER_ID}" \ --arg technical_owner_id "${TECHNICAL_OWNER_ID}" \ '{ profile: {id: $profile_id}, seat: {seat_id: $server_name}, csr: ($server_csr | sub("\n+$"; "")), delivery_format: "x509", attributes: { subject: {common_name: $server_name}, extensions: { san: { dns_names: [$server_name] } } }, tags: ["pipeline:payments-api-deploy"], cert_owner_ids: [$business_owner_id, $technical_owner_id] }' | curl --fail-with-body --silent --show-error \ -X POST "https://demo.one.digicert.com/mpki/api/v1/certificate" \ -H "x-api-key: ${SERVICE_API_TOKEN}" \ -H "Content-Type: application/json" \ --data-binary @- \ -o certificate.json ``` **Python** ```python server_name = "api.payments.example.com" response = requests.post( f"{base_url}/mpki/api/v1/certificate", headers={"x-api-key": service_api_token}, json={ "profile": {"id": profile_id}, "seat": {"seat_id": server_name}, "csr": Path("server.csr").read_text().rstrip("\n"), "delivery_format": "x509", "attributes": { "subject": {"common_name": server_name}, "extensions": { "san": { "dns_names": [server_name], }, }, }, "tags": ["pipeline:payments-api-deploy"], "cert_owner_ids": [business_owner_id, technical_owner_id], }, timeout=30, ) response.raise_for_status() certificate = response.json() Path("certificate.json").write_text(response.text) ``` A successful request returns `201 Created`. A private profile with immediate issuance returns the certificate directly: ```json { "serial_number": "", "delivery_format": "x509", "certificate": "" } ``` If the response contains `request_id` instead, the profile requires approval or pickup, and the certificate isn't issued yet. Retrieve it as described in [Asynchronous operations](https://dev.digicert.com/md/solutions/governed-tls-issuance/operate.md#asynchronous-operations). With the `x509` delivery format, `certificate` is a PEM-encoded certificate. Save `serial_number`, and write `certificate` to `server-cert.pem`: **cURL** ```bash SERIAL_NUMBER="$(jq -er '.serial_number' certificate.json)" jq -ej '.certificate' certificate.json > server-cert.pem export SERIAL_NUMBER jq '{serial_number, delivery_format}' certificate.json ``` **Python** ```python serial_number = certificate["serial_number"] Path("server-cert.pem").write_text(certificate["certificate"]) print(json.dumps({ "serial_number": certificate["serial_number"], "delivery_format": certificate["delivery_format"], }, indent=2)) ``` Confirm that `delivery_format` is `x509`. - **Enforced at issuance.** The profile rejects requests that break its token binding, business unit scope, or FQDN allow-list for SAN DNS names. The rejection tests in [Validate the guardrails](#step-56-validate-the-guardrails) prove these controls before you onboard the team. - **Checked after issuance.** `cert_owner_ids` is optional, so a request without owners still issues, and the central PKI team maps the metadata after issuance. The owner and metadata searches in [Confirm the governance views find the certificate](#step-54-confirm-the-governance-views-find-the-certificate) show whether a certificate is missing an owner or a mandatory attribute. ## Step 5.2: Verify the inventory record > **Note** > > From this step on, the central PKI team runs the phase with its setup credential. Two tests in [Validate the guardrails](#step-56-validate-the-guardrails) also send the delegated team's token. The inventory record proves which profile, business unit, and issuing CA produced the certificate. Retrieve the certificate by its `serial_number`: **cURL** ```bash curl --fail-with-body --silent --show-error \ -X GET "https://demo.one.digicert.com/mpki/api/v1/certificate/${SERIAL_NUMBER}" \ -H "x-api-key: ${ADMIN_API_TOKEN}" \ -G \ --data-urlencode "account_id=${ACCOUNT_ID}" \ -o certificate-record.json ``` **Python** ```python response = requests.get( f"{base_url}/mpki/api/v1/certificate/{serial_number}", headers={"x-api-key": admin_api_token}, params={"account_id": account_id}, timeout=30, ) response.raise_for_status() certificate_record = response.json() Path("certificate-record.json").write_text(response.text) ``` A successful request returns `200 OK` with the inventory record. The sample shows the fields this step checks: ```json { "id": "", "profile": { "id": "", "name": "Private TLS - payments-platform - non-production - REST API" }, "business_unit": { "id": "", "name": "payments-platform" }, "ica": { "id": "" }, "common_name": "api.payments.example.com", "status": "issued", "valid_to": "TZ", "key_size": 3072, "signature_algorithm": "" } ``` Save the record's `id` as `certificate_id`: **cURL** ```bash CERTIFICATE_ID="$(jq -er '.id' certificate-record.json)" export CERTIFICATE_ID jq '{status, "profile.id": .profile.id, "business_unit.id": .business_unit.id, "ica.id": .ica.id, common_name, key_size, signature_algorithm, valid_to}' certificate-record.json ``` **Python** ```python certificate_id = certificate_record["id"] print(json.dumps({ "status": certificate_record["status"], "profile.id": certificate_record["profile"]["id"], "business_unit.id": certificate_record["business_unit"]["id"], "ica.id": certificate_record["ica"]["id"], "common_name": certificate_record["common_name"], "key_size": certificate_record["key_size"], "signature_algorithm": certificate_record["signature_algorithm"], "valid_to": certificate_record["valid_to"], }, indent=2)) ``` Check each field: | Field | Expected value | |-------|----------------| | `status` | `issued` | | `profile.id` | `profile_id` | | `business_unit.id` | `business_unit_id` | | `ica.id` | `ica_id`, which links this record to the DigiCert Private CA source you approved. Some records also report the CA's name in `issuing_ca_name`. | | `common_name` | The server name you requested. The FQDN allow-list doesn't check the common name, so this check does. | | `key_size`, `signature_algorithm`, and `valid_to` | The values the profile's `fields` set | ### Validate the certificate path Validate the issued certificate against `root-ca.pem` and `issuing-ca.pem`. These are local OpenSSL commands, the same for both the cURL and Python paths: ```bash openssl verify -CAfile root-ca.pem -untrusted issuing-ca.pem server-cert.pem openssl x509 -in server-cert.pem -noout -subject -issuer -serial -dates \ -ext subjectAltName,extendedKeyUsage,crlDistributionPoints,authorityInfoAccess ``` Confirm that: - `openssl verify` reports `server-cert.pem: OK`. - The issuer is the approved issuing CA. - The SAN contains only the requested server name. - The CRL distribution point ends in the issuing CA's `active_crl.file_name` from its approval evidence. If the certificate carries an authority information access extension, record its OCSP and CA issuer URLs in the evidence pack. A certificate can omit it. ## Step 5.3: Apply the mandatory metadata The central PKI team maps the metadata standard to each certificate after issuance, with the setup credential. The delegated team can't: - **Send metadata at issuance.** The profile in this manual attaches no attributes, so a request that sends `custom_attributes` returns `400` with `internal_service_error` "Not expected custom attribute id=\ from profile". - **Map metadata itself.** Mapping requires `MANAGE_EM_CUSTOM_ATTRIBUTES`, which its issuance role doesn't hold, so a mapping request with its token returns `403` with `no_access` "Not enough permissions". Map the three mandatory attributes to the certificate. Replace the values with the service's own: **cURL** ```bash jq -n \ --arg account_id "${ACCOUNT_ID}" \ --arg environment_attribute_id "${ENVIRONMENT_ATTRIBUTE_ID}" \ --arg criticality_attribute_id "${CRITICALITY_ATTRIBUTE_ID}" \ --arg app_service_attribute_id "${APP_SERVICE_ATTRIBUTE_ID}" \ '{ account_id: $account_id, custom_attributes_request: [ {id: $environment_attribute_id, value: "test"}, {id: $criticality_attribute_id, value: "tier2"}, {id: $app_service_attribute_id, value: "payments-api"} ] }' | curl --fail-with-body --silent --show-error \ -X PUT "https://demo.one.digicert.com/mpki/api/v1/custom-attributes/certificate/${CERTIFICATE_ID}" \ -H "x-api-key: ${ADMIN_API_TOKEN}" \ -H "Content-Type: application/json" \ --data-binary @- | jq '.' ``` **Python** ```python response = requests.put( f"{base_url}/mpki/api/v1/custom-attributes/certificate/{certificate_id}", headers={"x-api-key": admin_api_token}, json={ "account_id": account_id, "custom_attributes_request": [ {"id": environment_attribute_id, "value": "test"}, {"id": criticality_attribute_id, "value": "tier2"}, {"id": app_service_attribute_id, "value": "payments-api"}, ], }, timeout=30, ) response.raise_for_status() print(response.text) ``` A successful request returns `200 OK` with no body. A `DROP_DOWN_LIST` value outside the attribute's `items` returns `400` with `invalid_input_field` "Not expected value \ for custom attribute with id \". Map the metadata for every certificate the delegated team issues. The scheduled checks in [Monitoring](https://dev.digicert.com/md/solutions/governed-tls-issuance/operate.md#monitoring) find certificates that are missing an owner or a mandatory attribute. ## Step 5.4: Confirm the governance views find the certificate Owners and metadata let the central PKI team answer who owns a certificate and which services in each tier expire soon, and the provenance tag shows which pipeline requested it. Its governance views search the inventory by owner, by metadata, and by tag. Run the same searches, and confirm that the new certificate appears. ### Search by owner `cert_owners` filters by owner email. Search for the certificate by the technical owner's email address. Replace the address with your technical owner's: **cURL** ```bash TECHNICAL_OWNER_EMAIL="payments-technical-owner@example.com" curl --fail-with-body --silent --show-error \ -X GET "https://demo.one.digicert.com/mpki/api/v1/certificate-search" \ -H "x-api-key: ${ADMIN_API_TOKEN}" \ -G \ --data-urlencode "account_id=${ACCOUNT_ID}" \ --data-urlencode "serial_number=${SERIAL_NUMBER}" \ --data-urlencode "cert_owners=${TECHNICAL_OWNER_EMAIL}" | jq '.' ``` **Python** ```python technical_owner_email = "payments-technical-owner@example.com" response = requests.get( f"{base_url}/mpki/api/v1/certificate-search", headers={"x-api-key": admin_api_token}, params={ "account_id": account_id, "serial_number": serial_number, "cert_owners": technical_owner_email, }, timeout=30, ) response.raise_for_status() print(json.dumps(response.json(), indent=2)) ``` A successful request returns `200 OK` with the matching certificates and `total`. The sample shows the fields this step checks: ```json { "total": 1, "items": [ { "profile": { "id": "", "name": "Private TLS - payments-platform - non-production - REST API" }, "seat": { "seat_id": "api.payments.example.com" }, "business_unit": { "id": "", "name": "payments-platform" }, "account": { "id": "" }, "ica": { "id": "" }, "common_name": "api.payments.example.com", "status": "issued", "serial_number": "", "valid_from": "TZ", "valid_to": "TZ" } ] } ``` Confirm that `total` is `1` and that the item's `serial_number`, `profile.id`, and `business_unit.id` match. If `total` is `0`, the request didn't name the owner: 1. Correct the delegated team's request template. 1. Add the owners to this certificate with `PUT /mpki/api/v1/certificate-owners/certificate/{id}` and `certificate_id`. ### Search by metadata `custom_attributes` filters by attribute. A leading `:` filters by value, and no prefix filters by attribute name. Search for the certificate by its `criticality` value: **cURL** ```bash curl --fail-with-body --silent --show-error \ -X GET "https://demo.one.digicert.com/mpki/api/v1/certificate-search" \ -H "x-api-key: ${ADMIN_API_TOKEN}" \ -G \ --data-urlencode "account_id=${ACCOUNT_ID}" \ --data-urlencode "serial_number=${SERIAL_NUMBER}" \ --data-urlencode "custom_attributes=:tier2" | jq '.' ``` **Python** ```python response = requests.get( f"{base_url}/mpki/api/v1/certificate-search", headers={"x-api-key": admin_api_token}, params={ "account_id": account_id, "serial_number": serial_number, "custom_attributes": ":tier2", }, timeout=30, ) response.raise_for_status() print(json.dumps(response.json(), indent=2)) ``` A successful request returns `200 OK` with the matching certificates and `total`. The sample shows the fields this step checks: ```json { "total": 1, "items": [ { "serial_number": "", "common_name": "api.payments.example.com" } ] } ``` Confirm that `total` is `1`. If it's `0`, the metadata isn't mapped yet. [Apply the mandatory metadata](#step-53-apply-the-mandatory-metadata). Run the same filters across the whole business unit to build the recurring cleanup views that the DigiCert® Trust Architecture Playbook recommends. Compare each total with the business unit's total: - **Missing owner.** Use `business_unit_id` with `cert_owners`. A certificate without an owner has no one to receive its expiration notices. - **Missing mandatory attribute.** Use `business_unit_id` with `custom_attributes`. A certificate without a mandatory attribute is missing from every report filtered on that attribute. For the alert threshold, see [Monitoring](https://dev.digicert.com/md/solutions/governed-tls-issuance/operate.md#monitoring). ### Search by tag The inventory record doesn't list tags, so search for the provenance tag the request set. `tags` matches whole tags exactly, including case, and a comma-separated list matches any of its tags. Replace the tag with your own: **cURL** ```bash curl --fail-with-body --silent --show-error \ -X GET "https://demo.one.digicert.com/mpki/api/v1/certificate-search" \ -H "x-api-key: ${ADMIN_API_TOKEN}" \ -G \ --data-urlencode "account_id=${ACCOUNT_ID}" \ --data-urlencode "serial_number=${SERIAL_NUMBER}" \ --data-urlencode "tags=pipeline:payments-api-deploy" | jq '.' ``` **Python** ```python response = requests.get( f"{base_url}/mpki/api/v1/certificate-search", headers={"x-api-key": admin_api_token}, params={ "account_id": account_id, "serial_number": serial_number, "tags": "pipeline:payments-api-deploy", }, timeout=30, ) response.raise_for_status() print(json.dumps(response.json(), indent=2)) ``` The response has the same shape as the metadata search. Confirm that `total` is `1`. If it's `0`, check the tag's spelling and case, then correct the delegated team's request template if it didn't set the tag. ## Step 5.5: Retrieve the audit evidence Audit logs record who performed each lifecycle action, when, and with what result. Governance, risk, and compliance (GRC) teams sample these events as evidence. Retrieve the business unit's certificate create events, newest first, in a narrow window around the issuance. Set `from` and `to` in UTC, in the format `YYYY-MM-DDTHH:mm:ssZ`: **cURL** ```bash curl --fail-with-body --silent --show-error \ -X GET "https://demo.one.digicert.com/mpki/api/v1/audit-log" \ -H "x-api-key: ${ADMIN_API_TOKEN}" \ -G \ --data-urlencode "account_id=${ACCOUNT_ID}" \ --data-urlencode "business_unit_id=${BUSINESS_UNIT_ID}" \ --data-urlencode "resource_type=end_entity_certificate" \ --data-urlencode "action=create" \ --data-urlencode "from=2026-10-09T10:00:00Z" \ --data-urlencode "to=2026-10-09T11:00:00Z" \ --data-urlencode "sort=timestamp:desc" \ --data-urlencode "limit=100" \ -o audit-events.json ``` **Python** ```python response = requests.get( f"{base_url}/mpki/api/v1/audit-log", headers={"x-api-key": admin_api_token}, params={ "account_id": account_id, "business_unit_id": business_unit_id, "resource_type": "end_entity_certificate", "action": "create", "from": "2026-10-09T10:00:00Z", "to": "2026-10-09T11:00:00Z", "sort": "timestamp:desc", "limit": 100, }, timeout=30, ) response.raise_for_status() audit_events = response.json() Path("audit-events.json").write_text(response.text) ``` To list only the delegated service user's actions, add `admin_id=`. Profile events don't carry a business unit, so the `business_unit_id` filter excludes them. To find the profile's creation for the evidence pack, send `resource_type=profile` and `action=create` without `business_unit_id`, and match `resource_id` to `profile_id`. A successful request returns `200 OK` with the events in `items`. Use `offset` and `limit` to page through them: ```json { "total": 1, "offset": 0, "limit": 100, "items": [ { "id": "", "account": { "id": "" }, "business_unit": { "id": "" }, "resource_type": "end_entity_certificate", "resource_id": "", "action": "create", "user": { "id": "", "name": "" }, "timestamp": "TZ", "description": "", "status": "success", "data": "{\"serialNumber\":\"\",\"commonName\":\"api.payments.example.com\",\"caCertId\":\"\",\"validFrom\":\"\",\"validTo\":\"\"}" } ] } ``` In each certificate `create` event, `resource_id` is the certificate `id` from the inventory record, and `user` names the requester. The `data` field is a JSON-encoded string with the certificate's details, such as `serialNumber`, `commonName`, `caCertId`, `validFrom`, and `validTo`. Select the delegated service user's successful event in the window, and save its `id` as `issuance_audit_event_id`: **cURL** ```bash jq --arg service_user_id "${SERVICE_USER_ID}" ' [.items[] | select(.user.id == $service_user_id and .status == "success")] | if length == 1 then .[0] else error("expected one match, found \(length)") end ' audit-events.json > audit-event.json ISSUANCE_AUDIT_EVENT_ID="$(jq -er '.id' audit-event.json)" export ISSUANCE_AUDIT_EVENT_ID jq '{id, timestamp, "user.name": .user.name, resource_type, action, resource_id}' audit-event.json ``` **Python** ```python matches = [ item for item in audit_events["items"] if item["user"]["id"] == service_user_id and item["status"] == "success" ] if len(matches) != 1: raise LookupError(f"Expected one match, found {len(matches)}") audit_event = matches[0] Path("audit-event.json").write_text(json.dumps(audit_event, indent=2)) issuance_audit_event_id = audit_event["id"] print(json.dumps({ "id": audit_event["id"], "timestamp": audit_event["timestamp"], "user.name": audit_event["user"]["name"], "resource_type": audit_event["resource_type"], "action": audit_event["action"], "resource_id": audit_event["resource_id"], }, indent=2)) ``` The save stops unless exactly one such event is in the window: - **More than one.** Narrow the window, and send the request again. - **None.** See [The audit log returns no issuance event](https://dev.digicert.com/md/solutions/governed-tls-issuance/troubleshoot.md#the-audit-log-returns-no-issuance-event). Confirm that `user.name` identifies the delegated service user rather than the setup credential, and that `timestamp` falls inside the window. ## Step 5.6: Validate the guardrails Before you onboard the team, prove that the profile rejects requests outside the boundary. Each test changes one thing in the request from [Issue the certificate as the delegated identity](#step-51-issue-the-certificate-as-the-delegated-identity). Every test must fail. If one succeeds, a control is missing. > **Note** > > A rejection is the expected result. The cURL examples report `The requested URL returned error: 400` before they print the saved response, and the Python examples print the status instead of raising an error. ### Build the test request Save the request from [Issue the certificate as the delegated identity](#step-51-issue-the-certificate-as-the-delegated-identity) as `guardrail-request.json`. Each test starts from this body: **cURL** ```bash jq -n \ --arg profile_id "${PROFILE_ID}" \ --arg server_name "${SERVER_NAME}" \ --rawfile server_csr server.csr \ --arg business_owner_id "${BUSINESS_OWNER_ID}" \ --arg technical_owner_id "${TECHNICAL_OWNER_ID}" \ '{ profile: {id: $profile_id}, seat: {seat_id: $server_name}, csr: ($server_csr | sub("\n+$"; "")), delivery_format: "x509", attributes: { subject: {common_name: $server_name}, extensions: { san: { dns_names: [$server_name] } } }, tags: ["pipeline:payments-api-deploy"], cert_owner_ids: [$business_owner_id, $technical_owner_id] }' > guardrail-request.json ``` **Python** ```python guardrail_request = { "profile": {"id": profile_id}, "seat": {"seat_id": server_name}, "csr": Path("server.csr").read_text().rstrip("\n"), "delivery_format": "x509", "attributes": { "subject": {"common_name": server_name}, "extensions": { "san": { "dns_names": [server_name], }, }, }, "tags": ["pipeline:payments-api-deploy"], "cert_owner_ids": [business_owner_id, technical_owner_id], } Path("guardrail-request.json").write_text(json.dumps(guardrail_request, indent=2)) ``` ### Unbound token Send the request with the setup credential instead of the delegated team's token: **cURL** ```bash curl --fail-with-body --silent --show-error \ -X POST "https://demo.one.digicert.com/mpki/api/v1/certificate" \ -H "x-api-key: ${ADMIN_API_TOKEN}" \ -H "Content-Type: application/json" \ --data-binary @guardrail-request.json \ -o guardrail-unbound-token.json jq '.' guardrail-unbound-token.json ``` **Python** ```python response = requests.post( f"{base_url}/mpki/api/v1/certificate", headers={"x-api-key": admin_api_token}, json=guardrail_request, timeout=30, ) Path("guardrail-unbound-token.json").write_text(response.text) print(response.status_code) print(json.dumps(response.json(), indent=2)) ``` The profile binds only `api_token_id`, so it must reject the request with `400 Bad Request`: ```json { "errors": [ { "code": "profile_api_token_error", "message": "The specified profile does not allow certificate generation with the requested API token" } ] } ``` ### Out-of-namespace name Send the request with the delegated team's token and a server name outside the team's namespace, such as `api.other.example.com`, as both the common name and the SAN DNS name. The FQDN allow-list checks only SAN DNS names, so this test changes both: **cURL** ```bash OUT_OF_NAMESPACE_NAME="api.other.example.com" jq --arg out_of_namespace_name "${OUT_OF_NAMESPACE_NAME}" ' .seat.seat_id = $out_of_namespace_name | .attributes.subject.common_name = $out_of_namespace_name | .attributes.extensions.san.dns_names = [$out_of_namespace_name] ' guardrail-request.json > guardrail-namespace-request.json curl --fail-with-body --silent --show-error \ -X POST "https://demo.one.digicert.com/mpki/api/v1/certificate" \ -H "x-api-key: ${SERVICE_API_TOKEN}" \ -H "Content-Type: application/json" \ --data-binary @guardrail-namespace-request.json \ -o guardrail-namespace.json jq '.' guardrail-namespace.json ``` **Python** ```python out_of_namespace_name = "api.other.example.com" namespace_request = { **guardrail_request, "seat": {"seat_id": out_of_namespace_name}, "attributes": { "subject": {"common_name": out_of_namespace_name}, "extensions": { "san": { "dns_names": [out_of_namespace_name], }, }, }, } Path("guardrail-namespace-request.json").write_text(json.dumps(namespace_request, indent=2)) response = requests.post( f"{base_url}/mpki/api/v1/certificate", headers={"x-api-key": service_api_token}, json=namespace_request, timeout=30, ) Path("guardrail-namespace.json").write_text(response.text) print(response.status_code) print(json.dumps(response.json(), indent=2)) ``` The profile must reject the request with `400 Bad Request`, `internal_service_error`, and the `message` from the profile's `allowed_fqdn_regex` rule: ```json { "errors": [ { "code": "internal_service_error", "message": "Names must be within payments.example.com." } ] } ``` The rejected request still creates a seat for the requested name. A created seat isn't consumed until an active certificate is issued for it. ### Another team's profile Send the request with the delegated team's token, but set `profile.id` to a REST API profile in another business unit that binds other tokens. Replace `` with that profile's `id`: **cURL** ```bash OTHER_PROFILE_ID="" jq --arg other_profile_id "${OTHER_PROFILE_ID}" ' .profile.id = $other_profile_id ' guardrail-request.json > guardrail-other-profile-request.json curl --fail-with-body --silent --show-error \ -X POST "https://demo.one.digicert.com/mpki/api/v1/certificate" \ -H "x-api-key: ${SERVICE_API_TOKEN}" \ -H "Content-Type: application/json" \ --data-binary @guardrail-other-profile-request.json \ -o guardrail-other-profile.json jq '.' guardrail-other-profile.json ``` **Python** ```python other_profile_id = "" other_profile_request = { **guardrail_request, "profile": {"id": other_profile_id}, } Path("guardrail-other-profile-request.json").write_text(json.dumps(other_profile_request, indent=2)) response = requests.post( f"{base_url}/mpki/api/v1/certificate", headers={"x-api-key": service_api_token}, json=other_profile_request, timeout=30, ) Path("guardrail-other-profile.json").write_text(response.text) print(response.status_code) print(json.dumps(response.json(), indent=2)) ``` The profile must reject the request with `400 Bad Request`, `profile_api_token_error`, and the same message as the unbound token test. If the account has no other profile that binds tokens, record that in the evidence pack, and run this test when one exists. > **Note** > > A REST API profile that doesn't bind tokens issues the certificate instead. That's why [Confirm that no other profile accepts the token](https://dev.digicert.com/md/solutions/governed-tls-issuance/phase-4-governed-profile.md#step-43-confirm-that-no-other-profile-accepts-the-token) must return an empty list. ### Record the results Record each test's request, response, and timestamp in the evidence pack. The examples save each request and response in the working directory. Repeat the tests after any change to the profile, to token binding on any REST API profile, or to the delegated service user's role. ## Step 5.7: Assemble the evidence pack Assemble the evidence pack for this issuance: | Evidence record | What to keep | Where it comes from | |-----------------|--------------|---------------------| | CA source approval | The issuing CA record and hierarchy | [Approve the private CA source](https://dev.digicert.com/md/solutions/governed-tls-issuance/phase-2-approved-ca-source.md) | | Profile approval | The profile record and the `profile` create event | [Verify the profile's guardrails](https://dev.digicert.com/md/solutions/governed-tls-issuance/phase-4-governed-profile.md#step-42-verify-the-profiles-guardrails) and [Retrieve the audit evidence](#step-55-retrieve-the-audit-evidence) | | Identity and authorization | The service user record and the profile binding check | [Verify the identity's scope](https://dev.digicert.com/md/solutions/governed-tls-issuance/phase-3-delegated-identity.md#step-33-verify-the-identitys-scope) and [Confirm that no other profile accepts the token](https://dev.digicert.com/md/solutions/governed-tls-issuance/phase-4-governed-profile.md#step-43-confirm-that-no-other-profile-accepts-the-token) | | Namespace authorization | The namespace owner's approval and the FQDN pattern test results | Your namespace owner and [Test the FQDN allow-list pattern](https://dev.digicert.com/md/solutions/governed-tls-issuance/phase-4-governed-profile.md#test-the-fqdn-allow-list-pattern) | | Issuance event | The audit event's timestamp and requester, and the inventory record's profile, issuing CA, and serial number | [Retrieve the audit evidence](#step-55-retrieve-the-audit-evidence) and [Verify the inventory record](#step-52-verify-the-inventory-record) | | Certificate identity | The subject, SAN, and validity | [Verify the inventory record](#step-52-verify-the-inventory-record) | | Owner and metadata | The metadata mapping and the owner and metadata searches | [Apply the mandatory metadata](#step-53-apply-the-mandatory-metadata) and [Confirm the governance views find the certificate](#step-54-confirm-the-governance-views-find-the-certificate) | | Certificate path | The `openssl verify` result | [Validate the certificate path](#validate-the-certificate-path) | | Guardrail tests | The requests, responses, and timestamps | [Validate the guardrails](#step-56-validate-the-guardrails) | | Exception status | `none`, or the ID of the approved exception | Your exception register | ## Phase 5 checkpoint - [ ] The delegated team's token issued the certificate, and `server-cert.pem` validates to `root-ca.pem` through `issuing-ca.pem`. - [ ] The inventory record shows `profile_id`, `business_unit_id`, and `ica_id`. - [ ] The certificate carries the three mandatory attributes, and searches by technical owner email, by `criticality` value, and by provenance tag each return it. - [ ] The audit event attributes the issuance to the delegated service user, and `issuance_audit_event_id` is recorded in the evidence pack. - [ ] Each guardrail test fails with the expected error, and the results are in the evidence pack. The governed issuance path is complete. Before production, work through [Operate this solution](https://dev.digicert.com/md/solutions/governed-tls-issuance/operate.md), including the production readiness checklist. ## Outputs and handoff | Output | Produced in | Used by | | --- | --- | --- | | `serial_number` | Issue the certificate as the delegated identity: response `serial_number` | Operations, audit, or cleanup | | `server-cert.pem` | Issue the certificate as the delegated identity: response `certificate` | Operations, audit, or cleanup | | `certificate_id` | Verify the inventory record: response `id` | Operations, audit, or cleanup | | `issuance_audit_event_id` | Retrieve the audit evidence: response `items[].id` | Operations, audit, or cleanup |