feat: add audit log mock data
This commit is contained in:
194
src/pages/Admin/AuditLog/auditMocks.ts
Normal file
194
src/pages/Admin/AuditLog/auditMocks.ts
Normal file
@@ -0,0 +1,194 @@
|
||||
export interface AuditEvent {
|
||||
id: number
|
||||
timestamp: string
|
||||
username: string
|
||||
category: 'INFRA' | 'AUTH' | 'USER_MGMT' | 'CONFIG'
|
||||
action: string
|
||||
target: string
|
||||
result: 'SUCCESS' | 'FAILURE'
|
||||
detail: Record<string, unknown>
|
||||
ipAddress: string
|
||||
userAgent: string
|
||||
}
|
||||
|
||||
const now = Date.now()
|
||||
const hour = 3600_000
|
||||
const day = 24 * hour
|
||||
|
||||
export const AUDIT_EVENTS: AuditEvent[] = [
|
||||
{
|
||||
id: 1, timestamp: new Date(now - 0.5 * hour).toISOString(),
|
||||
username: 'hendrik', category: 'USER_MGMT', action: 'CREATE_USER',
|
||||
target: 'users/alice', result: 'SUCCESS',
|
||||
detail: { displayName: 'Alice Johnson', roles: ['VIEWER'] },
|
||||
ipAddress: '10.0.1.42', userAgent: 'Mozilla/5.0 Chrome/125',
|
||||
},
|
||||
{
|
||||
id: 2, timestamp: new Date(now - 1.2 * hour).toISOString(),
|
||||
username: 'system', category: 'INFRA', action: 'POOL_RESIZE',
|
||||
target: 'db/primary', result: 'SUCCESS',
|
||||
detail: { oldSize: 10, newSize: 20, reason: 'auto-scale' },
|
||||
ipAddress: '10.0.0.1', userAgent: 'cameleer-scheduler/1.0',
|
||||
},
|
||||
{
|
||||
id: 3, timestamp: new Date(now - 2 * hour).toISOString(),
|
||||
username: 'alice', category: 'AUTH', action: 'LOGIN',
|
||||
target: 'sessions/abc123', result: 'SUCCESS',
|
||||
detail: { method: 'OIDC', provider: 'keycloak' },
|
||||
ipAddress: '192.168.1.100', userAgent: 'Mozilla/5.0 Firefox/126',
|
||||
},
|
||||
{
|
||||
id: 4, timestamp: new Date(now - 2.5 * hour).toISOString(),
|
||||
username: 'unknown', category: 'AUTH', action: 'LOGIN',
|
||||
target: 'sessions', result: 'FAILURE',
|
||||
detail: { method: 'local', reason: 'invalid_credentials' },
|
||||
ipAddress: '203.0.113.50', userAgent: 'curl/8.1',
|
||||
},
|
||||
{
|
||||
id: 5, timestamp: new Date(now - 3 * hour).toISOString(),
|
||||
username: 'hendrik', category: 'CONFIG', action: 'UPDATE_THRESHOLD',
|
||||
target: 'thresholds/pool-connections', result: 'SUCCESS',
|
||||
detail: { field: 'maxConnections', oldValue: 50, newValue: 100 },
|
||||
ipAddress: '10.0.1.42', userAgent: 'Mozilla/5.0 Chrome/125',
|
||||
},
|
||||
{
|
||||
id: 6, timestamp: new Date(now - 4 * hour).toISOString(),
|
||||
username: 'hendrik', category: 'USER_MGMT', action: 'ASSIGN_ROLE',
|
||||
target: 'users/bob', result: 'SUCCESS',
|
||||
detail: { role: 'EDITOR', method: 'direct' },
|
||||
ipAddress: '10.0.1.42', userAgent: 'Mozilla/5.0 Chrome/125',
|
||||
},
|
||||
{
|
||||
id: 7, timestamp: new Date(now - 5 * hour).toISOString(),
|
||||
username: 'system', category: 'INFRA', action: 'INDEX_REBUILD',
|
||||
target: 'opensearch/exchanges', result: 'SUCCESS',
|
||||
detail: { documents: 15420, duration: '12.3s' },
|
||||
ipAddress: '10.0.0.1', userAgent: 'cameleer-scheduler/1.0',
|
||||
},
|
||||
{
|
||||
id: 8, timestamp: new Date(now - 6 * hour).toISOString(),
|
||||
username: 'bob', category: 'AUTH', action: 'LOGIN',
|
||||
target: 'sessions/def456', result: 'SUCCESS',
|
||||
detail: { method: 'local' },
|
||||
ipAddress: '10.0.2.15', userAgent: 'Mozilla/5.0 Safari/17',
|
||||
},
|
||||
{
|
||||
id: 9, timestamp: new Date(now - 8 * hour).toISOString(),
|
||||
username: 'hendrik', category: 'USER_MGMT', action: 'CREATE_GROUP',
|
||||
target: 'groups/developers', result: 'SUCCESS',
|
||||
detail: { parent: null },
|
||||
ipAddress: '10.0.1.42', userAgent: 'Mozilla/5.0 Chrome/125',
|
||||
},
|
||||
{
|
||||
id: 10, timestamp: new Date(now - 10 * hour).toISOString(),
|
||||
username: 'system', category: 'INFRA', action: 'BACKUP',
|
||||
target: 'db/primary', result: 'SUCCESS',
|
||||
detail: { sizeBytes: 524288000, duration: '45s' },
|
||||
ipAddress: '10.0.0.1', userAgent: 'cameleer-scheduler/1.0',
|
||||
},
|
||||
{
|
||||
id: 11, timestamp: new Date(now - 12 * hour).toISOString(),
|
||||
username: 'hendrik', category: 'CONFIG', action: 'UPDATE_OIDC',
|
||||
target: 'config/oidc', result: 'SUCCESS',
|
||||
detail: { field: 'autoSignup', oldValue: false, newValue: true },
|
||||
ipAddress: '10.0.1.42', userAgent: 'Mozilla/5.0 Chrome/125',
|
||||
},
|
||||
{
|
||||
id: 12, timestamp: new Date(now - 1 * day).toISOString(),
|
||||
username: 'alice', category: 'AUTH', action: 'LOGOUT',
|
||||
target: 'sessions/abc123', result: 'SUCCESS',
|
||||
detail: { reason: 'user_initiated' },
|
||||
ipAddress: '192.168.1.100', userAgent: 'Mozilla/5.0 Firefox/126',
|
||||
},
|
||||
{
|
||||
id: 13, timestamp: new Date(now - 1 * day - 2 * hour).toISOString(),
|
||||
username: 'hendrik', category: 'USER_MGMT', action: 'DELETE_USER',
|
||||
target: 'users/temp-user', result: 'SUCCESS',
|
||||
detail: { reason: 'cleanup' },
|
||||
ipAddress: '10.0.1.42', userAgent: 'Mozilla/5.0 Chrome/125',
|
||||
},
|
||||
{
|
||||
id: 14, timestamp: new Date(now - 1 * day - 4 * hour).toISOString(),
|
||||
username: 'system', category: 'INFRA', action: 'POOL_RESIZE',
|
||||
target: 'db/primary', result: 'FAILURE',
|
||||
detail: { oldSize: 20, newSize: 50, error: 'max_connections_exceeded' },
|
||||
ipAddress: '10.0.0.1', userAgent: 'cameleer-scheduler/1.0',
|
||||
},
|
||||
{
|
||||
id: 15, timestamp: new Date(now - 1 * day - 6 * hour).toISOString(),
|
||||
username: 'hendrik', category: 'USER_MGMT', action: 'UPDATE_GROUP',
|
||||
target: 'groups/admins', result: 'SUCCESS',
|
||||
detail: { addedMembers: ['alice'], removedMembers: [] },
|
||||
ipAddress: '10.0.1.42', userAgent: 'Mozilla/5.0 Chrome/125',
|
||||
},
|
||||
{
|
||||
id: 16, timestamp: new Date(now - 2 * day).toISOString(),
|
||||
username: 'bob', category: 'AUTH', action: 'PASSWORD_CHANGE',
|
||||
target: 'users/bob', result: 'SUCCESS',
|
||||
detail: { method: 'self_service' },
|
||||
ipAddress: '10.0.2.15', userAgent: 'Mozilla/5.0 Safari/17',
|
||||
},
|
||||
{
|
||||
id: 17, timestamp: new Date(now - 2 * day - 3 * hour).toISOString(),
|
||||
username: 'system', category: 'INFRA', action: 'VACUUM',
|
||||
target: 'db/primary/exchanges', result: 'SUCCESS',
|
||||
detail: { reclaimedBytes: 1048576, duration: '3.2s' },
|
||||
ipAddress: '10.0.0.1', userAgent: 'cameleer-scheduler/1.0',
|
||||
},
|
||||
{
|
||||
id: 18, timestamp: new Date(now - 2 * day - 5 * hour).toISOString(),
|
||||
username: 'hendrik', category: 'CONFIG', action: 'UPDATE_THRESHOLD',
|
||||
target: 'thresholds/latency-p99', result: 'SUCCESS',
|
||||
detail: { field: 'warningMs', oldValue: 500, newValue: 300 },
|
||||
ipAddress: '10.0.1.42', userAgent: 'Mozilla/5.0 Chrome/125',
|
||||
},
|
||||
{
|
||||
id: 19, timestamp: new Date(now - 3 * day).toISOString(),
|
||||
username: 'attacker', category: 'AUTH', action: 'LOGIN',
|
||||
target: 'sessions', result: 'FAILURE',
|
||||
detail: { method: 'local', reason: 'account_locked', attempts: 5 },
|
||||
ipAddress: '198.51.100.23', userAgent: 'python-requests/2.31',
|
||||
},
|
||||
{
|
||||
id: 20, timestamp: new Date(now - 3 * day - 2 * hour).toISOString(),
|
||||
username: 'hendrik', category: 'USER_MGMT', action: 'ASSIGN_ROLE',
|
||||
target: 'groups/developers', result: 'SUCCESS',
|
||||
detail: { role: 'EDITOR', method: 'group_assignment' },
|
||||
ipAddress: '10.0.1.42', userAgent: 'Mozilla/5.0 Chrome/125',
|
||||
},
|
||||
{
|
||||
id: 21, timestamp: new Date(now - 4 * day).toISOString(),
|
||||
username: 'system', category: 'INFRA', action: 'BACKUP',
|
||||
target: 'db/primary', result: 'FAILURE',
|
||||
detail: { error: 'disk_full', sizeBytes: 0 },
|
||||
ipAddress: '10.0.0.1', userAgent: 'cameleer-scheduler/1.0',
|
||||
},
|
||||
{
|
||||
id: 22, timestamp: new Date(now - 4 * day - 1 * hour).toISOString(),
|
||||
username: 'alice', category: 'CONFIG', action: 'VIEW_CONFIG',
|
||||
target: 'config/oidc', result: 'SUCCESS',
|
||||
detail: { section: 'provider_settings' },
|
||||
ipAddress: '192.168.1.100', userAgent: 'Mozilla/5.0 Firefox/126',
|
||||
},
|
||||
{
|
||||
id: 23, timestamp: new Date(now - 5 * day).toISOString(),
|
||||
username: 'hendrik', category: 'USER_MGMT', action: 'CREATE_ROLE',
|
||||
target: 'roles/OPERATOR', result: 'SUCCESS',
|
||||
detail: { scope: 'custom', description: 'Pipeline operator' },
|
||||
ipAddress: '10.0.1.42', userAgent: 'Mozilla/5.0 Chrome/125',
|
||||
},
|
||||
{
|
||||
id: 24, timestamp: new Date(now - 5 * day - 3 * hour).toISOString(),
|
||||
username: 'system', category: 'INFRA', action: 'INDEX_REBUILD',
|
||||
target: 'opensearch/agents', result: 'SUCCESS',
|
||||
detail: { documents: 230, duration: '1.1s' },
|
||||
ipAddress: '10.0.0.1', userAgent: 'cameleer-scheduler/1.0',
|
||||
},
|
||||
{
|
||||
id: 25, timestamp: new Date(now - 6 * day).toISOString(),
|
||||
username: 'hendrik', category: 'USER_MGMT', action: 'CREATE_USER',
|
||||
target: 'users/bob', result: 'SUCCESS',
|
||||
detail: { displayName: 'Bob Smith', roles: ['VIEWER'] },
|
||||
ipAddress: '10.0.1.42', userAgent: 'Mozilla/5.0 Chrome/125',
|
||||
},
|
||||
]
|
||||
Reference in New Issue
Block a user