A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://docs.aws.amazon.com/kms/latest/developerguide/xks-troubleshooting.html below:

Troubleshooting external key stores - AWS Key Management Service

Troubleshooting external key stores

The resolution for most problems with external key stores are indicated by the error message that AWS KMS displays with each exception, or by the connection error code that AWS KMS returns when an attempt to connect the external key store to its external key store proxy fails. However, some issues are a bit more complex.

When diagnosing an issue with an external key store, first locate the cause. This will narrow the range of remedies and make your troubleshooting more efficient.

Note

When management operations on external key stores fail, they generate several different exceptions. But AWS KMS cryptographic operations return KMSInvalidStateException for all failures related to the external configuration or connection state of the external key store. To identify the problem, use the accompanying error message text.

The ConnectCustomKeyStore operation succeeds quickly before the connection process is complete. To determine whether the connection process is successful, view the connection state of the external key store. If the connection process fails, AWS KMS returns a connection error code that explains the cause and suggests a remedy.

AWS KMS provides several tools to help you identify and resolve problems with your external key store and its keys. Use these tools in conjunction with the tools provided with your external key store proxy and external key manager.

Note

Your external key store proxy and external key manager might provide easier methods of creating and maintaining your external key store and its KMS keys. For details, see the documentation for your external tools.

AWS KMS exceptions and error messages

AWS KMS provides a detailed error message about any problem it encounters. You can find additional information about AWS KMS exceptions in the AWS Key Management Service API Reference and AWS SDKs. Even if you are using the AWS KMS console, you might find these references to be helpful. For example, see the Errors list for the CreateCustomKeyStores operation.

To optimize the performance of your external key store proxy, AWS KMS returns exceptions based on your proxy's reliability within a given aggregation period of 5 minutes. In the event of a 500 Internal Server Error, 503 Service Unavailable, or connection timeout, a proxy with high reliability returns KMSInternalException and triggers an automatic retry to ensure that requests eventually succeed. However, a proxy with low reliability returns KMSInvalidStateException. For more information, see Monitoring an external key store.

If the problem surfaces in a different AWS service, such as when you use a KMS key in your external key store to protect a resource in another AWS service, the AWS service might provide additional information to help you identify the problem. If the AWS service doesn't provide the message, you can view the error message in the CloudTrail logs that record the use of your KMS key.

CloudTrail logs

Every AWS KMS API operation, including actions in the AWS KMS console, is recorded in AWS CloudTrail logs. AWS KMS records a log entry for successful and failed operations. For failed operations, the log entry includes the AWS KMS exception name (errorCode) and the error message (errorMessage). You can use this information to help you identify and resolve the error. For an example, see Decrypt failure with a KMS key in an external key store.

The log entry also includes the request ID. If the request reached your external key store proxy, you can use the request ID in the log entry to find the corresponding request in your proxy logs, if your proxy provides them.

CloudWatch metrics

AWS KMS records detailed Amazon CloudWatch metrics about the operation and performance of your external key store, including latency, throttling, proxy errors, external key manager status, the number of days until your TLS certificate expires, and the reported age of your proxy authentication credentials. You can use these metrics to develop data models for the operation of your external key store and CloudWatch alarms that alert you to impending problems before they occur.

Important

AWS KMS recommends that you create CloudWatch alarms to monitor the external key store metrics. These alarms will alert you to early signs of problems before they develop.

Monitoring graphs

AWS KMS displays graphs of the external key store CloudWatch metrics on the detail page for each external key store in the AWS KMS console. You can use the data in the graphs to help locate the source of errors, detect impending problems, establish baselines, and refine your CloudWatch alarm thresholds. For details about interpreting the monitoring graphs and using their data, see Monitor external key stores.

Displays of external key stores and KMS keys

AWS KMS displays detailed information about your external key stores and the KMS keys in the external key store in the AWS KMS console, and in the response to the DescribeCustomKeyStores and DescribeKey operations. These displays include special fields for external key stores and KMS keys with information that you can use for troubleshooting, such as the connection state of the external key store and the ID of the external key that is associated with the KMS key. For details, see View external key stores.

XKS Proxy Test Client

AWS KMS provides an open source test client that verifies that your external key store proxy conforms to the AWS KMS External Key Store Proxy API Specification. You can use this test client to identify and resolve problems with your external key store proxy.

Configuration errors

When you create an external key store, you specify property values that comprise the configuration of your external key store, such as the proxy authentication credential, proxy URI endpoint, proxy URI path, and VPC endpoint service name. When AWS KMS detects an error in a property value, the operation fails and returns an error that indicates the faulty value.

