Implement full ZTXP security flow, tests, and infrastructure fixes#5
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- PEP Lambda: build TAM from request context, sign with KMS (ECDSA_SHA_256), call Broker; extract JWT sub claim for principal identity - Broker Lambda: verify KMS signature, replay protection via timestamp TTL, forward to OPA PDP; deny on any verification failure - Notes Lambda: full DynamoDB CRUD (list/get/create/update/delete), scoped to authenticated principal from authorizer context - OPA policy: updated to rego.v1 syntax, added admin rule, device compliance check, risk score threshold (< 70 for writes) - OPA tests: 13 Rego unit tests covering all allow/deny paths - Python tests: 35 unit tests (all passing) for all three handlers - Terraform: API Gateway $default stages (both APIs), PDP ALB made internal, dedicated security groups for ALB and ECS task, IAM execution role for ECS with ECR pull permissions, CloudWatch log config for OPA container, KMS_KEY_ARN wired to broker, WAF with rate limiting + AWS managed common rule set - CI: GitHub Actions workflow (Python tests, OPA tests, Terraform validate) - Dockerfile: load full policy directory instead of single file Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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
principalIdfrom authorizer contextrego.v1syntax, added admin rule, device compliance check, risk score threshold; 13 Rego unit tests covering all allow/deny paths$defaultstages, PDP ALB made internal, dedicated security groups (only ALB can reach OPA container), ECS IAM execution role with ECR + CloudWatch, KMS_KEY_ARN wired to Broker, WAF rate limiting + AWS managed common rulesetTest plan
pytest ztxb-aws-lab/tests/ -v)opa test ztxb-aws-lab/app/pdp/policy/ -v)terraform validatepasses inztxb-aws-lab/infra/🤖 Generated with Claude Code