DShield Framework Clients



Please read "Guidelines for Developing DShield Client Software" at
http://www.dshield.org/specs.php

OVERVIEW

This directory contains the development files for the DShield "framework"
client system. Use this to develop a new DShield parser or to modify an
existing parser. The idea is that all the "framework" code for the
different parsers is contained in one file so that all DShield clients that
are developed using this system will have a common set of operating
instructions.

This is a simple system. All the code for the client, except for the log
parser, is contained in 'framework.pl.' Individual parsers for specfic
firewalls are contained in *.parser files. e.g. iptables.parser will
be concatenated with framework.pl to make iptables.pl. iptables.pl
is the script that is used to convert iptables based logs.

FILES TO WATCH OUT FOR

build_clients.pl does this conversion.

package_clients.pl assumes that build_clients.pl was just run and makes
tarballs for all the clients. Each tarball will consist of

If you are going to develop a new parser, please develop using
this arrangement and send the .parser file in to DShield. We will add the
.parser file to our copy of the framework development kit and
generate a new tarball for distribution. And a new Framework Development
Kit that will now contain your parser.

If you find problems with existing parsers, please submit changes as a
separate parser, not as a modified version of the final script.
(i.e., Don't send in a modified version of iptables.pl.)

REQUIREMENTS FOR THE PARSER

The parser should accept a log line and convert it to DShield format. Look
at the existing ipchains.parser or iptables.parser files (or whatever
parser is most familiar to you) to get an idea on how this works and what
variables are used, etc. Try it with a small sample log file so
that you will know what is in the log (and what to expect to see
in the output.)

The development process should be something like: Work on your
parser file. Then use build_clients.pl to assemble it
into a working script. Have some sort of test.cnf configuration file
available. Execute it with some sort of "wrapper" script.
See http://www.dshield.org/clients/framework/README.php for instructions
and hints about testing and configuration.

DOCUMENT YOUR PARSER IN THE HEADING BLOCK

The beginning of the parser should contain comments to document how to
configure the script for the firewall that this particular parser is
designed to parse. This section should be formatted like

Each comment line must start with a "#" character. Keep the line
length less than 80 characters, please. Do not have any blank
lines in this section. At the ending of this section have

my $PARSER_VERSION = "2002-01-25";

with the date in "YYYY-MM-DD" format. ($PARSER_VERSION is used to identify
the parser in the subject line of the email that is sent
to report@dshield.org.) Then have a blank line.

The package_clients.pl script that assembles the scripts from the *.parser
files and framework.pl will treat all lines until the first blank line
as the heading. The heading portion of the parser will be put
at the beginning of the .pl file. The remainder of the parser will be
appended to the end of the .pl file. This heading will be appended to the
README.txt that is put in each tarball so that it is customized for each
individual parser. All the headings are concatenated and appended to
DEVELOPER.txt that is put in the Framework Developemt Kit and is displayed
at http://www.dshield.org/clients/framework/DEVELOPER.php

The main point here is that everything before the first blank line
is treated as the heading. Comments and $PARSER_VERSION go in the heading.

REGULAR EXPRESSIONS ARE THE HEART OF THE PARSER

Most of the existing parsers use one, or more, regular expressions to pick
the relevent portions out of the log line that is being converted.
See http://www.dshield.org/regex.php for documentation
on how regular expressions are used for log parsing.

TEXT2HTML

A Text2HTML script is included that will convert ASCII text files to HTML.
This isn't really needed for writing a framework client, but I included
it because I use it to make the web site version of the document
files. This is a lot easier authoring system than fooling around with SGML
or XML. YMMV.

http://www.dshield.org/clients/framework/README.php was made by
processing the http://www.dshield.org/clients/framework/README.txt file
that is in this distribution with the text2html.pl script that is in
this distribution.

The Text2HTML script came from http://peter.verhas.com/progs/perl/text2html/
I tweaked it a bit so it would work with these text documention files the way
I formatted them.

WHERE TO SEND YOUR WORKING PARSER

When you get it working, send the .parser file (and a
sample log file, please) to info@dshield.

DOCUMENTATION FOR ALL PARSERS

GLOBAL VARIABLES THAT THE PARSERS SHOULD USE