Skip to content

Commit c9f0081

Browse files
doc: updated
1 parent 6d16ffc commit c9f0081

File tree

2 files changed

+3
-265
lines changed

2 files changed

+3
-265
lines changed

README.md

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -199,29 +199,6 @@ VAULT_ADDR=http://127.0.0.1:8100 VAULT_AGENT_MODE=true cargo run --package vault
199199
- [x] `KeyGet` - Retrieve public keys
200200
- [x] `Signer` - Low-level signing interface
201201

202-
### ✅ AWS KMS Adapter
203-
- [x] Environment-based configuration
204-
- [x] Key generation with ECC_NIST_P256 (default)
205-
- [x] ECDSA_SHA_256 signatures
206-
- [x] Key existence checking
207-
- [x] Public key retrieval
208-
- [x] Scheduled key deletion
209-
- [x] IAM integration
210-
- [x] CloudTrail audit support
211-
212-
### ✅ HashiCorp Vault Adapter
213-
- [x] Environment-based configuration
214-
- [x] Key generation with ECDSA P-256 (secp256r1)
215-
- [x] ECDSA signatures with Transit secrets engine
216-
- [x] Key existence checking
217-
- [x] Public key retrieval in DER format
218-
- [x] Key deletion with proper policies
219-
- [x] Docker containerization for local testing
220-
- [x] IOTA testnet transaction support
221-
- [x] Vault Agent sidecar mode for Kubernetes
222-
- [x] ServiceAccount-based authentication
223-
- [x] Automatic token rotation support
224-
225202
### ✅ Builder Pattern
226203
- [x] Auto-detection of available adapters
227204
- [x] Manual adapter configuration
@@ -238,11 +215,9 @@ VAULT_ADDR=http://127.0.0.1:8100 VAULT_AGENT_MODE=true cargo run --package vault
238215

239216
The architecture supports additional adapters:
240217

241-
- **File System Storage** - For development and testing
242-
- **DFNS Service** - Multi-party computation
243-
- **Azure Key Vault** - Microsoft cloud HSM
244-
- **Google Cloud KMS** - Google cloud key management
245-
- **Hardware Security Modules** - Direct HSM integration
218+
- **File System Storage** (For development and testing)
219+
- **DFNS Service**
220+
- **Turnkey Service**
246221

247222
## 🔒 Security Considerations
248223

@@ -263,26 +238,10 @@ The system provides atomic 'permissions' such as `KeyRead`, `KeySign`, etc., all
263238
### Explicit Boundaries Principle
264239
Clear interface definitions separate provider code from user code, emphasizing responsibility boundaries.
265240

266-
## 🤝 Contributing
267-
268-
1. Follow the hexagonal architecture principles
269-
2. All comments must be in English
270-
3. Implement comprehensive tests for new adapters
271-
4. Update documentation for new features
272-
5. Follow existing code style and conventions
273-
274241
## 📜 License
275242

276243
Apache-2.0
277244

278-
## 🏢 Enterprise Roadmap
279-
280-
- **Multi-tenancy support** (planned)
281-
- **Key rotation mechanisms** (planned)
282-
- **Compliance reporting** (planned)
283-
- **Performance monitoring** (planned)
284-
- **Policy engines** (planned)
285-
286245
---
287246

288247
## 📚 Additional Documentation

VAULT_INTEGRATION.md

Lines changed: 0 additions & 221 deletions
Original file line numberDiff line numberDiff line change
@@ -210,27 +210,10 @@ All secret-storage-core traits are fully implemented for HashiCorp Vault:
210210
# Start Vault with Docker Compose
211211
docker-compose -f docker-compose.vault.yml up -d
212212

213-
# Check status
214-
docker-compose -f docker-compose.vault.yml ps
215-
216-
# View logs
217-
docker-compose -f docker-compose.vault.yml logs -f vault
218-
219213
# Stop and clean up
220214
docker-compose -f docker-compose.vault.yml down
221215
```
222216

223-
## 🧪 Testing
224-
225-
### **Unit Tests**
226-
```bash
227-
# Test Vault adapter
228-
cargo test --package vault-adapter
229-
230-
# Test storage factory (includes all adapters)
231-
cargo test --package storage-factory
232-
```
233-
234217
### **Integration Tests**
235218
```bash
236219
# Start Vault development server
@@ -244,22 +227,6 @@ cargo run --package storage-factory --example iota_vault_demo
244227

245228
## 🚀 Production Deployment
246229

