You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -110,75 +93,138 @@ Audit logs are stored in the `audit_log` table in the Bytebase metadata database
110
93
111
94
You can manually delete old logs from the `audit_log` table or set up a scheduled job (e.g., using pg_cron or system cron) to automatically purge logs periodically. As a general best practice, many organizations retain audit logs for **at least 90 days**, and often **6–12 months** in environments with stricter compliance or investigation requirements. When choosing a retention period, balance your regulatory and security needs against available storage capacity and consider exporting logs to external log management or SIEM systems for longer-term retention.
112
95
113
-
## Events Reference
114
-
115
-
Bytebase logs the following event categories:
116
-
117
-
### Authentication & Authorization
118
-
119
-
- User login/logout (Login, Logout)
120
-
- API token operations
121
-
- IAM policy changes
122
-
- Role assignments (CreateRole, UpdateRole, DeleteRole)
123
-
124
-
### Database Operations
125
-
126
-
- Schema migrations
127
-
- Data changes (DML operations)
128
-
- Database creation/deletion/updates
129
-
- Database transfers between projects
130
-
- SQL query executions
131
-
- Database catalog modifications
132
-
133
-
### Project Management
134
-
135
-
- Project creation/updates/deletion
136
-
- Project IAM policy updates
137
-
- Database group management
138
-
139
-
### Issue & Change Management
140
-
141
-
- Issue creation/updates/approvals
142
-
- Rollout plan executions
143
-
- Task runs and approvals
144
-
145
-
### Instance Management
146
-
147
-
- Instance creation/updates/deletion
148
-
- Instance connection operations
149
-
- Data source management
150
-
- Sync operations
151
-
152
-
### Configuration & Settings
153
-
154
-
- Workspace settings changes
155
-
- Organization policy updates
156
-
- SSO/IDP configurations
157
-
- Setting updates
158
-
159
-
### Access Control
160
-
161
-
- Permission grants/revokes
162
-
- Group membership changes (CreateGroup, UpdateGroup, DeleteGroup)
163
-
- User management operations
96
+
## Log Structure
97
+
98
+
### Payload Structure (JSON)
99
+
100
+
Each audit log entry contains a JSON payload with the following fields:
101
+
102
+
| Field | Type | Description |
103
+
|-------|------|-------------|
104
+
|`parent`| string | Scope of the audit log. Format: `projects/{project}` or `workspaces/{workspace}`|
105
+
|`method`| string | Full API method name. Example: `/bytebase.v1.SQLService/Query`|
106
+
|`resource`| string | The primary resource being acted upon. Context-dependent based on operation type |
107
+
|`user`| string | User who performed the action. Format: `users/{email}`|
|**Authentication**| User Login |`/bytebase.v1.AuthService/Login`| User authentication (password, SSO, MFA) | User email | Sensitive fields redacted: `password`, `otpCode`, `recoveryCode`, `mfaTempToken`, `idpContext`. MFA phase logs extract user email from MFA temp token when email is not in request. |
156
+
|| User Logout |`/bytebase.v1.AuthService/Logout`| User session termination | - ||
157
+
|| Token Exchange |`/bytebase.v1.AuthService/ExchangeToken`| Workload Identity token exchange (CI/CD) | - | Used for CI/CD pipelines with external OIDC tokens. |
158
+
|**User Management**| Create User |`/bytebase.v1.UserService/CreateUser`| Create new user account | User name | User responses redacted to only include: `name`, `email`, `title`, `userType`. |
159
+
|| Update User |`/bytebase.v1.UserService/UpdateUser`| Modify user settings, MFA, profile | User name | User responses redacted to only include: `name`, `email`, `title`, `userType`. |
160
+
|| Delete User |`/bytebase.v1.UserService/DeleteUser`| Soft-delete user account | - ||
161
+
|| Restore User |`/bytebase.v1.UserService/UndeleteUser`| Restore deleted user | - ||
|| Set Project IAM Policy |`/bytebase.v1.ProjectService/SetIamPolicy`| Modify project member permissions | Resource name | Includes `serviceData` with `PolicyDelta` showing added/removed bindings. |
176
+
|**Workspace IAM**| Set Workspace IAM Policy |`/bytebase.v1.WorkspaceService/SetIamPolicy`| Modify workspace-level permissions | Resource name | Includes `serviceData` with `PolicyDelta` showing added/removed bindings. |
|| Admin Execute |`/bytebase.v1.SQLService/AdminExecute`| Execute SQL with admin privileges (streaming) | Database name | Response rows completely redacted. Each request/response pair in the stream generates a separate audit log. |
193
+
|| Export Data |`/bytebase.v1.SQLService/Export`| Export query results to file | Database/rollout name | Request `password` field redacted. Response `content` not logged (too large). |
0 commit comments