# Editing Network rule creates ufw duplicates

**Project:** Bugs | **Board:** Planned | **Votes:** 6
**URL:** https://roadmap.ploi.io/projects/7-bugs/items/838-editing-network-rule-creates-ufw-duplicates-and-cant-be-deleted

---

E.g

When creating a Network rule via UI, it creates the following rule:
`ufw allow from 10.131.34.164 to any port 3306 proto tcp comment 'joshua'`

When we edit the rule, it creates another one with the old way without the protocol:
`ufw allow from 10.131.34.164 to any port 3306 comment 'mysql-joshua'`

When deleting the rule, it deletes the original one while the one without protocol and updated comment is left behind.

---

## Comments

**Cristian Balan** (2023-10-25T22:22:35+00:00):
I have updated the description.

**Cristian Balan** (2024-05-08T12:57:44+00:00):
Update: I have edited an existing rule and it created the duplicate rule due to the bug. However, this time when I have deleted the rule from the UI, both rules remained in place on the server (logs say: "Could not delete non-existent rule").

This has security implications in both cases, when editing to update an IP and creating the unintended duplicate, as well as when deleting the rule as it doesn't.

**Cristian Balan** (2024-06-02T21:24:42+00:00):
This goes hand in hand with https://roadmap.ploi.io/projects/7-bugs/items/1038-add-web-worker-ip-to-the-ufw-rules-when-updating-default-network-ssh-rule

**Cristian Balan** (2025-01-30T09:13:06+00:00):
This is still an issue and makes everything we see in Server > Network unreliable and presents a risk. In fact it is a mess... :(

