Skip to content

Implement Comprehensive Audit Logging Interceptor for Sensitive Endpoints #113

Description

@Cjay-Cyber-2

Description — what to implement and the why/impact.

Implement a nest interceptor that automatically records an immutable audit log entry for all sensitive administrative and financial state-changing endpoints in the API.

Context & Requirements — background, constraints, design references, edge cases;

As a Financial Operating System for autonomous agents, every privileged action (such as policy updates, key rotation, and fund transfers) must be traceable. The audit log must record the actor ID, IP address, user agent, timestamp, endpoint path, request payload hash, and response status.

Acceptance Criteria — a checklist of specific, testable conditions that define "done".

  • AuditLog model verified or added in prisma/schema.prisma.
  • NestJS interceptor @AuditLog() implemented and applied to sensitive controllers.
  • Sensitive fields (such as passwords, private keys, or tokens) automatically redacted from logged payloads.
  • Unit tests verifying correct logging behavior and payload sanitization.

Implementation Guidance — likely files/modules to touch and a suggested approach.

  • Likely files: src/common/interceptors/audit.interceptor.ts, src/modules/audit/, prisma/schema.prisma.
  • Ensure logging runs asynchronously so it does not block request completion.

Testing & Validation — how the contributor should prove it works.

  • Run npm test and verify audit interceptor tests.
  • Confirm no sensitive secrets appear in simulated audit log outputs.

Submission Guidelines — must open a PR that includes "Closes #"; assignment is required before starting.


Wave complexity: Medium

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions