Audit Logs

View and analyze the cryptographic operations audit trail in 4Quays

Every cryptographic operation in 4Quays is logged. The audit trail provides compliance evidence and operational visibility without storing sensitive payload content.

What's Logged

Each operation record includes:

FieldDescription
Request IDUnique identifier for the operation
TimestampWhen the operation occurred
ApplicationSource service that made the request
PolicyPolicy number used
DestinationTarget service
Operationprotect, unprotect, sign, verify
AlgorithmCryptographic algorithm used
Key IDKey used for the operation
Payload SizeSize of input payload (bytes)
Response StatusSuccess or error code
Response TimeProcessing duration (ms)
Error MessageDetails if operation failed

What's NOT Logged

The audit trail never stores:

  • Plaintext payload content
  • Encrypted payload content
  • Key material
  • Request body details

Viewing Audit Logs

Via Dashboard

  1. Navigate to Audit Log in the sidebar
  2. Use filters to narrow results:
    • Date range
    • Application
    • Policy
    • Operation type
    • Status (success/error)
  3. Click any row for full details

Via API

const response = await fetch('https://api.4quays.com/admin/audit', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${adminApiKey}`,
  },
  params: {
    from: '2026-02-01T00:00:00Z',
    to: '2026-02-09T23:59:59Z',
    policyNumber: 'RBC-TRANSFER-001',
    status: 'success',
    limit: 100,
  },
});

const logs = await response.json();

Filtering Options

By Time

{
  from: '2026-02-01T00:00:00Z',
  to: '2026-02-09T23:59:59Z',
}

By Application

{
  applicationId: 'banking-service-id',
}

By Policy

{
  policyNumber: 'RBC-TRANSFER-001',
}

By Operation Type

{
  operation: 'protect',  // or 'unprotect'
}

By Status

{
  status: 'success',  // or 'error'
}

By Error Code

{
  errorCode: 'KEY_EXPIRED',
}

Audit Log Details

Click on any log entry to see full details:

{
  "requestId": "req_abc123",
  "timestamp": "2026-02-09T10:30:00.000Z",
  "application": {
    "id": "app_xyz",
    "name": "Banking Service"
  },
  "policy": {
    "number": "RBC-TRANSFER-001",
    "version": 2
  },
  "destination": {
    "id": "svc_rbc",
    "name": "RBC Transfer API"
  },
  "operation": "protect",
  "algorithm": {
    "encryption": "AES-256-GCM",
    "keyWrapping": "RSA-2048"
  },
  "key": {
    "id": "key_456",
    "fingerprint": "SHA256:abc..."
  },
  "payloadSizeBytes": 1024,
  "responseStatus": 200,
  "responseTimeMs": 45,
  "errorMessage": null,
  "errorCode": null
}

Analytics and Reporting

Operations Dashboard

The audit dashboard shows:

  • Operations per minute/hour/day
  • Success rate
  • Average latency
  • Error breakdown by type
  • Algorithm distribution

Compliance Reports

Generate compliance reports:

const response = await fetch('https://api.4quays.com/admin/audit/report', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${adminApiKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    reportType: 'compliance',
    from: '2026-01-01T00:00:00Z',
    to: '2026-02-09T23:59:59Z',
    format: 'pdf',
  }),
});

Reports include:

  • Total operations by algorithm
  • Key usage summary
  • Error analysis
  • Policy usage statistics

Algorithm Adoption Tracking

Monitor algorithm transitions:

const response = await fetch('https://api.4quays.com/admin/audit/algorithms', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${adminApiKey}`,
  },
  params: {
    from: '2026-01-01T00:00:00Z',
    to: '2026-02-09T23:59:59Z',
  },
});

const { algorithms } = await response.json();
// { "AES-256-GCM+RSA-2048": 45000, "AES-256-GCM+ML-KEM-768": 5000 }

Exporting Audit Data

CSV Export

const response = await fetch('https://api.4quays.com/admin/audit/export', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${adminApiKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    from: '2026-02-01T00:00:00Z',
    to: '2026-02-09T23:59:59Z',
    format: 'csv',
  }),
});

const csvData = await response.text();

JSON Export

{
  format: 'json',
}

Log Retention

Default retention periods:

Data TypeRetention
Operation logs90 days
Error logs1 year
Compliance reports7 years

Configure custom retention in organization settings.

Integration with External Systems

Webhook Notifications

Send audit events to external systems:

await fetch('https://api.4quays.com/admin/webhooks', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${adminApiKey}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    url: 'https://your-siem.example.com/events',
    events: ['operation.error', 'key.rotated'],
    secret: 'webhook-signing-secret',
  }),
});

SIEM Integration

Export to common SIEM formats:

  • Splunk (HEC format)
  • Elasticsearch
  • CloudWatch Logs
  • Azure Monitor

Debugging with Audit Logs

When debugging integration issues:

  1. Get the request ID from your application logs
  2. Search audit logs by request ID
  3. Check error details for specific failure reasons
  4. Verify algorithm and key used
  5. Check response time for latency issues
// Search by request ID
const response = await fetch(
  `https://api.4quays.com/admin/audit/${requestId}`,
  {
    headers: {
      'Authorization': `Bearer ${adminApiKey}`,
    },
  }
);

Best Practices

Regular Review

  • Review error logs daily
  • Analyze algorithm distribution weekly
  • Generate compliance reports monthly

Alerting

Set up alerts for:

  • Error rate exceeds threshold
  • Specific error codes (KEY_EXPIRED, POLICY_NOT_FOUND)
  • Unusual operation volume
  • New algorithms in use

Retention Planning

  • Understand compliance requirements
  • Configure appropriate retention periods
  • Plan for data growth

What's Next