BullDog: Generation 7

A comprehensive and progressive firewall

Military Strength, Flexible, Configurable,

and Reliable

This software is NOT associated with any other Bulldog product found on the internet.

 

Bulldog is a powerful but lightweight firewall for heavy use systems. With many features, this firewall can be used by anyone who wants to protect his/her systems.

This system allow dynamic and static rules sets for maximum protection and has several advance features.

This firewall will work for the hobbyist or a military base. Generation 7 is a complete rewrite and redesign from scratch and still evolving.

Be prepared to spend some time setting this up. If you are looking for a "quick fix", then you are on the wrong site. BullDog is NOT a quick fix, but rather one step in a complete security policy.

Its is covered by the GPL and is FREE and always will be. I encourage and welcome anyone who wants to port and/or provide ideas/code to better this software.

I would like to see this software developed into a new breed of firewall that provides the best of security with ease of use.

This software was developed on Linux v2.2.16-17 and v2.4 with 64 megs to 1 Gig of RAM and supports iptables via the ip_queue kernel module. Bulldog will NOT run on Windows systems.

Please be sure to read this page carefully. There are many aspects to Bulldog that can be confusing. Below are details instructions. If you have any questions or comments, please feel free to e-mail me by clicking here.

 

Important Changes:

IMPORTANT: MAJOR UPGRADE! BullDog's collector has undergone a major upgrade. Please read the updated information carefully and BACKUP ALL PREVIOUS copies of BullDog (source and the /sbin/bulldog directory) before attempting to work with this version. Copy your bulldog.conf to your root directory or some other safe and secure area. Erase ALL files in /sbin/bulldog and /sbin/bulldog/Work after shutting dowm BullDog but before you install the new version.

This web page IS the documentation. Be sure to print this web page. I decided to go this way for speed of production. I audited my server logs and found that 1000's of people rely on this software as part of their security policy. As such, timeliness is critical.


Be sure you inspect the define statements in the bulldog.h file. Many of these settings can and need be tweaked for your system, especially the DYNAMIC if you have a dynamic ip based system such as dial-up or DHCP. Feed back is appreciated on these routine as it is difficult for me to test these functions.

The pcap library is no longer used by BullDog. BullDig now requires the libipq library from the iptables (netfilter) package. As always, iptables (and now libipq) must be installed and your kernel (the ip_queue module must be available or compiled into the kernel) setup properly. Consult the NetFilter Site for further information and instructions.

Promiscuous operations have been removed as the libipq method provides this without the associated risks and concerns concern with having a NIC in promiscuous mode.

Dynamic addresses are now supported. This is a compile time feature and must be enabled by uncommenting the #define DYNAMIC line in the bulldog.h file. A recompile is neccessary to use the new functions.

With the new collector/processor method, dynamic IP address systems should perform as well as static IP address systems.

A new module has been added to validdate IP addresses in the DNS database. The validator handles active traffic only. This is based on the BIND 9 Administrator's manual, max_cache_ttl. Bind defaults to 7 days a a cache ttl, BullDog uses 3 days as a ttl to maintain absolute up-to-date information on active IP traffic.

The DNS Database now has two modes: Research and Non-Research or Active. This is controlled by the usage of the DNS Spider module. See below for the DNSSPIDER define statement.

BullDog now has a scan only define (in bulldog.h) that will allow all aspects of BullDog to run without actually blocking IP addresses. This enhancement increases testing and diagnostics productivity in a safe environment. It is also very important to use the SCANONLY mode to build your initial DNS Database if you plan on using domain name based rules to prevent false blocks.

Downloads:

BullDog.tar.bz2 (REQUIRED), updated: Tuesday, October 18, 2005 at 11:17:50 PM

DNS Database, 392,893,544 entries, updated: Thursday, October 18, 2007 at 03:58:45 AM

WGET or LFTP are the ONLY agents can be used to fetch the raw DNS database (Research). It has grown well beyond feasible limits to try to compress. Using this method means the DNS database is updated in real time.

The DNS Database is NOT REQUIRED.

If you do NOT install the DNS-Database, BullDog will build a new one based upon the traffic to your system and its internal domain spider. The internal domain spider now defaults to off. Using the domain spider tells BullDog to build a research database as well as the active database.

 

Installation:
Step-by-step description. These descriptions are here for the new or novice users of BullDog. Experts already know what to do. Linux commands (press enter after each command)
1. Download the above listed files to a safe area like /usr/src  
2. Make a directory under /sbin called bulldog. Make sure ONLY root can read this directory.

mkdir /sbin/bulldog

chown root:root /sbin/bulldog

chmod 700 /sbin/bulldog

