Skip to main content

Monitor

Struct Monitor 

Source
pub struct Monitor { /* private fields */ }
Expand description

Shared host monitor coordinating audit logging, remembered rules, pending approval gates, and optional whole-VM freeze-on-ask.

Implementations§

Source§

impl Monitor

Source

pub fn new(cfg: MonitorConfig, pause: Arc<PauseController>) -> Arc<Self> ⓘ

Source

pub fn attach_vmi(&self, vmi: Arc<VmiTracker>)

Source

pub fn p9_proc(&self) -> Option<ProcInfo>

Source

pub fn net_proc(&self) -> Option<ProcInfo>

Source

pub fn is_active(&self) -> bool

Source

pub fn ask_net(&self) -> bool

Source

pub fn ask_fs_write(&self) -> bool

Source

pub fn ask_sensitive_read(&self) -> bool

Source

pub fn pause_controller(&self) -> &Arc<PauseController> ⓘ

Source

pub fn emit(&self, ev: AuditEvent)

Source

pub fn pause_vm(&self, reason: impl Into<String>) -> bool

Pause the VM explicitly and emit vm.paused.

Source

pub fn resume_vm(&self) -> Option<u64>

Resume the VM explicitly and emit vm.resumed.

Source

pub fn request_approval( &self, kind: ApprovalKind, remember_key: &str, target: String, detail: Option<String>, ) -> ApprovalDecision

Request an external decision for an intercepted operation. Checks cached AllowAlways / DenyAlways rules first; if unknown, holds the calling host driver thread (and optionally freezes the entire guest VM if freeze_on_ask) until resolved via approval_callback or Self::resolve_approval.

Source

pub fn resolve_approval( &self, approval_id: u64, decision: ApprovalDecision, ) -> bool

Resolve a pending approval by approval_id (returns false if not found).

Source

pub fn pending_approvals(&self) -> Vec<ApprovalRequest>

Snapshot currently pending approval requests.

Source

pub fn shutdown(&self)

Unblock all pending approvals and pauses during VM shutdown.

Auto Trait Implementations§

§

impl !Freeze for Monitor

§

impl !RefUnwindSafe for Monitor

§

impl !UnwindSafe for Monitor

§

impl Forget for Monitor

§

impl Move for Monitor

§

impl Send for Monitor

§

impl Sync for Monitor

§

impl Unpin for Monitor
where Arc<dyn Fn(AuditEvent) + Send + Sync>: Unpin, Arc<Mutex<File>>: Unpin, Arc<dyn Fn(&ApprovalRequest) -> ApprovalDecision + Send + Sync>: Unpin, Arc<PauseController>: Unpin, Align4<u32>: Unpin, Arc<VmiTracker>: Unpin, Align8<u64>: Unpin, Align1<u8>: Unpin, *const u8 is !null: Unpin, *mut Counter<Channel<ApprovalDecision>>: Unpin, *mut Counter<Channel<ApprovalDecision>>: Unpin, *mut Counter<Channel<ApprovalDecision>>: Unpin,

§

impl UnsafeUnpin for Monitor

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.