The audit logging feature was introduced in v3.1.0. The audit data contains information about events in Cerberus and can be queried using SQL in AWS Athena. This feature is off by default. You can enable audit logging as part of environment creation, or enable it for existing environments. The CLI has commands for creating the S3 Buckets, IAM Roles and permissions and setting up Athena and auto-populating the properties needed to enable.
enable-audit-logs: true
to your environment YAML filecerberus -f /path/to/env-standup.yaml create-environment
cerberus --env [environment name] enable-audit-logging-for-existing-environment
In the AWS console:
SELECT principal_name,
count(principal_name) AS request_count
FROM audit_data
WHERE year = 2018 and month = 06
GROUP BY principal_name
ORDER BY request_count desc
SELECT principal_name,
count(principal_name) AS count
FROM audit_data
WHERE was_success = 'false'
GROUP BY principal_name
ORDER BY count desc
SELECT principal_name, sdb_name_slug, path, count(sdb_name_slug) AS count
FROM audit_data
WHERE path like '/v1/secret/%'
and http_method = 'POST'
and year = 2018
and month = 05
and day >= 01
GROUP BY principal_name, sdb_name_slug, path
ORDER BY count desc;
SELECT client_version,
count(client_version) AS count
FROM audit_data
WHERE path like '/v%/auth/%'
GROUP BY client_version
ORDER BY count desc;