Skip to main content

EGR100 - Failed to Remove Egress Access

Agent error code #EGR100 indicates that the agent could not take away a local account's egress access when a grant ended: on nftables, removing the uid from the knoc's users set, and on iptables, rewriting the knoc's chain without its rules. The account may still be able to reach the knoc's destinations.

The grant was written with its expiry (a timeout on nftables, --datestop on iptables), so the kernel stops admitting the account on time even when this delete fails. The exposure is for a grant ended early, by a revoke or a logout, where the timeout is still running. An account that is already gone is not an error: the kernel often drops it at expiry before the revoke arrives.

On Windows a grant is an exception for the account on the knoc's outbound Block rule, and this code means Windows refused the change that removes it. A firewall rule has no expiry, so the account keeps its access until the exception is gone.

Common causes include:

  • A firewall reload replaced the ruleset at the same moment
  • nft returned an error the agent did not recognise
  • The agent lost its sudo permission for nft or iptables-restore after the grant was made

Steps to Resolve

Check Whether the Account Is Still Admitted

Run knocker status egress. It lists the accounts each users set or chain allows right now and when each expires.

Remove It by Hand if Needed

On nftables, with the family, table and name the knoc's Users set gives:

sudo nft delete element inet filter knocknoc_egress_users '{ <uid> }'

On iptables, delete each rule commented knocknoc:<knoc id>:<uid> from the knoc's chain: sudo iptables -S KNOCKNOC_EGRESS_1 lists them, one per destination, and sudo iptables -D KNOCKNOC_EGRESS_1 followed by the rest of a line removes it.

Take the account's uid from id -u <account>.

On Windows

Open the knoc's rule in Windows Defender Firewall with Advanced Security, go to Properties > Local principals and remove the account from Exceptions. The agent log, in C:\Program Files (x86)\Knocknoc-Agent\logs by default, has the error Windows returned.

Check nft Permission

sudo -u knocknoc-agent sudo -n nft list tables should succeed. If it does not, see #EGR002.