Tool for generating optimized firewall rules