Rewriting firewall rules