You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cb10f83
Browse filesBrowse the repository at this point in the historyBrowse files
feat(providers): add AWS STS credential refresh and aws-s3 provider profile
Add server-side AWS STS AssumeRole credential refresh so gateways can
mint short-lived AWS credentials for sandboxes. Combined with the SigV4
proxy re-signing from #1638, sandboxes can access S3 (and other AWS
services) without ever seeing real credentials.
## STS credential refresh (server)
- New `AwsStsAssumeRole` variant in `ProviderCredentialRefreshStrategy`.
- `provider_refresh.rs` implements the refresh loop: calls
`sts:AssumeRole` using the gateway's ambient AWS credentials (or
explicit long-lived keys from material), stores the resulting
`AccessKeyId`, `SecretAccessKey`, and `SessionToken` on the provider,
and schedules re-rotation before expiry.
- `ConfigureProviderRefresh` and `RotateProviderCredential` RPCs gated
behind the `providers_v2_enabled` setting. Validates that configuring
STS refresh for one provider won't collide with credential keys already
held by another provider attached to the same sandbox.
- Proto: `AWS_STS_ASSUME_ROLE = 3` on `ProviderCredentialRefreshStrategy`.
## Provider profiles: `aws` and `aws-s3`
AWS provider profiles follow the same pattern as the existing
`aws-bedrock` profile: a generic base plus service-specific variants.
- `providers/aws.yaml`: base AWS profile with STS refresh material
(role_arn, session_name, external_id, aws_region, optional long-lived
keys) but no endpoints or binaries allowlist. Intended for AWS
services that don't yet have a dedicated profile — the user attaches
their own policy to supply endpoints. This is the same role
`google-cloud` plays relative to `google-vertex-ai`.
- `providers/aws-s3.yaml`: S3-specific profile that adds pre-configured
endpoints covering regional (`*.s3.*.amazonaws.com`), global
(`*.s3.amazonaws.com` with `signing_region: us-east-1`), and dualstack
variants. All endpoints use `credential_signing: sigv4` and
`signing_service: s3` so the proxy re-signs requests automatically.
Includes a binaries allowlist for Python, curl, and the AWS CLI.
- End-to-end walkthrough added in `examples/aws-s3-sts.md`.
- Provider docs updated in `docs/sandboxes/manage-providers.mdx`.
## Policy: single-label `*` wildcard in middle DNS labels
- `validate_host_wildcard` in `openshell-policy` now permits `*` as a
complete middle label (e.g. `*.s3.*.amazonaws.com`) in addition to the
existing leading-label and intra-label positions. A bare `*` label
matches exactly one DNS label via Rego's `glob.match` with `.`
separator, consistent with TLS wildcard semantics.
- OPA endpoint matching and L7 config lookup updated to handle
middle-label wildcards: `host_matches_wildcard_middle` rule and
`endpoint_config_for_middle_wildcard` in Rego.
- Validation rejects `**` in any position and partial wildcards in
middle labels (e.g. `s*.example.com` in a non-leading label).
## SigV4 body validation fix
- Allow bodyless requests (GET/HEAD/DELETE) through the SignBody path.
boto3 sets `x-amz-content-sha256` to the empty-body hash on all
requests, routing them through SignBody via `detect_payload_mode`.
Previously `BodyLength::None` was rejected; now it signs with the
empty-body hash, matching AWS SDK behavior.
## TUI
- Added `AwsStsAssumeRole` match arm to the refresh strategy label in
the provider settings view.
Validated end-to-end: gateway mints STS credentials, sandbox runs boto3
PutObject/ListObjects/GetObject against real S3 through the SigV4
re-signing proxy. The sandbox sees only placeholder credentials.
Signed-off-by: Russell Bryant <[email protected]>
0 commit comments