Design of an Ideal Personal Firewall

Common conceptintegrity of modules (component protection). In this
This paragraph describes common concept ofcase the firewall allows malicious code to damage or
Windows personal firewalls. It is not necessary toreplace files of privileged applications. If such application
implement the firewall in a similar way to have itis about to run its modules are verified and the
secure. Common personal firewall is implemented asexecution is stopped or reported to the user. The file
three or four separate components.protection is also needed for all system files.
Kernel driverDriver protection
The first part is kernel driver. Its has two mainWindows operating systems trust its drivers. This
functions and that is why it is sometimes implementedmean that every code that is run by the driver is
in two components rather than in one. The firsttrusted and thus it is allowed to execute even
function is a packet filter. Usually on the NDIS, TDI orprotected processor's instruction and has potential
both levels this driver checks every packet thataccess to all system resources. This is why it is
comes in from the network or goes out to thenecessary to implement a part of security software
network. This is also known as inbound and outboundlike personal firewall as a system driver. However, it is
connection protection. There exist some personalalso why it is necessary to control loading of new
firewalls that do not implement neither inbound nordrivers and to protect existing drivers. Malicious
outbound connection protection. However, theseprograms must not be able to install drivers or modify
products also have kernel drivers because of theiralready loaded drivers.
second function. The second function is calledService protection
sandbox. The most common methods of the sandboxSince a part of the firewall is usually implemented as a
implementation are SSDT hooks and SSDT GDIsystem service the protection of system services is
hooks. The driver of the firewall replaces somealso necessary. But it is not only the firewall
system functions with its own code that verifies thecomponent that has to be protected. To install a new
rights of calling application and either denies the actionservice is easy way for malware how to persist in the
or passes the execution to original code. Thesesystem because system services can be set to run
methods allows the firewall to control all the possibleevery system start. What is more, a malicious service
dangerous activity of applications such as attempts tocan be dangerous also because it runs even if no user
open files, processes, registry keys, modify firewallis logged on. Creation, deletion and control of system
settings, automatically respond to its queries etc.services must be protected actions.
System serviceRegistry protection
There are special user mode processes called systemWindows registry contains a lot of important system
services. These processes have special functions andinformation. Settings of system components can be
behaviour in the system. They run under privilegedchanged using the registry. An incorrect modification of
system user rather than under common user account.some registry objects can easily cause system to
This fact allows services to run independently of userbecome unstable or unable to boot. There are many
and they run also when no user is logged in. The roleregistry keys and values that should be protected
of service in the personal firewall is to secure theagainst modifications of malicious applications.
communication between main components. TheProtection of other system resources
service receives messages from the GUI and fromThere are also different system resources and
the kernel driver and forwards this messages to eachobjects in Windows operating systems. Some of them
other. For example if the firewall is in the learningcan be dangerous if they are controlled by malware.
mode, the driver code in hooked SSDT function mayOne of these objects is a well known section
be unable to decide whether to allow or deny the'DevicePhysicalMemory' which can be used to gain the
action because there is no corresponding rule for thecomplete control of the system if it is not protected.
action in the database. In such case it wants the userThe firewall must protect those objects that can be
to decide. This requires to send a message to GUI tomisused by malware.
show the dialog and to receive the answer from it.Parent process control
This communication is usually implemented through theWe already know that it is necessary to protect
service component. The service of the firewall isprivileged processes. Probably the easiest way how to
sometimes used to ensure that the GUI is alwaysimplement process protection is to control opening of
available for the user.processes and threads. However, if the process
Graphical user interfaceprotection is implement in this way it is also important
The graphical user interface (GUI) is the user part ofto implement Parent process control. Every process in
the firewall. It often implements a trayicon from whichthe system has to be created by some other process
the administration of the firewall is available. Another- its parent. The parent is always given two handles
important function of the GUI is to ask user for thewhen new it creates child process. These are handle
decision of actions when the firewall is in the learningto the process object and handle to its main thread.
mode.The given process handle is opened with a full access
Self-protectionand thus the parent process can control its child
This is rule no. 1 for all security products, not only forcompletely. This is why the firewall must restrict the
personal firewalls. No matter the perfection of otherexecution of privileged processes. Moreover, the
features, if the firewall is not able to secure itself it isparent process control should be implemented even if
useless. If a malicious activity is able to switch off,the firewall security design does not protect processes
disable or destroy the personal firewall it is equivalentvia control of opening of processes and threads.
not to have any personal firewall at all. All parts of theSome privileged processes can be misused to
firewall have to be protected including its processes,execute privilege action if they are run with specific
files, registry entries, drivers, services and other systemcommand line arguments. Many firewalls do not
resources and objects.distinguish between the execution of privileged and
Verification of own componentsunprivileged processes. They restrict the process
The verification of own components is very close tocreation in general such that only those applications
the above mentioned Self-protection. Firewalls arethat were selected before are able to create child
usually complex programs and they are oftenprocesses.
implemented in more than one module or component.Control of automatically started programs
In such case there are a few main modules that areThe firewall should protect those places in the
executed by the operating system. During the startupoperating system that can be used by malware to
or in the middle of run these modules loads otherpersist in the system after the reboot. If we allow
modules of the firewall. We say that the modules areusers to run new unknown applications then there is no
loaded dynamically. It is necessary to check thechance to protect the system against executing
integrity of all dynamically loaded modules. This impliesmalicious application. And users often download and
that the integrity checker must be implemented in oneinstall or run new applications. The firewall is able to
of the main modules.restrict actions of malicious applications such that they
Inbound and outbound protectionare not able to damage the system. However, if the
A good personal firewall offers both inbound andmalware application persists in the system it can
outbound protection. The inbound protection meansdamage it later when a new security bug is
that packets sent from the Internet or local areadiscovered. This is why the firewall should control
network to your computer are filtered and only portsthose applications that are run automatically e.g. after
that you want to be open are accessible. Thisevery system start or user logon.
protection is standard and is very good and reliable inSniffing protection
almost all personal firewalls. On the other hand is theSpyware like keyloggers or packet sniffers are
outbound protection which cause problems to alldangerous applications because they are made to
vendors nowadays. The outbound protection meanssteal the most sensitive data users can have - their
that only applications that are allowed to can accesspasswords. But not only passwords are targets of
the Internet or local area network. This is not as simplethese applications. Personal information, personal
as it looks. Imagine the situation that you want tocorrespondence or business documents are also
browse the Internet with your Internet browser andsensitive information that must be protected. The
that you do not want other applications to do so. Thefirewall has to protect sensitive data not only when
problem here is that it is not enough only to checkthey are complete in form of files but also when they
which application wants to send the packet to theare made or being transferred. Keyloggers can
Internet because modern operating systems allowsreceive every key stroke user makes and thus
programs to communicate. An application that is notassemble the whole information letter by letter. Packet
allowed to access the Internet can start the browsersniffers are waiting for the messages to be
and use it for the communication. Your personaltransferred using some network interface and they
firewall has to protect all those privileged applicationsmake copies of sent messages. There are many
against misusing by malware. It has to restrict theways how to implement spyware programs to collect
access them. But this is still not enough. The personalsensitive data and all of them have to be protected by
firewall has to protect itself. Malicious applicationsthe firewall.
should not be able to switch it off or modify its rules.Protection of system resources
This means that it also has to protect systemEvery system has limited resources. Windows
resources etc. There are many problems in this andworkstations are able to deal with a few thousands of
we still talk only about one feature - the outboundobjects. This number is sufficient for every work of
protection.common users. However, if a malicious program
Process protectioncreates thousands of threads the system become
Every privileged process must be protected againstunusable and such an action cause Denial of service
several dangerous actions. Firstly, no malicious(DoS). The firewall should limit unprivileged applications
application can terminate the process. Secondly, it mustto cause DoS. There should be a limit set for number
not be possible to modify its code or data. Thirdly, itof threads, open files, used memory and other system
must not be possible to execute any code in aresources used by unprivileged applications.
context of any privileged process. This point alsoNo ring3 hooks
includes DLL injection.The ring3 (or usermode) hooking is a technique that
File and component protectioncan be use to implement a personal firewall or its
The protection of files is very close to Processparts. However, ring3 hooks can be used only for
protection. If a malicious code is able to replace files ofspecial features and never for security critical features.
privileged applications it is equivalent to modify theirA protection implemented by ring3 hooks can be easily
code flow when they run. There are two ways howbypassed by malicious applications. Ring3 hooks must
to implement the protection of files. The first waynot be used to restrict behaviour of unknown
(active protection) is to prevent write and deleteapplications. They can be used very rarely to modify
access to files that belong to privileged applications.or control the behaviour of privileged applications that
Because this can be hard to implement many firewallare guaranteed not to bypass ring3 hooks.
coders choose the second way - to check the