Firewalls are one of the most widely used mechanisms against security threats in distributed andnetwork systems.However, principled methodologies for firewall extraction policies have been scarcely investigated so far.We introduce a new model for translating low level firewall rules into higher abstraction level rules which allow for the inference of firewall policies. In order to do so, we introduced a new methodology based on rules' decorrelation algorithms that compute hierarchical firewall policies from lower level firewall rules. Further, we define a new effective model for the explicit extraction of blacklisted and whitelisted hosts and networks.