feat(actions): vend AWS STS web identity sessions#137
Conversation
|
@- |
|
Outer-loop security correction: the action no longer returns plaintext STS fields in a generic response. It now requires a platform-provided age recipient, encrypts the complete credential envelope inside baton-aws, and returns only base64 age ciphertext, its recipient-derived key ID, expiration, and assumed-role ARN. Full |
5bc9f80 to
566ef10
Compare
Connector PR Review: feat(actions): vend AWS STS web identity sessionsBlocking Issues: 0 | Suggestions: 1 | Threads Resolved: 0 Review Summary Security Issues Correctness Issues Suggestions
|
b549f6e to
7dfdc3b
Compare
|
Rebased onto current |
|
Followed up on the fresh automated-review suggestion in |
Add a global action that exchanges a C1-issued OIDC token for a bounded AssumeRoleWithWebIdentity session, with optional restrictive session policy and secret-marked outputs. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Translate AWS identity, authorization, and throttling failures to actionable gRPC statuses and document the OIDC trust and encrypted action contract. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Move profiles, status, and creation timestamps off deprecated trait fields and resolve action schema lint findings. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Use the standard RFC3339 layout and upgrade age to v1.3.1, including the vendored HPKE dependency. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Reject noncanonical encryption recipients, invalid AWS session names and policies, and incomplete credential responses. Drop unrelated resource-status churn carried through the rebase. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Map AWS policy and parameter validation failures to InvalidArgument so callers do not retry deterministic request failures. Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
deacb92 to
08ff89d
Compare
| DurationSeconds: awsSdk.Int32(int32(duration)), | ||
| } | ||
| if policy, exists := actions.GetStringArg(args, "policy_json"); exists && strings.TrimSpace(policy) != "" { | ||
| if len(policy) > maxSTSSessionPolicyLength || !json.Valid([]byte(policy)) { |
There was a problem hiding this comment.
🟡 Suggestion: json.Valid accepts any valid JSON token (bare string, number, boolean), not just a policy object. AWS will still reject non-object policies as MalformedPolicyDocument (mapped to InvalidArgument), so this is not a correctness bug — but unmarshaling into a map[string]any (or checking the first non-space byte opens an object) would reject invalid shapes locally with a clearer error before the STS call.
Summary
Adds an AWS-specific global action for credential vending without modeling ephemeral STS sessions as durable resources.
AssumeRoleWithWebIdentityagainst a customer-configured trust relationshipThe C1 platform remains responsible for OIDC token issuance, entitlement and approval resolution, audience/subject claims, idempotent request tracking, supplying the encryption recipient, storing/decrypting the encrypted result, and audit. AWS remains responsible for validating the role trust policy and limiting session duration.
Customer prerequisite
The customer creates an IAM OIDC provider for the C1 issuer and a target role whose trust policy restricts issuer, audience, and subject. C1 then invokes this action with the target role ARN, a per-request OIDC token, and a platform-controlled age recipient.
Security boundary
The connector never returns plaintext AWS credentials. The optional session policy can only narrow the target role's permissions; it can be used for contextual restrictions such as an
aws:SourceIpdeny boundary. The target role trust policy remains the authoritative AWS-side admission boundary.Validation
go test ./...go build ./cmd/baton-awsgolangci-lint run