

# Configure signing and the trust bundle

**Preview release**  
Agent and workload identity is in preview release for AWS Identity and Access Management (IAM) and is subject to change.

When a workload authenticates to a service outside AWS, the service verifies the workload's credential against keys that your provider publishes. This page describes the signing keys behind those credentials and the endpoints where relying parties fetch the matching public material.

You don't need signing keys for calls to AWS services. AWS Security Token Service (AWS STS) verifies those directly.

## JWT signing keys
<a name="wi-sign-jwt-keys"></a>

Every provider that uses the Secure Production Identity Framework for Everyone (SPIFFE) scheme has two JSON Web Token (JWT) signing keys, created with the provider. A NONE provider has no signing keys and publishes no trust bundle. The IAM console shows the key algorithm, and tokens and the API use the signing algorithm:


| Signing algorithm | Key algorithm | 
| --- | --- | 
| ES384 | ECC\_NIST\_P384 | 
| RS256 | RSA\_2048 | 

IAM generates, holds, and rotates these keys for you on a schedule. During a rotation, the JSON Web Key Set (JWKS) lists two keys for the same algorithm, each with its own key ID (kid), so verifiers keep working. You can't rotate, disable, or delete the JWT keys yourself. A workload chooses which key signs its token when it requests a JSON Web Token SPIFFE Verifiable Identity Document (JWT-SVID). For more information, see Authenticate to services outside AWS.

## X.509 signer
<a name="wi-sign-x509"></a>

To issue X.509 SPIFFE Verifiable Identity Documents (X.509-SVIDs), attach your own certificate authority (CA) from AWS Private Certificate Authority (AWS Private CA). The CA belongs to you, and your root key never leaves your control.

### CA requirements
<a name="wi-sign-ca-requirements"></a>
+ The CA is a multi-Region CA created with AWS Private CA in service-affiliated mode for workload identity. For more information, see Service-affiliated CAs and Workload identity in the AWS Private CA User Guide.
+ Use AWS Private CA to replicate the CA to every Region where your workloads run, and to US East (N. Virginia) us-east-1. IAM reads the CA certificate from us-east-1 when you attach it. For steps, see Replicate the CA in the AWS Private CA User Guide.
+ You don't write a policy on the CA. AWS Private CA attaches the issuance policy for a service-affiliated CA, and it accepts only issuance requests that arrive through AWS STS.
+ The principal that attaches or rotates the CA needs acm-pca:GetCertificateAuthorityCertificate and acm-pca:DescribeCertificateAuthority on the CA in us-east-1, and acm-pca:CreateCertificateAuthorityAssociation. IAM makes these calls with your credentials and creates the CA's association with the provider. Creating, updating, and deleting a signer also need acm-pca:DeleteCertificateAuthorityAssociation. IAM uses it to release the CA's association with your credentials, for example to undo a signer create that fails, when you delete a signer, or when a rotation removes a retired entry.
+ If the CA is in a different account from the provider, the CA owner uses AWS Private CA CreatePermission to grant the provider's account those reads, CreateCertificateAuthorityAssociation, and DeleteCertificateAuthorityAssociation.

A provider can have one X.509 signer for each key algorithm, such as RSA\_2048 and EC\_prime256v1. Each signer keeps up to 5 entries through rotations, including entries that have stopped signing. When a rotation would exceed 5 entries, IAM deletes the oldest INACTIVE entries for you, and those deletions are permanent. A CA can be attached to a provider for only one key algorithm. If a workload calls from a Region where the CA has no replica, the request fails with RegionalSignerUnavailable.

### Signer status
<a name="wi-sign-status"></a>


| Status | Meaning | 
| --- | --- | 
| IN\_TRANSITION | Attached or rotated in, not yet signing. IAM is publishing its certificate so verifiers can fetch it first. | 
| ACTIVE | Signing new certificates. | 
| VALIDATING | No longer signing. Its certificate stays published so existing certificates still verify. | 
| INACTIVE | IAM removed its certificate from the trust bundle 12 hours after it stopped signing. You can delete it. | 

When you attach or rotate a CA, you can set SigningDelayInHours, 1 through 48 hours, to control when the CA starts signing. If you omit it, a new CA starts signing 1 hour after you attach it, and 24 hours after you rotate to it.

### Attach an X.509 signer
<a name="wi-sign-attach"></a>

#### Console
<a name="wi-sign-attach-console"></a>

1. In the IAM console navigation pane, choose **Agent and workload identity**, and then choose **Outbound signer** for your provider.

1. Under **Certificate signer**, choose **Enable**.

1. Choose where to get the CA:
   + **Choose from this account** – Select an existing service-affiliated AWS Private CA.
   + **Use one from another account** – Enter the **Certificate authority ID** and the owning account ID of a CA shared from a different account.
   + **Create new** – Create a new AWS Private CA in this account. This option is available only for an account-level provider. For an organization-level provider, use a CA in an account other than the management account.

1. (Optional) For **Minimum signing delay**, enter 1 through 48 hours.

1. Choose **Enable**.

#### AWS CLI
<a name="wi-sign-attach-cli"></a>

```bash
aws iam create-workload-identity-provider-outbound-signer \
  --workload-identity-provider-arn arn:aws:iam::o-a1b2c3d4e5:workload-identity-provider/corp-example-prod \
  --outbound-signer 'X509={CertificateAuthorityId=0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d,AccountId=111122223333}'
```

