Skip to main content
Audit logging tracks all configuration changes and data operations within your Bytebase workspace. These logs help you identify who performed what action, when it occurred, and what resources were affected. This enables compliance monitoring, security analysis, and troubleshooting.
Audit logging is available only for Pro and Enterprise plans.

Accessing Audit Logs

GUI

Workspace Admin or DBA can access audit logs through the Bytebase console:
  1. Navigate to the Settings page
  2. Select Audit Log from the sidebar
  3. View the chronological list of all audit events
overview You can filter audit logs by:
  • User
  • Action type
  • Resource
  • Time range
filter filter-date

API

Use the Bytebase API to programmatically access audit logs for integration with external systems and automated monitoring.
For detailed API documentation and examples, see Audit Log API.

Streaming

Stream audit logs to external logging and monitoring systems for centralized management. It supports JSON format output in addition to the default text format.
  1. Navigate to SettingsGeneralAudit Log Export
  2. Enable Enable audit logging to stdout
  3. Save the configuration
Once enabled, all audit events stream to stdout of your Bytebase service. To enable JSON format output, start Bytebase with the --enable-json-logging flag:
docker run --rm --init \
  --name bytebase \
  --publish 8080:8080 --pull always \
  --volume ~/.bytebase/data:/var/opt/bytebase \
  bytebase/bytebase:latest \
  --enable-json-logging
Supported integrations:
  • SIEM Platforms: e.g., Splunk, Datadog, Elastic Security
  • Log Aggregators: e.g., Fluentd, Logstash, Grafana Loki
  • Cloud Services: e.g., AWS CloudWatch, Google Cloud Logging, Azure Monitor

Log Structure

Example Entry

{
  "parent": "projects/sample-project",
  "method": "/bytebase.v1.SQLService/Query",
  "resource": "instances/prod-postgres/databases/mydb",
  "user": "users/[email protected]",
  "severity": "INFO",
  "request": "{\"name\":\"instances/prod-postgres/databases/mydb\",\"statement\":\"SELECT * FROM users LIMIT 10\",\"limit\":100}",
  "response": "{\"results\":[{\"columnNames\":[\"id\",\"name\"],\"columnTypeNames\":[\"int4\",\"text\"],\"rowsCount\":10}]}",
  "status": { "code": 0 },
  "latency": { "seconds": 0, "nanos": 125000000 },
  "requestMetadata": {
    "callerIp": "192.168.1.100",
    "callerSuppliedUserAgent": "Mozilla/5.0 Chrome/120.0"
  }
}

Payload Fields

FieldTypeDescription
parentstringScope of the audit log. Format: projects/{project} or workspaces/{workspace}
methodstringFull API method name. Example: /bytebase.v1.SQLService/Query
resourcestringThe primary resource being acted upon
userstringUser who performed the action. Format: users/{email}
severitystringLog severity level
requeststringJSON-serialized request payload (sensitive fields redacted)
responsestringJSON-serialized response payload (sensitive fields redacted)
statusobjectgRPC status with code and message fields
latencyobjectOperation duration with seconds and nanos fields
serviceDataobjectService-specific metadata (e.g., IAM policy changes)
requestMetadataobjectClient information including callerIp and callerSuppliedUserAgent

Severity Levels

LevelValueDescription
SEVERITY_UNSPECIFIED0Unspecified
DEBUG1Debug-level information
INFO2Informational messages (default)
NOTICE3Notable events
WARNING4Warning conditions
ERROR5Error conditions
CRITICAL6Critical conditions
ALERT7Action must be taken immediately
EMERGENCY8System is unusable

Status Codes

Status codes follow gRPC conventions:
CodeNameDescription
0OKOperation succeeded (no error)
1CANCELEDOperation was canceled, typically by the caller
2UNKNOWNOperation failed for an unknown reason
3INVALID_ARGUMENTClient supplied an invalid argument
4DEADLINE_EXCEEDEDDeadline expired before the operation could complete
5NOT_FOUNDRequested entity (e.g., file, resource) was not found
6ALREADY_EXISTSEntity that client attempted to create already exists
7PERMISSION_DENIEDCaller doesn’t have permission to execute the operation
8RESOURCE_EXHAUSTEDSome resource has been exhausted (e.g., quota, disk space)
9FAILED_PRECONDITIONSystem is not in a state required for operation’s execution
10ABORTEDOperation aborted due to concurrency issue (e.g., transaction abort)
11OUT_OF_RANGEOperation attempted past the valid range (e.g., seek past EOF)
12UNIMPLEMENTEDOperation isn’t implemented, supported, or enabled
13INTERNALInternal error - some invariants expected by the system have been broken
14UNAVAILABLEService is currently unavailable (usually temporary)
15DATA_LOSSUnrecoverable data loss or corruption
16UNAUTHENTICATEDRequest does not have valid authentication credentials

