A method and apparatus are disclosed for analyzing the operation of one or more
network gateways, such as firewalls or routers, that perform a packet filtering
function in a network environment. Given a user query, the disclosed firewall analysis
tool simulates the behavior of the various firewalls, taking into account the topology
of the network environment, and determines which portions of the services or machines
specified in the original query would manage to reach from the source to the destination.
The relevant packet-filtering configuration files are collected and an internal
representation of the implied security policy is derived. A graph data structure
is used to represent the network topology. A gateway-zone graph permits the firewall
analysis tool to determine where given packets will travel in the network, and
which gateways will be encountered along those paths. In this manner, the firewall
analysis tool can evaluate a query object against each rule-base object, for each
gateway node in the gateway-zone graph that is encountered along each path between
the source and destination. A graphical user interface is provided for receiving
queries, such as whether one or more given services are permitted between one or
more given machines, and providing results. A spoofing attack can be simulated
by allowing the user to specify where packets are to be injected into the network,
which may not be the true location of the source host-group.