Firewall rules are not cleaned up properly #19

Closed
opened 2026-07-04 13:43:48 +01:00 by danny · 8 comments
danny commented 2026-07-04 13:43:48 +01:00 (Migrated from gitlab.keyop.co.uk)

When a process is killed it is unable to clean up firewall rules on exit.
We also do not record enough information in the rule comments to be able to identify rules relating the specific queue we're handling in order to remove them on startup.

We should record the queue number with the iptables rule comment, and on first startup should remove any rules relating to this particular queue. That removes the need for external manual cleanup of iptables rules.

When a process is killed it is unable to clean up firewall rules on exit. We also do not record enough information in the rule comments to be able to identify rules relating the specific queue we're handling in order to remove them on startup. We should record the queue number with the iptables rule comment, and on first startup should remove any rules relating to this particular queue. That removes the need for external manual cleanup of iptables rules.
danny commented 2026-07-04 13:48:32 +01:00 (Migrated from gitlab.keyop.co.uk)

Current script which performs cleanup of the rules on startup is at https://gitlab.keyop.co.uk/danny/scripts/-/blob/master/nfqctl?ref_type=heads

Current script which performs cleanup of the rules on startup is at https://gitlab.keyop.co.uk/danny/scripts/-/blob/master/nfqctl?ref_type=heads
danny commented 2026-07-04 14:22:34 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in commit 9871067144

mentioned in commit 9871067144f05cecc09c406293b9fb3ec47c5366
danny commented 2026-07-04 14:22:46 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in merge request !57

mentioned in merge request !57
danny (Migrated from gitlab.keyop.co.uk) closed this issue 2026-07-04 14:27:36 +01:00
danny commented 2026-07-04 14:27:37 +01:00 (Migrated from gitlab.keyop.co.uk)

Merge seems to work Ok, and the ordering concerns in the MR do not seem to be a problem.

Closing.

Merge seems to work Ok, and the ordering concerns in the MR do not seem to be a problem. Closing.
danny commented 2026-07-04 14:30:54 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in commit 2e09fff4a9

mentioned in commit 2e09fff4a99b6257552c5a5642bc45383ec3c499
danny commented 2026-07-04 14:32:46 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in commit danny/scripts@082b4c942f

mentioned in commit danny/scripts@082b4c942f91aadd1441dcfbeae531a1fec7c629
danny commented 2026-07-06 07:42:15 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in commit 80fd9d6922

mentioned in commit 80fd9d69226cfbdda60a609cbcea0f5a0cfb9a77
danny commented 2026-07-06 07:42:16 +01:00 (Migrated from gitlab.keyop.co.uk)

mentioned in commit ebace5f679

mentioned in commit ebace5f67981a64d31e64ca91d0ad4c5e4e7ca4b
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
keyop-go/nfq_forwarder#19
No description provided.