Overview
The Events service provides:- Event Collection: Client-side event submission endpoint
- Event Storage: Persisting events to database and Azure Table Storage
- Event Types: User actions, cipher operations, organization activities
- Compliance Support: Audit trails for regulatory requirements
- Security Monitoring: Track suspicious activities and access patterns
Architecture
Configuration
Fromsrc/Events/Startup.cs:26:
Service Configuration
Event Collection
Collect Endpoint
Fromsrc/Events/Controllers/CollectController.cs:16:
Collect Controller
POST /collect
Authentication: Required (Bearer token)
Request Body:
Event Types
User Events
Login/Logout
User authentication events
Vault Export
Vault data export operations
Settings Changes
User profile and settings modifications
2FA Events
Two-factor authentication changes
Cipher Events
Fromsrc/Events/Controllers/CollectController.cs:80:
Cipher Event Types
- Viewing credentials
- Auto-filling forms
- Copying sensitive data
- Revealing hidden fields
Organization Events
Organization Event Types
Administrative Events
- User invitations
- Policy changes
- Collection modifications
- Group management
- Permission changes
Event Validation
The service validates event submissions:1
Authentication
Verify user is authenticated via Bearer token
2
Authorization
Check user has access to referenced resources (ciphers, organizations)
3
Batching
Group cipher events for efficient processing (50 per batch)
4
Storage
Persist events to database and Azure Table Storage
Application Cache
Fromsrc/Events/Startup.cs:56:
The Events service uses application cache for organization abilities:
Cache Configuration
- Azure Service Bus: Multi-instance deployments
- In-Memory: Single instance deployments
src/Events/Startup.cs:80:
Cache Hosted Service
Event Integrations
The service supports event-driven integrations via RabbitMQ: Fromsrc/Events/Startup.cs:86:
Event Integrations
- Slack: Organization event notifications
- Microsoft Teams: Webhook notifications
- Custom Webhooks: User-defined integrations
Middleware Pipeline
Fromsrc/Events/Startup.cs:90:
Request Pipeline
Event Storage
Events are stored in two locations:SQL Database
Primary event storage with relational queries:Event Table
Azure Table Storage
Scalable event storage for high-volume events:Table Storage
- High throughput
- Cost-effective storage
- Efficient time-range queries
Client Integration
JavaScript Example
Mobile Example (C#)
Deployment
Environment Variables
Docker
Performance Considerations
Batch Processing
Cipher events processed in batches of 50 for efficiency
Async Operations
Non-blocking event persistence
Table Storage
Azure Table for high-volume event storage
Cache Sync
Service Bus for distributed cache invalidation
Security Considerations
- Authentication: All requests require valid Bearer tokens
- Authorization: Users can only log events for resources they access
- Validation: Cipher and organization access validated before logging
- IP Tracking: Client IP addresses captured for security analysis
- Audit Trail: Events are immutable once stored
Compliance Support
The Events service supports compliance requirements:- GDPR: User activity tracking and data access logs
- SOC 2: Audit trails for security controls
- HIPAA: Access logging for protected health information
- ISO 27001: Information security event management
Querying Events
Organization administrators can query events via the API service:start: Start date (ISO 8601)end: End date (ISO 8601)actingUserId: Filter by useritemId: Filter by resource (cipher, collection, etc.)
Related Services
- API Service - Triggers server-side events
- Events Processor - Background event processing
- Notifications Service - Real-time event notifications