This package provides a sample curl
based utility to test external key store proxy implementations for compliance against the AWS KMS External Keystore (XKS) Proxy API Specification.
1.1.0
awk
base64
bash 4.2+
cat
curl 7.75+
(i.e. with sigv4
support)dd
echo
env
head
jq 1.5+
mktemp
printf
read
rm
sed
sh
sha256sum
tr
uuidgen
xxd
# Change this to your XKS Proxy endpoint to test. export XKS_PROXY_HOST="localhost" # Change this to the URI_PREFIX of a logical keystore supported by your XKS Proxy. export URI_PREFIX="example/uri/path/prefix" # Change this to the Access key ID for request authentication to your logical keystore. # Valid characters are a-z, A-Z, 0-9, /, - (hyphen), and _ (underscore) export SIGV4_ACCESS_KEY_ID="BETWEEN2TENAND3TENCHARACTERS" # Change this to the Secret access key for request authentication to your logical keystore. # Secret access key must have between 43 and 64 characters. Valid characters are a-z, A-Z, 0-9, /, +, and = export SIGV4_SECRET_ACCESS_KEY="PleaseReplaceThisWithSomeSecretOfLength43To64" # Change this to a test key id supported by your logical keystore. export KEY_ID="foo" # Run the tests ./test-xks-proxy # Run all the tests including the use of encrypt-only key, decrypt-only key and # key that can neither encrypt nor decrypt. You can specify the respective key id's with # the environment variables ENCRYPT_ONLY_KEY_ID, DECRYPT_ONLY_KEY_ID and IMPOTENT_KEY_ID. ./test-xks-proxy -a
If you have Docker installed, you can build this client into a Docker image and run the tests via the Docker container. This has the benefit of automatically getting all the necessary versions of dependencies such as curl
, jq
, etc.
# Build docker image named test-xks-proxy make docker # Then run everything in the same way as you would with "test-xks-proxy", # but replacing "test-xks-proxy" with "test-xks-proxy-via-docker". # For example, to get help, ./test-xks-proxy-via-docker -hExamples of running in other modes
# Do not include the curl HTTP response headers in the output VERBOSE= ./test-xks-proxy # To make curl verbose VERBOSE=-v ./test-xks-proxy # To make curl verbose and include the HTTP response headers in the output VERBOSE=-iv ./test-xks-proxy # To enable debugging output to stderr, including the actual curl command being run DEBUG=1 ./test-xks-proxy # To enable all of the above VERBOSE=-iv DEBUG=1 ./test-xks-proxy # To test against the endpoint http:://xks-proxy.mydomain.com # XKS_PROXY_HOST=xks-proxy.mydomain.com \ # SCHEME= \ # ./test-xks-proxy # To enable mTLS, a client side SSL key and certificate would need to be specified. # The command to run the tests would be something like: # XKS_PROXY_HOST=xks-proxy_with_mtls_enabled.mydomain.com \ # MTLS="--key client_key.pem --cert client_cert.pem" \ # ./test-xks-proxy
The following environment variables can be used to override the default settings.
SIGV4_ACCESS_KEY_ID
- Access key ID for request authentication to your logical keystore. Valid characters are a-z, A-Z, 0-9, /, - (hyphen), and _ (underscore)
"BETWEEN2TENAND3TENCHARACTERS"
SIGV4_SECRET_ACCESS_KEY
- (Required) Secret access key for request authentication to your logical keystore. Secret access key must have between 43 and 64 characters. Valid characters are a-z, A-Z, 0-9, /, +, and =
"PleaseReplaceThisWithSomeSecretOfLength43To64"
XKS_PROXY_HOST
- the xks-proxy endpoint
"localhost"
URI_PREFIX
- the xks-proxy URI prefix
"example/uri/path/prefix"
REGION
- the region used for SigV4 authentication
"us-east-1"
VERBOSE
- verbosity
"-i"
"-i"
to include the curl HTTP response headers in the output"-v"
to make curl verbose"-iv"
to do bothKEY_ID
- the HSM key id
"foo"
ENCRYPT_ONLY_KEY_ID
- the HSM key id for an encrypt-only key
"encrypt_only_key"
DECRYPT_ONLY_KEY_ID
- the HSM key id for an decrypt-only key
"decrypt_only_key"
IMPOTENT_KEY_ID
- the HSM key id for a key that can neither encrypt nor decrypt
"impotent_key"
SCHEME
- used to select whether TLS is used over http
"https://"
SECURE
- (TLS) By default, every SSL connection curl
makes is verified to be secure. This option allows curl
to proceed and operate even for server connections otherwise considered insecure.
"--insecure"
to disable SSL connection verification if https is in useMTLS
- used to specify both a client-side SSL private key and SSL certifcate for performing mutual TLS with the xks-proxy.
DEBUG
- used to toggle debugging output to stderr
0
to disable debugging output1
to enable debugging output, printing the actual curl
command being runANSI_ESCAPE
- used to toggle the use of ANSI Escape codes in the output
1
to enable the use of ANSI Escape codes in the output0
to disable the use of ANSI Escape codes in the outputThe sha256sum
command can be installed on OSX
via
and is typically pre-installed in a Linux distribution.
See CONTRIBUTING for more information.
This project is licensed under the Apache-2.0 License.
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