Many configuration issues can be resolved by fixing the incorrect value. You can fix an invalid proxy URI path or proxy authentication credential without disconnecting the external key store. For definitions of these values, including uniqueness requirements, see Assemble the prerequisites. For instructions about updating these values, see Edit external key store properties.

To avoid errors with your proxy URI path and proxy authentication credential values, when creating or updating your external key store, upload a proxy configuration file to the AWS KMS console. This is a JSON-based file with proxy URI path and proxy authentication credential values that is provided by your external key store proxy or external key manager. You can't use a proxy configuration file with AWS KMS API operations, but you can use the values in the file to help you provide parameter values for your API requests that match the values in your proxy.

General configuration errors

Exceptions: CustomKeyStoreInvalidStateException (CreateKey), KMSInvalidStateException (cryptographic operations), XksProxyInvalidConfigurationException (management operations, except for CreateKey)

Connection error codes: XKS_PROXY_INVALID_CONFIGURATION, XKS_PROXY_INVALID_TLS_CONFIGURATION

For external key stores with public endpoint connectivity, AWS KMS tests the property values when you create and update the external key store. For external key stores with VPC endpoint service connectivity, AWS KMS tests the property values when you connect and update the external key store.

Note

The ConnectCustomKeyStore operation, which is asynchronous, might succeed even though the attempt to connect the external key store to its external key store proxy fails. In that case, there is no exception, but the connection state of the external key store is Failed, and a connection error code explains the error message. For more information, see External key store connection errors.

If AWS KMS detects an error in a property value, the operation fails and returns XksProxyInvalidConfigurationException with one of the following error messages.

The external key store proxy rejected the request because of an invalid URI path. Verify the URI path for your external key store and update if necessary.

XKS_PROXY_INVALID_TLS_CONFIGURATION

AWS KMS cannot establish a TLS connection to the external key store proxy. Verify the TLS configuration, including its certificate. VPC endpoint service connectivity configuration errors

Exceptions: XksProxyVpcEndpointServiceNotFoundException, XksProxyVpcEndpointServiceInvalidConfigurationException

In addition to general connectivity issues, you might encounter the following issues while creating, connecting, or updating an external key store with VPC endpoint service connectivity. AWS KMS tests the property values of an external key store with VPC endpoint service connectivity while creating, connecting, and updating the external key store. When management operations fail due to configuration errors, they generate the following exceptions:

XksProxyVpcEndpointServiceNotFoundException

The cause might be one of the following:

XksProxyVpcEndpointServiceInvalidConfigurationException

This error occurs when the VPC endpoint service fails to meet one of the following requirements:

External key store connection errors

The process of connecting an external key store to its external key store proxy takes about five minutes to complete. Unless it fails quickly, the ConnectCustomKeyStore operation returns an HTTP 200 response and a JSON object with no properties. However, this initial response does not indicate that the connection was successful. To determine whether the external key store is connected, see its connection state. If the connection fails, the connection state of the external key store changes to FAILED and AWS KMS returns a connection error code that explains the cause of the failure.

Note

When the connection state of a custom key store is FAILED, you must disconnect the custom key store before attempting to reconnect it. You cannot connect a custom key store with a FAILED connection status.

To view the connection state of an external key store:

When the connection state is FAILED, the connection error code helps to explains the error.

To view the connection error code:

Connection error codes for external key stores

The following connection error codes apply to external key stores

INTERNAL_ERROR

AWS KMS could not complete the request due to an internal error. Retry the request. For ConnectCustomKeyStore requests, disconnect the custom key store before trying to connect again.

INVALID_CREDENTIALS

One or both of the XksProxyAuthenticationCredential values is not valid on the specified external key store proxy.

NETWORK_ERRORS

Network errors are preventing AWS KMS from connecting the custom key store to its backing key store.

XKS_PROXY_ACCESS_DENIED

AWS KMS requests are denied access to the external key store proxy. If the external key store proxy has authorization rules, verify that they permit AWS KMS to communicate with the proxy on your behalf.

XKS_PROXY_INVALID_CONFIGURATION

A configuration error is preventing the external key store from connecting to its proxy. Verify the value of the XksProxyUriPath.

XKS_PROXY_INVALID_RESPONSE

AWS KMS cannot interpret the response from the external key store proxy. If you see this connection error code repeatedly, notify your external key store proxy vendor.

XKS_PROXY_INVALID_TLS_CONFIGURATION

AWS KMS cannot connect to the external key store proxy because the TLS configuration is invalid. Verify that the external key store proxy supports TLS 1.2 or 1.3. Also, verify that the TLS certificate is not expired, that it matches the hostname in the XksProxyUriEndpoint value, and that it is signed by a trusted certificate authority included in the Trusted Certificate Authorities list.

XKS_PROXY_NOT_REACHABLE

AWS KMS can't communicate with your external key store proxy. Verify that the XksProxyUriEndpoint and XksProxyUriPath are correct. Use the tools for your external key store proxy to verify that the proxy is active and available on its network. Also, verify that your external key manager instances are operating properly. Connection attempts fail with this connection error code if the proxy reports that all external key manager instances are unavailable.

XKS_PROXY_TIMED_OUT

AWS KMS can connect to the external key store proxy, but the proxy does not respond to AWS KMS in the time allotted. If you see this connection error code repeatedly, notify your external key store proxy vendor.

XKS_VPC_ENDPOINT_SERVICE_INVALID_CONFIGURATION

The Amazon VPC endpoint service configuration doesn't conform to the requirements for an AWS KMS external key store.

XKS_VPC_ENDPOINT_SERVICE_NOT_FOUND

AWS KMS can't find the VPC endpoint service that it uses to communicate with the external key store proxy. Verify that the XksProxyVpcEndpointServiceName is correct and the AWS KMS service principal has service consumer permissions on the Amazon VPC endpoint service.

Latency and timeout errors

Exceptions: CustomKeyStoreInvalidStateException (CreateKey), KMSInvalidStateException (cryptographic operations), XksProxyUriUnreachableException (management operations)

Connection error codes: XKS_PROXY_NOT_REACHABLE, XKS_PROXY_TIMED_OUT

When AWS KMS can't contact the proxy within the 250 millisecond timeout interval, it returns an exception. CreateCustomKeyStore and UpdateCustomKeyStore return XksProxyUriUnreachableException. Cryptographic operations return the standard KMSInvalidStateException with an error message that describes the problem. If ConnectCustomKeyStore fails, AWS KMS returns a connection error code that describes the problem.

Timeout errors might be transient issues that can be resolved by retrying the request. If the problem persists, verify that your external key store proxy is active and is connected to the network, and that its proxy URI endpoint, proxy URI path, and VPC endpoint service name (if any) are correct in your external key store. Also, verify that your external key manager is close to the AWS Region for your external key store. If you need to update any of these values, see Edit external key store properties.

To track latency patterns, use the XksProxyLatency CloudWatch metric and the Average latency graph (based on that metric) in the Monitoring section of the AWS KMS console. Your external key store proxy might also generate logs and metrics that track latency and timeouts.

XksProxyUriUnreachableException

AWS KMS cannot communicate with the external key store proxy. This might be a transient network issue. If you see this error repeatedly, verify that your external key store proxy is active and is connected to the network, and that its endpoint URI is correct in your external key store.

Latency and timeout errors often manifest as connection failures. When the ConnectCustomKeyStore operation fails, the connection state of the external key store changes to FAILED and AWS KMS returns a connection error code that explains the error. For a list of connection error codes and suggestions for resolving the errors, see Connection error codes for external key stores. The connection codes lists for All custom key stores and External key stores apply to external key stores. The following connection errors are related to latency and timeouts.

XKS_PROXY_NOT_REACHABLE

-or-

CustomKeyStoreInvalidStateException, KMSInvalidStateException, XksProxyUriUnreachableException

AWS KMS cannot communicate with the external key store proxy. Verify that your external key store proxy is active and is connected to the network, and that its URI path and endpoint URI or VPC service name are correct in your external key store.

This error might occur for the following reasons:

XKS_PROXY_TIMED_OUT

-or-

CustomKeyStoreInvalidStateException, KMSInvalidStateException, XksProxyUriUnreachableException

AWS KMS rejected the request because the external key store proxy did not respond in time. Retry the request. If you see this error repeatedly, report it to your external key store proxy administrator.

This error might occur for the following reasons:

XKS_PROXY_TIMED_OUT

-or-

CustomKeyStoreInvalidStateException, KMSInvalidStateException, XksProxyUriUnreachableException

The external key store proxy did not respond to the request in the time allotted. Retry the request. If you see this error repeatedly, report it to your external key store proxy administrator. Authentication credential errors

Exceptions: CustomKeyStoreInvalidStateException (CreateKey), KMSInvalidStateException (cryptographic operations), XksProxyIncorrectAuthenticationCredentialException (management operations other than CreateKey)

