forked from bchanot/claude
fix(memory): security re-scan — header tail, cookie flags, JSON key affixes, URL lookbehind
Header rule redacts to end of line. -b/--cookie values redacted before pattern 1. JSON keys take affixes. URL rules get a lookbehind. A switch file with no boolean enabled logs one line. Probe skips logging without CLAUDE_JOB_DIR.
This commit is contained in:
1 parent
24f53afa99
commit
f80b00a997
3 files changed
+68
-9
No files matched your search
@@ -3,13 +3,15 @@
|
||||
// probe.
|
||||
import type { Register } from 'claude-code'
|
||||
|
||||
const LOG = `${process.env.CLAUDE_JOB_DIR}/tmp/probe4b/log.jsonl`
|
||||
const JOB_DIR = process.env.CLAUDE_JOB_DIR
|
||||
const LOG = `${JOB_DIR}/tmp/probe4b/log.jsonl`
|
||||
|
||||
function cut(v: any, n: number): any {
|
||||
return v === undefined || v === null ? v : String(v).slice(0, n)
|
||||
}
|
||||
|
||||
async function append($: any, obj: any): Promise<void> {
|
||||
if (JOB_DIR === undefined) return // no job dir: no log
|
||||
try {
|
||||
const prev = (await $.fs.exists(LOG)) ? await $.fs.read(LOG) : ''
|
||||
const text = typeof prev === 'string' ? prev : (prev?.text ?? '')
|
||||
|
||||
Reference in new issue
Block a user