Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
node_modules
coverage
dist
coverage
.env
.env.*
.DS_Store
*.log
coverage
coverage/
19 changes: 19 additions & 0 deletions AUDIT_RETENTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Audit Log Retention and Privacy Considerations

## Retention Policy
Audit logs in the current implementation are stored in-memory using the `InMemoryAuditLogRepository`.
- **Volatile Storage**: Since the storage is in-memory, logs are cleared whenever the server restarts.
- **Production Recommendation**: When moving to production, a persistent database (e.g., PostgreSQL) should be used.
- **Cleanup**: Periodic cleanup of logs older than 90 days is recommended to maintain performance.

## Privacy Considerations
- **Non-Sensitive Logging**: The system is designed to log *actions* (who, what, when) without storing sensitive payload data.
- **Personally Identifiable Information (PII)**:
- `performedBy`: Stores the user identifier (e.g., from `x-user` header).
- `resourceId`: Stores the identifier of the modified resource (e.g., wallet address or credit line ID).
- **Metadata**: Only includes high-level request information (`method`, `path`). Avoid logging full request bodies or headers to prevent accidental exposure of credentials or private data.
- **Access Control**: The `GET /api/audit/logs` endpoint should be protected by admin-level authentication in a production environment. Currently, it is publicly accessible for demonstration and development purposes.

## Security
- Audit logs are immutable via the service once created.
- The `clearAuditLogs` method is intended for test environments and system maintenance only.
9 changes: 9 additions & 0 deletions coverage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

> [email protected] test
> node --experimental-vm-modules node_modules/.bin/jest --coverage --reporter=json

----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 0 | 0 | 0 | 0 |
----------|---------|----------|---------|---------|-------------------
224 changes: 0 additions & 224 deletions coverage/base.css

This file was deleted.

87 changes: 0 additions & 87 deletions coverage/block-navigation.js

This file was deleted.

Loading