Skip to main content

EGR000 - Egress Allowlisting Is Not Set Up

Agent error code #EGR000 indicates that the agent received an egress knoc for a firewall that egress allowlisting is not set up on. On pf, the agent treats the firewall as set up only when the base rules knocker enable egress writes for it are on disk, in /etc/knocknoc-agent/knocknoc-egress.pf.

nftables and iptables have no base file, because the fence is your own rules, and never report this code. A knoc whose users set is missing reports #EGR061, and one whose chain is missing #EGR059.

Windows has no base file. The agent treats Windows egress as set up whenever its service runs as LocalSystem and Windows Firewall answers it. Windows Firewall turned off, or overridden by a Group Policy, is reported as #EGR007.

Without its base file the firewall's egress rules may not be in the kernel either, so the agent refuses every grant rather than report access it cannot enforce. Each grant and Validate integration on the knoc report it.

On Linux and OpenBSD, knocker enable egress sets up every firewall the host can run and skips the rest. Common causes include:

  • knocker enable egress was never run on this host
  • It ran, but skipped this firewall because the host lacks what it needs
  • It ran, but the agent was not restarted afterwards, so it still reports what it found when it started
  • knocker disable egress was run, or the base file was removed by hand
  • The knoc's firewall is not the one the host is set up for, such as Windows on a Linux agent, or the knoc is attached to the wrong agent

Steps to Resolve

Check the Host

On the agent host:

knocker status egress

It shows each firewall egress is set up on. With none, it names each firewall and why the host cannot run it.

Enable Egress Allowlisting

  1. Install or enable what the status says is missing, such as pf (doas pfctl -e)
  2. Preview the change: doas knocker enable egress --dry-run
  3. Apply it: doas knocker enable egress
  4. enable restarts the agent. If the agent was not running, start it: doas rcctl start knocknoc_agent

On Windows

There is nothing to enable. Open the agent's page in Knocknoc and check it shows egress as set up. If it does not, check the Knocknoc Agent service logs on as Local System, as #EGR002 describes, and that the Windows Defender Firewall service (mpssvc) is running.

Confirm the Knoc's Firewall and Agent

Open the knoc in Knocknoc and check the agent it is attached to is the bastion you set up, and that its Firewall is one the agent's page lists as set up.