Audited Events

EventMethodDescription
User Login/bytebase.v1.AuthService/LoginUser authentication (password, SSO, MFA)
User Logout/bytebase.v1.AuthService/LogoutUser session termination
Token Exchange/bytebase.v1.AuthService/ExchangeTokenWorkload Identity token exchange for CI/CD pipelines
Notes:
  • Sensitive fields redacted: password, otpCode, recoveryCode, mfaTempToken, idpContext
  • MFA phase logs extract user email from MFA temp token when email is not in request
EventMethodDescription
Create User/bytebase.v1.UserService/CreateUserCreate new user account
Update User/bytebase.v1.UserService/UpdateUserModify user settings, MFA, profile
Delete User/bytebase.v1.UserService/DeleteUserSoft-delete user account
Restore User/bytebase.v1.UserService/UndeleteUserRestore deleted user
Update Email/bytebase.v1.UserService/UpdateEmailChange user email address
Notes:
  • User responses redacted to only include: name, email, title, userType
EventMethodDescription
Create Group/bytebase.v1.GroupService/CreateGroupCreate user group
Update Group/bytebase.v1.GroupService/UpdateGroupModify group membership/settings
Delete Group/bytebase.v1.GroupService/DeleteGroupDelete user group
EventMethodDescription
Create Role/bytebase.v1.RoleService/CreateRoleCreate custom role
Update Role/bytebase.v1.RoleService/UpdateRoleModify role permissions
Delete Role/bytebase.v1.RoleService/DeleteRoleDelete custom role
EventMethodDescription
Create Identity Provider/bytebase.v1.IdentityProviderService/CreateIdentityProviderConfigure new SSO provider
Update Identity Provider/bytebase.v1.IdentityProviderService/UpdateIdentityProviderModify SSO configuration
Delete Identity Provider/bytebase.v1.IdentityProviderService/DeleteIdentityProviderRemove SSO provider
EventMethodDescription
Delete Project/bytebase.v1.ProjectService/DeleteProjectSoft-delete project
Restore Project/bytebase.v1.ProjectService/UndeleteProjectRestore deleted project
Batch Delete Projects/bytebase.v1.ProjectService/BatchDeleteProjectsDelete multiple projects
Set Project IAM Policy/bytebase.v1.ProjectService/SetIamPolicyModify project member permissions
Notes:
  • IAM policy changes include serviceData with PolicyDelta showing added/removed bindings
EventMethodDescription
Set Workspace IAM Policy/bytebase.v1.WorkspaceService/SetIamPolicyModify workspace-level permissions
Notes:
  • Includes serviceData with PolicyDelta showing added/removed bindings
EventMethodDescription
Create Instance/bytebase.v1.InstanceService/CreateInstanceRegister new database instance
Update Instance/bytebase.v1.InstanceService/UpdateInstanceModify instance configuration
Delete Instance/bytebase.v1.InstanceService/DeleteInstanceSoft-delete instance
Restore Instance/bytebase.v1.InstanceService/UndeleteInstanceRestore deleted instance
Batch Update Instances/bytebase.v1.InstanceService/BatchUpdateInstancesBulk update instances
Add Data Source/bytebase.v1.InstanceService/AddDataSourceAdd connection to instance
Update Data Source/bytebase.v1.InstanceService/UpdateDataSourceModify connection settings
Remove Data Source/bytebase.v1.InstanceService/RemoveDataSourceRemove connection
Notes:
  • DataSource sensitive fields redacted: password, sslCa, sslCert, sslKey, sshPassword, sshPrivateKey, authenticationPrivateKey, externalSecret, saslConfig.krbConfig.keytab, masterPassword
