From 363ff3387ba1677e9d1b67e234ed0343b484273c Mon Sep 17 00:00:00 2001 From: Cornelius Ludmann Date: Wed, 28 May 2025 08:18:44 +0000 Subject: [PATCH] Redact args in the logs of audit log service --- components/server/src/audit/AuditLogService.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/components/server/src/audit/AuditLogService.ts b/components/server/src/audit/AuditLogService.ts index 3b3b5d1085bb97..c34639628a62f9 100644 --- a/components/server/src/audit/AuditLogService.ts +++ b/components/server/src/audit/AuditLogService.ts @@ -53,7 +53,16 @@ export class AuditLogService { action: method, args: argsScrubbed, }; - log.info("audit", new TrustedValue(logEntry)); + // The args param contains workspace IDs and other sensitive data. Since + // it's quite hard to detect them, best way is to simply not log it at + // all. It's still part of the audit database but does not appear in the + // component logs. + const logEntryForLogging = { + ...logEntry, + args: ["[redacted]"], + }; + + log.info("audit", new TrustedValue(logEntryForLogging)); await this.dbAuditLog.recordAuditLog(logEntry); }