Configure Audits

Configure audits in Grey Matter Fabric.

The auditing capability of the Grey Matter Sidecar enables observability for all events within Grey Matter Fabric. This tutorial will guide you through a few easy steps to add an audit trail for your Fabric service.

Prerequisites

To complete this tutorial, you’ll need an understanding of, and local access to the following environments and tools:

Step 1: Add Kafka to the Sidecar

Since the Sidecar will emit events into Kafka to be collected as the user wants, you will need to set up Kafka in Fabric. To emit a full GEM payload into Kafka, add the following environment variables to the hello-service-proxy section of the docker-compose.yml file.

  - EMIT_EVENTS=true
      - EMIT_FULL_RESPONSE=true
      - USE_KAFKA=true
      - ENFORCE_AUDIT=true
      - KAFKA_TOPIC="hello-service-tests"
      - KAFKA_ENABLED=true
      - OBS_ENFORCE=true
      - OBS_ENABLED=true
      - OBS_FULL_RESPONSE=true
      - KAFKA_ZK_DISCOVER=true
      - INHEADERS_ENABLED=true

Once you have made these changes, proceed to step 2.

Step 2: Add Kafka to Fabric

You'll need to add Kafka to Fabric so Kafka can start tracking audits and push them to Fabric. To add Kafka to Fabric, add the following code to the docker-compose-yml file:

Once you have added Kafka to Fabric, proceed to Step 3.

Step 3: Test Audit Event Results

Now verify that the audit trails work. Anytime someone visits a route that goes to the hello-service, the hello-service-proxy will emit an audit event in Kafka that says that something happened.

The event looks something like this:

View Observables in Kafka

To view exactly what is put into Kafka, enter the following command into the Kafka CLI located here: https://kafka.apache.org/quickstart#quickstart_consumearrow-up-right

Sample Output from Kafka

The output should look like this:

What's Next?

Have your audits configured? Take the next step and learn how to visualize your audit data.

Visualize Auditschevron-right

Questions?

circle-check

Last updated

Was this helpful?