Skip to content

Build Audit Log Module for Admin Actions #80

Description

@Mkalbani

Description

Implement a comprehensive audit logging module that records every admin action taken through the API. For a game with on-chain rewards and community-submitted content, audit trails are non-negotiable. Admins must be accountable for bans, reward adjustments, puzzle approvals, and NFT operations, with a queryable log that persists the who, what, when, and context of every action.

Acceptance Criteria

  • An audit module is scaffolded at src/audit/
  • AuditLog entity stores actorId, action, targetEntity, targetId, payload (JSON), and timestamp
  • Logs are written automatically via an interceptor applied to all admin routes
  • GET /admin/audit returns paginated audit logs with filters for actor, action type, and date range
  • Sensitive fields (passwords, tokens) are scrubbed from logged payloads before storage
  • Audit logs are immutable — no update or delete endpoints exist for log records
  • Log writes are non-blocking and do not affect the response time of the triggering action
  • Unit tests cover log creation, payload scrubbing, filtering, and immutability enforcement

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions