Add CI broker Lambda for hard team validation, fix QA items#74
Merged
Conversation
CI Broker (security hardening):
- New ci-broker Lambda validates repo→team via GitHub API before
issuing STS credentials. Team/deploy roles now trust ONLY the
broker and apply-gate Lambdas — no direct OIDC assumption.
- New javabin-ci-app-broker OIDC role can ONLY invoke the broker
Lambda (no AWS resource access)
- Workflows assume broker role → call Lambda → receive team-scoped
credentials. Team check is now Lambda-enforced (hard), not
workflow-enforced (soft).
QA fixes:
- FAILED risk now propagates to apply gate (enables override when
Bedrock is down, instead of hard-failing the plan step)
- S3 state path includes team: apps/{team}/{repo}/terraform.tfstate
- Password-set Lambda limited to 5 concurrent executions (rate limit)
- Apply-gate updated to assume ci-team-* roles (was ci-app-*)
Terraform Plan🚧 Changes detected — Plan: 6 to add, 4 to change, 0 to destroy. Plan outputLLM ReviewRisk: 🟢 LOW Plan creates a new CI broker Lambda function and updates IAM roles to support GitHub Actions workflows, with routine Lambda concurrency tuning.
|
Alexanderamiri
added a commit
that referenced
this pull request
May 9, 2026
## Summary
### CI Broker (security hardening)
Replaces direct OIDC → team role assumption with a Lambda-brokered
pattern:
```
Before: Workflow → OIDC → javabin-ci-team-{team} (workflow resolves team - soft)
After: Workflow → OIDC → javabin-ci-app-broker → Lambda → validates team via GitHub API → javabin-ci-team-{team} (hard)
```
- **Team/deploy roles no longer have OIDC trust.** Only the broker and
apply-gate Lambdas can assume them.
- **javabin-ci-app-broker** OIDC role can ONLY invoke the broker Lambda
(zero AWS resource access).
- **Broker Lambda** calls GitHub API to validate repo→team membership,
then returns STS credentials.
- Same pattern as apply-gate, but for plan and deploy phases.
### QA fixes
- **FAILED risk propagation**: No longer hard-fails the plan step.
Propagates to apply gate where the override flow handles it (enables
deploys when Bedrock is down).
- **Team in state path**: `apps/{team}/{repo}/terraform.tfstate`
prevents cross-team state collision.
- **Password-set rate limiting**: Lambda reserved concurrency = 5
(prevents brute force).
- **Apply-gate**: Updated to assume `ci-team-*` roles (was `ci-app-*`).
## Test plan
- [ ] `terraform plan` — verify broker Lambda, IAM roles, trust policies
- [ ] Test app repo CI: broker role → invoke Lambda → receive team
credentials
- [ ] Verify repo not in a team gets clear error from broker
- [ ] Verify Bedrock failure produces FAILED risk that can be overridden
- [ ] Verify password-set Lambda has reserved_concurrent_executions = 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI Broker (security hardening)
Replaces direct OIDC → team role assumption with a Lambda-brokered pattern:
QA fixes
apps/{team}/{repo}/terraform.tfstateprevents cross-team state collision.ci-team-*roles (wasci-app-*).Test plan
terraform plan— verify broker Lambda, IAM roles, trust policies