Skip to main content
This guide walks you through the complete setup flow — from creating your first workload identity in the CertGov UI to verifying that your workload’s certificate is trusted and not revoked.

1. Create a workload identity

Go to Workload Identity in the left nav and click New Identity. Fill in: Click Create Identity. The identity is created in pending_enrollment status — no cert yet.

2. Generate an enrollment token

Open the identity you just created. In the Enrollment Token section, click Generate Token. The token is a <uuid>:<32-hex> string. Copy it immediately — it is only shown once and stored as a one-way hash. This token is what your workload uses to bootstrap its first certificate. It is single-use: once the workload enrolls, the token cannot be reused. If the workload needs to re-enroll (e.g. key compromise, re-deployment), generate a new token from this same screen. The token expires at the time shown — if it expires before the workload uses it, generate a new one.

3. Enroll the workload

The workload generates its own private key and sends a CSR to CertGov. CertGov ignores the CSR’s CN and SANs — the CN and SANs are taken from the identity configuration, so the workload cannot self-assign a different identity. Enrollment endpoint:
Request body:
Response:
The workload should:
  1. Store cert_pem and its private key on disk (or in memory)
  2. Use renew_before to know when to trigger renewal
  3. Never reuse the enrollment token
After a successful enrollment the identity status changes to active in the CertGov UI.
The CertGov team provides test scripts for quick end-to-end enrollment verification. See Testing below.

4. Renew the workload certificate

Renewal uses mutual TLS (mTLS) — the workload presents its current certificate to authenticate the renewal request. No API key or token is needed after the first enrollment. Renewal endpoint (mTLS listener, port 8444):
The client must present its current workload certificate via TLS client authentication. Request body:
The workload should generate a new key for each renewal (key rotation). The CSR’s CN and SANs are ignored — same as enrollment. Response: Same shape as enrollment (cert_pem, serial, not_after, renew_before).
The renewal endpoint is port 8444, not 8443. The mTLS listener requires client certs; the main API listener (8443) does not.

5. Testing

Use these scripts from the CertGov repo root to test enrollment and renewal end-to-end:
Both scripts save ./workload-key.pem and ./workload-cert.pem in the current directory. To test against a specific environment:

6. Verify the certificate

Check the chain and that the certificate carries your organization ID:
Expected: workload-cert.pem: OK, and a subject containing OU = org:<your-org-id>. To check revocation the way a strict service does:
To make your own services accept these certs safely, including revocation and organization checks, see Accepting Certs in Your Services.

7. What you see in the UI

Once enrolled and renewing, the workload identity detail page shows: Credential Events counts enrollment + renewal calls against this identity. It is not an mTLS connection counter — a workload that renews once every 24 hours will show 1 event per day.

8. AWS Roles Anywhere CRL distribution (optional)

If your workload uses AWS and you want CertGov to push revocation data to your AWS account, configure CRL distribution.

8a. Set up AWS

In your AWS account:
  1. Create a Trust Anchor in IAM Roles Anywhere. Use source External certificate bundle and paste the CertGov root certificate (https://ca.certgov.io/root.crt, converted to PEM).
  2. Create the CertGov push role. CertGov needs no AWS keys. It assumes a role in your account to upload the CRL. On Workload Identities → CRL Distribution in CertGov, copy the trust policy and permissions policy shown under Create the CertGov push role, and create an IAM role with them (for example certgov-crl-push). The trust policy contains an external ID unique to your organization. Keep it.
  3. Create the workload role your workload will assume. Use a trust policy generated by CertGov: the per-identity one on the identity’s page, or the org-wide and per-policy ones on CRL Distribution. Each requires your organization ID. Don’t remove that condition.
  4. Create a Profile in IAM Roles Anywhere that lists the workload role, with the minimum session duration (15 minutes).

8b. Configure in CertGov

Go to Workload Identities → CRL Distribution. Click Save Configuration, then Re-push CRL Now to test. A successful push registers the CRL in Roles Anywhere, and the status line shows its CRL ID. The Roles Anywhere console doesn’t list CRLs. To confirm AWS has the latest one, check its updatedAt:
Earlier versions of CertGov asked for an IAM user’s access key here. Those keys are deprecated. Saving a push role ARN deletes the stored key from CertGov. Then deactivate the key in AWS.
After this, the workload identity detail page will show a ready-to-paste credential-process snippet for ~/.aws/config:
Replace the file paths with the actual paths where the workload stores its cert and key. CertGov pushes an updated CRL to Roles Anywhere every time a workload cert is revoked, and on a regular schedule. If a push fails, you’ll see an alert in Alerts and an error under the buttons on CRL Distribution.

9. Revocation

To revoke a workload identity, open the identity in the UI and click Revoke in the Actions section. What happens immediately:
  • Renewal and re-enrollment are blocked
  • The cert’s serial is added to the revocation list
  • The CRL is rebuilt and published at crl.certgov.io
  • If AWS is configured, the updated CRL is pushed to Roles Anywhere (AWS refuses new credentials within seconds)
The identity status changes to revoked. Services that load the CRL reject the cert at their next refresh, within 15 minutes if they follow the integration guide. Services that don’t check revocation keep accepting it until it expires. To re-enroll the same identity later: click Re-enable Identity → then generate a new token and have the workload re-enroll.

Troubleshooting

Enrollment returns 401:
  • Check that the token hasn’t expired (the UI shows the expiry time)
  • Check that the token hasn’t already been used (status shows “Token was used at…”)
  • Tokens are single-use — generate a new one if needed
Renewal returns 401:
  • The mTLS listener requires the workload to present its certificate
  • Confirm the renewal request is going to port 8444, not 8443
  • Confirm --cert and --key flags (or the TLS client config) point to the current workload cert/key
Chain doesn’t verify:
  • Check the cert’s Issuer field: openssl x509 -in workload-cert.pem -noout -issuer. It must match the intermediate you passed with -untrusted
AWS CRL push failing:
  • Check the error shown in CRL Distribution status or in Alerts
  • assume push role: sts AssumeRole: AccessDenied: the push role’s trust policy must name CertGov’s AWS identity and your external ID exactly as shown on CRL Distribution
  • Confirm the push role has rolesanywhere:ImportCrl and rolesanywhere:UpdateCrl
  • Confirm the Trust Anchor ARN matches the region in the CertGov config