MITRE Honeyclient Project > HoneyClient-Manager > HoneyClient::Manager::FW

Download:
HoneyClient-Manager-0.99.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source  

NAME ^

HoneyClient::Manager::FW - Perl module to remotely handle firewall rule/chain creation and deletion which will provide network connectivity for the honeyclients during crawling. Additionally, it will provide protection when the honeyclients become compromised by enabling static rate limiting(tcp/udp/icmp) and MAC address filtering.

VERSION ^

This documentation refers to HoneyClient::Manager::FW version 0.99.

SYNOPSIS ^

CREATING THE SOAP SERVER

  # Make sure HoneyClient::Util::Config loads properly
use HoneyClient::Util::Config qw(getVar);

# Make sure IPTables::IPv4 loads use IPTables::IPv4;

# Make sure HoneyClient::Manager::FW can load use HoneyClient::Manager::Firewall::FW;

# Make sure HoneyClient::Util::SOAP loads properly require_ok('HoneyClient::Util::SOAP');

package HoneyClient::Manager::Firewall::FW; use HoneyClient::Util::SOAP qw(getClientHandle getServerHandle); my $daemon = getServerHandle(); $daemon->handle;

The SOAP firewall server will boot up when the honeywall is started by the HoneyClient manager. The main directory that holds all the listener code is the /hc directory. startFWListener.pl is located in the /etc/rc.d/rc3.d directory and will boot up when the honeywall starts up in run level three. After start up, the firewall listener will await calls from the HoneyClient manager so that the firewall may be configured properly and dynamically updated when crawling begins.

Steps to get honeyclient listening:

1. Boot up honeyclient honeywall vmware image. 2. Start up our SOAP firewall and SOAP log listener /usr/bin/perl /hc/startFWListener.pl > /dev/null 2> /dev/null & These will start upon boot of the honeywall so you will not have to do anything except boot the image. 3. Now the firewall is listening for all SOAP client calls 4. Do a "ps -xf" to confirm that your firewall is listening It should show something like: 7580 pts/0 S 0:01 /usr/bin/perl /hc/startFWListener.pl 5. Make your FW calls now from honeyclient-client.pl.

INTERACTING WITH SOAP SERVER

 use HoneyClient::Util::SOAP qw(getClientHandle);
 use HoneyClient::Util::Config qw(getVar);

After the honeywall boots up, startFWListerner.pl will be executed and begin listening. From here we want to start interacting with our SOAP FW server.

 # Create a new SOAP client, to talk to the HoneyClient::Manager::FW module
 # @initlist will contain all the return values sent back from the server (PID of startFWListerner.pl on server and status message)
 #  Lets set our default honeyclient ruleset:
  my $stub = getClientHandle(namespace => "HoneyClient::Manager::FW");
  my $som = $stub->fwInit();
  my @initlist = $som->paramsall;
  print "$_\n" foreach (@initlist);

 # To dynamically append new rules to the iptables ruleset, do the following
$hashref = this data structure will be passed from the manager to the HoneyClient::Manager::FW

 $som = $stub->addRule( $hashref );
 print $stub->result;
 print "\n";

# To dynamically delete rules, all you need to do is delete the user-defined chain that was originally created.

$som = $stub->deleteChain( $hashref ); print $stub->result; print "\n";

# To get the status of the current iptables ruleset, this function prints to hard disk the working iptables ruleset $som = $stub->getStatus(); print $stub->result; print "\n";

# For all new VM's that we plan to add later on, we will have to add new VM chains: $som = $stub->addChain( $hashref); print $stub->result; print "\n";

 # To shutdown the Firewall SOAP listner on the Honeywall
$som = $stub->FWShutdown();
print $stub->result;
print "\n";

DESCRIPTION ^

Once created, the daemon acts as a stand-alone SOAP server, processing individual requests from the HoneyClient manager and manipulating the IPTables ruleset on the transparent virtual honeywall.

# This package name. our $PACKAGE = __PACKAGE__; our $DAEMON_PID : shared = undef; # Complete URL of SOAP server, when initialized. our $URL_BASE; our $URL; our $UPTIME = "/usr/bin/uptime";

BEGIN {

        # Defines which functions can be called externally.
        require Exporter;
        our ( @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $VERSION );

        # Set our package version.
        $VERSION = 0.99;

        @ISA = qw(Exporter);

        # Symbols to export automatically
        @EXPORT =
          qw( _parseHash _validateInit init_fw destroy_fw _doFullBackup _flushChains _setAcceptPolicy _setDefaultDeny _set_log_rules _setstaticrate _setDefaultRules _remoteConnection _set_ip_forwarding _getpid);

        # Items to export into callers namespace by default. Note: do not export
        # names by default without a very good reason. Use EXPORT_OK instead.
        # Do not simply export all your public functions/methods/constants.

        # This allows declaration use HoneyClient::Manager::FW ':all';
        # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
        # will save memory.

        %EXPORT_TAGS = ( 'all' => [qw(init_fw destroy_fw)], );

        # Symbols to autoexport (when qw(:all) tag is used)
        @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );

        $SIG{PIPE} = 'IGNORE';    # Do not exit on broken pipes.
}

EXTERNAL SOAP FUNCTIONS ^

SEE ALSO ^

http://www.honeyclient.org/trac

SOAP::Lite, SOAP::Transport::HTTP

http://www.soaplite.com

IPTables::IPv4

Net::DNS

IPTables Perl API http://sourceforge.net/projects/iptperl/

Data::Dumper, English, Proc::ProcessTable, FileHandle

http://www.honeyclient.org/trac

REPORTING BUGS ^

http://www.honeyclient.org/trac/newticket

ACKNOWLEDGEMENTS ^

Derrik Pates for providing the IPTables perl API code and to the sourceforge perl API mailing list for providing detailed support about the IPTables::IPv4 module.

AUTHOR ^

JD Durick, <jdurick@mitre.org>

Xeno Kovah, <xkovah@mitre.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2007 The MITRE Corporation. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.