Skip to content

egress_guard

Structs

Functions

  • install_and_exec - Installs the guard filter, hands the listener fd to the host supervisor over
  • start - Binds the control socket and spawns the supervisor thread.

Struct

Where and how blocked attempts are reported for signed auditing — the firma run audit channel to the Sidecar.

Fields:

  • socket_path: std::path::PathBuf - Sidecar run-audit control socket (FIRMA_RUN_AUDIT_SOCK).
  • session_id: String - Session and agent identity stamped onto each message.
  • agent_id: String

Trait Implementations:

  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result
  • Clone
    • fn clone(self: &Self) -> AuditChannel

firma_run::egress_guard::EgressGuardHandle

Section titled “firma_run::egress_guard::EgressGuardHandle”

Struct

Live handle to a running guard supervisor. Dropping it stops the supervisor thread and removes the control socket.

Methods:

  • fn socket_path(self: &Self) -> &Path

Trait Implementations:

  • Drop
    • fn drop(self: & mut Self)

Struct

Inputs to [start].

Fields:

  • socket_path: std::path::PathBuf - Unix socket the in-sandbox installer connects to, to hand over the
  • allow_ports: Vec<u16> - Loopback ports the agent may still reach (proxy bridge, DNS stub).
  • report: Option<AuditChannel> - Optional sink for signed audit reports. When None (e.g. an external

Trait Implementations:

  • Clone
    • fn clone(self: &Self) -> SupervisorConfig
  • Debug
    • fn fmt(self: &Self, f: & mut $crate::fmt::Formatter) -> $crate::fmt::Result

Function

Installs the guard filter, hands the listener fd to the host supervisor over socket_path, then execves the agent. Never returns on success.

Returns a [RunError] when the supervisor socket cannot be reached, the filter cannot be installed, the fd cannot be sent, or exec fails. The caller (the __egress-guarded-run subcommand) maps the error to a fail-closed non-zero exit.

fn install_and_exec(socket_path: &std::path::Path, argv: &[String]) -> Result<std::convert::Infallible, crate::error::RunError>

Function

Binds the control socket and spawns the supervisor thread.

The thread waits for the in-sandbox installer to connect and pass the notification listener fd, then services connect notifications until the returned handle is dropped.

Returns a [RunError] when the control socket directory cannot be created or the socket cannot be bound.

fn start(config: SupervisorConfig) -> Result<EgressGuardHandle, crate::error::RunError>