EventMethodDescription
Update Database/bytebase.v1.DatabaseService/UpdateDatabaseModify database settings/labels
Batch Update Databases/bytebase.v1.DatabaseService/BatchUpdateDatabasesBulk update databases
Update Database Catalog/bytebase.v1.DatabaseCatalogService/UpdateDatabaseCatalogModify schema catalog/classification
EventMethodDescription
Create Database Group/bytebase.v1.DatabaseGroupService/CreateDatabaseGroupCreate logical database group
Update Database Group/bytebase.v1.DatabaseGroupService/UpdateDatabaseGroupModify database group
Delete Database Group/bytebase.v1.DatabaseGroupService/DeleteDatabaseGroupDelete database group
EventMethodDescription
Execute Query/bytebase.v1.SQLService/QueryExecute read-only SQL query
Admin Execute/bytebase.v1.SQLService/AdminExecuteExecute SQL with admin privileges (streaming)
Export Data/bytebase.v1.SQLService/ExportExport query results to file
Notes:
  • Response rows completely redacted - only metadata captured: columnNames, columnTypeNames, rowsCount, error, latency, statement
  • Each request/response pair in streaming operations generates a separate audit log
  • Export request password field redacted; response content not logged
EventMethodDescription
Create Issue/bytebase.v1.IssueService/CreateIssueCreate change request
Update Issue/bytebase.v1.IssueService/UpdateIssueModify issue details
Create Issue Comment/bytebase.v1.IssueService/CreateIssueCommentAdd comment to issue
Update Issue Comment/bytebase.v1.IssueService/UpdateIssueCommentModify issue comment
Batch Update Issues Status/bytebase.v1.IssueService/BatchUpdateIssuesStatusBulk status change
Approve Issue/bytebase.v1.IssueService/ApproveIssueApprove change request
Reject Issue/bytebase.v1.IssueService/RejectIssueReject change request
Request Issue/bytebase.v1.IssueService/RequestIssueRe-request approval
EventMethodDescription
Create Plan/bytebase.v1.PlanService/CreatePlanCreate deployment plan
Update Plan/bytebase.v1.PlanService/UpdatePlanModify deployment plan
Create Rollout/bytebase.v1.RolloutService/CreateRolloutCreate deployment rollout
Run Tasks/bytebase.v1.RolloutService/BatchRunTasksExecute deployment tasks
Skip Tasks/bytebase.v1.RolloutService/BatchSkipTasksSkip deployment tasks
Cancel Task Runs/bytebase.v1.RolloutService/BatchCancelTaskRunsCancel running tasks
EventMethodDescription
Create Policy/bytebase.v1.OrgPolicyService/CreatePolicyCreate organizational policy
Update Policy/bytebase.v1.OrgPolicyService/UpdatePolicyModify policy settings
Delete Policy/bytebase.v1.OrgPolicyService/DeletePolicyRemove policy
Update Setting/bytebase.v1.SettingService/UpdateSettingModify system settings

Events Not Logged

CategoryOperationsReason
Read-Only OperationsAll Get*, List*, Search* methods, GetIamPolicyLow security impact - viewing data doesn’t modify state
High-Frequency OperationsAuthService/Refresh, BatchSyncInstances, Actuator health checksToo frequent, would create excessive log volume
Validate-Only RequestsAny request with validate_only = trueDry-run operations that don’t modify state
Utility ServicesCELService/*, SQLService/AICompletion, SQLService/DiffMetadataUtility functions with no security implications
Review & Sheet OperationsReviewConfigService/*, SheetService/*, WorksheetService/*Lower security impact configuration
Release & RevisionReleaseService/*, RevisionService/*Schema tracking operations
Instance Role OperationsInstanceRoleService/*Database role management

Retention

Bytebase does not automatically purge audit logs. You must implement periodic cleanup to prevent disk space exhaustion, which can cause Bytebase to crash.
Audit logs are stored in the audit_log table in the Bytebase metadata database. Recommended retention periods:
  • Minimum: 90 days
  • Compliance environments: 6–12 months
Cleanup options:
  • Manually delete old logs from the audit_log table
  • Set up a scheduled job using pg_cron or system cron
  • Export logs to external log management or SIEM systems for longer-term retention

Limitations

Privacy and Security

  • Query results excluded: Actual row data from queries is redacted
  • Sensitive data masking: Passwords, API keys, SSL certificates, SSH keys automatically replaced with masked values
  • Response truncation: Large response payloads may be omitted

Technical Constraints

  • Synchronous generation: Audit logs are generated during request processing
  • Pagination limit: Maximum 5,000 entries per API call
  • Filter complexity: Searches must use valid CEL expressions
  • Storage: Logs stored in metadata database, following its retention policies