Infrastructure prerequisites

The Audit service requires the following components to be set up before it can be started:
  • Docker engine
  • Kafka
  • Elasticsearch

Dependencies

The Audit service is built as a Docker image and runs on top of Kafka and Elasticsearch. Therefore, these services must be set up and running before starting the Audit service.

Configuration

Configuring Kafka

To configure the Kafka server for the Audit service, set the following environment variables:
  • SPRING_KAFKA_BOOTSTRAP_SERVERS - address of the Kafka server, it should be in the format β€œhost:port”
  • SPRING_KAFKA_CONSUMER_GROUP_ID - the consumer group ID to be used for the audit logs
  • KAFKA_CONSUMER_THREADS - the number of Kafka consumer threads to be used for processing audit logs
  • KAFKA_TOPIC_AUDIT_IN - the topic key for receiving audit logs

Configuring Elasticsearch

Configure Elasticsearch connection for audit data storage:
VariableDescriptionDefault ValueExample
SPRING_ELASTICSEARCH_REST_PROTOCOLConnection protocolhttpshttps
SPRING_ELASTICSEARCH_REST_URISURL(s) of Elasticsearch nodes (no protocol)-elasticsearch:9200
SPRING_ELASTICSEARCH_REST_DISABLESSLDisable SSL verificationfalsefalse
SPRING_ELASTICSEARCH_REST_USERNAMEAuthentication username-elastic
SPRING_ELASTICSEARCH_REST_PASSWORDAuthentication password-your-secure-password
SPRING_ELASTICSEARCH_INDEXSETTINGS_DATASTREAMAudit data stream nameaudit-logsaudit-logs
SPRING_ELASTICSEARCH_INDEXSETTINGS_SHARDSNumber of primary shards22
SPRING_ELASTICSEARCH_INDEXSETTINGS_REPLICASNumber of replica shards22

Configuring logging

To control the log levels, set the following environment variables:
  • LOGGING_LEVEL_ROOT - the log level for the root spring boot microservice logs
  • LOGGING_LEVEL_APP - the log level for app-level logs
Make sure to overwrite the placeholders (where needed) with the appropriate values before starting the service.