3.Change to the bulldog directory. cd /sbin/bulldog
4. Copy the BullDog.tar.bz2 file to the current directory. cp /usr/src/BullDog.tar.bz2 /sbin/bulldog
5. Unpack the BullDog.tar.bz2 file.

bzip2 -d BullDog.tar.bz2

tar -xf BullDog.tar

6. Pick a drive large that can hold at LEAST 5 gigs of data. Note that the current DNS database is 20 GIGS. You should always double your estimated value at the very minimum. This is for a symbolic link to the DNS database. I'll use /home as an example. This areas can be user readable based upon Administrator preference.

mkdir /home/dns

ln -sf /home/dns /sbin/bulldog/dns

7. Inspect the bulldog.h defines. Be sure they are as you want them (see below for an indepth description). Compile the source in debug mode to be sure it compiles clean on your system. Debug mode will report unused variables, ignore these. They will go away shorly as I continue to clean up the code.

7a. Only AFTER you have checked that it compiles AND you have made your initial configuration, use COMPILE instead of DEBUG.

Before making any changes to the code, always make a backup copy of the original. Things can always go wrong, including simple typing errors.

./DEBUG

or

./COMPILE

 

Now comes the hard part. BullDog needs to be configured to run properly.

Configuration is perhaps the most difficult part and will most likely require the most time.

This is the most important tip: KNOW YOUR SYSTEM.

System Requirements: LINUX (NOT WINDOWS), 64 megs of ram (Recommended at least 256 megs of ram), at least 5 megs disk space (This size is a rough estimate of an IP traffic based DNS Database), IPTABLES and LIBIPQ. These numbers are for BullDog without the current DNS Database. The DNS Database on my system is a RESEARCH database. A non-research database will NOT be this large. If you want the current DNS Database, then the minimum is 256 megs of ram and AT LEAST 20 GIGS of disk space.

Operator requirements: PATIENCE, a good amount of time to study your system, pen and paper for notes. PRINT this web page for quick and easy reference.

IMPORTANT: BullDog does NOT come with a configuration, YOU must provide a configuration for YOUR machine... A sample file however is provided. The InitFW script MUST be modified for YOUR system.

Below is a complete list of defines that can and should be adjusted/inspected from the bulldog.h file (not neccessarily in the same order) and a detailed description of them:

DEBUG

Debugging enabled:

#define DEBUG

Debugging Disabled (default):

//#define DEBUG

This option puts BullDog in diagnostics mode. It effects all modules and causes BullDog to display lots of information to the screen.

DYNAMIC

Use dynamic IP addresses:

#define DYNAMIC

Use static IP addresses (default):

//#define DYNAMIC

This option tells BullDog that it will run on a dialup or DHCP system where the user does not know what IP address will be issued. This causes BullDog to determin what the IP address(es) are and use extra code to keep track on them.

SCANONLY

Passive Operations:

#define SCANONLY

Active (IP blocking enabled, default):

//#define SCANONLY

This option tells BullDog to do all normal operations, including loogging, but NOT actually block an IP address. This is very useful is testing the configuration or testing BullDog itsself with no negitive effects to your system. This option is also useful for first time users to build the initial DNS database.

DNSSPIDER

Build research DNS Database:

#define DNSSPIDER

Do NOT build the research
database (default):

//#define DNSSPIDER

This option controls BullDog's DNS Database and how it will be managed. If the dns spider is enabled, BullDog builds a research version. The research version can grow quite large, and currently requires 20 GIGS of disk space.

If the dns spider is NOT enabled, BuildDog builds a DNS Database using IP traffic only. The resulting database is significantly smaller. Testing has suggested around 5 MEGS. Milage WILL vary though as it is based on YOUR actual traffic.

DShield

Send last hour's logs:

#define DShield

No communications to DShield (default):

//#define DShield

This option tells BullDog that once an hour it will send attack data to the DShield.org website. This sys is a member of DShield and supports law enforcement ridding the internet of crimal hackers (crackers). This option is disabled on dynamic IP systems.

For this to work, you must have a DShield user ID. See DSUSER.

DSUSER

If you have a DShield ID:

#define DSUSER "<id number>"

If you do not have a number (default):

//#define DSUSER ""

This is for DShield usage only. The user ID is sent via email when you sign up to DShield.

I openly recommend and encourage participating in the DShield community.

MAXTHREADS

Default settings:

#ifdef DYNAMIC
#define MAXTHREADS 16
#define MAXRESOLVERS 3
#define MAXDNSQ 3
#define MAXVAL 3
#else
#define MAXTHREADS 40
#define MAXRESOLVERS 12
#define MAXDNSQ 12
#define MAXVAL 12
#endif

This is the number of packet processors, too many can cause a dead lock, too few can cause packet overload and dropped packets. Research indicates 40 seems to be a good value for a heavily loaded 1Mbps pipe.

NOTE: This number will be different for static and dynamic systems. The way I have found that seems to work is using the top command and watching the %CPU item. Milage will vary. If your system is sluggish, this value may be too high. You should see no difference in system operations.

MAXRESOLVERS

This is the number of resolvers spawned for the DNS database refresh engine. 12 is a confortable number for 1Mbps pipe.

See note for MAXTHREADS. This value should not be as high as MAXTHREADS.

MAXDNSQ

This is the number of DNS Queue resolvers for the packet processors. I find a log value of 12 or better to be good for 1Mbps pipe.

See note for MAXTHREADS. This value should not be as high as MAXTHREADS.

MAXVAL

This is the number of DNS Validators for the packet processors. I find a log value of 12 or better to be good for 1Mbps pipe. Typically this value may be equal to or larger then MAXDNSQ.

See note for MAXTHREADS. This value should not be as high as MAXTHREADS.

 

Example Configuration File: /sbin/bulldog/bulldog.conf (Heavily Commented)
# BullDog Configuration

# Blank lines are ignored

# This is a comment. Use them generously.

# A new feature to BullDog is Lists. Lists allow you to define groups
# that can replace several rules with one rule. Lists can only be used in rules.

L kernel 20-21 any
L mmedia 2828 6170-7171 1755 8000-9000 1075 3155 9010 16792

# Internal or local addresses. These addresses are your IP assignments.

# BullDog will IGNORE these addresses when traffic is to AND from them.

# ie: traffic from 11.22.33.44 to/from 127.0.0.1 will NOT be scanned. USE WITH CARE.

# Local Host. This is a HEAVILY RECOMMEND line.
# It must be the ONLY internal address if DYNAMIC is defined in bulldog.h
I 127.0.0.1

# Be sure to put YOUR'S here,. STATIC IP SYSTEMS ONLY.
I 11.22.33.44

# Rules - all 5 parts are required.

# These are the rules for what is ALLOWED.
# If its not here, its NOT allowed into the system.

# The entry is as follows:

# R - Rule
# 11.22.33.44 -- Source Address
# 80 - Source Port, in this case, the WWW
# any - Destination address, allow to any destination
# 1024-65535 - Destination Port - only allow this range, the word ANY equals this range
# t - Only allow TCP, u for UDP, I for ICMP, may br combined, ie tu
# If an ! is at the end of the line, then the rule is ONE WAY from source to dest.

# This first rule allows all traffic to/from the web server
R 11.22.33.44 80 any 1025-65535 t

# This rule allows all traffic destines to/from an inside system to an outside web server
R 11.22.33.44 any any 80 t

# Use the above model for any port/IP combination you want allowed

# For DNS Services. Remember, ANY in the port means 1024-65535.

R 11.22.33.44 53 any any tu
R 11.22.33.44 any any 53 tu

# The below is required if you have MicroSoft Windows on your LAN
# and its an excellent example of domain usage in the rules

R 11.22.33.44 123 time.windows.com any tu

# These lines are required for basic operations. This prevents internal problems.

# For the LocalHost. Not neccessary if you use the I command.
# This is ONE WAY because both source and destination are the same
R 127.0.0.1 0-65535 127.0.0.1 0-65535 tui!

# My external IP address(s)
R 11.22.33.44 any 11.22.33.44 any tui!

# Using the above L command in a rule.
# Lists need to be used with care as they can open holes that you do NOT want.
# Lists are a powerful feature. On my system, I reduced my rules from 294 to 17 with Lists.

R 11.22.33.44 any 204.152.189.116 $kernel tu

# Another example of using lists
# Common multimedia/misc ports

R 63.230.33.209 $mmedia any any tu
R 63.230.33.209 any any $mmedia tu

# Banned list, This can be an IP address or partial domain name

# The below bans every site that has the word click in it.
B click

 

After you have examined your system and configured the bulldog.conf file, Be sure to adjust the /sbin/bulldog/InitFW script to your system. Be sure to add these command to your start up scripts only AFTER extensive testing.

DNS Database count by zone, updated Thursday, October 18, 2007 at 03:58:45 AM.

