Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Mask temporary AWS key ids in diagnostics bundles too

milind-soni0882a75568aa
diff --git a/electron/diagnostics.mjs b/electron/diagnostics.mjs
index 69b6729d92..0633c0ba7d 100644
--- a/electron/diagnostics.mjs
+++ b/electron/diagnostics.mjs
@@ -55,7 +55,7 @@ const CREDENTIAL_TOKEN_FORMATS = [
/\b(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9]{20,}/g,
/\bgithub_pat_[A-Za-z0-9_]{20,}/g,
/\bxox[abposr]-[A-Za-z0-9-]{20,}/g,
- /\bAKIA[0-9A-Z]{16}\b/g,
+ /\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,
/\bAIza[0-9A-Za-z_-]{30,}/g,
/\bnpm_[A-Za-z0-9]{20,}/g,
];
diff --git a/electron/diagnostics.test.mjs b/electron/diagnostics.test.mjs
index 36436a1c70..7dfbf7b569 100644
--- a/electron/diagnostics.test.mjs
+++ b/electron/diagnostics.test.mjs
@@ -123,6 +123,14 @@ describe("buildDiagnosticsReport", () => {
expect(report).toContain("Groq HTTP 401");
});
+ it("masks long-term and temporary AWS access key ids", () => {
+ const longTerm = `AKIA${"ABCDEFGHIJKLMNOP"}`;
+ const temporary = `ASIA${"QRSTUVWXYZ234567"}`;
+ const redacted = redactSecretsInLine(`aws ${longTerm} then sts ${temporary} done`);
+ for (const id of [longTerm, temporary]) expect(redacted).not.toContain(id);
+ expect(redacted).toContain("done");
+ });
+
it("includes privacy-safe desktop crash metadata separately from the server log", () => {
const desktopLogTail =
"[2026-08-31T11:00:00.000Z] event=render-process-gone surface=main-window reason=crashed exitCode=5";