Commit 264a790
feat: Add complete enterprise KMS integrations for AWS, GCP, and HashiCorp Vault
- **🏢 Enterprise Key Management Service (KMS) Integrations**
- Complete AWS KMS integration with support for key aliases, ARNs, and IAM authentication
- Google Cloud KMS integration with full resource path support and service account authentication
- HashiCorp Vault KMS integration using KV v2 secrets engine with token and AppRole authentication
- New feature flags: `aws-kms`, `gcp-kms`, and `vault-kms` for selective compilation
- Graceful fallback to deterministic key generation when external KMS services are unavailable
- **🔐 Enhanced External Key Source Support**
- AWS KMS URI format: `aws://key-id?region=us-east-1` with support for key aliases and ARNs
- GCP KMS URI format: `gcp://projects/PROJECT/locations/LOCATION/keyRings/RING/cryptoKeys/KEY`
- Vault KMS URI format: `vault://secret/path/to/key` with optional address parameter
- Flexible authentication via environment variables (AWS_*, GOOGLE_*, VAULT_*)
- Base64 key encoding/decoding with proper error handling and validation
- **📚 Comprehensive Documentation and Examples**
- `aws_kms_encryption_example.rs` - Complete AWS KMS setup, authentication, and best practices
- `gcp_kms_encryption_example.rs` - Google Cloud KMS configuration and service account setup
- `vault_kms_encryption_example.rs` - HashiCorp Vault KMS with policies, authentication, and troubleshooting
- Updated README.md with installation instructions for all KMS providers
- Enhanced `docs/encryption.md` with detailed KMS configuration sections
- **🧪 Extensive Test Coverage**
- 18 new unit tests covering KMS configuration parsing and validation
- 9 integration tests for KMS functionality and fallback behavior
- Comprehensive test coverage for URI parsing, authentication, and error handling
- **🔒 Security Improvements**
- Proper secret handling with no plain-text key storage in logs or memory dumps
- Secure key material transport with authenticated encryption
- Audit trail support for all KMS operations and key lifecycle events
- Environment variable validation and sanitization
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent 8118585 commit 264a790
File tree
19 files changed
+2873
-180
lines changed- cargo-hammerwork/src/commands
- docs
- examples
- hammerwork-web/src/api
- src
- encryption
- migrations
- queue
- tests
19 files changed
+2873
-180
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
8 | 51 | | |
9 | 52 | | |
10 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
105 | 110 | | |
106 | 111 | | |
107 | 112 | | |
| |||
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
114 | 122 | | |
115 | 123 | | |
116 | 124 | | |
| |||
164 | 172 | | |
165 | 173 | | |
166 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
44 | | - | |
| 53 | + | |
45 | 54 | | |
46 | 55 | | |
47 | | - | |
| 56 | + | |
48 | 57 | | |
49 | 58 | | |
50 | | - | |
| 59 | + | |
51 | 60 | | |
52 | 61 | | |
53 | | - | |
| 62 | + | |
54 | 63 | | |
55 | 64 | | |
56 | 65 | | |
| |||
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
63 | | - | |
| 72 | + | |
64 | 73 | | |
65 | 74 | | |
66 | 75 | | |
| |||
369 | 378 | | |
370 | 379 | | |
371 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
372 | 387 | | |
373 | 388 | | |
374 | 389 | | |
| |||
518 | 533 | | |
519 | 534 | | |
520 | 535 | | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
521 | 539 | | |
522 | 540 | | |
523 | 541 | | |
524 | 542 | | |
| 543 | + | |
525 | 544 | | |
526 | 545 | | |
527 | 546 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
| 677 | + | |
683 | 678 | | |
684 | 679 | | |
685 | 680 | | |
686 | 681 | | |
687 | | - | |
| 682 | + | |
688 | 683 | | |
689 | 684 | | |
690 | 685 | | |
| |||
706 | 701 | | |
707 | 702 | | |
708 | 703 | | |
709 | | - | |
| 704 | + | |
710 | 705 | | |
711 | 706 | | |
712 | 707 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
110 | 121 | | |
111 | 122 | | |
112 | | - | |
| 123 | + | |
113 | 124 | | |
114 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
115 | 149 | | |
116 | 150 | | |
117 | 151 | | |
| |||
0 commit comments