Skip to content

Troubleshoot an External Key Store

Private Preview

External Key Store (XKS) is currently available as a private preview. Review the service boundaries for current limitations and SLA status.

An error on a key store, or on one of its KMS keys, comes from one of two places:

  • Exoscale KMS. Before it calls your proxy, Exoscale KMS checks the key store and its keys: whether they exist in the zone, their state, their names and the request itself. These errors are listed in Errors from Exoscale KMS.
  • Your XKS proxy or external key manager. When a call to your proxy fails, Exoscale KMS returns Key store proxy request failed. If your proxy answered with an error, Exoscale KMS also passes that error on. These errors are listed in Errors from your proxy.

For the results of the periodic health checks, see Monitor the Health of a Key Store.

Errors from Exoscale KMS

Error titleCauseWhat to do
Key store not foundNo key store with this ID exists in the zone of the request. A key store belongs to a single zone.Check the key store ID and the zone of the request.
Key store is disconnectedYou used a KMS key in a disconnected key store, or tried to create one in it.Connect the key store, then retry.
Key store is referencedYou tried to delete a key store that still has KMS keys.Delete the keys first and wait for their waiting period to end.
Key store name already existsAnother key store of your organization in this zone uses this name.Choose a different name.
Key store state changedThe key store was modified by another request at the same time.Retry the request.
Invalid argumentA field of the request is invalid, for example a proxy endpoint that is not an https:// URL with a host, or a KMS key in an external key store requested with a usage other than encrypt-decrypt, a key spec other than AES_256, or as a multi-zone key.Correct the field named in the error detail, then retry.
Invalid originYou tried to replicate a KMS key in an external key store. These keys exist in a single zone.Use the key in its own zone.
Key store proxy request failedExoscale KMS could not complete a call to your proxy: the proxy could not be reached, did not answer within 500 ms, or answered with an error. When you create a KMS key, it is also returned if the external key is disabled or does not allow both encryption and decryption.Check the error detail. If your proxy answered with an error, see Errors from your proxy.
Invalid ciphertextThe ciphertext cannot be decrypted with this KMS key. For a key in an external key store, it is also returned when your proxy reports InvalidCiphertextException.Check that you decrypt with the KMS key and the encryption context used for encryption, and that the ciphertext is unchanged.

Errors from your proxy

When your proxy answers a request with an error, the error response of Exoscale KMS contains an xks-proxy-error object with two fields:

The specification defines the following errors. Their cause is on your proxy or your external key manager.

error-nameHTTP statusMeaningWhat to check
ValidationException400The proxy considers a parameter of the request invalid.That your proxy implements version 1 of the specification.
InvalidStateException400The external key or the key manager is disabled, deactivated or blocked.The state of the external key in your key manager.
InvalidCiphertextException400Decryption only. The ciphertext, initialization vector, authentication tag or additional authenticated data is invalid. Exoscale KMS returns Invalid ciphertext.That the ciphertext was produced by this KMS key and is unchanged.
InvalidKeyUsageException400The external key does not allow the requested encryption or decryption.That the external key allows both encryption and decryption.
AuthenticationFailedException401The AWS SigV4 signature of the request is invalid.The access key and secret key of the key store, and the region (the zone of the key store) and service name (kms-xks-proxy) configured in your proxy.
AccessDeniedException403The authorization rules of your proxy refused the request, based on its request metadata.The rules of your proxy for the calling principal, the KMS key and the operation, against the formats in Request Metadata.
KeyNotFoundException404The external key does not exist in your key manager.The external-key-id of the KMS key.
InvalidUriPathException404The path of the request is not valid on your proxy.The path of the key store endpoint, including its prefix, for example /kms/xks/v1.
ThrottlingException429Your proxy is limiting the rate of requests.The rate limits of your proxy.
InternalException500Your proxy, or a component behind it such as your key manager, failed.The logs of your proxy and of your key manager.
UnsupportedOperationException501Your proxy does not implement the operation, or a parameter exceeds the size it supports.That your proxy implements GetHealthStatus, GetKeyMetadata, Encrypt and Decrypt.
DependencyTimeoutException503Your proxy timed out while reaching a component behind it, such as your key manager.The connection between your proxy and your key manager.

Request Metadata

Every request that Exoscale KMS sends to your proxy contains a requestMetadata object. Your proxy can use it to authorize requests, for example per API key or per KMS key, and to match its logs with your Exoscale requests. If your proxy validates these fields strictly, configure it to accept the formats below. Otherwise it may refuse valid requests with ValidationException or AccessDeniedException.

FieldSent with
awsPrincipalArnGetKeyMetadata, Encrypt and Decrypt
kmsKeyArnEncrypt and Decrypt
kmsOperationAll requests
kmsRequestIdAll requests

The field names come from the AWS KMS External Key Store Proxy API Specification. However, awsPrincipalArn and kmsKeyArn contain Exoscale specific resource identifiers, not AWS ARNs.

Field Formats

In the formats below, <zone> is the Exoscale zone of the key store, for example ch-gva-2, and <organization-id> is the UUID of your Exoscale organization.

awsPrincipalArn
The Exoscale identity that made the request:
  • An API key: ern:<zone>:<organization-id>:api-key:<api-key>, where <api-key> is the API key itself, starting with EXO. The API secret is never sent.
  • An IAM user: ern:<zone>:<organization-id>:iam-user:<user-id>, where <user-id> is the UUID of the user.
kmsKeyArn
The KMS key that the request uses: ern:<zone>:<organization-id>:<kms-key-id>:1, where <kms-key-id> is the UUID of the KMS key. The last segment is always 1. It is not the key version, and it does not change when the key is rotated.
kmsRequestId
The ID of the Exoscale KMS request. The Decrypt and Encrypt requests of a single re-encrypt operation carry the same ID.
kmsOperation
The Exoscale KMS operation that triggered the request. Exoscale KMS sends only the values in the table below.
kmsOperationProxy operationTriggered by
CreateCustomKeyStoreGetHealthStatusCreating a key store
ConnectCustomKeyStoreGetHealthStatusConnecting a key store
UpdateCustomKeyStoreGetHealthStatusUpdating the endpoint or the credential of a key store
KmsHealthCheckGetHealthStatusHealth checks of a connected key store
CreateKeyGetKeyMetadataCreating a KMS key in the key store
EncryptEncryptEncrypt
GenerateDataKeyEncryptGenerate data key
ReEncryptEncryptRe-encrypt, when the KMS key is the destination key
DecryptDecryptDecrypt
ReEncryptDecryptRe-encrypt, when the KMS key is the source key

Format Stability

The formats above may change in the future, to move towards more standardized formats. If they change, or if the list of kmsOperation values changes, Exoscale will notify you in advance and provide a migration period, so that you can update the rules of your proxy.

Last updated on