A firewall is used to isolate and protect your computer from unwanted communcation from the outside to the inside and from the inside to the outside.
The program we use for our personal firewall is ZoneAlarm. There are other firewalls. We like ZoneAlarm for several reasons.
Normally a firewall is used as a defense against hackers gaining entrance into your computer. Given the massive security holes that Microsoft continues to leave in their software it is not a bad idea to take steps to protect yourself. A firewall will help. Look here for a brief review of ZoneAlarm
But how does a firewall help protect against a virus? We can't answer for all firewalls, but we can tell you how ZoneAlarm will help.
The first bit of protection afforded by ZoneAlarm is a thing they call Mail Attachment Quarantine. If you receive an email with an exe file attachment ZoneAlarm will quarantine the file so that it is not accidentally activated.
"When an attachment is detected, ZoneAlarm quarantines it by changing the extension to .ZL and ends with either a letter or number. For example, a file called SERVER.VBS will be renamed SERVER.ZL1.
"When you double-click on a quarantined file, ZoneAlarm asks whether or not you would like to open the attachment. At this point, you can choose to open the attachment, to delete the e-mail, or to check further on the validity of the e-mail and the attachment.
"MailSafe does not automatically delete files attached to your e-mails and it is not a virus scanner. Rather than scanning and deleting viruses, it quarantines the attachment file and gives you the opportunity to keep the identified .VBS program from running. Visual Basic Script files can only cause damage when they are allowed to run on your machine."
Given some of the sneaky methods viruses are using to con you into clicking on them this little dash of cold water in the face can be just the thing to save you from disaster.
Another valuable protection afforded by ZoneAlarm works through the fundamental definition of a firewall. Since the firewall blocks communication, when a virus tries to "call home" or make direct internet connection ZoneAlarm will alert you to the new program trying to use the internet and give you a chance to allow or deny this connection. This is the feature which told us we had a worm.
If our virus definitions were up-to-date this would not have been needed. But our virus definitions were a month too old, we got a worm and it tried to call home to download its buddy program to trash out computer. ZoneAlarm stopped it. Concequenly we like ZoneAlarm.