OpenGate/ Docs

Audit Events

OpenGate IAM emits structured audit events via Apache Kafka for every authentication and administrative action. Use them for security monitoring, compliance, and SIEM integration.

On this page


Event Schema

All events use the DomainEvent envelope:

{
"eventId": "550e8400-e29b-41d4-a716-446655440000",
"eventType": "auth.login.success",
"aggregateId": "usr_abc123",
"realm": "master",
"payload": {
  "clientId": "opengate-console",
  "ipAddress": "203.0.113.42",
  "userAgent": "Mozilla/5.0 ...",
  "mfaUsed": true
},
"occurredAt": "2025-06-01T10:30:00Z"
}

Event Types

TopicEvent TypeTrigger
opengate.authauth.login.successSuccessful password + MFA authentication
opengate.authauth.login.failureFailed login attempt
opengate.authauth.logoutUser logout or token revocation
opengate.authauth.token.refreshRefresh token exchanged
opengate.usersuser.createdNew user registered
opengate.usersuser.updatedUser profile updated
opengate.usersuser.deletedUser account deleted
opengate.usersuser.email_verifiedEmail verification completed
opengate.usersuser.password_changedPassword updated
opengate.sessionssession.createdNew session opened
opengate.sessionssession.terminatedSession revoked (logout / admin)
opengate.mfamfa.enrolledUser enrolled TOTP or Email OTP
opengate.mfamfa.disabledMFA removed from account

Consuming Events

AuditConsumer.javajava
@Service
public class AuditConsumer {

@KafkaListener(topics = {"opengate.auth", "opengate.users", "opengate.sessions"},
               groupId = "audit-service")
public void handleAuditEvent(DomainEvent event) {
  log.info("AUDIT event={} aggregate={} realm={} at={}",
    event.eventType(), event.aggregateId(),
    event.realm(), event.occurredAt()
  );
  // Forward to SIEM, write to audit DB, etc.
}
}

Forwarding to SIEM

Kafka → Elasticsearch (via Logstash)

logstash-audit.confconf
input {
kafka {
  bootstrap_servers => "localhost:9092"
  topics => ["opengate.auth", "opengate.users", "opengate.sessions"]
  codec => json
}
}

filter {
date {
  match => ["occurredAt", "ISO8601"]
  target => "@timestamp"
}
}

output {
elasticsearch {
  hosts => ["elasticsearch:9200"]
  index => "opengate-audit-%{+YYYY.MM.dd}"
}
}

Kafka → Splunk

Use the Splunk Kafka Connector with topics opengate.auth, opengate.users, opengate.sessions.


Retention & Compliance

RequirementRecommendation
GDPRRetain audit logs for 1 year; anonymize PII after retention period
SOC 2Retain for 1 year with tamper-evident storage
PCI DSSRetain for 1 year (3 months readily available)
Kafka retentionSet retention.ms=31536000000 (1 year) on audit topics

PII in audit logs

Audit events may contain email addresses and IP addresses. Ensure your log retention and access policies comply with applicable data protection regulations.