If the provider already has an X.509 signer for the CA's key algorithm, the call fails with EntityAlreadyExists, even if that signer is disabled. To replace its CA, use the update command. To add a different key algorithm, create another signer.

### Rotate to a new CA
<a name="wi-sign-rotate"></a>

The current CA keeps signing until the new one's start time, so issuance isn't interrupted. Before you rotate, replicate the new CA to us-east-1 and to every Region where your workloads run. For steps, see Replicate the CA in the AWS Private CA User Guide.

In the console, on the **Outbound signer** page, under **Certificate signer**, choose **Update**, and then choose the new CA. Or use the AWS Command Line Interface (AWS CLI):

```bash
aws iam update-workload-identity-provider-outbound-signer \
  --workload-identity-provider-arn arn:aws:iam::o-a1b2c3d4e5:workload-identity-provider/corp-example-prod \
  --outbound-signer 'X509={CertificateAuthorityId=1b2c3d4e-5f6a-7b8c-9d0e-1f2a3b4c5d6e,AccountId=111122223333}' \
  --signing-delay-in-hours 24
```

To cancel a rotation that hasn't completed, run the update command again with the CA that is currently signing.

### Stop and resume certificate issuance
<a name="wi-sign-stop-resume"></a>

Disabling stops new certificates immediately. Existing certificates still verify, because their CA stays published for 12 hours. In the console, on the **Outbound signer** page, under **Certificate signer**, choose **Disable** or **Enable**.

```bash
aws iam disable-workload-identity-provider-outbound-signer \
  --workload-identity-provider-arn arn:aws:iam::o-a1b2c3d4e5:workload-identity-provider/corp-example-prod \
  --signer-type X509
aws iam enable-workload-identity-provider-outbound-signer \
  --workload-identity-provider-arn arn:aws:iam::o-a1b2c3d4e5:workload-identity-provider/corp-example-prod \
  --signer-type X509
```

While the signer is disabled, certificate requests fail with SignerNotConfigured. When you enable it, the most recently active CA resumes signing immediately.

### Delete a CA immediately
<a name="wi-sign-delete-ca"></a>

Use this if a CA is compromised. Deleting removes the CA's certificate from the trust bundle at once. Every certificate it issued stops verifying at each relying party the next time that party refreshes the bundle. Ask relying parties that cache the bundle to refresh it. You can delete only a CA whose status is VALIDATING or INACTIVE, so disable or rotate first. In the console, choose **Delete** under **Certificate signer**.

**Replacing a deleted subordinate CA**  
The trust bundle publishes the top of the CA's chain. If the deleted CA was a subordinate CA, a replacement under the same root republishes that root, and certificates from the deleted CA verify again. Put the replacement under a new root, or wait until the deleted CA's certificates expire (up to 12 hours).

```bash
aws iam delete-workload-identity-provider-outbound-signer \
  --workload-identity-provider-arn arn:aws:iam::o-a1b2c3d4e5:workload-identity-provider/corp-example-prod \
  --outbound-signer 'X509={CertificateAuthorityId=0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d,AccountId=111122223333}'
```

### List signers
<a name="wi-sign-list"></a>

```bash
aws iam list-workload-identity-provider-outbound-signers \
  --workload-identity-provider-arn arn:aws:iam::o-a1b2c3d4e5:workload-identity-provider/corp-example-prod
```

The list includes every signer the provider has held, including retired ones.

### AWS API
<a name="wi-sign-api"></a>

IAM API Reference: `CreateWorkloadIdentityProviderOutboundSigner`, `UpdateWorkloadIdentityProviderOutboundSigner`, `DisableWorkloadIdentityProviderOutboundSigner`, `EnableWorkloadIdentityProviderOutboundSigner`, `DeleteWorkloadIdentityProviderOutboundSigner`, `ListWorkloadIdentityProviderOutboundSigners`

## Trust bundle
<a name="wi-sign-trust-bundle"></a>

Each provider publishes its public verification material on one host, `https://<endpoint-id>.workloads.tokens.sts.global.api.aws`. The endpoint ID is random and reveals nothing about your account or provider. You can find the URLs in the IAM console on the provider's Outbound signer page, under Token verifier information and Certificate verifier information, or in the OutboundSigners field of get-workload-identity-provider.


| Endpoint | Contents | Used by | 
| --- | --- | --- | 
| `/.well-known/openid-configuration` | OpenID Connect (OIDC) discovery document. The issuer value equals the iss claim of every JWT-SVID. | OIDC-compatible relying parties | 
| `/.well-known/jwks.json` | Public JWT signing keys, selected by kid | Services that verify JWT-SVIDs | 
| `/bundle` | SPIFFE trust bundle with the X.509 CA and JWT keys, and a refresh hint | SPIFFE-aware meshes and peers | 

These endpoints are public and need no AWS credentials. A relying party fetches them once, caches them, and verifies credentials locally with no call to AWS at request time.

Within AWS, you can also read the bundle with AWS STS. Only the provider's own account, or for an organization-level provider its own organization, can call it.

```bash
aws sts get-trust-bundles \
  --provider-arn arn:aws:iam::o-a1b2c3d4e5:workload-identity-provider/corp-example-prod
```

### AWS API
<a name="wi-sign-trust-bundle-api"></a>

AWS STS API Reference: [`GetTrustBundles`](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetTrustBundles.html)