Skip to main content

Audit Logging

TrustGate maintains comprehensive audit logs of all actions taken on applicants, cases, and system configurations. These logs are essential for regulatory compliance, security monitoring, and incident investigation.

What's Logged

User Actions

Every action by users and API clients:

Event TypeExamples
Applicant ActionsView, create, update, delete applicants
Document ActionsUpload, view, download documents
Verification ActionsInitiate, review verifications
Case ActionsCreate, assign, resolve cases
Screening ActionsRun screens, resolve hits
Settings ChangesUpdate configurations

System Events

Automated system actions:

Event TypeExamples
Workflow TriggersAuto-approve, escalation rules
Scheduled JobsPeriodic reviews, data retention
IntegrationsWebhook deliveries, third-party calls
Security EventsLogin attempts, permission changes

Viewing Audit Logs

Get Applicant Audit Trail

curl -X GET "https://api.bytrustgate.com/v1/applicants/{applicant_id}/audit-log" \
-H "Authorization: Bearer YOUR_API_KEY"

Response

{
"applicant_id": "550e8400-e29b-41d4-a716-446655440000",
"audit_entries": [
{
"id": "audit_001",
"timestamp": "2025-01-20T14:30:00Z",
"action": "applicant.viewed",
"actor": {
"type": "user",
"id": "user_123",
"email": "analyst@company.com",
"ip_address": "192.168.1.1"
},
"details": {
"fields_viewed": ["personal_info", "documents"]
}
},
{
"id": "audit_002",
"timestamp": "2025-01-20T14:35:00Z",
"action": "applicant.status_changed",
"actor": {
"type": "user",
"id": "user_123",
"email": "analyst@company.com",
"ip_address": "192.168.1.1"
},
"details": {
"previous_status": "pending_review",
"new_status": "approved",
"reason": "All checks passed"
}
},
{
"id": "audit_003",
"timestamp": "2025-01-20T14:40:00Z",
"action": "document.downloaded",
"actor": {
"type": "user",
"id": "user_456",
"email": "manager@company.com",
"ip_address": "192.168.1.2"
},
"details": {
"document_id": "doc_789",
"document_type": "passport"
}
}
],
"pagination": {
"total": 45,
"page": 1,
"per_page": 50
}
}

Query Audit Logs

curl -X GET "https://api.bytrustgate.com/v1/audit-logs?action=applicant.status_changed&from=2025-01-01&to=2025-01-31&actor_id=user_123" \
-H "Authorization: Bearer YOUR_API_KEY"

Query Parameters

ParameterDescription
actionFilter by action type
actor_idFilter by user or API key
actor_typeFilter by actor type (user, api_key, system)
resource_typeFilter by resource (applicant, case, document)
resource_idFilter by specific resource ID
fromStart date (ISO 8601)
toEnd date (ISO 8601)

Action Types

Applicant Actions

ActionDescription
applicant.createdNew applicant created
applicant.viewedApplicant record accessed
applicant.updatedApplicant data modified
applicant.deletedApplicant record deleted
applicant.status_changedStatus updated
applicant.exportedData exported

Document Actions

ActionDescription
document.uploadedDocument uploaded
document.viewedDocument image accessed
document.downloadedDocument downloaded
document.deletedDocument removed
document.verifiedVerification completed

Verification Actions

ActionDescription
verification.initiatedCheck started
verification.completedCheck finished
verification.manual_reviewManual override applied

Case Actions

ActionDescription
case.createdCase opened
case.assignedCase assigned to user
case.status_changedCase status updated
case.note_addedNote added to case
case.resolvedCase resolved
case.closedCase closed

Security Actions

ActionDescription
auth.loginUser login
auth.logoutUser logout
auth.login_failedFailed login attempt
auth.password_changedPassword updated
auth.mfa_enabledMFA turned on
api_key.createdNew API key created
api_key.revokedAPI key revoked
permission.grantedPermission added
permission.revokedPermission removed

Log Details

Actor Information

Each log entry includes:

{
"actor": {
"type": "user",
"id": "user_123",
"email": "analyst@company.com",
"name": "John Analyst",
"role": "compliance_analyst",
"ip_address": "192.168.1.1",
"user_agent": "Mozilla/5.0...",
"session_id": "sess_abc123"
}
}

API Key Actions

{
"actor": {
"type": "api_key",
"id": "key_xyz789",
"name": "Production API Key",
"ip_address": "10.0.0.1",
"environment": "production"
}
}

System Actions

{
"actor": {
"type": "system",
"process": "workflow_engine",
"trigger": "rule_auto_approve_low_risk"
}
}

Log Export

Export Audit Logs

curl -X POST https://api.bytrustgate.com/v1/audit-logs/export \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"format": "csv",
"from": "2025-01-01",
"to": "2025-01-31",
"filters": {
"action": "applicant.*"
},
"delivery": {
"method": "email",
"email": "compliance@company.com"
}
}'

Export Formats

FormatUse Case
csvSpreadsheet analysis
jsonSystem integration
pdfRegulatory submission

Real-Time Log Streaming

Configure Log Streaming

Stream logs to your SIEM or monitoring system:

curl -X POST https://api.bytrustgate.com/v1/audit-logs/stream \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"destination": "webhook",
"url": "https://your-siem.com/ingest",
"events": ["auth.*", "applicant.deleted", "settings.*"],
"format": "json",
"batch_size": 100,
"flush_interval_seconds": 60
}'

Supported Destinations

DestinationDescription
webhookHTTPS endpoint
s3S3-compatible storage
cloudwatchCloud logging service
datadogDatadog logs
splunkSplunk HEC

Log Retention

Default Retention

Log TypeRetention
Security events7 years
Applicant actions5 years
System events2 years
Debug logs90 days

Configure Retention

curl -X PUT https://api.bytrustgate.com/v1/settings/audit-log-retention \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"security_events_years": 7,
"applicant_actions_years": 5,
"system_events_years": 2
}'

Log Integrity

Tamper Protection

  • Logs are append-only
  • Cryptographic hash chains ensure integrity
  • Logs cannot be modified or deleted
  • Regular integrity verification

Verify Log Integrity

curl -X GET "https://api.bytrustgate.com/v1/audit-logs/verify?from=2025-01-01&to=2025-01-31" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"verification": {
"status": "verified",
"period": {
"from": "2025-01-01",
"to": "2025-01-31"
},
"entries_verified": 125000,
"hash_chain_valid": true,
"last_verified": "2025-01-20T00:00:00Z"
}
}

Next Steps