AWS SigV4 Credential Signing
AWS SigV4 credential signing lets sandbox agents call AWS services (Bedrock, S3, STS, and others) through the proxy’s CONNECT tunnel. The proxy intercepts outbound requests, strips the sandbox client’s placeholder Authorization header, and re-signs the request with real AWS credentials from the provider. The sandbox never sees the real credentials.
Prerequisites
- A provider with
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYcredentials configured. Optionally includeAWS_SESSION_TOKENfor STS temporary credentials. - An endpointless
awsprovider profile when the sandbox policy defines the service endpoints, or an endpoint-bearing service profile such asaws-s3. - A sandbox policy with
credential_signingenabled on the target endpoint. For the endpointlessawsprofile, the endpoint must also setcredential_binding.providerto the attached provider name.
Provider Setup
Create a provider with AWS credentials:
For STS temporary credentials, include the session token:
To have the gateway mint and rotate STS credentials for you instead of supplying
them statically, use the aws or aws-s3 profile with the aws_sts_assume_role
refresh strategy. A single sts:AssumeRole mints all three env vars
(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN) that the
signer reads. See Manage Providers.
Policy Configuration
Enable SigV4 signing on a per-endpoint basis. The binding selects which provider instance supplies credentials, while the signing fields control how the proxy applies them:
Bedrock Example
The Bedrock example uses rules for fine-grained access control. When rules are present, omit the access field — they are mutually exclusive.
S3 Example
STS Example
Signing Modes
The credential_signing field accepts three values:
In sigv4 auto-detect mode, the proxy inspects the x-amz-content-sha256 header sent by the client SDK:
- Hex hash → buffer body and sign it (same as
sigv4:body). UNSIGNED-PAYLOAD→ sign headers only (same assigv4:no_body).STREAMING-UNSIGNED-PAYLOAD-TRAILER→ sign headers only, stream body through.- Absent → sign body if
Content-Lengthis present, otherwise use unsigned payload.
Chunk-signed streaming modes like STREAMING-AWS4-HMAC-SHA256-PAYLOAD are not supported. The proxy cannot reproduce per-chunk signatures. If your client SDK sends chunk-signed requests, use sigv4:no_body instead.
Region Detection
The proxy extracts the AWS region from the endpoint hostname automatically. It supports standard, dualstack, FIPS, virtual-hosted, GovCloud, and China partition hostnames.
For endpoints where the region cannot be inferred from the hostname, set signing_region explicitly:
Restrictions
credential_signingandrequest_body_credential_rewriteare mutually exclusive on the same endpoint. The policy validator rejects policies that set both.credential_binding.providermust name a provider attached to that sandbox. Use it only when the selected provider profile has no endpoints. Endpoint-bearing profiles already define their credential boundary.- OpenShell rejects a signed sandbox policy before activation unless the endpoint has a resolvable AWS credential source. An endpoint-bearing profile must declare
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYand cover the signed host, port, and path. An endpointless profile must declare those keys and be selected withcredential_binding.provideron the signed endpoint. - The
sigv4:bodymode buffers at most 10 MiB. Requests with larger bodies are rejected. Usesigv4:no_bodyorsigv4(auto-detect) for large payloads. - The active provider must contain current
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYvalues. If either becomes unavailable after policy activation, the request fails closed.
Use from a Sandbox
Inside a sandbox, configure the AWS SDK with placeholder credentials. The proxy replaces them with real credentials during re-signing:
Then use any AWS SDK or CLI normally. The proxy transparently re-signs requests before forwarding to AWS.