247-
### **Standard Vault Configuration**
248-
```hcl
249-
# Enable Transit secrets engine
250-
vault secrets enable -path=iota-transit transit
251-
252-
# Create policy for IOTA operations
253-
vault policy write iota-policy - <<EOF
254-
path "iota-transit/keys/*" {
255-
capabilities = ["create", "read", "update", "delete", "list"]
256-
}
257-
path "iota-transit/sign/*" {
258-
capabilities = ["update"]
259-
}
260-
EOF
261-
```
262-
263230
### **Environment Configuration (Standard Mode)**
264231
```bash
265232
# Production environment
@@ -272,179 +239,6 @@ export VAULT_MOUNT_PATH="iota-transit"
272239

273240
The recommended approach for Kubernetes deployments uses the Vault Agent sidecar pattern for enhanced security.
274241

275-
**Benefits:**
276-
- ✅ No long-lived secrets in pods
277-
- ✅ Automatic token rotation (e.g., TTL 1h)
278-
- ✅ ServiceAccount-based authentication
279-
- ✅ Reduced attack surface
280-
- ✅ Zero secret management in app code
281-
282-
**Step 1: Enable Kubernetes Authentication in Vault**
283-
284-
```bash
285-
# Enable Kubernetes auth method
286-
vault auth enable kubernetes
287-
288-
# Configure Kubernetes authentication
289-
vault write auth/kubernetes/config \
290-
kubernetes_host="https://kubernetes.default.svc" \
291-
kubernetes_ca_cert=@/var/run/secrets/kubernetes.io/serviceaccount/ca.crt \
292-
token_reviewer_jwt=@/var/run/secrets/kubernetes.io/serviceaccount/token
293-
294-
# Create role for IOTA app
295-
vault write auth/kubernetes/role/iota-app \
296-
bound_service_account_names=iota-app \
297-
bound_service_account_namespaces=iota \
298-
policies=iota-policy \
299-
ttl=1h
300-
```
301-
302-
**Step 2: Create Vault Agent ConfigMap**
303-
304-
```yaml
305-
apiVersion: v1
306-
kind: ConfigMap
307-
metadata:
308-
name: vault-agent-config
309-
namespace: iota
310-
data:
311-
agent.hcl: |
312-
# Auto-authentication using Kubernetes ServiceAccount
313-
auto_auth {
314-
method "kubernetes" {
315-
mount_path = "auth/kubernetes"
316-
config = {
317-
role = "iota-app"
318-
}
319-
}
320-
321-
sink "file" {
322-
config = {
323-
path = "/vault/secrets/token"
324-
}
325-
}
326-
}
327-
328-
# API proxy with automatic token injection
329-
api_proxy {
330-
use_auto_auth_token = true
331-
}
332-
333-
# Local listener for app connections
334-
listener "tcp" {
335-
address = "127.0.0.1:8100"
336-
tls_disable = true
337-
}
338-
339-
# Vault server address
340-
vault {
341-
address = "https://vault.company.com:8200"
342-
}
343-
```
344-
345-
**Step 3: Deploy Application with Sidecar**
346-
347-
```yaml
348-
apiVersion: v1
349-
kind: ServiceAccount
350-
metadata:
351-
name: iota-app
352-
namespace: iota
353-
---
354-
apiVersion: apps/v1
355-
kind: Deployment
356-
metadata:
357-
name: iota-app
358-
namespace: iota
359-
spec:
360-
replicas: 3
361-
selector:
362-
matchLabels:
363-
app: iota-app
364-
template:
365-
metadata:
366-
labels:
367-
app: iota-app
368-
spec:
369-
serviceAccountName: iota-app
370-
371-
containers:
372-
# Main application container
373-
- name: app
374-
image: iota-app:latest
375-
env:
376-
# Point to local Vault Agent proxy
377-
- name: VAULT_ADDR
378-
value: "http://127.0.0.1:8100"
379-
# Enable Vault Agent mode (no token needed)
380-
- name: VAULT_AGENT_MODE
381-
value: "true"
382-
- name: VAULT_MOUNT_PATH
383-
value: "iota-transit"
384-
ports:
385-
- containerPort: 8080
386-
resources:
387-
requests:
388-
cpu: 100m
389-
memory: 128Mi
390-
limits:
391-
cpu: 500m
392-
memory: 512Mi
393-
394-
# Vault Agent sidecar
395-
- name: vault-agent
396-
image: hashicorp/vault:1.15
397-
args:
398-
- "agent"
399-
- "-config=/vault/config/agent.hcl"
400-
env:
401-
- name: VAULT_ADDR
402-
value: "https://vault.company.com:8200"
403-
volumeMounts:
404-
- name: vault-config
405-
mountPath: /vault/config
406-
- name: vault-secrets
407-
mountPath: /vault/secrets
408-
resources:
409-
requests:
410-
cpu: 50m
411-
memory: 64Mi
412-
limits:
413-
cpu: 200m
414-
memory: 256Mi
415-
416-
volumes:
417-
- name: vault-config
418-
configMap:
419-
name: vault-agent-config
420-
- name: vault-secrets
421-
emptyDir:
422-
medium: Memory
423-
```
424-
425-
**Step 4: Deploy and Verify**
426-
427-
```bash
428-
# Apply all resources
429-
kubectl apply -f vault-agent-configmap.yaml
430-
kubectl apply -f iota-app-deployment.yaml
431-
432-
# Check pod status
433-
kubectl get pods -n iota
434-
435-
# Verify both containers are running
436-
kubectl describe pod -n iota <pod-name>
437-
438-
# Check application logs
439-
kubectl logs -n iota <pod-name> -c app
440-
441-
# Check Vault Agent logs
442-
kubectl logs -n iota <pod-name> -c vault-agent
443-
444-
# Test the application
445-
kubectl port-forward -n iota <pod-name> 8080:8080
446-
```
447-
448242
**Application Code (No Changes Required!):**
449243

450244
```rust
@@ -465,21 +259,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
465259
}
466260
```
467261

468-
## 📊 Performance Characteristics
469-
470-
- **Key Generation**: ~200-500ms (network dependent)
471-
- **Signing Operations**: ~100-300ms (network dependent)
472-
- **Concurrent Operations**: Supported (Vault handles concurrency)
473-
- **Scalability**: Enterprise-grade with Vault clustering
474-
475-
## 🔒 Security Features
476-
477-
- **Hardware Security**: Keys secured in Vault's encryption boundary
478-
- **Audit Logging**: Complete audit trail through Vault logs
479-
- **Access Control**: Fine-grained policies and authentication
480-
- **Network Security**: TLS encryption for all communications
481-
- **Key Isolation**: Strong isolation between different applications/tenants
482-
483262
## 🎉 Summary
484263

485264
The HashiCorp Vault adapter provides a complete, enterprise-ready alternative to AWS KMS for IOTA secret storage, featuring:

0 commit comments

Comments
 (0)