Phase 3
Create the delegated issuance identity
Create a dedicated service user for the delegated team with one least-privilege Trust Lifecycle Manager role and an expiration date.
Phase details
- Workstream
- Service identity · Step 1 of 1
- Product
- Account Manager
- Time
- 15 minutes
- Setup
- One-time setup
- Goal
- The delegated team has a dedicated, expiring service user that holds only the issuance role, and its token is in the team's secret manager.
- Inputs
admin_api_tokenaccount_idissuance_role_nameservice_user_namecredential_custodian_emailservice_user_end_date- Expected outputs
service_user_idapi_token_idservice_api_token- Prerequisite
- Define the governance boundary
Use DigiCert® Account Manager to create the delegated service user, the non-human identity the delegated team uses to request certificates. The central PKI team runs this phase with its setup credential.
The service user:
- Serves one team and one purpose.
- Holds a single least-privilege DigiCert® Trust Lifecycle Manager role.
- Expires on a known date.
The profile in Publish the governed issuance profile binds to its token, so no other credential can issue through that profile.
Phase prerequisites
Make sure you have:
- The
account_idfrom Define the governance boundary. - The least-privilege issuance role from Before you begin.
- A service user name that identifies the team and purpose, such as
payments-platform-tls-issuance-nonprod. Don’t reuse one service user across teams or environments. - The email address of the person who manages the service user’s credentials.
- An expiration date for the service user, aligned to your credential rotation policy.
- A setup credential with the User manager role, or a role with the Manage users permission.
Endpoints used
| Method | Path | Purpose |
|---|---|---|
| GET | /account/api/v1/role | Find the API name of the least-privilege issuance role. |
| POST | /account/api/v1/user | Create the service user and return its API token once. |
| GET | /account/api/v1/user/{user_id} | Confirm the service user’s roles, permissions, account, and expiration. |
Step 3.1: Find the issuance role
Find the API name of the issuance role. Account Manager assigns roles by that name, which can differ from the display name in the product and between tenants.
List the account’s Trust Lifecycle Manager roles. The application_code filter returns only the enterprise_manager product key, where these roles are:
curl --fail-with-body --silent --show-error \
-X GET "https://demo.one.digicert.com/account/api/v1/role" \
-H "x-api-key: ${ADMIN_API_TOKEN}" \
-G \
--data-urlencode "application_code=enterprise_manager" \
--data-urlencode "account_id=${ACCOUNT_ID}" \
-o roles.jsonresponse = requests.get(
f"{base_url}/account/api/v1/role",
headers={"x-api-key": admin_api_token},
params={
"application_code": "enterprise_manager",
"account_id": account_id,
},
timeout=30,
)
response.raise_for_status()
roles = response.json()
Path("roles.json").write_text(response.text)A successful request returns 200 OK with the roles under enterprise_manager. The sample shows two of them:
{
"enterprise_manager": [
{
"id": "<enterprise-manager-id>",
"name": "EM_EPKI_USER_&_CERT_MANAGER",
"display_name": "User and certificate manager",
"description": "EPKI User & cert manager",
"type": "default",
"status": "ACTIVE",
"access_scope": "account"
},
{
"id": "<enterprise-manager-id>",
"name": "EM_PAYMENTS_PLATFORM_TLS_ISSUANCE",
"description": "Payments platform team: certificate issuance only",
"type": "custom",
"status": "ACTIVE",
"access_scope": "account"
}
]
}
A custom role has no display_name, so identify the role by its name. Find the active issuance role under enterprise_manager in roles.json, and replace <issuance-role-name> with its name. The selection stops unless exactly one active role has that name:
ISSUANCE_ROLE_NAME="<issuance-role-name>"
jq --arg issuance_role_name "${ISSUANCE_ROLE_NAME}" '
[.enterprise_manager[] | select(.name == $issuance_role_name and .status == "ACTIVE")]
| if length == 1 then .[0] else error("expected one match, found \(length)") end
' roles.json > role.json
jq '{name, display_name, type, status}' role.jsonissuance_role_name = "<issuance-role-name>"
matches = [
item for item in roles["enterprise_manager"]
if item["name"] == issuance_role_name and item["status"] == "ACTIVE"
]
if len(matches) != 1:
raise LookupError(f"Expected one match, found {len(matches)}")
role = matches[0]
Path("role.json").write_text(json.dumps(role, indent=2))
print(json.dumps({
"name": role["name"],
"display_name": role.get("display_name"),
"type": role["type"],
"status": role["status"],
}, indent=2))Confirm that type is custom. If you use the predefined User and certificate manager role for a demo-tenant validation, its name is EM_EPKI_USER_&_CERT_MANAGER.
Don’t give the delegated service user a role or permission that lets the team change its own constraints. That removes the separation between the central PKI team and the delegated team.
- Manager, Certificate profile manager, and Custom attribute manager let the team change the profile, metadata, and business unit that constrain it.
MANAGE_EM_CUSTOM_ATTRIBUTEScovers more than mapping metadata. Don’t add it to the issuance role, even to let the team map its own metadata.
Step 3.2: Create the delegated service user
Create the service user with one role, one account, and an expiration date. Replace the name, email address, expiration, and description with your own:
jq -n \
--arg account_id "${ACCOUNT_ID}" \
--arg issuance_role_name "${ISSUANCE_ROLE_NAME}" \
'{
user_type: "service",
friendly_name: "payments-platform-tls-issuance-nonprod",
email: "pki-credential-custodian@example.com",
accounts: [$account_id],
roles: [$issuance_role_name],
end_date: "2027-01-31T23:59:59Z",
description: "Payments platform team: non-production TLS issuance through the governed profile"
}' |
curl --fail-with-body --silent --show-error \
-X POST "https://demo.one.digicert.com/account/api/v1/user" \
-H "x-api-key: ${ADMIN_API_TOKEN}" \
-H "Content-Type: application/json" \
--data-binary @- \
-o delegated-service-user.jsonresponse = requests.post(
f"{base_url}/account/api/v1/user",
headers={"x-api-key": admin_api_token},
json={
"user_type": "service",
"friendly_name": "payments-platform-tls-issuance-nonprod",
"email": "pki-credential-custodian@example.com",
"accounts": [account_id],
"roles": [issuance_role_name],
"end_date": "2027-01-31T23:59:59Z",
"description": "Payments platform team: non-production TLS issuance through the governed profile",
},
timeout=30,
)
response.raise_for_status()
delegated_service_user = response.json()
Path("delegated-service-user.json").write_text(response.text)| Field | Value | Source |
|---|---|---|
friendly_name | A name that identifies the team and purpose | You choose it. Don’t reuse one service user across teams or environments. |
email | The address of the person who manages the service user’s credentials | Your credential custodian |
end_date | The expiration, in YYYY-MM-DDTHH:MM:SSTZD format | Your credential rotation policy |
description | The owning team, purpose, and profile scope | You choose it |
This request isn’t safe to repeat. If the result is uncertain, look for a service user with the exact friendly_name in the account before you send it again.
A successful request returns 201 Created with the service user and its first API token. In the response:
api_token.nameis the service user’sfriendly_name.api_token.end_datematches the service user’send_date.- The API normalizes
end_dateto23:59:59Zon the date you send.
The sample shows a service user that holds the recommended custom role:
{
"id": "<user-id>",
"email": "pki-credential-custodian@example.com",
"status": "ACTIVE",
"access_scope": "account",
"primary_account_id": "<account-id>",
"created_at": "<YYYY-MM-DD>T<HH:MM:SS>Z",
"friendly_name": "payments-platform-tls-issuance-nonprod",
"description": "Payments platform team: non-production TLS issuance through the governed profile",
"api_token": {
"id": "<api-token-id>",
"user_id": "<user-id>",
"name": "payments-platform-tls-issuance-nonprod",
"token": "<api-token-value>",
"end_date": "2027-01-31T23:59:59Z",
"enabled": true
},
"accounts": [
{
"id": "<account-id>",
"name": "<account-name>",
"active": true,
"service_period": {
"from": "<YYYY-MM-DD>",
"to": "<YYYY-MM-DD>"
},
"friendly_identifier": "<friendly-identifier>",
"locale": "en_US"
}
],
"applications": [
{
"id": "<application-id>",
"name": "Trust Lifecycle",
"app_code": "enterprise_manager",
"permissions": [
"CREATE_EM_CERTIFICATE",
"VIEW_EM_CERTIFICATE",
"MANAGE_EM_VIEWS",
"VIEW_EM_ENROLLMENT",
"MANAGE_EM_ENROLLMENT"
],
"roles": [
"EM_PAYMENTS_PLATFORM_TLS_ISSUANCE"
]
}
],
"end_date": "2027-01-31T23:59:59Z"
}
The API returns api_token.token only in this response, and you can’t recover it later. Two local files hold it until the following steps move it to the delegated team’s secret manager and delete them:
delegated-service-user.json, the saved response.service-api-token.secret, which the save writes without printing the token.
If you lose the token, create a replacement for the same service user, as described in Rotate the delegated team’s token.
Save three different values:
- The user
idasservice_user_id. Audit log searches use it. api_token.idasapi_token_id. The profile binds to it.api_token.tokenasservice_api_token. The delegated team sends it in thex-api-keyheader.
SERVICE_USER_ID="$(jq -er '.id' delegated-service-user.json)"
API_TOKEN_ID="$(jq -er '.api_token.id' delegated-service-user.json)"
umask 077
jq -ej '.api_token.token' delegated-service-user.json > service-api-token.secret
SERVICE_API_TOKEN="$(cat service-api-token.secret)"
export SERVICE_USER_ID API_TOKEN_ID SERVICE_API_TOKEN
jq '{id, status, end_date, "api_token.id": .api_token.id}' delegated-service-user.jsonservice_user_id = delegated_service_user["id"]
api_token_id = delegated_service_user["api_token"]["id"]
service_api_token = delegated_service_user["api_token"]["token"]
Path("service-api-token.secret").touch(mode=0o600)
Path("service-api-token.secret").write_text(service_api_token)
print(json.dumps({
"id": delegated_service_user["id"],
"status": delegated_service_user["status"],
"end_date": delegated_service_user["end_date"],
"api_token.id": delegated_service_user["api_token"]["id"],
}, indent=2))Confirm that status shows the user is active and end_date matches the expiration you set.
Keep the user id and api_token.id in a file without the token, so you can restore them after you delete the saved response. This is a local command, the same for both the cURL and Python paths:
jq '{id, api_token: {id: .api_token.id}}' delegated-service-user.json > delegated-service-user-ids.json
Move the token to the delegated team’s secret manager. Then delete delegated-service-user.json and service-api-token.secret.
Step 3.3: Verify the identity’s scope
Before you bind a profile to this service user’s token in Publish the governed issuance profile, confirm that its access is what you intended. Retrieve the service user:
curl --fail-with-body --silent --show-error \
-X GET "https://demo.one.digicert.com/account/api/v1/user/${SERVICE_USER_ID}" \
-H "x-api-key: ${ADMIN_API_TOKEN}" | jq '.'response = requests.get(
f"{base_url}/account/api/v1/user/{service_user_id}",
headers={"x-api-key": admin_api_token},
timeout=30,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2))A successful request returns 200 OK with the service user’s accounts, roles, and permissions, without the API token. The sample shows the service user from the create response:
{
"id": "<user-id>",
"email": "pki-credential-custodian@example.com",
"status": "ACTIVE",
"access_scope": "account",
"primary_account_id": "<account-id>",
"created_at": "<YYYY-MM-DD>T<HH:MM:SS>Z",
"user_type": "service",
"friendly_name": "payments-platform-tls-issuance-nonprod",
"description": "Payments platform team: non-production TLS issuance through the governed profile",
"locale": "en_US",
"applications": [
{
"id": "<application-id>",
"name": "Trust Lifecycle",
"app_code": "enterprise_manager",
"permissions": [
"CREATE_EM_CERTIFICATE",
"VIEW_EM_CERTIFICATE",
"MANAGE_EM_VIEWS",
"VIEW_EM_ENROLLMENT",
"MANAGE_EM_ENROLLMENT"
],
"roles": [
"EM_PAYMENTS_PLATFORM_TLS_ISSUANCE"
]
}
],
"accounts": [
{
"id": "<account-id>",
"name": "<account-name>",
"active": true,
"service_period": {
"from": "<YYYY-MM-DD>",
"to": "<YYYY-MM-DD>"
},
"friendly_identifier": "<friendly-identifier>",
"locale": "en_US"
}
],
"disable_api_access_token": false,
"disable_cac_upload": false,
"end_date": "2027-01-31T23:59:59Z"
}
Check each field:
| Field | Expected value |
|---|---|
user_type | service |
status | ACTIVE |
access_scope | account |
accounts[].id | Only account_id |
applications | A Trust Lifecycle entry whose app_code is enterprise_manager. No other entry lists roles. |
applications[].roles | Only issuance_role_name |
applications[].permissions | Only the issuance permissions you intended |
end_date | The expiration you set |
For a custom role with Certificates, Create, and Enrollment (Manage), permissions lists CREATE_EM_CERTIFICATE, VIEW_EM_CERTIFICATE, MANAGE_EM_VIEWS, VIEW_EM_ENROLLMENT, and MANAGE_EM_ENROLLMENT. Without MANAGE_EM_ENROLLMENT, the issuance request returns 403. The predefined User and certificate manager role lists many more permissions, including seat and report management.
Add the service user to your service user register. The DigiCert® Trust Architecture Playbook treats service users as privileged identities, because their tokens request certificates from a pipeline without anyone signing in. Record these items in each entry:
- An owner and a purpose.
- A profile scope.
- Expiration and rotation dates.
- An access review status.
- An emergency disable path. For this service user, that’s Disable the delegated team’s token in an emergency.
Phase 3 checkpoint
-
service_user_idandapi_token_idare indelegated-service-user-ids.json, the token is in the delegated team’s secret manager, and you deleteddelegated-service-user.jsonandservice-api-token.secret. - The service user holds exactly one role,
issuance_role_name, for Trust Lifecycle Manager, in exactly one account. - The service user has an expiration date, and its register entry records its owner, purpose, scope, rotation date, access review status, and emergency disable path.
When you also complete Approve the private CA source, continue to Publish the governed issuance profile.