Skip to content

bug: multi-folder --audit-log is a silent no-op #879

Description

@Ayush7614

Summary

With --audit-log <path> (or CVE_LITE_AUDIT_LOG), multi-folder scans open the log handle but emit no events — not even scan.started / scan.finished. Override audits in multi-folder hard-wire NULL_AUDIT_LOG. Unlike --sarif / --cdx (which print an unsupported warning), audit-log fails silently.

Expected

Per docs/audit-log.md: every run emits scan.started and scan.finished (and oa.detected when override hygiene runs). Consumers can always pair start/finish.

Actual

src/index.ts creates the audit log, then on the multi-folder path:

const exitCode = await handleMultiFolderScan(...);
auditLogHandle.close();
process.exit(exitCode);

No emit calls. Inside src/scan/multi-folder-scan.ts, override audit uses NULL_AUDIT_LOG, so even OA findings never stream.

--sarif / --cdx in multi-folder explicitly error with a yellow message; --audit-log does not.

Impact

Compliance / change-control pipelines that enable --audit-log on monorepos get an empty (or unchanged) NDJSON file and assume the run was logged. False sense of audit coverage.

Suggested fix

  1. Emit at least scan.started / scan.finished around multi-folder scans (with folder count / exit code).
  2. Pass the real audit-log handle into per-folder override audits instead of NULL_AUDIT_LOG when --check-overrides is set.
  3. Optionally warn (like SARIF/CDX) until full event parity lands — prefer emitting events over warning-only.

Reproduce

cve-lite /path/to/multi-folder-root --offline --check-overrides --audit-log ./audit.ndjson
wc -l ./audit.ndjson
# expected: ≥2 events (started + finished), plus oa.detected when OA findings exist
# actual: 0 new events

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions