Audit Service
NestJSSupport
The Audit Service records and tracks all system changes for compliance. It captures user actions, data modifications, and system events with full tenant isolation.
Key Features
- Change Tracking — Records all CRUD operations across services
- JWT Claims Storage — Captures user context from JWT for each audit entry
- Encryption — Sensitive data encryption in audit logs
- Tenant Isolation — Separate audit trails per tenant
- RabbitMQ Consumer — Event-driven audit logging
- Query API — Search and filter audit records
API Endpoints
GET
/api/auditQuery audit trail with filters
GET
/api/audit/:idGet specific audit entry
GET
/api/audit/entity/:type/:idGet audit history for a specific entity
Configuration
| Name | Type | Default | Description |
|---|---|---|---|
| DB_HOST | string | localhost | MSSQL server host |
| RABBITMQ_URIS | string | - | RabbitMQ connection URIs |
| ENCRYPTION_KEY | string | - | Key for sensitive data encryption |
RabbitMQ Integration
Consumes from:
AuditTrailqueue — Audit events from all services