You establish and maintain an authentication credential for AWS KMS on your external key store proxy. Then you tell AWS KMS the credential values when you create an external key store. To change the authentication credential, make the change on your external key store proxy. Then update the credential for your external key store. If your proxy rotates the credential, you must update the credential for your external key store.

If the external key store proxy won't authenticate a request signed with the proxy authentication credential for your external key store, the effect depends on the request:

The external key store proxy rejected the request because it could not authenticate AWS KMS. Verify the credentials for your external key store and update if necessary.

This error might occur for the following reasons:

Key state errors

Exceptions: KMSInvalidStateException

KMSInvalidStateException is used for two distinct purposes for KMS keys in custom key stores.

To find the required key state for an AWS KMS API operations, see Key states of AWS KMS keys. To find the key state of a KMS key, on the Customer managed keys page, view the Status field of the KMS key. Or, use the DescribeKey operation and view the KeyState element in the response. For details, see Identify and view keys.

Note

The key state of a KMS key in an external key store does not indicate anything about the status of its associated external key. For information about the external key status, use your external key manager and external key store proxy tools.

The CustomKeyStoreInvalidStateException refers to the connection state of the external key store, not the key state of a KMS key.

A cryptographic operation on a KMS key in a custom store might fail because the key state of the KMS key is Unavailable or PendingDeletion. (Disabled keys return DisabledException.)

Decryption errors

Exceptions: KMSInvalidStateException

When a Decrypt operation with a KMS key in an external key store fails, AWS KMS returns the standard KMSInvalidStateException that cryptographic operations use for all external configuration errors and connection state errors on an external key store. The error message indicates the problem.

To decrypt a ciphertext that was encrypted using double encryption, the external key manager first uses the external key to decrypt the outer layer of ciphertext. Then AWS KMS uses the AWS KMS key material in the KMS key to decrypt the inner layer of ciphertext. An invalid or corrupt ciphertext can be rejected by the external key manager or AWS KMS.

The following error messages accompany the KMSInvalidStateException when decryption fails. It indicates a problem with the ciphertext or the optional encryption context in the request.

The external key store proxy rejected the request because the specified ciphertext or additional authenticated data is corrupted, missing, or otherwise invalid. The ciphertext that the external key store proxy submitted for decryption, or the encryption context, is corrupted, missing, or otherwise invalid. External key errors

An external key is a cryptographic key in the external key manager that serves as the external key material for a KMS key. AWS KMS cannot directly access the external key. It must ask the external key manager (via the external key store proxy) to use the external key to encrypt data or decrypt a ciphertext.

You specify the ID of the external key in its external key manager when you create a KMS key in your external key store. You cannot change the external key ID after the KMS key is created. To prevent problems with the KMS key, the CreateKey operation asks the external key store proxy to verify the ID and configuration of the external key. If the external key doesn't fulfill the requirements for use with a KMS key, the CreateKey operation fails with an exception and error message that identifies the problem.

However, issues can occur after the KMS key is created. If a cryptographic operation fails because of a problem with the external key, the operation fails and returns an KMSInvalidStateException with an error message that indicates the problem.

CreateKey errors for the external key

Exceptions: XksKeyAlreadyInUseException, XksKeyNotFoundException, XksKeyInvalidConfigurationException

The CreateKey operation attempts to verify the ID and properties of the external key that you provide in the External key ID (console) or XksKeyId (API) parameter. This practice is designed to detect errors early before you try to use the external key with the KMS key.

External key in use

Each KMS key in an external key store must use a different external key. When CreateKey recognizes that the external key ID (XksKeyId) for a KMS key is not unique in the external key store, it fails with an XksKeyAlreadyInUseException.

If you use multiple IDs for the same external key, CreateKey won't recognize the duplicate. However, KMS keys with the same external key are not interoperable because they have different AWS KMS key material and metadata.

External key not found

When the external key store proxy reports that it cannot find the external key using the external key ID (XksKeyId) for the KMS key, the CreateKey operation fails and returns XksKeyNotFoundException with the following error message.

The external key store proxy rejected the request because it could not find the external key.

This error might occur for the following reasons:

External key requirements not met

When the external key store proxy reports that the external key does not fulfill the requirements for use with a KMS key, the CreateKey operation fails and returns XksKeyInvalidConfigurationException with one of the following error messages.

The key spec of the external key must be AES_256. The key spec of specified external key is <key-spec>. The status of the external key must be ENABLED. The status of specified external key is <status>. The key usage of the external key must include ENCRYPT and DECRYPT. The key use of specified external key is <key-usage>. Cryptographic operation errors for the external key

Exceptions: KMSInvalidStateException

When the external key store proxy cannot find the external key associated with the KMS key, or the external key doesn't fulfill the requirements for use with a KMS key, the cryptographic operation fails.

External key issues that are detected during a cryptographic operation are more difficult to resolve than external key issues detected before creating the KMS key. You cannot change the external key ID after the KMS key is created. If the KMS key has not yet encrypted any data, you can delete the KMS key and create a new one with a different external key ID. However, ciphertext generated with the KMS key cannot be decrypted by any other KMS key, even one with the same external key, because keys will have different key metadata and different AWS KMS key material. Instead, to the extent possible, use your external key manager tools to resolve the problem with the external key.

When the external key store proxy reports a problem with the external key, cryptographic operations return KMSInvalidStateException with an error message that identifies the problem.

External key not found

When the external key store proxy reports that it cannot find the external key using the external key ID (XksKeyId) for the KMS key, cryptographic operations return a KMSInvalidStateException with the following error message.

The external key store proxy rejected the request because it could not find the external key.

This error might occur for the following reasons:

External key configuration errors

When the external key store proxy reports that the external key doesn't fulfill the requirements for use with a KMS key, the cryptographic operation returns KMSInvalidStateException with the one of the following error messages.

The external key store proxy rejected the request because the external key does not support the requested operation. The external key store proxy rejected the request because the external key is not enabled in the external key manager. Proxy issues

Exceptions:

CustomKeyStoreInvalidStateException (CreateKey), KMSInvalidStateException (cryptographic operations), UnsupportedOperationException, XksProxyUriUnreachableException, XksProxyInvalidResponseException (management operations other than CreateKey)

The external key store proxy mediates all communication between AWS KMS and the external key manager. It translates generic AWS KMS requests into a format that your external key manager can understand. If the external key store proxy doesn't conform to the AWS KMS External Key Store Proxy API Specification, or if isn't operating properly, or can't communicate with AWS KMS, you won't be able to create or use KMS keys in your external key store.

While many errors mention the external key store proxy because of its critical role in the external key store architecture, those problem might originate in the external key manager or external key.

The issues in this section relate to problems with the design or operation of the external key store proxy. Resolving these issues might require a change to the proxy software. Consult your proxy administrator. To help diagnose proxy issues, AWS KMS provides XKS Proxy Text Client, an open source test client that verifies that your external key store proxy conforms to the AWS KMS External Key Store Proxy API Specification.

CustomKeyStoreInvalidStateException, KMSInvalidStateException or XksProxyUriUnreachableException

The external key store proxy is in an unhealthy state. If you see this message repeatedly, notify your external key store proxy administrator.

CustomKeyStoreInvalidStateException, KMSInvalidStateException or XksProxyInvalidResponseException

AWS KMS cannot interpret the response from the external key store proxy. If you see this error repeatedly, consult your external key store proxy administrator.

CustomKeyStoreInvalidStateException, KMSInvalidStateException or UnsupportedOperationException

The external key store proxy rejected the request because it does not support the requested cryptographic operation.

Exceptions: CustomKeyStoreInvalidStateException, KMSInvalidStateException

Some external key store proxies implement authorization requirements for the use of its external keys. An external key store proxy is permitted, but not required, to design and implement an authorization scheme that allows particular users to request particular operations under certain conditions. For example, a proxy might allow a user to encrypt with a particular external key, but not to decrypt with it. For more information, see External key store proxy authorization (optional).

Proxy authorization is based on metadata that AWS KMS includes in its requests to the proxy. The awsSourceVpc and awsSourceVpce fields are included in the metadata only when the request is from a VPC endpoint and only when the caller is in the same account as the KMS key.

"requestMetadata": {
    "awsPrincipalArn": string,
    "awsSourceVpc": string, // optional
    "awsSourceVpce": string, // optional
    "kmsKeyArn": string,
    "kmsOperation": string,
    "kmsRequestId": string,
    "kmsViaService": string // optional
}

When the proxy rejects a request due to an authorization failure, the related AWS KMS operation fails. CreateKey returns CustomKeyStoreInvalidStateException. AWS KMS cryptographic operations return KMSInvalidStateException. Both use the following error message:

The external key store proxy denied access to the operation. Verify that the user and the external key are both authorized for this operation, and try the request again.

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4