jdx/mise · error

per-host network filtering

Error message

per-host network filtering (--allow-net=<host>) is not supported on Linux. Use --deny-net to block all network, or remove --allow-net.

What it means

On Linux, mise's sandbox implements network restriction with seccomp, which can only deny network syscalls wholesale — it cannot filter by destination host. If per-host allow rules were requested (`--allow-net=<host>`) alongside deny-net or deny-process, `apply_linux` bails explaining that only full denial is supported and pointing at `--deny-net`.

Solutions

  1. Drop the `--allow-net=<host>` flags on Linux and rely on `--deny-net` to block all network.
  2. Remove `--deny-net` entirely if the command needs network access.
  3. Implement host filtering outside mise (firewall/nftables rules or a userspace proxy) when per-host control is required on Linux.

Example fix

// before
mise x --allow-net=registry.npmjs.org --deny-net -- npm publish
// after
mise x -- npm publish  # or: mise x --deny-net -- make offline-test
Defensive patterns

Strategy: validation

Validate before calling

if (process.platform === 'linux' && allowNetHosts.length > 0)
  throw new Error('--allow-net=<host> is not supported on Linux; use --deny-net only');

Prevention

When it happens

Trigger: Running `mise x --allow-net=registry.npmjs.org --deny-net ... -- <cmd>` (or deny_process set) on Linux: any non-empty `allow_net` combined with `effective_deny_net()` or `deny_process` triggers the bail.

Common situations: Users porting macOS sandbox (seatbelt) invocations that support per-host filtering to Linux; CI scripts sharing flags across platforms; intending 'allow only this host' which Linux seccomp cannot express here.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/335ff84c7bff5492. Report an issue: GitHub.

Appendix: source

Thrown at src/sandbox/mod.rs:333

        {
            return self.apply_macos(program, args).await;
        }

        #[cfg(not(any(target_os = "linux", target_os = "macos")))]
        {
            warn!("sandbox is not supported on this platform, running unsandboxed");
            Ok(None)
        }
    }

    #[cfg(all(not(test), target_os = "linux"))]
    fn apply_linux(&self, program: &str) -> eyre::Result<()> {
        if self.effective_deny_read() || self.effective_deny_write() || self.deny_process {
            landlock::apply_landlock(self, Some(std::path::Path::new(program)))?;
        }
        if self.effective_deny_net() || self.deny_process {
            if !self.allow_net.is_empty() {
                eyre::bail!(
                    "per-host network filtering (--allow-net=<host>) is not supported on Linux. \
                     Use --deny-net to block all network, or remove --allow-net."
                );
            }
            seccomp::apply_seccomp_filter(self.effective_deny_net(), self.deny_process)?;
        }
        Ok(())
    }

    #[cfg(all(not(test), target_os = "macos"))]
    async fn apply_macos(
        &self,
        program: &str,
        args: &[String],
    ) -> eyre::Result<Option<SandboxedCommand>> {
        let profile =
            macos::generate_seatbelt_profile(self, Some(std::path::Path::new(program))).await;
        let mut sandbox_args = vec![

View on GitHub (pinned to 533346cc37)