-
Notifications
You must be signed in to change notification settings - Fork 30
Draft: Support for AWS XKS v2 #644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for AWS XKS (External Key Store) v2, enabling the KMS server to act as an XKS proxy that integrates with AWS KMS. The implementation includes AWS SigV4 authentication middleware, health status monitoring, key metadata retrieval, and encrypt/decrypt operations.
Key changes:
- Added AWS XKS configuration options and parameter structures
- Implemented SigV4 authentication middleware for AWS requests
- Added XKS API endpoints (health status, key metadata, encrypt, decrypt)
- Updated Rust toolchain from 1.90.0 to 1.91.0
Reviewed changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| rust-toolchain.toml | Updated Rust version to 1.91.0 |
| crate/server/src/routes/aws_xks/* | New AWS XKS implementation including middleware, endpoints, and error handling |
| crate/server/src/config/* | Added AWS XKS configuration parameters |
| crate/server/src/core/operations/{encrypt,decrypt}.rs | Improved error handling to distinguish between authorization and not-found errors |
| crate/server/src/start_kms_server.rs | Integrated AWS XKS service endpoints into server |
| Cargo.toml | Added new dependencies for AWS signature verification and HTTP handling |
| request.requestMetadata.kmsRequestId, | ||
| request.requestMetadata.awsPrincipalArn | ||
| ); | ||
| debug!("encrypt request: {:?}", request.requestMetadata); |
Copilot
AI
Dec 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug message incorrectly says 'encrypt request' when this is the decrypt endpoint. Should say 'decrypt request'.
| debug!("encrypt request: {:?}", request.requestMetadata); | |
| debug!("decrypt request: {:?}", request.requestMetadata); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 37 out of 38 changed files in this pull request and generated 7 comments.
| #[allow(clippy::struct_field_names)] | ||
| pub struct AwsXksConfig { | ||
| /// This setting turns on endpoints handling the AWS XKS feature | ||
| #[clap(long, env = "KMS_AWX_XKS_ENABLE", default_value = "false")] |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of environment variable prefix from 'AWX' to 'AWS' to match AWS naming conventions.
| /// The AWS XKS region to use for signing requests (sigv4) | ||
| #[clap( | ||
| long, | ||
| env = "KMS_AWX_XKS_REGION", |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of environment variable prefix from 'AWX' to 'AWS' to match AWS naming conventions.
| /// The AWS XKS service name to use for signing requests (sigv4) | ||
| #[clap( | ||
| long, | ||
| env = "KMS_AWX_XKS_SERVICE", |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of environment variable prefix from 'AWX' to 'AWS' to match AWS naming conventions.
|
|
||
| #[clap( | ||
| long, | ||
| env = "KMS_AWX_XKS_SIGV4_ACCESS_KEY_ID", |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of environment variable prefix from 'AWX' to 'AWS' to match AWS naming conventions.
|
|
||
| #[clap( | ||
| long, | ||
| env = "KMS_AWX_XKS_SIGV4_SECRET_ACCESS_KEY", |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of environment variable prefix from 'AWX' to 'AWS' to match AWS naming conventions.
|
|
||
| #[clap( | ||
| long, | ||
| env = "KMS_AWX_XKS_KEK_USER", |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of environment variable prefix from 'AWX' to 'AWS' to match AWS naming conventions.
| - Start the server with XKS enabled: | ||
|
|
||
| ```bash | ||
| cargo run --bin cosmian_kms_server -- --enable-xks-service |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command line flag --enable-xks-service does not match the actual configuration structure which uses --aws-xks-enable. Update the documentation to use the correct flag.
| cargo run --bin cosmian_kms_server -- --enable-xks-service | |
| cargo run --bin cosmian_kms_server -- --aws-xks-enable |
Check PR review below for a description