Expand description
Internal shared API — secure audit JSONL writer used by in-repo crates.
This is public to avoid duplicating 0700/0600 audit log permission handling
between futu-core::log and futu-auth::audit; external callers should use
their higher-level logging/auth entrypoints.
Shared secure audit log writer.
The daemon and auth crate both need identical audit JSONL writer behavior:
directory paths roll daily as futu-audit.log*, log directories are tightened
to 0700, log files are tightened to 0600, and world-readable temp paths emit a
visible warning. Keeping the implementation here avoids silent drift between
futu-core::log and futu-auth::audit.
Functions§
- open_
file_ 0600 - Open an audit log file with 0600 permissions on Unix.
- open_
writer - Open an audit output path as a non-blocking writer.
- tighten_
dir_ perms - Best-effort tighten audit log directory permissions to 0700 on Unix.
- tighten_
log_ files_ in_ dir - Best-effort chmod all
futu-audit.log*files in a rolling audit directory. - warn_
if_ world_ readable_ path - Emit a warning when the audit log path lives under a world-readable temp dir.