ZoneCount
377,672
410,503,450
69
810,162
122,882,549
134,687
15416,328
16207,722
17103,097
18103,815
19155
2046,097
2411,944,656
253
32245,604
335
348
3539,850
38127,113
4060,280
4150,985
431,368,555
4413,335
451,730
472,619,729
5286
5334
5511,486
562,169
5710,082
581,099,724
591,623,505
607,904,303
614,961,043
626,186,155
635,258,135
646,352,401
656,967,728
668,967,037
678,913,382
6812,369,841
697,545,054
706,136,399
711,969,060
72778,427
73323
74529,420
75547,146
76393,948
77299,622
78139,916
79252,118
809,033,804
819,745,828
828,621,417
836,945,032
845,085,485
851,250,250
86747,964
87976,308
88806,176
89687,692
90369,065
91357,484
921,024
9630,896
9727,315
9851,388
9913,171
11611,781
1171,065
1185,728
12186,339
122181,837
12337,012
124203,707
1251,327,255
12616,776,664
1271
1282,304,487
1291,897,608
1301,941,476
1311,286,936
132828,149
133477,637
1341,378,844
1353,610,109
136458,481
1371,006,257
138756,240
139782,121
140771,179
1411,308,191
142848,230
143704,965
1441,749,537
1457,284,532
1461,136,691
147667,286
1481,938,652
149687,997
150869,999
1512,705,322
152938,259
153132,901
154167,115
155875,747
156291,482
157392,776
158898,136
159764,173
160646,196
1611,510,450
162313,055
163984,207
164621,745
165868,789
1662,802,311
167426,358
168759,373
169249,737
170349,280
171209,901
1725,574,182
1881,001
1891,243,183
190435,057
192885,988
1931,741,151
1942,208,453
1952,766,049
196328,005
1981,026,283
1991,080,539
2005,825,419
2012,993,442
2022,722,240
2033,420,587
2041,404,773
2051,043,207
2061,831,990
2073,162,084
2082,205,484
2094,391,647
2103,623,775
2111,797,948
2124,546,530
2135,342,392
21419,632
215514
2165,907,858
2176,310,846
2185,909,548
21910,361,413
2207,976,130
2218,160,442
2222,264,169
224174
22816,110,688
23016,726,802
23116,512,657
233516
2551
Total392,893,544

Degenerates of the internet: BUSTED!

(This list contains Hackers, Spammers,
Virus infected computers and/or anyone
I don't want connecting to my machine)

(Updated every hour)


Saturday, July 04, 2009 at 04:03:13 AM

Sites protected by BullDog:

Path of Jesus Web Services
The Peshitta, the Aramaic Bible
Pelican Consulting
Christian Evangelisation Worldwide
Falcon Lawn


Do you run BullDog and want your site listed?
E-mail me.

 

The DOG HOUSE (Rants and Gripes):

Its RANT time again! I think it is pretty pathetic the Microsoft requires national news coverage from CNN or FOX News to remind their customers of the "Infamous Black Tuesday time-to-patch day." Are M$ admins and users that damned stupid that they have to be TOLD to update their systems???? What has the computer age come to when a product vender makes national news each and every month to have people using their software update the damned thing????

This situation is deplorable and pathetic when one thinks about the large volume of software users in this country alone that do NOT need for its users to be reminded to fix their broken pile of junk. COME ON PEOPLE, pull your heads out of the ether and fix the damned thing already. The last thing I want to hear on the news is about the millions of stupid people that shouldn't own a computer if they can't keep it up-to-date. Latest spam statistics show the U.S. has the LARGEST population of spam-zombie computers world-wide. WHY? If you're too stupid to keep it up to date, put the damned thing back in the box and send it back to the store/manufacturer OR be a RESPONSIBLE computer user and LEARN how to keep it up to date. They have DUMMY books for everything else, maybe someone should print a dummies book on updates and why they are needed! That way we can get this damned crap off the morning news and get some REAL news about world.

Keep on top of hackers activities and viruses with these excellent security sites:

(A MUST visit):

Fighting for a ThiefWare Free Web

Computer Incident Advisory Capability

DShield (This System is a proud member, join and help fight the Blacks Hats)

Zone-H, see what the Black Hats have been doing

ClamScan: AntiVirus software for Linux

AntiVir: Excellent AntiVirus software

LavaSoftUSA (SpyWare Remover)


Find weaknesses in your system security with these great tools:

nmap.


Other excellent resources:

Linux Online (lists BullDog)

Linux Questions (lists BullDog)

Savanah (part of GNU) (hosts BullDog)

AntiOnline (Vote for BullDog)

Internet Traffic Report

DSL Reports


All pictures on this site were collected from (supposedly) free and public resources. However, if there is a copyrighted image on this site, please let me know and I will correct it as quickly as possible.
All advertisments at the bottom of this page do not reflect the views of the author.
They are only to help offset the costs of maintaining this site.

BullDog Firewall © 1999-2006 Robert Aloysius Peter Matthias Darin.
All Rights Reserved.
This page was last updated on Friday, 06-Jul-2007 15:59:07 CDT
Your Ad Here