Audit Logging
Retrieving auditing information for core PCD services
Overview
Audit logs in Private Cloud Director provide users with the ability to view the actions that have taken place on their environment. Currently audit logging is enabled for the following services:
Identity
Compute
Networking
Volumes
Audit Log Retrieval for Admin Users
Admin users can now retrieve audit logs directly from the UI. To access the logs, navigate to Settings (gear icon) and select Audit Logs within the Private Cloud Director UI.
Mandatory Filters
When accessing audit logs, the following filters must be specified:
Region
Domain
Tenant
Service
By default, the logs from the past 24 hours are retrieved with additional filters, such as a custom time range, available by enabling the Use Optional Filters toggle.
Downloading Audit Logs
Clicking the Download Logs button will download the logs as a .ndjson file, containing one JSON object per line. An example format is shown below:
Fields that cannot be populated will display as unknown, and UUID fields will be represented as 00000000-0000-0000-0000-000000000000.
Audit Capabilities and Known Issues
Currently, auditing is enabled for compute, networking, and identity services, with more detailed capabilities planned for future releases. Note the following known issue:
Resource IDs are not populated during the creation of a resource. Subsequent actions will display the resource ID correctly.
Deployment Options for Audit Logs
Several parameters can be set through deployment options to configure audit logging:
audit_pvc_size: Size of the PVC associated with the audit database (default:5Gi)audit_pvc_sc: Storage class associated with the audit PVC (default:pcd-sc)audit_retention_days: Number of days logs are retained (default:7)
Example configuration:
More information on configuring options for Self Hosted PCD can be found here:
Audit Log Retrieval API:
Audit logs can also be accessed via API. This is an admin only endpoint.
Streams audit logs matching the provided filters. The response is in NDJSON (Newline Delimited JSON) format to support large datasets without memory buffering.
If no start_time is provided, defaults to the last 24 hours.
Platform9 authentication token obtained from the identity service.
Filter by region name.
Filter by tenant UUID.
Filter by User ID.
Filter by username.
Filter by action name (e.g., 'authenticate', 'create').
Filter by resource type (e.g., 'service/compute/server').
Filter by component/service name.
Start of the time range (RFC3339). Defaults to T-24h.
End of the time range.
Maximum number of records to return.
A stream of audit logs.
Stream of JSON objects (AuditLog) separated by newlines.
{"timestamp_utc":"2023-10-01T12:00:00Z","region":"us-east","action_name":"create","username":"admin"} {"timestamp_utc":"2023-10-01T12:01:00Z","region":"us-east","action_name":"delete","username":"admin"}Method Not Allowed
Internal Server Error (Database query failed)
GET /resmgr/audit/export HTTP/1.1
Host: your.du.url
x-auth-token: YOUR_API_KEY
Accept: */*
{"timestamp_utc":"2023-10-01T12:00:00Z","region":"us-east","action_name":"create","username":"admin"}
{"timestamp_utc":"2023-10-01T12:01:00Z","region":"us-east","action_name":"delete","username":"admin"}
Retrieves unique values for regions, projects, domains, and actions to populate UI filter dropdowns.
Platform9 authentication token obtained from the identity service.
Available filter options.
Method Not Allowed
Internal Server Error
GET /resmgr/audit/filters HTTP/1.1
Host: your.du.url
x-auth-token: YOUR_API_KEY
Accept: */*
{
"services": {
"compute": [
"instance",
"flavor"
],
"networking": [
"network",
"port"
]
},
"outcomes": [
"text"
],
"regions": [
"text"
],
"project_ids": [
"123e4567-e89b-12d3-a456-426614174000"
],
"domains": [
"text"
],
"action_names": [
"text"
],
"action_results": [
"text"
]
}Last updated
Was this helpful?
