|
| 1 | +# Project Structure |
| 2 | + |
| 3 | +``` |
| 4 | +├── api/ # Python Lambda API |
| 5 | +│ ├── src/app/ # Application code |
| 6 | +│ │ ├── routers/ # API route handlers |
| 7 | +│ │ ├── resources/ # AWS resource clients (DynamoDB, KMS) |
| 8 | +│ │ ├── models.py # Pydantic models and vault schema |
| 9 | +│ │ ├── vault.py # Core vault operations |
| 10 | +│ │ ├── encryptors.py # HPKE encryption logic |
| 11 | +│ │ └── lambda_handler.py # Lambda entry point |
| 12 | +│ ├── dependencies/ # Lambda layer dependencies |
| 13 | +│ └── template.yml # SAM template |
| 14 | +│ |
| 15 | +├── enclave/ # Rust Nitro Enclave application |
| 16 | +│ └── src/ |
| 17 | +│ ├── main.rs # Enclave entry point (vsock listener) |
| 18 | +│ ├── hpke.rs # HPKE decryption |
| 19 | +│ ├── kms.rs # KMS integration |
| 20 | +│ ├── expressions.rs # CEL expression execution |
| 21 | +│ ├── models.rs # Request/response types |
| 22 | +│ └── protocol.rs # Vsock message protocol |
| 23 | +│ |
| 24 | +├── parent/ # Rust parent instance application |
| 25 | +│ └── src/ |
| 26 | +│ ├── main.rs # Parent entry point |
| 27 | +│ ├── application.rs # Axum app setup |
| 28 | +│ ├── routes.rs # HTTP route handlers |
| 29 | +│ ├── enclaves.rs # Enclave management |
| 30 | +│ ├── imds.rs # EC2 instance metadata |
| 31 | +│ └── protocol.rs # Vsock communication |
| 32 | +│ |
| 33 | +├── canary/ # Python canary Lambda for monitoring |
| 34 | +│ └── src/app/ |
| 35 | +│ |
| 36 | +├── docs/ # MkDocs documentation |
| 37 | +│ |
| 38 | +├── scripts/ # Development scripts |
| 39 | +│ |
| 40 | +├── Cargo.toml # Rust workspace root |
| 41 | +├── deploy.sh # Main deployment script |
| 42 | +├── uninstall.sh # Cleanup script |
| 43 | +│ |
| 44 | +# CloudFormation Templates |
| 45 | +├── vpc_template.yml # VPC infrastructure |
| 46 | +├── kms_template.yml # KMS key setup |
| 47 | +├── ci_template.yml # CI/CD pipeline |
| 48 | +├── vault_template.yml # Vault EC2 infrastructure |
| 49 | +└── deploy_template.yml # Deployment orchestration |
| 50 | +``` |
| 51 | + |
| 52 | +## Key Patterns |
| 53 | + |
| 54 | +- **Workspace**: Rust workspace with `enclave` and `parent` members |
| 55 | +- **Lambda Layers**: Python dependencies in `api/dependencies/` |
| 56 | +- **SAM**: Each Lambda component has its own `template.yml` and `samconfig.toml` |
| 57 | +- **Makefiles**: Each component has a Makefile for common operations |
| 58 | +- **License Headers**: All source files include MIT-0 license header |
0 commit comments