Skip to main content

EGR400 - Invalid Response From the Egress Firewall

Uploading.Agent error code #EGR400 indicates that the agent ran the egress firewall's command to read its rules, and the command failed or returned output the agent could not parse. The agent reads nftables as JSON, iptables through iptables-save, and pf through pfctl -s rules.. On Windows the agent reads the knoc's rule from Windows Firewall, and this code means Windows returned something the agent did not expect, or the rule's Local principals could not be read.

The agent reports it when it lists the accounts a knoc admits (during a resync or Validate integration), and when it gathers the host's egress setup for the agent's page in Knocknoc.

Common causes include:

    The installed nft was built without JSON support A wrapper script sits on the PATH ahead of the real binary and prints output of its own The read ran out of time on a host with a very large ruleset, or while another process held the iptables lock The nftables set holds an element the agent cannot read back

    Steps to Resolve

    Run the Read as the Agent

    Firewall Command nftables sudo -u knocknoc-agent sudo -n nft -j list set inet filter knocknoc_egress_users, naming the knoc's users set iptables sudo -u knocknoc-agent sudo -n iptables -w -t filter -S <chain>, naming the knoc's chain pf doas -u _knocknoc-agent doas -n pfctl -a 'knocknoc_egress/*' -s rules

    A refusal, an error, or anything printed before the rules is the cause.

    On Windows, run Get-NetFirewallRule -DisplayName "<rule>" | Get-NetFirewallSecurityFilter in PowerShell, naming the knoc's rule. Its LocalUser must start with D: or with O: and G: followed by D:. The agent log, in C:\Program Files (x86)\Knocknoc-Agent\logs by default, has the error.

    Check the Version

      nftables egress needs nft 0.9.4 or later with JSON support: if nft -j list tables errors, the build needs replacing Check iptables --version reports a release rather than a wrapper's own text

      Confirm You Are Running the Real Binary

      Run command -v nft, command -v iptables or command -v pfctl and check it points at the system binary.