Audit Log Schema
Golf Gateway generates structured audit logs for all MCP traffic, authentication events, and security analysis. This reference documents the complete schema used for audit log entries.Quick Reference
| Category | Key Fields | Purpose |
|---|---|---|
| Core | timestamp, event_type, component | Event identification and timing |
| Identity | session_id, gateway_id, organization_id | Session and gateway tracking |
| User | user.sub, user.email, user.authenticated | User identity (privacy-compliant) |
| Authentication | authentication.result, authentication.provider_type | Auth method and result |
| Security | security.threat_score, security.blocked, security.was_scrubbed | Threat detection and PII scrubbing |
| MCP Protocol | mcp_method, mcp_tool_name, mcp_*_payload | MCP JSON-RPC details |
| Integrity | sequence, prev_hash, integrity_hash | Tamper-proof hash chain |
| Internal | message, correlation, metadata | Internal processing (not exported) |
Schema Overview
View Complete Schema Example
View Complete Schema Example
Core Fields
These fields are present on every audit log entry.| Field | Type | Description |
|---|---|---|
timestamp | string | ISO 8601 timestamp with timezone (e.g., 2024-01-15T10:30:45.123456+00:00) |
event_type | string | Type of audit event (see Event Types) |
component | string | System component that generated the event |
Event Types
| Value | Description |
|---|---|
mcp_request | Standard MCP JSON-RPC request |
mcp_response | Standard MCP JSON-RPC response |
mcp_sampling_request | Sampling/createMessage request |
mcp_sampling_response | Sampling/createMessage response |
mcp_elicitation_request | Server-initiated elicitation request |
mcp_elicitation_response | Elicitation response from client |
mcp_notification | MCP notification (no response expected) |
authentication | Authentication event |
security | Security analysis event |
Component Values
| Value | Description |
|---|---|
mcp_parser | MCP message parsing |
auth | Authentication and authorization |
security | Security analysis and threat detection |
Session and Identity
| Field | Type | Description |
|---|---|---|
session_id | string | null | MCP protocol session identifier |
gateway_id | string | null | Gateway UUID (multi-gateway deployments) |
gateway_name | string | null | Human-readable gateway name |
organization_id | string | null | Organization UUID (multi-tenant deployments) |
Integrity Fields
These fields provide tamper-proof audit logging through cryptographic hash chaining.| Field | Type | Description |
|---|---|---|
sequence | integer | null | Monotonically increasing sequence number |
prev_hash | string | null | HMAC-SHA256 hash of the previous log entry |
integrity_hash | string | null | HMAC-SHA256 hash of the current entry |
The integrity chain allows verification that no log entries have been modified or deleted. Configure the hash key with
GOLF_SECURITY_INTEGRITY_KEY.Client Info
Information about the MCP client, extracted from theinitialize request.
| Field | Type | Description |
|---|---|---|
client_info.name | string | MCP client name (e.g., “claude-desktop”, “cursor”) |
client_info.version | string | MCP client version |
Authentication
Authentication and authorization results.| Field | Type | Description |
|---|---|---|
authentication.method | string | Authentication method (default: oauth2) |
authentication.result | string | success, failed, or anonymous |
authentication.completed_at | integer | Unix timestamp in milliseconds |
authentication.provider_type | string | null | IDP type: auth0, okta, microsoft-entra-id, descope |
authentication.provider_name | string | null | Human-readable provider name |
authentication.authorization_result | string | granted, denied, or anonymous |
authentication.scopes | array | Granted OAuth scopes |
authentication.granted_at | integer | Unix timestamp in milliseconds |
authentication.user_id | string | null | User subject identifier |
authentication.email | string | null | User email (hashed before export) |
authentication.name | string | null | User display name (removed before export) |
authentication.session_created | boolean | Whether a new session was created |
authentication.session_type | string | authenticated or anonymous |
Security
Security analysis and threat detection results.| Field | Type | Description |
|---|---|---|
security.threat_score | float | Threat score from 0.0 (safe) to 1.0 (malicious) |
security.threats_detected | array | List of detected threat types |
security.analyzed | boolean | Whether security analysis was performed |
security.skipped_reason | string | null | Reason analysis was skipped |
security.blocked | boolean | Whether the request/response was blocked |
security.detection_method | string | null | llm, pattern, or rate_limit |
security.threat_category | string | null | prompt_injection, jailbreak, data_exfiltration, etc. |
security.content_size_bytes | integer | null | Size of analyzed content in bytes |
security.inference_ms | float | null | LLM inference duration in milliseconds |
PII Scrubbing Fields
| Field | Type | Description |
|---|---|---|
security.was_scrubbed | boolean | Whether content was scrubbed for PII |
security.entities_redacted | integer | Total PII entities redacted |
security.fields_masked | integer | Total fields masked by name |
security.entities_by_type | object | Breakdown of redacted entities by type |
security.redacted_paths | array | JSON paths where entities were redacted |
security.masked_field_names | array | Field names that were masked |
security.custom_rules_fired | array | Custom regex rules that matched |
security.scrub_duration_ms | float | null | Scrubbing duration in milliseconds |
Request
Request context information.| Field | Type | Description |
|---|---|---|
request.method | string | null | HTTP or MCP method |
request.path | string | null | Request path or resource |
request.size_bytes | integer | null | Request size in bytes |
request.headers | object | Request headers (sanitized to empty before export) |
Upstream
Information about the upstream MCP server.| Field | Type | Description |
|---|---|---|
upstream.host | string | Upstream server hostname |
upstream.port | integer | Upstream server port (1-65535) |
upstream.url | string | null | Original URL for display |
upstream.name | string | null | Upstream server name |
User
User identity information.| Field | Type | Description |
|---|---|---|
user.sub | string | null | User subject identifier |
user.email | string | null | User email (hashed to 16-char SHA256 before export) |
user.name | string | null | User display name (removed before export) |
user.authenticated | boolean | Whether user is authenticated |
user.anonymous | boolean | Whether user is anonymous |
MCP Protocol Fields
Extracted Fields
These fields are extracted from MCP messages for efficient querying and aggregation.| Field | Type | Description |
|---|---|---|
mcp_method | string | null | MCP JSON-RPC method (e.g., tools/call, resources/read) |
mcp_tool_name | string | null | Tool name from tools/call or tools/list |
mcp_resource_uri | string | null | Resource URI from resources/read or resources/list |
mcp_prompt_name | string | null | Prompt name from prompts/get or prompts/list |
Raw Payloads
| Field | Type | Description |
|---|---|---|
mcp_request_payload | string | null | Raw MCP request JSON (formatted) |
mcp_response_payload | string | null | Raw MCP response JSON (formatted) |
Token Estimates
| Field | Type | Description |
|---|---|---|
mcp_request_tokens | integer | null | Estimated token count for request |
mcp_response_tokens | integer | null | Estimated token count for response |
Error Detection
| Field | Type | Description |
|---|---|---|
has_error | boolean | null | Whether MCP response contains an error |
Elicitation Fields
Fields for server-initiated user input requests (MCP elicitation).| Field | Type | Description |
|---|---|---|
mcp_elicitation_mode | string | null | Elicitation mode: form or url |
mcp_elicitation_id | string | null | Elicitation ID for URL mode correlation |
mcp_elicitation_action | string | null | User action: accept, decline, or cancel |
Threat Analysis
Detailed threat analysis results (when available).| Field | Type | Description |
|---|---|---|
threat_analysis.threat_score | float | Threat score from 0.0 to 1.0 |
threat_analysis.detected_patterns | array | List of detected threat patterns |
threat_analysis.severity | string | critical, incident, or low |
threat_analysis.remediation | string | null | Suggested remediation action |
Session Statistics
Aggregate session statistics (for monitoring events).| Field | Type | Description |
|---|---|---|
session_stats.active_sessions | integer | Number of active sessions |
session_stats.total_created | integer | Total sessions created |
session_stats.total_authenticated | integer | Total authenticated sessions |
session_stats.total_anonymous | integer | Total anonymous sessions |
Internal Fields
These fields are present in audit log entries for internal processing but are excluded from external exports and the GraphQL API.| Field | Type | Description |
|---|---|---|
message | object | null | Raw MCP message data for internal processing |
correlation | object | null | Request/response correlation for internal tracking |
metadata | object | Additional metadata for legacy compatibility and flexible extensions |
Complete Example
MCP Request Event:Export Destinations
Audit logs are exported to configured destinations with automatic schema mapping:| Destination | Index Pattern | Documentation |
|---|---|---|
| Elasticsearch | {prefix}-YYYY.MM.DD | Export to Elasticsearch |
| OpenTelemetry | OTLP logs | Export to OpenTelemetry |
| Microsoft Sentinel | Custom DCR table | Export to Sentinel |
Each destination applies field-specific transformations. For example, Elasticsearch uses daily indices while Sentinel transforms fields to PascalCase for KQL compatibility.
Related Documentation
Environment Variables
Configure Golf Gateway using environment variables
YAML Configuration
Distributed mode configuration for GitOps deployments
Export to Elasticsearch
Set up audit log export to Elasticsearch
Export to Sentinel
Set up audit log export to Microsoft Sentinel