pub struct NetworkAuditLog { /* private fields */ }Expand description
Re-export of heel’s rolling network audit log for terminal-tool configuration. JSONL sink for network access decisions.
Lines are written by one dedicated thread that owns the sink, in the order
the decisions were made; NetworkAuditLog::record resolves once its line
has been written and flushed. Cloning shares the thread, which exits when
the last clone is dropped.
Implementations§
Source§impl NetworkAuditLog
impl NetworkAuditLog
Sourcepub const FILE_PREFIX: &'static str = "network-audit"
pub const FILE_PREFIX: &'static str = "network-audit"
File name prefix for rotated audit log files.
Sourcepub fn rolling_daily(
directory: impl AsRef<Path>,
max_files: usize,
) -> Result<NetworkAuditLog, Error>
pub fn rolling_daily( directory: impl AsRef<Path>, max_files: usize, ) -> Result<NetworkAuditLog, Error>
Open a daily-rotated audit log under directory, keeping at most
max_files rotated files.
Sourcepub fn file(path: impl AsRef<Path>) -> Result<NetworkAuditLog, Error>
pub fn file(path: impl AsRef<Path>) -> Result<NetworkAuditLog, Error>
Append every decision to the single file at path, creating it if it
does not exist and keeping whatever it already holds.
One file per run is what a harness that starts many sandboxes wants: the decisions of exactly that sandbox, with nothing to split apart afterwards. The parent directory must already exist — creating it here would silently produce an audit trail somewhere the caller did not mean.
Trait Implementations§
Source§impl Clone for NetworkAuditLog
impl Clone for NetworkAuditLog
Source§fn clone(&self) -> NetworkAuditLog
fn clone(&self) -> NetworkAuditLog
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Forget for NetworkAuditLog
impl Freeze for NetworkAuditLog
impl Move for NetworkAuditLog
impl RefUnwindSafe for NetworkAuditLog
impl Send for NetworkAuditLog
impl Sync for NetworkAuditLog
impl Unpin for NetworkAuditLog
impl UnsafeUnpin for NetworkAuditLog
impl UnwindSafe for NetworkAuditLog
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more