Related Documentation:
- API Standards - Security headers and CORS policy
- System Design - Security implications of system design
- Operations - Security monitoring and logging requirements
- Authentication
- Data Protection
- Access Control
- Security Headers
- CORS Policy
- Audit Logging
- Security Monitoring
The system uses JWT tokens issued by the DDI platform for both:
- User authentication (staff members)
- Service authentication (machine-to-machine)
{
"sub": "staff_id_123", // or "service_id_123" for m2m
"iss": "https://ddi.platform",
"aud": ["reputation-system"],
"exp": 1625097600,
"permissions": ["snapshot:create", "snapshot:execute"],
"type": "user" // or "service" for m2m
}
- Access tokens expire after 1 hour
- Refresh tokens valid for 30 days
- Rotate refresh tokens on use
- Implement token revocation
- Monitor token usage for suspicious patterns
- Single authentication mechanism for all clients
- Fine-grained permission control via JWT claims
- Token-based rate limiting and monitoring
- Enhanced audit trails with client context
- Defense in depth with token validation
- Encrypt sensitive data at rest
- Use TLS 1.3 for all communications
- Implement request signing for critical operations
- Log security events with proper masking
- Merkle tree for efficient verification
- Zero-knowledge proofs for privacy
- Smart contract access control
- Immutable commitment records
snapshot:create
- Create new snapshotssnapshot:execute
- Run snapshot calculationssnapshot:commit
- Commit results onchainsnapshot:read
- View snapshot datascore:read
- View score data
- Admin: Full access
- Operator: Create and execute snapshots
- Viewer: Read-only access
- Service: Machine-to-machine access
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Access-Control-Allow-Origin: https://{HOST}
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, X-Request-ID
Access-Control-Max-Age: 86400
- Authentication attempts
- Token usage and revocation
- Snapshot operations
- Onchain commitments
- Score verifications
- Permission changes
{
"timestamp": "2025-06-01T12:00:00Z",
"level": "INFO",
"request_id": "uuid",
"user_id": "staff_123",
"action": "snapshot:create",
"resource_id": "snap_123",
"ip_address": "1.2.3.4",
"user_agent": "Mozilla/5.0...",
"status": "success"
}
- Failed authentication attempts
- Token usage patterns
- Rate limit hits
- Suspicious IP addresses
- Unusual access patterns
- Multiple failed logins
- Unusual token usage
- Rate limit breaches
- Permission changes
- Onchain commitment failures