<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>divisionbyzero &#187; security</title>
	<atom:link href="http://divisionbyzero.net/blog/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://divisionbyzero.net/blog</link>
	<description>question . authority</description>
	<lastBuildDate>Tue, 06 Jul 2010 16:43:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Statistics, Risk Analysis, and Misunderstandings</title>
		<link>http://divisionbyzero.net/blog/2010/06/11/statistics-risk-analysis-and-misunderstandings/</link>
		<comments>http://divisionbyzero.net/blog/2010/06/11/statistics-risk-analysis-and-misunderstandings/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 14:55:05 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[risk management]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://divisionbyzero.net/blog/?p=172</guid>
		<description><![CDATA[I married a Statistician, so this article sums the lectures I receive on a daily basis.  Risk Management is statistical analysis, and I&#8217;m not sure how many folks in IT Security have Graduate level Stat exposure.  So, the understanding of our statistical shortcomings is key.  You need to read that entire article, twice. This statement [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste">I married a Statistician, so <a title="Your intuition is not magic" href="http://lesswrong.com/lw/2bu/your_intuitions_are_not_magic/" target="_blank">this article</a> sums the lectures I receive on a daily basis.  Risk Management is statistical analysis, and I&#8217;m not sure how many folks in IT Security have Graduate level Stat exposure.  So, the understanding of our statistical shortcomings is key.  You need to read that entire article, twice.</div>
<div></div>
<div id="_mcePaste">This statement struck me, as I&#8217;ve noticed a scary trend in IT Security:</div>
<blockquote>
<div id="_mcePaste">&#8220;People who know a little bit of statistics &#8211; enough to use statistical techniques, not enough to understand why or how they work &#8211; often end up horribly misusing them.  Statistical tests are complicated mathematical techniques, and to work, they tend to make numerous assumptions. The problem is that if those assumptions are not valid, most statistical tests do not cleanly fail and produce obviously false results.&#8221;</div>
</blockquote>
<div id="_mcePaste">As we outsource more security, and buy more products, we must be careful, as this statement is also true:</div>
<blockquote>
<div id="_mcePaste">&#8220;People who know a little bit of <em>IT Security</em> &#8211; enough to use an <em>IDS or SIEM</em>, not enough to understand why or how they work &#8211; often end up horribly misusing them.  <em>Security tools</em> use <em>complicated technical techniques</em>, and to work, they tend to make numerous assumptions. The problem is that if those assumptions are not valid, most security tools do not cleanly fail and produce obviously false results.&#8221;</div>
</blockquote>
<div>My wife&#8217;s constant guidance in Statistics has been invaluable to my evaluations of IT Security Policy and Implementation.  When I came across this article thanks to <a title="alexhutton" href="http://twitter.com/alexhutton" target="_blank">@alexhutton</a>, I had to share it!</div>
]]></content:encoded>
			<wfw:commentRss>http://divisionbyzero.net/blog/2010/06/11/statistics-risk-analysis-and-misunderstandings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using POE to hook syslog-ng</title>
		<link>http://divisionbyzero.net/blog/2009/07/02/using-poe-to-hook-syslog-ng/</link>
		<comments>http://divisionbyzero.net/blog/2009/07/02/using-poe-to-hook-syslog-ng/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 23:21:13 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[perl5]]></category>
		<category><![CDATA[poe]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[syslog]]></category>
		<category><![CDATA[syslog-ng]]></category>

		<guid isPermaLink="false">http://divisionbyzero.net/blog/?p=121</guid>
		<description><![CDATA[A massively code heavy post on integrating syslog into in house applications using syslog-ng and Perl's amazing POE Event Framework to do really crazy things!]]></description>
			<content:encoded><![CDATA[<p>Being able to do analysis, sorting, or database storage of syslog messages is incredibly useful.  There are tons of solutions on the market to do just that.  If you&#8217;re working on a system developed in house that you&#8217;d like to incorporate syslog messages into, then it may be easier to hook directly into the syslog stream than to introduce another piece of software into the environment which needs to be glued.</p>
<p>Syslog-ng facilitates easy integration with Perl binaries as the Perl program is spawned once during the daemon start up and a handle to that program&#8217;s STDIN is maintained for dispatching of messages.  Using POE, we can turn this into an event driven model, making additional complexity simple.</p>
<p>In this example, we&#8217;ll create a POE Master session that receives all of the syslog-ng input from STDIN.  Using off the shelf components, we&#8217;ll run a TCP Server on port 9514 that will allow clients to connect and subscribe to feeds based on the &#8220;program&#8221; name of the message being dispatched.<br />
<span id="more-121"></span><br />
Anytime I&#8217;m using Regular Expressions over and over, I like to &#8220;precook&#8221; them.  This compiles the regular expression, and lets the engine skip that step each time they&#8217;re used.  Doing so is simply a matter of declaring the regex with the <code>qr//</code> operator:</p>
<pre class="brush: perl;">
my %cooked = (
	program =&gt; qr/\s+\d+:\d+:\d+\s+\S+\s+([^:\s]+)(:|\s)/,
);
</pre>
<h2>Initialization</h2>
<p>Next we&#8217;ll create the administrative session in charge of dispatching the messages to the proper channels:</p>
<pre class="brush: perl;">
# Dispatcher Master Session
POE::Session-&gt;create(
	inline_states =&gt; {
		_start					=&gt; \&amp;dispatcher_start,
		_stop					=&gt; sub { print &quot;SESSION &quot;, $_[SESSION]-&gt;ID, &quot; stopped.\n&quot;; },
		register_client			=&gt; \&amp;register_client,
		subscribe_client		=&gt; \&amp;subscribe_client,
		hangup_client			=&gt; \&amp;hangup_client,

		dispatch_message		=&gt; \&amp;dispatch_message,
	},
);
</pre>
<p>We&#8217;ll define those subroutines shortly, but we need to setup the rest of our sessions.  Next, we&#8217;ll need a TCP Server to handle the client connections, we can get that using <code>POE::Component::Server::TCP</code>:</p>
<pre class="brush: perl;">
# TCP Session Master
POE::Component::Server::TCP-&gt;new(
		Alias		=&gt; 'server',
		Address		=&gt; '127.0.0.1',
		Port		=&gt; 9514,

		ClientConnected		=&gt; \&amp;client_connect,
		ClientInput			=&gt; \&amp;client_input,

		ClientDisconnected	=&gt; \&amp;client_term,
		ClientError			=&gt; \&amp;client_term,

		InlineStates		=&gt; {
			client_print		=&gt; \&amp;client_print,
		},
);
</pre>
<p>The final session will handle the Input on STDIN from syslog-ng:</p>
<pre class="brush: perl;">
# Syslog-ng Stream Master
POE::Session-&gt;create(
		inline_states =&gt; {
			_start		=&gt; \&amp;stream_start,
			_stop		=&gt; sub { print &quot;SESSION &quot;, $_[SESSION]-&gt;ID, &quot; stopped.\n&quot;; },
			stream_line		=&gt; \&amp;stream_line,
		},
);
</pre>
<p>Now we have to define the subroutines that we&#8217;ll be dispatching events to.  The heavy lifting is done by POE, and we&#8217;re left to handle simple things.</p>
<h1>Session Routines: <code>dispatcher</code></h1>
<p>This session is going to managing which clients receive which messages.  The actual input is handled by the <code>stream</code> session, and the sending of the messages to the client by the <code>server</code> session.  As we have a raw <code>POE::Session</code>, our first subroutine <code>dispatcher_start</code> is just going to do some basic preparation:</p>
<pre class="brush: perl;">
sub dispatcher_start {
	my ($kernel, $heap) = @_[KERNEL, HEAP];

	$kernel-&gt;alias_set( 'dispatcher' );  # allow named dispatch to this session.

	$heap-&gt;{subscribers} = {};
        $heap-&gt;{clients} = {};

}
</pre>
<p>Next event to be handled is the <i>register_client</i> event which is fired anytime a connection is established to the <code>server</code> session.  All the dispatcher does is register it&#8217;s session_id into an internal heap.  Nothing happens with it, but if we needed to send a message to all clients, we could loop over this hash and broadcast message.</p>
<pre class="brush: perl;">
sub register_client {
    # ARG0 =&gt; TCP Client Session ID
    my ($kernel,$heap,$sid) = @_[KERNEL,HEAP,ARG0];

    $heap-&gt;{clients}{$sid} = 1;
}
</pre>
<p>Clients can subscribe to a program name, which they do by entering &#8220;<code>sub dhcpd, dnsmasq</code>&#8221; into the TCP Server.  It&#8217;s not fancy, but man is it convenient for debugging and development purposes.  The <code>server</code> session determines that the subscription is occurring and passes it&#8217;s argument string to the <code>dispatcher</code> session via the <i>subscribe_client</i> event.  This subroutine is called:</p>
<pre class="brush: perl;">
sub subscribe_client {
    # ARG0 =&gt; SID of Client
    # ARG1 =&gt; Argument String of the subscribe
	my ($kernel,$heap,$sid,$argstr) = @_[KERNEL,HEAP,ARG0,ARG1];

    # Split the input at commas or spaces into words:
	my @progs = map { lc } split /[\s,]+/, $argstr;
    # Add the SID to the list of Subscribed Clients for that program
	foreach my $prog (@progs) {
		$heap-&gt;{subscribers}{$prog}{$sid} = 1;
	}

    # Inform the client they've subscribed via client_print
	$kernel-&gt;post( $sid =&gt; 'client_print' =&gt; 'Subscribed to : ' . join(', ', @progs ) );
}
</pre>
<p>If a client disconnects, we remove it from the message dispatching hash:</p>
<pre class="brush: perl;">
sub hangup_client {
    # ARG0 =&gt; SID of Client Disconnecting
	my ($kernel,$heap,$sid) = @_[KERNEL,HEAP,ARG0];

	delete $heap-&gt;{clients}{$sid};

	foreach my $p ( keys %{ $heap-&gt;{subscribers} } ) {
		delete $heap-&gt;{subscribers}{$p}{$sid}
			if exists $heap-&gt;{subscribers}{$p}{$sid};
	}
}
</pre>
<p>Now comes the most important event the dispatcher handles, <i>dispatch_message</i>.  In this event, we have a message from syslog-ng that needs to go to interested parties.  This event determines the &#8220;program&#8221; and it&#8217;s subscribers and sends that message along appropriately:</p>
<pre class="brush: perl; highlight: [14];">
sub dispatch_message {
    # ARG0 =&gt; The raw message from syslog-ng
	my ($kernel,$heap,$msg) = @_[KERNEL,HEAP,ARG0];

    # Determine the program name
	if( my ($program) = map { lc } ($msg =~ /$cooked{program}/) ) {
		# remove the sub process and PID from the program
		$program =~ s/\(.*//g;
		$program =~ s/\[.*//g;

        # If we have subscribers, send them the message.
		if( exists $heap-&gt;{subscribers}{$program} ) {
			foreach my $sid (keys %{ $heap-&gt;{subscribers}{$program} }) {
				$kernel-&gt;post( $sid =&gt; 'client_print' =&gt; $msg );
			}
		}
}
</pre>
<p>You'll notice on line 14 above, the <code>post( $sid => client_print => $msg )</code> sends the event to the appropriate client and calls the <i>client_print</i> event on itself.  This is all the dispatcher needs to do.  The rest is handled by other other sessions.</p>
<h1>Session Routines: <code>server</code></h1>
<p>This session accepts new tcp clients and handles writing to the sockets.  We'll take a look at a few subroutines here.  Fist we'll look at the <i>ClientConnect</i> event.</p>
<pre class="brush: perl;">
sub client_connect {
    # SESSION is the client's session object
	my ($kernel,$heap,$ses) = @_[KERNEL,HEAP,SESSION];

	my $SID = $ses-&gt;ID;

    # Register the Client with the Dispatcher
	$kernel-&gt;post( 'dispatcher' =&gt; 'register_client' =&gt; $SID );

    # Store the current entry for 'client' in the heap so we can communicate later
	$heap-&gt;{clients}{ $SID } = $heap-&gt;{client};

	# Say hello to the client.
	$heap-&gt;{client}-&gt;put( &quot;Hello Client: $SID&quot; );
}
</pre>
<p>We also need a <i>disconnect</i> event:</p>
<pre class="brush: perl;">
sub client_term {
	my ($kernel,$heap,$ses) = @_[KERNEL,HEAP,SESSION];
	my $sid = $ses-&gt;ID;

    # Delete the Client's Dispatch Table
	delete $heap-&gt;{dispatch}{$sid};
    # Tell the dispatcher session we're through
	$kernel-&gt;post( 'dispatcher' =&gt; 'hangup_client' =&gt;  $sid );
}
</pre>
<p>Next we&#8217;ll handle sending message to the client, which is incredibly easy:</p>
<pre class="brush: perl;">
sub client_print {
    # ARG0 =&gt; Message to Send to the Client
	my ($kernel,$heap,$ses,$mesg) = @_[KERNEL,HEAP,SESSION,ARG0];

	$heap-&gt;{clients}{$ses-&gt;ID}-&gt;put($mesg);
}
</pre>
<p>Now we a routine to handle the <i>ClientInput</i> event.  This event will take commands from the clients and do something with them.  We&#8217;ll use an internal dispatch table in the form of a hash to handle translating commands.  This will allow us to expand our API if we need to.</p>
<pre class="brush: perl; highlight: [12,13,14,15,34,36];">
sub client_input {
    # SESSION is the Client Session Object with input
    # ARG0 =&gt; Input waiting from that client
	my ($kernel,$heap,$ses,$msg) = @_[KERNEL,HEAP,SESSION,ARG0];
	my $sid = $ses-&gt;ID;

    # Build a Dispatch Table if one does not exists in the heap for this entry.
	if( !exists $heap-&gt;{dispatch}{$sid} ) {
		$heap-&gt;{dispatch}{$sid} = {

			subscribe		=&gt; {
				re			=&gt; qr/^sub(?:scribe)? (.*)/,
				callback	=&gt; sub {
					$kernel-&gt;post( 'dispatcher' =&gt; 'subscribe_client' =&gt; $sid, shift );
				},
			},
            # FUTURE API for Clients receiving every message!
			#fullfeed		=&gt; {
			#	re			=&gt; qr/^(fullfeed)/,
			#	callback	=&gt; sub {
			#		$kernel-&gt;post( 'dispatcher' =&gt; 'fullfeed_client' =&gt; $sid );
			#	},
			#},
		};
	}

	#
	# Check for messages:
	my $handled = 0;
    # Get Our Dispatch Table
	my $dispatch = $heap-&gt;{dispatch}{$sid};
    # Look up and take action according to our dispatch table
	foreach my $evt ( keys %{ $dispatch } ) {
		if( my($args) = ($msg =~ /$dispatch-&gt;{$evt}{re}/)) {
			$handled = 1;
			$dispatch-&gt;{$evt}{callback}-&gt;($args);
			last;
		}
	}

    # Inform the client that their command was not understood.
	if( !$handled ) {
		$kernel-&gt;post( $sid =&gt; 'client_print' =&gt; 'UNKNOWN COMMAND, Ignored.' );
	}
}
</pre>
<p>That&#8217;s the most complicated routine in the program, but it does allow us to morph the dispatch tables for individual clients.  Lines 12-15 build a dispatch table entry with the regular expression to match the command, followed by a callback subroutine reference which handles the command.  Lines 34 and 36 are where these rules are applied to the input from the client.</p>
<h1>Session Routines: <code>stream</code></h1>
<p>The last session is very simple.  This session maintains the connection to STDIN from syslog-ng and dispatches those lines as events to the <code>dispatcher</code> session.  There is a startup routine:</p>
<pre class="brush: perl;">
sub stream_start {
	my ($kernel, $heap) = @_[KERNEL, HEAP];

	$kernel-&gt;alias_set( 'stream' );

	#
	# Initialize the connection to STDIN as a POE::Wheel
	my $stdin = IO::Handle-&gt;new_from_fd( \*STDIN, 'r' );
	my $stderr = IO::Handle-&gt;new_from_fd( \*STDERR, 'w' );

	$heap-&gt;{stream} = POE::Wheel::ReadWrite-&gt;new(
		InputHandle		=&gt; $stdin,
		OutputHandle	=&gt; $stderr,
		InputEvent		=&gt; 'stream_line',
	);
}
</pre>
<p>And the <i>stream_line</i> event which sends the incoming syslog messages to the <code>dispatcher</code> session for processing:</p>
<pre class="brush: perl;">
#--------------------------------------------------------------------------#
sub stream_line {
    # ARG0 =&gt; Line from STDIN, New line delimited.
	my ($kernel,$msg) = @_[KERNEL,ARG0];

	return unless length $msg;

	$kernel-&gt;post( 'dispatcher' =&gt; 'dispatch_message' =&gt; $msg );

}
</pre>
<h1>Setting it up with syslog-ng</h1>
<p>If we store our POE program in <code>/usr/local/bin/poe-syslog-ng.pl</code>, in the syslog-ng.conf we need to specify it as a program:</p>
<pre class="brush: plain;">
#
# Subscriber Feeds
destination d_subscribers {
	program(&quot;/usr/local/bin/poe-syslog-ng.pl&quot;);
};
</pre>
<p>Then you can feed it based on filters, just like the rest of the <code>destination</code> macros in syslog-ng:</p>
<pre class="brush: plain;">
#
# SUBSCRIPTION SERVICE:
log { source(s_ext); source(s_udp); filter(f_database); destination(d_subscribers); };
</pre>
<h1>The whole #! </h1>
<p>For those interested, I&#8217;ve written a program that expands this example with enhanced functionality.  The full source is available here:</p>
<pre class="brush: perl; collapse: true; light: false; toolbar: true;">
#!/usr/bin/perl
#
# This is the POE Master Server.
#  1) Take all the syslog input
#  2) Listen for parsers
#  3) Filter streams to parsers
#  TODO: 4) Maintain Parser State, restarting on crash

use strict;
use warnings;

use Socket;
use Regexp::Common qw(net);

sub POE::Kernel::ASSERT_DEFAULT (){ 1 }
#sub POE::Kernel::TRACE_DEFAULT (){ 1 }
use POE qw(
	Wheel::ReadWrite
	Component::Server::TCP
);

my %cooked = (
	program =&gt; qr/\s+\d+:\d+:\d+\s+\S+\s+([^:\s]+)(:|\s)/,
);

#--------------------------------------------------------------------------#
# POE Session Initialization

# Dispatcher Master Session
POE::Session-&gt;create(
	inline_states =&gt; {
		_start					=&gt; \&amp;dispatcher_start,
		_stop					=&gt; sub { print &quot;SESSION &quot;, $_[SESSION]-&gt;ID, &quot; stopped.\n&quot;; },
		register_client			=&gt; \&amp;register_client,
		subscribe_client		=&gt; \&amp;subscribe_client,
		unsubscribe_client		=&gt; \&amp;unsubscribe_client,
		fullfeed_client			=&gt; \&amp;fullfeed_client,
		dispatch_message		=&gt; \&amp;dispatch_message,
		broadcast				=&gt; \&amp;broadcast,
		hangup_client			=&gt; \&amp;hangup_client,
		server_shutdown			=&gt; \&amp;server_shutdown,
		debug_client			=&gt; \&amp;debug_client,
		nobug_client			=&gt; \&amp;nobug_client,
		debug_message			=&gt; \&amp;debug_message,
	},
);

# TCP Session Master
POE::Component::Server::TCP-&gt;new(
		Alias		=&gt; 'server',
		Address		=&gt; '127.0.0.1',
		Port		=&gt; 9514,

		ClientConnected		=&gt; \&amp;client_connect,
		ClientInput			=&gt; \&amp;client_input,

		ClientDisconnected	=&gt; \&amp;client_term,
		ClientError			=&gt; \&amp;client_term,

		InlineStates		=&gt; {
			client_print		=&gt; \&amp;client_print,
		},
);

# Syslog-ng Stream Master
POE::Session-&gt;create(
		inline_states =&gt; {
			_start		=&gt; \&amp;stream_start,
			_stop		=&gt; sub { print &quot;SESSION &quot;, $_[SESSION]-&gt;ID, &quot; stopped.\n&quot;; },

			stream_line		=&gt; \&amp;stream_line,
			stream_error	=&gt; \&amp;stream_error,
		},
);

#--------------------------------------------------------------------------#

#--------------------------------------------------------------------------#
# POE Main Loop
POE::Kernel-&gt;run();
exit 0;
#--------------------------------------------------------------------------#

#--------------------------------------------------------------------------#
# POE Event Functions
#--------------------------------------------------------------------------#

#--------------------------------------------------------------------------#
sub debug {
	my $msg = shift;
	chomp($msg);
	$poe_kernel-&gt;post( 'dispatcher' =&gt; 'debug_message' =&gt; $msg );
	print &quot;[debug] $msg\n&quot;;
}
#--------------------------------------------------------------------------#
sub dispatcher_start {
	my ($kernel, $heap) = @_[KERNEL, HEAP];

	$kernel-&gt;alias_set( 'dispatcher' );

	$heap-&gt;{subscribers} = { };
	$heap-&gt;{full} = { };
	$heap-&gt;{debug} = { };
}

#--------------------------------------------------------------------------#
sub register_client {
	my ($kernel,$heap,$sid) = @_[KERNEL,HEAP,ARG0];

	$heap-&gt;{clients}{$sid} = 1;
}

#--------------------------------------------------------------------------#
sub debug_client {
	my ($kernel,$heap,$sid) = @_[KERNEL,HEAP,ARG0];

	if( exists $heap-&gt;{full}{$sid} ) {  return;  }

	$heap-&gt;{debug}{$sid} = 1;
	$kernel-&gt;post( $sid =&gt; 'client_print' =&gt; 'Debugging enabled.' );
}

#--------------------------------------------------------------------------#
sub nobug_client {
	my ($kernel,$heap,$sid) = @_[KERNEL,HEAP,ARG0];

	delete $heap-&gt;{debug}{$sid}
		if exists $heap-&gt;{debug}{$sid};
	$kernel-&gt;post( $sid =&gt; 'client_print' =&gt; 'Debugging disabled.' );
}

#--------------------------------------------------------------------------#
sub fullfeed_client {
	my ($kernel,$heap,$sid) = @_[KERNEL,HEAP,ARG0];

	#
	# Remove from normal subscribers.
	foreach my $prog (keys %{ $heap-&gt;{subscribers} }) {
		delete $heap-&gt;{subscribers}{$prog}{$sid}
			if exists $heap-&gt;{subscribers}{$prog}{$sid};
	}

	#
	# Turn off DEBUG
	if( exists $heap-&gt;{debug}{$sid} ) {
		delete $heap-&gt;{debug}{$sid};
	}

	#
	# Add to fullfeed:
	$heap-&gt;{full}{$sid} = 1;

	$kernel-&gt;post( $sid =&gt; 'client_print' =&gt; 'Full feed enabled, all other functions disabled.');
}

#--------------------------------------------------------------------------#
sub subscribe_client {
	my ($kernel,$heap,$sid,$argstr) = @_[KERNEL,HEAP,ARG0,ARG1];

	if( exists $heap-&gt;{full}{$sid} ) {  return;  }

	my @progs = map { lc } split /[\s,]+/, $argstr;
	foreach my $prog (@progs) {
		$heap-&gt;{subscribers}{$prog}{$sid} = 1;
	}

	$kernel-&gt;post( $sid =&gt; 'client_print' =&gt; 'Subscribed to : ' . join(', ', @progs ) );
}
#--------------------------------------------------------------------------#
sub unsubscribe_client {
	my ($kernel,$heap,$sid,$argstr) = @_[KERNEL,HEAP,ARG0,ARG1];

	my @progs = map { lc } split /[\s,]+/, $argstr;
	foreach my $prog (@progs) {
		delete $heap-&gt;{subscribers}{$prog}{$sid};
	}

	$kernel-&gt;post( $sid =&gt; 'client_print' =&gt; 'Subscription removed for : ' . join(', ', @progs ) );
}

#--------------------------------------------------------------------------#
sub hangup_client {
	my ($kernel,$heap,$sid) = @_[KERNEL,HEAP,ARG0];

	delete $heap-&gt;{clients}{$sid};

	foreach my $p ( keys %{ $heap-&gt;{subscribers} } ) {
		delete $heap-&gt;{subscribers}{$p}{$sid}
			if exists $heap-&gt;{subscribers}{$p}{$sid};
	}

	if( exists $heap-&gt;{debug}{$sid} ) {
		delete $heap-&gt;{debug}{$sid};
	}

	if( exists $heap-&gt;{full}{$sid} ) {
		delete $heap-&gt;{full}{$sid};
	}

	debug(&quot;Client Termination Posted: $sid\n&quot;);

}

#--------------------------------------------------------------------------#
sub stream_start {
	my ($kernel, $heap) = @_[KERNEL, HEAP];

	$kernel-&gt;alias_set( 'stream' );

	#
	# Initialize the connection to STDIN as a POE::Wheel
	my $stdin = IO::Handle-&gt;new_from_fd( \*STDIN, 'r' );
	my $stderr = IO::Handle-&gt;new_from_fd( \*STDERR, 'w' );

	$heap-&gt;{stream} = POE::Wheel::ReadWrite-&gt;new(
		InputHandle		=&gt; $stdin,
		OutputHandle	=&gt; $stderr,
		InputEvent		=&gt; 'stream_line',
		ErrorEvent		=&gt; 'stream_error',
	);
}

#--------------------------------------------------------------------------#
sub stream_line {
	my ($kernel,$msg) = @_[KERNEL,ARG0];

	return unless length $msg;

	$kernel-&gt;post( 'dispatcher' =&gt; 'dispatch_message' =&gt; $msg );

}

#--------------------------------------------------------------------------#
sub stream_error {
	my ($kernel) = $_[KERNEL];

	debug(&quot;STREAM ERROR!!!!!!!!!!\n&quot;);
	$kernel-&gt;call( 'dispatcher' =&gt; 'server_shutdown' =&gt; 'Stream lost' );
}

#--------------------------------------------------------------------------#
sub server_shutdown {
	my ($kernel,$heap,$msg) = @_[KERNEL,HEAP,ARG0];

	$kernel-&gt;call( dispatcher =&gt; 'broadcast' =&gt; 'SERVER DISCONNECTING: ' . $msg );
	$kernel-&gt;call( 'server' =&gt; 'shutdown' );
	exit;
}

#--------------------------------------------------------------------------#
sub client_connect {
	my ($kernel,$heap,$ses) = @_[KERNEL,HEAP,SESSION];

	my $KID = $kernel-&gt;ID();
	my $CID = $heap-&gt;{client}-&gt;ID;
	my $SID = $ses-&gt;ID;

	$kernel-&gt;post( 'dispatcher' =&gt; 'register_client' =&gt; $SID );

	$heap-&gt;{clients}{ $SID } = $heap-&gt;{client};
	#
	# Say hello to the client.
	$heap-&gt;{client}-&gt;put( &quot;EHLO Streamer (KERNEL: $KID:$SID)&quot; );
}

#--------------------------------------------------------------------------#
sub client_print {
	my ($kernel,$heap,$ses,$mesg) = @_[KERNEL,HEAP,SESSION,ARG0];

	$heap-&gt;{clients}{$ses-&gt;ID}-&gt;put($mesg);
}

#--------------------------------------------------------------------------#
sub broadcast {
	my ($kernel,$heap,$msg) = @_[KERNEL,HEAP,ARG0];

	foreach my $sid (keys %{ $heap-&gt;{clients} }) {
		$kernel-&gt;post( $sid =&gt; 'client_print' =&gt; $msg );
	}
}
#--------------------------------------------------------------------------#
sub dispatch_message {
	my ($kernel,$heap,$msg) = @_[KERNEL,HEAP,ARG0];

	foreach my $sid ( keys %{ $heap-&gt;{full} } ) {
		$kernel-&gt;post( $sid =&gt; 'client_print' =&gt; $msg );
	}

	if( my ($program) = map { lc } ($msg =~ /$cooked{program}/) ) {
		# remove the sub process and PID from the program
		$program =~ s/\(.*//g;
		$program =~ s/\[.*//g;

		debug(&quot;DISPATCHING MESSAGE [$program]&quot;);

		if( exists $heap-&gt;{subscribers}{$program} ) {
			foreach my $sid (keys %{ $heap-&gt;{subscribers}{$program} }) {
				$kernel-&gt;post( $sid =&gt; 'client_print' =&gt; $msg );
			}
		}
		else {
			debug(&quot;Message discarded, no listeners.&quot;);
		}
	}
	else {
			debug(&quot;Message discarded, format not understood.&quot;);
	}
}

#--------------------------------------------------------------------------#
sub debug_message {
	my ($kernel,$heap,$msg) = @_[KERNEL,HEAP,ARG0];

	foreach my $sid (keys %{ $heap-&gt;{debug} }) {
		$kernel-&gt;post( $sid =&gt; 'client_print' =&gt; '[debug] ' . $msg );
	}
}

#--------------------------------------------------------------------------#
sub client_input {
	my ($kernel,$heap,$ses,$msg) = @_[KERNEL,HEAP,SESSION,ARG0];
	my $sid = $ses-&gt;ID;

	if( !exists $heap-&gt;{dispatch}{$sid} ) {
		$heap-&gt;{dispatch}{$sid} = {
			fullfeed		=&gt; {
				re			=&gt; qr/^(fullfeed)/,
				callback	=&gt; sub {
					$kernel-&gt;post( 'dispatcher' =&gt; 'fullfeed_client' =&gt; $sid );
				},
			},
			subscribe		=&gt; {
				re			=&gt; qr/^sub(?:scribe)? (.*)/,
				callback	=&gt; sub {
					$kernel-&gt;post( 'dispatcher' =&gt; 'subscribe_client' =&gt; $sid, shift );
				},
			},
			unsubscribe 	=&gt; {
				re			=&gt; qr/^unsub(?:scribe)? (.*)/,
				callback	=&gt; sub {
					$kernel-&gt;post( 'dispatcher' =&gt; 'unsubscribe_client' =&gt; $sid, shift );
				},
			},
			debug 	=&gt; {
				re			=&gt; qr/^(debug)/i,
				callback	=&gt; sub {
					$kernel-&gt;post( 'dispatcher' =&gt; 'debug_client' =&gt; $sid, shift );
				},
			},
			nobug 	=&gt; {
				re			=&gt; qr/^(no(de)?bug)/i,
				callback	=&gt; sub {
					$kernel-&gt;post( 'dispatcher' =&gt; 'nobug_client' =&gt; $sid, shift );
				},
			},
			#quit			=&gt; {
			#	re			=&gt; qr/(exit)|q(uit)?/,
			#	callback	=&gt; sub {
			#			$kernel-&gt;post( $sid =&gt; 'client_print' =&gt; 'Terminating connection on your request.');
			#			$kernel-&gt;post( $sid =&gt; 'shutdown' );
			#	},
			#},
			#status			=&gt; {
			#	re			=&gt; qr/^status/,
			#	callback	=&gt; sub {
			#		my $cnt = scalar( keys %{ $heap-&gt;{clients} } );
			#		my $subcnt = scalar( keys %{ $heap-&gt;{subscribers} });
			#		my $msg = &quot;Currently $cnt connections, $subcnt subscribed.&quot;;
			#		$kernel-&gt;post( $sid, 'client_print', $msg );
			#	},
			#},
		};
	}

	#
	# Check for messages:
	my $handled = 0;
	my $dispatch = $heap-&gt;{dispatch}{$sid};
	foreach my $evt ( keys %{ $dispatch } ) {
		if( my($args) = ($msg =~ /$dispatch-&gt;{$evt}{re}/)) {
			$handled = 1;
			$dispatch-&gt;{$evt}{callback}-&gt;($args);
			last;
		}
	}

	if( !$handled ) {
		$kernel-&gt;post( $sid =&gt; 'client_print' =&gt; 'UNKNOWN COMMAND, Ignored.' );
	}
}

#--------------------------------------------------------------------------#
sub client_term {
	my ($kernel,$heap,$ses) = @_[KERNEL,HEAP,SESSION];
	my $sid = $ses-&gt;ID;

	delete $heap-&gt;{dispatch}{$sid};
	$kernel-&gt;post( 'dispatcher' =&gt; 'hangup_client' =&gt;  $sid );

	debug(&quot;SERVER, client $sid disconnected.\n&quot;);
}

#--------------------------------------------------------------------------#
</pre>
]]></content:encoded>
			<wfw:commentRss>http://divisionbyzero.net/blog/2009/07/02/using-poe-to-hook-syslog-ng/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LinuxWorld 2008 and the goings on..</title>
		<link>http://divisionbyzero.net/blog/2008/09/05/linuxworld-2008-and-the-goings-on/</link>
		<comments>http://divisionbyzero.net/blog/2008/09/05/linuxworld-2008-and-the-goings-on/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 15:12:04 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Talks]]></category>
		<category><![CDATA[eris]]></category>
		<category><![CDATA[linuxworld]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://divisionbyzero.net/blog/?p=43</guid>
		<description><![CDATA[I had the privilege of speaking at LinuxWorld 2008 in San Francisco this year. It was a lot of fun and I certainly enjoyed the discussions with folks after my talk. My talk was on &#8220;Network Introspection with Open Source Tools&#8221; and I threatened to post updates on my progress here. I&#8217;ve been working on [...]]]></description>
			<content:encoded><![CDATA[<p>I had the privilege of speaking at <a href="http://linuxworldexpo.com/live/12/">LinuxWorld 2008</a> in San Francisco this year.  It was a lot of fun and I certainly enjoyed the discussions with folks after my talk.  My talk was on <a href="http://divisionbyzero.net/LinuxWorld08.pdf">&#8220;Network Introspection with Open Source Tools&#8221;</a> and I threatened to post updates on my progress here.</p>
<p>I&#8217;ve been working on packaging the code that I have into something that might be useful to the general public.  I&#8217;ll post another blog entry when I have a rough cut version of the package available for testing/breaking.</p>
]]></content:encoded>
			<wfw:commentRss>http://divisionbyzero.net/blog/2008/09/05/linuxworld-2008-and-the-goings-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updates, Recent Downtime</title>
		<link>http://divisionbyzero.net/blog/2008/06/03/updates-recent-downtime/</link>
		<comments>http://divisionbyzero.net/blog/2008/06/03/updates-recent-downtime/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 16:30:09 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Note]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://divisionbyzero.net/blog/?p=40</guid>
		<description><![CDATA[If you&#8217;ve noticed (probably not), recently the server has been unreachable. A few weeks back this was due to a bad hard drive. I finally transferred everything over to the new hard drive and got the sites back up and running thanks to a few friends and The Planet. Then this weekend, the data center [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve noticed (probably not), recently the server has been unreachable.  A few weeks back this was due to a bad hard drive.  I finally transferred everything over to the new hard drive and got the sites back up and running thanks to a few friends and <a href="http://theplanet.com">The Planet</a>.</p>
<p>Then this weekend, the data center that hosts this server <a href="http://mashable.com/2008/06/02/the-planets-data-center-explodes-fallout-extends-into-third-day/">exploded</a>.  The site is back up and running now, but there should be a few more hours of downtime on the horizon as they install and integrate a permanent electrical infrastructure to the data center.</p>
<p>Also, I&#8217;ve been selected to speak at the <a href="http://www.linuxworldexpo.com">Linux World Expo</a> in San Fransisco this year!  My talk is &#8220;<a href="http://linuxworldexpo.com/live/12/conference//tracks/tracksessions/Security/QMONYB00BIQP">Network Introspection with Open Source Tools</a>.&#8221;  If you&#8217;re going, please stop by and heckle me!</p>
<p>I may start updating this blog at some point.</p>
]]></content:encoded>
			<wfw:commentRss>http://divisionbyzero.net/blog/2008/06/03/updates-recent-downtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proxy Evasion with SSH</title>
		<link>http://divisionbyzero.net/blog/2007/10/04/proxy-evasion-with-ssh/</link>
		<comments>http://divisionbyzero.net/blog/2007/10/04/proxy-evasion-with-ssh/#comments</comments>
		<pubDate>Thu, 04 Oct 2007 21:41:42 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[evasion]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://divisionbyzero.net/blog/2007/10/04/proxy-evasion-with-ssh/</guid>
		<description><![CDATA[In our first installment, we looked at some solutions to provide a hospitable environment for proxy evasion. Today, we&#8217;ll dig deep into how to do this with my favorite protocol of all time, SSH. OpenSSH is a glorious implementation of a critical network protocol. Most networks have disabled and banned the use of telnet, rsh, [...]]]></description>
			<content:encoded><![CDATA[<p>In our <a href="http://divisionbyzero.net/blog/2006/12/09/proxy-evasion-the-environment/">first installment</a>,  we looked at some solutions to provide a hospitable environment for proxy evasion.  Today, we&#8217;ll dig deep into how to do this with my favorite protocol of all time, <a href="http://en.wikipedia.org/wiki/SSH">SSH</a>.</p>
<p><a href="http://openssh.org/">OpenSSH</a> is a glorious implementation of a critical network protocol.  Most networks have disabled and banned the use of telnet, rsh, and ftp in favor of the more &#8220;secure&#8221; SSH protocol.  OpenSSH runs on every platform I&#8217;ve encountered (using CygWin on Windows).  SSH provides an encrypted channel for data transfer.  Usually that&#8217;s Keyboard Interactive Sessions or Files (using SCP), however SSH is capable of setting up multiple channels and acting as a SOCKS4 or SOCKS5 Proxy.</p>
<p><span id="more-28"></span></p>
<p>From the manual:</p>
<blockquote>
<pre>
-D [bind_address:]port

Specifies a local ``dynamic'' application-level port forwarding.
This works by allocating a socket to listen to port on the local
side, optionally bound to the specified bind_address.  Whenever a
connection is made to this port, the connection is forwarded over
the secure channel, and the application protocol is then used to
determine where to connect to from the remote machine.  Currently
the SOCKS4 and SOCKS5 protocols are supported, and ssh will act
as a SOCKS server.  Only root can forward privileged ports.  Dy-
namic port forwardings can also be specified in the configuration
file.</pre>
</blockquote>
<p>That&#8217;s a lot of technical mumbo jumbo, so what does it mean?!  Well it means that if you have ssh and an ssh server outside of your work network that you can connect to, you can SOCKS5 Proxy all your Interesting Traffic elsewhere by issuing this command:</p>
<pre>ssh -D3128 server</pre>
<p>Then pointing your applications to SOCKS5 Proxy localhost port 3128 will encrypt all the traffic between you and the server that you&#8217;re connecting to.  <strong>This only provides privacy from the LOCAL or CORPORATE network, and does not encrypt your traffic on it&#8217;s way to it&#8217;s external destinations!!!!</strong></p>
<p>In the next installment, we&#8217;ll cover PuTTY.exe and how to evade proxies on Windows platforms.</p>
]]></content:encoded>
			<wfw:commentRss>http://divisionbyzero.net/blog/2007/10/04/proxy-evasion-with-ssh/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting back to things.</title>
		<link>http://divisionbyzero.net/blog/2007/01/19/getting-back-to-things/</link>
		<comments>http://divisionbyzero.net/blog/2007/01/19/getting-back-to-things/#comments</comments>
		<pubDate>Sat, 20 Jan 2007 03:41:42 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Note]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://divisionbyzero.net/blog/2007/01/19/getting-back-to-things/</guid>
		<description><![CDATA[The holidays are always a lot of fun. I ran out of time to do some things like keeping this blog updated. There&#8217;s been a ton of stuff in the news relevant to IT security. I&#8217;m not going to recap. I&#8217;ll be continuing my Proxy Evasion series as soon as I get a chance to [...]]]></description>
			<content:encoded><![CDATA[<p>The holidays are always a lot of fun.  I ran out of time to do some things like keeping this blog updated.  There&#8217;s been a ton of stuff in the news relevant to IT security.  I&#8217;m not going to recap.</p>
<p>I&#8217;ll be continuing my <a href="http://divisionbyzero.net/blog/2006/12/09/proxy-evasion-the-environment/">Proxy Evasion</a> series as soon as I get a chance to put together some screen shots for the tutorial part of the article.</p>
<p>Hopefully that article will be completed relatively soon.</p>
<p>Hope everyone had a great holiday season.</p>
<p>Pick up a copy of this book:</p>
<p><a href="http://www.amazon.com/gp/redirect.html%3FASIN=0321444426%26tag=manalangcom-20%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0321444426%253FSubscriptionId=0EMV44A9A5YT1RVDGZ82" title="View product details at Amazon"><img src="http://ec1.images-amazon.com/images/P/0321444426.01._SCTHUMBZZZ_V34644793_.jpg" alt="The Art of Software Security Assessment: Identifying and Preventing Software Vulnerabilities" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://divisionbyzero.net/blog/2007/01/19/getting-back-to-things/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proxy Evasion, The Environment</title>
		<link>http://divisionbyzero.net/blog/2006/12/09/proxy-evasion-the-environment/</link>
		<comments>http://divisionbyzero.net/blog/2006/12/09/proxy-evasion-the-environment/#comments</comments>
		<pubDate>Sat, 09 Dec 2006 15:00:51 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[evasion]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://divisionbyzero.net/blog/2006/12/09/proxy-evasion-the-environment/</guid>
		<description><![CDATA[There are a ridiculous number of organizations using transparent proxying as a means to limit access to external resources. The idea is that by proxying all web traffic, they can keep employees from visiting porn sites. I&#8217;m not necessarily convinced that this does them much good. My general experience has been that the type of [...]]]></description>
			<content:encoded><![CDATA[<p>There are a ridiculous number of organizations using transparent proxying as a means to limit access to external resources.  The idea is that by proxying all web traffic, they can keep employees from visiting porn sites.  I&#8217;m not necessarily convinced that this does them much good.  My general experience has been that the type of people looking at porn during the day will not become more productive as a result of losing the freedom to look at porn at work.  They&#8217;ll still be useless employees that you have to performance review instead of firing for inappropriate use of technology.</p>
<p>Additionally, these proxies do very little to increase the security of the network.  I&#8217;m fairly certain that by the time the Proxy Vendor is alerted to malware distributing websites, an anti-virus company has already issued an update.  This is redundant.  Normally, I&#8217;d fully support this redundant &#8211; ok, I&#8217;ll drop the buzzword &#8211; Defense in Depth solution.</p>
<p>However, piggy-backing on the heels of ay real security value, which is best described as the graph of 1/x, are made up categories of websites to deter your users from doing things that your CEO believes are inappropriate.  Interestingly enough, if the CEO is involved in Fantasy Football, you&#8217;ll be hard pressed to find an IT Infrastructure that denotes that classification of sites as inappropriate.  I digress.</p>
<p><span id="more-27"></span></p>
<p>I hate these policies.  The whole concept of the internet is free access to information.  As my job is Information Security, I frequently surf into the areas of the internet that <a href="http://websense.com/global/en/">WebSense</a> might classify as &#8220;Inappropiate Content&#8221;, &#8220;Hacker Sites&#8221;, or &#8220;Proxy Sites&#8221;.  It&#8217;s the nature of my business.  Luckily for me, I&#8217;ve been granted an exception to the policy that allows me to view such terrible web content.</p>
<p>However, my users are frequently inconvenienced by searches for &#8220;adult oriented material&#8221; as some of our reproductivity scientists might need access to sites that contain terms like &#8220;sex&#8221;, with interesting prefixes like &#8220;oral&#8221; and &#8220;vaginal&#8221;.  <strong><em>*Gasp*</em></strong></p>
<p>So, tired of executives so out of touch with their users that they don&#8217;t recognize them, much less know what they do, I begin my multipart series on Proxy Evasion with the Environmental Concerns.</p>
<h3>CygWin</h3>
<p>If you&#8217;re running Windows, I highly recommend that you install <a href="http://www.cygwin.com/">CygWin</a>.  <a href="http://en.wikipedia.org/wiki/POSIX">It provides a POSIX Compliant Environment</a> for Windows.  I&#8217;d be lost on Windows without it.</p>
<p>Using CygWin you can install a host of tools for network scouting, monitoring, manipulation, defense, and attack.  Some of my indispensables include:</p>
<ul>
<li><a href="http://insecure.org/nmap/">nmap</a> &#8211; find out about a host</li>
<li><a href="http://iptraf.seul.org/">iptraf</a> &#8211; find out about network traffic</li>
<li><a href="http://www.tcpdump.org/">tcpdump / libpcap</a> &#8211; excellent network sniffer</li>
<li><a href="http://www.winpcap.org/">winpcap</a> &#8211; I can&#8217;t remember if CygWin actually has libpcap support, if not, I remember having enormous success with WinPCAP</li>
</ul>
<p>None of those are necessary for Proxy Evasion, but they are nice tools to have laying around when you&#8217;re connected to a network.</p>
<h3>Mac OS X</h3>
<p>Don&#8217;t worry, I&#8217;m a Mac user too.  Mac OS X comes with a number of UNIX utilities already installed.  I highly reccommend installing the Developer&#8217;s Tools package to get GCC and then installing one of the ports systems available.  The two forerunners in the GNU/OpenSource porting for OS X are:</p>
<ul>
<li><a href="http://fink.sourceforge.net/">Fink</a> &#8211; Provides source &#038; binary downloads of packages with full dependency support.</li>
<li><a href="http://www.macports.org/">MacPorts</a> &#8211; Previously DarwinPorts, source only ports system.</li>
</ul>
<p>Though most free software will download and compile without hassle, it&#8217;s nice to have a package management suite that manages and downloads dependencies so you spend less time searching and installing and more time using your software.</p>
<h3>But.. But.. I don&#8217;t have Admin Rights!</h3>
<p>As a way to &#8220;increase security&#8221;, organizations will remove administrative privileges from average user&#8217;s computers.  <a href="http://divisionbyzero.net/blog/2006/07/18/eating-your-own-dog-food/">I feel this is complete hipocracy</a>, so I discourage it.  However, if you&#8217;re unfortunate to have these restraints enforced on your computer, there are ways to run your programs without installing them, and thus be compliant with the &#8220;I will not install my own software on company computers&#8221; rule you signed when you took the job.</p>
<p>They&#8217;re called &#8220;Portable Apps.&#8221;  They&#8217;re designed to be installed &#038; run off of <a href="http://en.wikipedia.org/wiki/USB_flash_drive">USB flash drives</a> and require no disk access on the computer you run it on.  This generally avoids all automated software policy enforcement, allowing you to run your programs without being hassled.</p>
<p>Here are the two biggest repositories for portable apps:</p>
<ul>
<li><a href="http://portableapps.com/">Portable Windows Apps</a></li>
<li><a href="http://www.freesmug.org/portableapps/">Portable Mac OS X Apps</a></li>
</ul>
<p>This biggest advantage to portable apps is the fact that they&#8217;re preferences are also stored on the drives.  This means even if you don&#8217;t have access to modify the network settings (ie, Proxy settings) on your applications because of an enforced policy, you can still modify the preferences on the portable apps.  This is terribly useful once we have tunnels setup to use for proxying.</p>
<p>I carry around a copy of Thunderbird, Firefox, Gaim/Adium, Abiword, and for Windows, <a href="http://www.putty.nl/">PuTTY</a>.</p>
<p>If you&#8217;re on Windows, please <a href="http://www.putty.nl/latest/x86/putty.exe">download PuTTY</a> now.  It&#8217;s a light weight ssh terminal that does not need to be installed.  It&#8217;s precompiled and can run with out writing preferences anywhere you&#8217;re not allowed.</p>
<p>By becoming aware of software solutions that allow you to do your work, you can setup a hospitable environment for productivity, free from the annoyances of &#8220;ADMINISTRATOR PRIVILEGES REQUIRED.&#8221;</p>
<p>In the next article, we&#8217;ll cover using SSH for Proxy Evasion.</p>
]]></content:encoded>
			<wfw:commentRss>http://divisionbyzero.net/blog/2006/12/09/proxy-evasion-the-environment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Is &#8216;Security Theatre&#8217; Good Enough?</title>
		<link>http://divisionbyzero.net/blog/2006/10/31/is-security-theatre-good-enough/</link>
		<comments>http://divisionbyzero.net/blog/2006/10/31/is-security-theatre-good-enough/#comments</comments>
		<pubDate>Wed, 01 Nov 2006 04:20:56 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://divisionbyzero.net/blog/2006/10/31/is-security-theatre-good-enough/</guid>
		<description><![CDATA[The American Populace is being inconvenienced, spied on, stripped of Constitutional Rights, and taxed without any idea where that money is going. The perpetrator is not some foreign, militant, activist group, it&#8217;s our own Government. There&#8217;s no outcry. All of these treacheries are being committed to increase security while the fact remains that all of [...]]]></description>
			<content:encoded><![CDATA[<p>The American Populace is being inconvenienced, spied on, stripped of Constitutional Rights, and taxed without any idea where that money is going.  The perpetrator is not some foreign, militant, activist group, it&#8217;s our own Government.  There&#8217;s no outcry.  All of these treacheries are being committed to increase security while the fact remains that all of these drastic measures have failed miserably.  The one constant is the relentless pursuit and protection of these programs by our elected officials.  They should be the voice of the populace, and perhaps they are.  Perhaps, &#8216;Security Theatre&#8217; is good enough for the masses.</p>
<p><span id="more-21"></span></p>
<p>There&#8217;s been a lot of coverage for a while about the inconsistencies and problems with the U.S. and it&#8217;s failed attempts at providing real security.  We have <a href="http://www.cleveland.com/news/plaindealer/index.ssf?/base/news/116212303846570.xml&#038;coll=2">Airport Screeners missing 20 of 22 bombs</a> in a live test of security conducted by TSA.  The New Scientist <a href="http://www.newscientist.com/channel/opinion/mg19225725.000">argues that most of the $44 BILLION spent on bioterrorism defense has been wasted</a>.  Recently, a bright young student at University of Indiana made a <a href="http://www.boingboing.net/2006/10/28/fbi_returns_to_fake_.html">fake boarding pass program</a>.  The interesting thing is this sort of thing had been <a href="http://www.schneier.com/crypto-gram-0308.html#6">documented</a> <a href="http://www.senate.gov/~schumer/SchumerWebsite/pressroom/press_releases/2005/PR4123.aviationsecurity021305.html">several</a> <a href="http://www.slate.com/id/2113157/fr/rss/">times</a> <a href="http://ioerror.livejournal.com/192472.html">before</a>.</p>
<p><a href="http://www.boingboing.net/2006/10/27/congressman_wants_fa.html">Blame</a>, of course, fell on this unsuspecting young student.  He crossed the line.  He made it _EASY_ for people to do this.  See, that&#8217;s the problem with these terrorists.  They&#8217;re inherently lazy.  They have no drive or ambition that would push them to open up MS Paint and digitally alter the image of a boarding pass.   That would require about 15 minutes, and terrorists certainly don&#8217;t have 15 minutes to spare to circumvent poor security measures.  The blame is misplaced.  TSA should be raided by the FBI.  Their lives should be disrupted and their houses sacked.</p>
<p>But we won&#8217;t point the finger at our security measures, certainly not Airport Security.  The fact is that good security measures could be developed that introduce little inconvenience into the picture for the end users.  However, I&#8217;m not entirely sure that would make people feel better.  This isn&#8217;t about real security or fighting terrorism.  It&#8217;s about being affected on a personal level by these security measures.</p>
<p>I don&#8217;t fly much.  Not because I&#8217;m afraid of terrorists, I rarely have the need to fly.  However, when I do, and I&#8217;m stuck in the long security lines at Airports, I can&#8217;t help but over hear people talking about how &#8220;at least we know we&#8217;re safe on the plane.&#8221;  Depending on my relative proximity to these conversations, I will tend to pipe up and explain the fault with the systems to my fellow travellers.  The response has not been good.  Now, they&#8217;re standing in a long line, wasting time, and Airport Screeners missed 20 out of 22 bombs.  Oddly enough, they kill the messenger.  Most of them just ask me to stop talking and then mutter under their breaths about how I don&#8217;t really know what I&#8217;m talking about.</p>
<p><strong>They want to <em>feel</em> secure, not <em>be </em>secure</strong>.  For these people, and they represent the masses, Security Theatre is not just good enough, it&#8217;s the requirement.  They may complain about it and rant, but if after 9/11 (take a shot if you&#8217;re playing along at home), they weren&#8217;t forced to stand in ridiculous lines and have underpaid, uninterested security guards look at their personal effects and throw their lip gloss in a trashcan labeled &#8216;contraband&#8217;, they&#8217;d be disoriented and petrified.  Sure, you think they&#8217;re scared now, but I really don&#8217;t think that air travel would&#8217;ve recovered as quickly as it did post 9/11 (*shot*) if people hadn&#8217;t been grotesquely inconvenienced.</p>
<p>There&#8217;s a problem with the perception of Security.  I see it in my day to day duties as a System Administrator / Programmer / Security Administrator.  If I had a nickel for every time I heard &#8220;security is getting in my way,&#8221; I&#8217;d be set.  People perceive security as inconvenience these days.  If they&#8217;re not being inconvenienced, then they&#8217;re pretty sure they&#8217;re not secure.  Nothing is going to change with the large scale security systems in this country until we change the perception of security.</p>
]]></content:encoded>
			<wfw:commentRss>http://divisionbyzero.net/blog/2006/10/31/is-security-theatre-good-enough/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Full Disk Encryption</title>
		<link>http://divisionbyzero.net/blog/2006/08/21/full-disk-encryption/</link>
		<comments>http://divisionbyzero.net/blog/2006/08/21/full-disk-encryption/#comments</comments>
		<pubDate>Mon, 21 Aug 2006 18:41:44 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[dumb]]></category>
		<category><![CDATA[fde]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://divisionbyzero.net/blog/2006/08/21/full-disk-encryption/</guid>
		<description><![CDATA[As you may or may not know, I am gainfully employed by the Federal Government in the area of Information Security. Recently the Bush Administration responded to media hype to issue a Federal Mandate requiring all government owned laptops use encryption technologies to encrypt their data. There are two interpretations of this memo. Encrypt the [...]]]></description>
			<content:encoded><![CDATA[<p>As you may or may not know, I am gainfully employed by the Federal Government in the area of Information Security.  <a href="http://www.whitehouse.gov/omb/memoranda/fy2006/m06-16.pdf">Recently the Bush Administration</a> responded to media hype to issue a Federal Mandate requiring all government owned laptops use encryption technologies to encrypt their data.</p>
<p>There are two interpretations of this memo.</p>
<ul>
<li>Encrypt the ENTIRE disk.</li>
<li>Encrypt just the files containing the data.</li>
</ul>
<p>So, what&#8217;s a lowly security administrator to do?!  Choices are bad!  Obviously you encrypt the entire disk! Right?! no? Why not?<br />
<span id="more-16"></span><br />
Well, recently concerned has been growing in the media over &#8220;Personally Identifiable Information&#8221; being recovered from stolen laptops.  Sadly, they&#8217;ve missed the point.  You see, most of the identity theft perpitrated results from malware, with a smaller number coming from physical security breaches, involving mostly <em>server hardware</em> like backup tapes, hard drives, and entire computers.  OMB and the Presidential mandate don&#8217;t deal with any of these issues, so their mandates can be viewed as little more than knee-jerk reactions to news coverage on the stolen VA Laptop.</p>
<p>Essentially, the media is now responsible for dictating Federal IT Security Policy.  This is what happens when you have governing bodies like OMB that don&#8217;t rationally evaluate threats or understand the technical aspect of IT Security.  It takes maybe another 10 minutes of searching through the archives at <a href="http://www.emergentchaos.com">Emergent Chaos</a> to realize that most breaches are the result of software breakins.  However, that&#8217;s not gonna stop the Federal Government from shelling out millions, possibly billions, to address the threat of data being stolen from a laptop that&#8217;s shutdown.</p>
<p>I don&#8217;t know about you, but the last time my laptop was shutdown was, well.. that one time it ran out of battery and I was miles away from a power adapter.  Otherwise my PowerBook just gets folded up and goes to sleep.  Full Disk Encryption decrypts the disk at BOOT.  So, since I&#8217;ve already booted, my entire drive is already booted, I gain nothing unless the battery dies.</p>
<p>&#8220;Full Disk Encryption&#8221; is also a pretty intimidating mouthful for most computer users.  Uninitiated, and some who think they&#8217;re initiated, sporting CISSP&#8217;s, would be lulled into thinking &#8220;HEY! My WHOLE disk is encrypted!  I&#8217;m secure!!!!!!!!!&#8221;  Unfortunately, this does nothing to protect your data from the software threats that are much more common.  You see, the disk is decrypted at boot, and then any programs just use the disk without even knowing that it&#8217;s encrypted.  So all the viruses and malware you&#8217;ve accumulated surfing the net for discount shopping and myspace.com updates on IE, is able to read ALL the data on your drive.</p>
<p>You haven&#8217;t really secured things from the most common threat, however, you have added another layer of complexity to the user&#8217;s experience.</p>
<p>So what is the solution?  Well first, it&#8217;s time to start investigating new methods for virus detection.  The Big 3 Vendors (Symantec, McAfee, and Trend Micro) have miss rates of 80% <a href="http://www.schneier.com/blog/archives/2006/08/why_the_topsell.html">because Virus authors are testing their virus against them</a>.  Closing this hole in the organizational structure will eliminate 80% of the threat to Identity Theft.</p>
<p>Horrible programming practices are usually to blame for the majority of personalized attacks that have leaked information in the past.  Managers should be encouraged to hire talented programmers and work with the programmers to create an atmosphere of cooperation.  The programmers should be involved in the design process.  They should also be given the right to veto or question their managers decisions.  Source control systems should be in place and encouraged.  Peer reviews should be factored into the development process.  The more eyes on the code, the more likely something will be caught.  The organization should adapt Best Practices based on recommendations by the development team.  These best practices require the same peer review that the code base gets.</p>
<p>This sounds like a lot of work, and it is.  Additionally, it&#8217;ll only fix like 1% of the Identity Theft problems.  However, it will raise the quality of the code, thus the product.  It might initially introduce some overhead, but that overhead will pay for itself and prove more cost effective as the products developed more accurately reflect customer desires.</p>
<p>If you have people with sensitive data on laptops or other portable media, you&#8217;re gonna need to deploy some form of encrypted mechanism for storage.  Personally, the encryption schemes that come builtin to Mac OS X and Windows XP should suffice for most intents and purposes.  Even OMB could&#8217;ve saved some money by leveraging this had they paid attention to their own rules.  Apple and Microsoft are both in process for attaining the coveted FIPS-140-2 compliance that is required for productions imploring encryption of federal data.  The Apple and Microsoft solutions have no cost overhead as they&#8217;re already installed on all the Apple and Microsoft laptops in production.</p>
<p>Folders with sensitive data should be encrypted in such a manner that there&#8217;s a an inactivity timeout, and the files must be decrypted when required.  Apple&#8217;s Disk Utility allows a user to construct an encrypted disk image that can be mounted like a regular DMG.  I&#8217;ve been told that Windows XP has a similar utility.  There are also free products out there like <a href="http://www.truecrypt.org">TrueCrypt</a> that allow you to hide the encrypted image in a JPG or other benign file.  For most people, the built-in encryption tools should be sufficient.</p>
<p>Users need to be trained to use the built-in features.  That&#8217;s where the money could go.  A simple PowerPoint presentation would satisfy most users.  I&#8217;d recommend that people routinely working with sensitive data be instructed on proper ways to store that data on their local machines.  You can pretend it won&#8217;t happen by making it a violation of Policy, but policy is a horrible place to hinge your IT Security Infrastructure on.</p>
<p>Don&#8217;t be sucked into the hype.  Think about things rationally and don&#8217;t make mandates that affect all government organizations without figuring out if there&#8217;s a potential threat there.  Realize, in my organization, we have over 300 users with laptops and in two years, we&#8217;ve had 0 lost or stolen laptops.</p>
]]></content:encoded>
			<wfw:commentRss>http://divisionbyzero.net/blog/2006/08/21/full-disk-encryption/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stop Being Afraid</title>
		<link>http://divisionbyzero.net/blog/2006/08/16/stop-being-afraid/</link>
		<comments>http://divisionbyzero.net/blog/2006/08/16/stop-being-afraid/#comments</comments>
		<pubDate>Thu, 17 Aug 2006 03:31:03 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Note]]></category>
		<category><![CDATA[safety]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[zefrank]]></category>

		<guid isPermaLink="false">http://divisionbyzero.net/blog/2006/08/16/stop-being-afraid/</guid>
		<description><![CDATA[I just found this interesting video blog, and this entry is right up my alley. ZeFrank on Terrorism]]></description>
			<content:encoded><![CDATA[<p>I just found this interesting video blog, and this entry is right up my alley.</p>
<p><a href="http://www.zefrank.com/theshow/archives/2006/08/081006.html#">ZeFrank on Terrorism</a></p>
]]></content:encoded>
			<wfw:commentRss>http://divisionbyzero.net/blog/2006/08/16/stop-being-afraid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Airport Security</title>
		<link>http://divisionbyzero.net/blog/2006/08/14/airport-security/</link>
		<comments>http://divisionbyzero.net/blog/2006/08/14/airport-security/#comments</comments>
		<pubDate>Mon, 14 Aug 2006 17:13:06 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Rant]]></category>
		<category><![CDATA[dumb]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://divisionbyzero.net/blog/2006/08/14/airport-security/</guid>
		<description><![CDATA[Bruce Schneier always has spot-on posts. Here&#8217;s his editorial on last week&#8217;s terror plots. It&#8217;s really that simple. Stop being terrorized. Stop being scared to live. Stop taking life so seriously, you&#8217;re never gonna make it out alive. We don&#8217;t need billions of dollars of security screening software/hardware. Anyone with a week of spare time [...]]]></description>
			<content:encoded><![CDATA[<p>Bruce Schneier always has spot-on posts.  <a href="http://http://www.schneier.com/blog/archives/2006/08/terrorism_secur.html">Here&#8217;s</a> his editorial on last week&#8217;s terror plots.</p>
<p>It&#8217;s really that simple.  Stop being terrorized.  Stop being scared to live.  Stop taking life so seriously, you&#8217;re never gonna make it out alive.  We don&#8217;t need billions of dollars of security screening software/hardware.  Anyone with a week of spare time will be able to circumvent it anyways.  This security is just a show, and I&#8217;m not entertained in the slightest.</p>
<p>I&#8217;m not flying again until these ridiculous regulations stop.  We know we&#8217;re accepting a risk getting onto a plane.  We&#8217;re 30,000 feet in the air, and if something mechanical fails, that&#8217;s a LONG way down.  You&#8217;re accepting even more of a risk when you get in your car to go to work.  You&#8217;re a billion times more likely to die in a car accident than a terror attack.  So why aren&#8217;t we campaigning against ridiculous bullshit by insurance companies and state legislations that waste your tax dollars to make them money instead of fixing problems with automobile safety?</p>
<p>It doesn&#8217;t sell papers.</p>
<p><strong>Update:</strong> It now appears that some people with some experience in Chemistry have <a href="http://www.interesting-people.org/archives/interesting-people/200608/msg00087.html">questioned the plausability</a> of the terrorist plot.<br />
<strong>Update 2:</strong> <a href="http://www.craigmurray.co.uk/archives/2006/08/the_uk_terror_p.html">More information</a> about the acquisition of the information that led to the arrests and wide spread media terrorism.</p>
]]></content:encoded>
			<wfw:commentRss>http://divisionbyzero.net/blog/2006/08/14/airport-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eating your own dog food</title>
		<link>http://divisionbyzero.net/blog/2006/07/18/eating-your-own-dog-food/</link>
		<comments>http://divisionbyzero.net/blog/2006/07/18/eating-your-own-dog-food/#comments</comments>
		<pubDate>Wed, 19 Jul 2006 02:18:14 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[trust]]></category>

		<guid isPermaLink="false">http://divisionbyzero.net/blog/2006/07/18/eating-your-own-dog-food/</guid>
		<description><![CDATA[Most of the organizations I&#8217;ve been a part of, the IT staff usually has exemptions from IT policies if not significantly escalated privileges. This distances them from their users. I also happen to know and test MANY different ways to circumvent the policies and controls in place on the network. You can&#8217;t push policies and [...]]]></description>
			<content:encoded><![CDATA[<p>Most of the organizations I&#8217;ve been a part of, the IT staff usually has exemptions from IT policies if not significantly escalated privileges.  This distances them from their users.  I also happen to know and test MANY different ways to circumvent the policies and controls in place on the network.  You can&#8217;t push policies and haphazardly grant exceptions to those policies to the group in charge of making them.</p>
<p><span id="more-11"></span></p>
<p>We live in a world of malware.  Spyware, Adware, Virii, and generally annoying programs saturate the landscape of the web.  Users don&#8217;t even have to really try to get these infections either.  Just visiting some <a title="websites" href="http://www.informationweek.com/management/showArticle.jhtml?articleID=190302133">websites</a> can lead to infection if you&#8217;re blissfully unaware of the evil in EULA&#8217;s.  To combat this problem, a large number of corporations automatically remove Administrator rights from user&#8217;s computers.  This sounds like a great idea, but atleast until Vista, Microsoft Employees all have <a title="Microsoft considering revoking administrative rights from employees with Vista" href="http://www.zdnet.com.au/news/security/soa/Microsoft_considers_taking_admin_rights_from_employees/0,2000061744,39257228,00.htm">administrative rights on their own workstations</a>!</p>
<p>Worse than your IT Staff being unfamiliar with userland without privileges, is the OS DEVELOPER being relatively unfamiliar with its interface without administrative privileges. Even with this protection, attackers can still <a title="ACL Privilege Escalation" href="http://www.frsirt.com/english/advisories/2006/0417">escalate privileges</a>, or circumvent that fact by <a title="Secunia Archive for Symantec AV" href="http://secunia.com/product/5555/">exploiting programs</a> that HAVE to run as administrator.  Take a look at the <a title="Secunia Security Advisories" href="http://www.secunia.com">Secunia</a> database for JUST the Operating System flaws in <a title="Secunia XP Advisory Listing" href="http://secunia.com/product/22/">Microsoft Windows XP Pro</a>.  A <a title="Search Secunia for " href="http://secunia.com/search/?search=antivirus">search for &#8220;antivirus&#8221; on Secunia</a> is also a bit depressing, listing 88 vulnerabilities for Antivirus Suites.</p>
<p>Aside from hackers, technologically inclined staff can <a title="Portable Applications" href="http://portableapps.com/">undermine</a> your group policies in several interesting ways.  Network security can be <a title="Breaking firewalls with OpenSSH &#038; Putty" href="http://souptonuts.sourceforge.net/sshtips.htm">circumvented</a> just as <a title="Torpark ( Firefox + Tor, portable )" href="http://torpark.nfshost.com/">easily</a>.  The advent of portable applications and network anonimizers, techniques used by &#8220;bad guys&#8221; for years, have destroyed policy&#8217;s strong hold on the corporate network.  Determined users will knock down any and all technological barriers to their productivity.<br />
Even if you&#8217;ve managed to take all the precautions to prevent the circumvention of your policies, including BIOS Protection, a determined user armed with <a title="Google Search :: bypass BIOS passwords" href="http://www.google.com/search?q=bypassing%20bios%20passwords">google</a> can <a title="Bypass BIOS passwords" href="http://labmice.techtarget.com/articles/BIOS_hack.htm">circumvent your BIOS password</a> and just boot up into <a title="Download Ubuntu" href="http://www.ubuntu.com/download/">Ubuntu</a> or any <a title="Arudius - Information Assurance Linux Live CD" href="http://arudius.sourceforge.net/">number</a> of <a title="Knoppix :: Security Tools Distribution" href="http://s-t-d.org/tools.html">other</a> <a title="PCLinuxOS :: Free linux Live CD" href="http://ftp.belnet.be/linux/pclinuxos/live-cd/english/preview/">free</a>, <a title="Auditor Security Collection" href="http://www.remote-exploit.org/index.php/Auditor_main">live</a> <a title="SLAX :: Slackware based, purpose driven Live CDs" href="http://www.slax.org/download.php">CD</a> distributions of linux to escape all of your fancy Active Directory Based security policies.  From there it&#8217;s trivial for users to do what they want.  Using <a title="WINE :: WINE Is Not an Emulator" href="http://www.winehq.org">WINE</a> and <a title="Open Office" href="http://www.openoffice.org">OpenOffice</a>, they can be just as productive as normal users, and far less restricted.</p>
<p>The bottom line is that the users have to be able to comfortably work within your organization with your security policies before your policies are effective at preventing breaches.  There are a number of factors, far beyond the reach of most corporate IT Policies &#038; Procedures documents that need to be addressed.</p>
<p>Employees honestly need to feel like a part of the organization, which is difficult when you consider how <a title="Executives Exploit the Labor" href="http://www.faireconomy.org/press/archive/1999/Executive_Excess/decade_of_executive_excess.html">upper management is distancing itself from the worker bees</a>.  As retarded as it sounds, when the average worker is being degraded by executives who take home more in BONUSES than most DEPARTMENTS take home cumulatively in their organization over the course of a year, there&#8217;s incentive for corporate espionage and sabotage.  This has been witnessed <a title="Wikipedia on the USSR" href="http://en.wikipedia.org/wiki/USSR">several</a> <a title="Wikipedia on Hitler" href="http://en.wikipedia.org/wiki/Adolf_Hitler">times</a> in <a title="French Revolution" href="http://en.wikipedia.org/wiki/French_revolution">history</a>.  I&#8217;ll stop before I get political, but bottom line, is there will never be &#8220;Information Security&#8221; in a country where there&#8217;s an obsurd distinction between rich &#038; poor.</p>
<p>Employees must also be given certain amount of <a title="My thoughts on trust." href="http://divisionbyzero.net/blog/2006/07/12/trust/">Trust</a> to give them a feeling of belonging or exclusivity.  The <a title="Perl - the official site" href="http://www.perl.org">tools</a> to <a title="Prelude IDS, Event Correlation" href="http://www.prelude-ids.org">provide accountability</a> to <a title="Snort, open source IDS" href="http://www.snort.org">actions on your network</a> are readily available, so should they fall out of line, you can casually remind them or adjust your policy if necessary.  If there&#8217;s no trust in the organization, the employee is forced to look out exclusively for themselves, which means they&#8217;ll be much more likely to act without regard to their impact on the organization.</p>
<p>Employees need room to grow and learn.  Without the potential to better themselves and their monetary compensation for their laborious contributions to your organization, the employees will leave, taking with them knowledge of your security measures.  They will also be more receptive to ideas of subterfuge, infidelity, and mutiny.  Reward your employees whenever possible.</p>
<p>Eventually you&#8217;ll get to the IT side of Network Security.  Basic preventive and passive monitoring measures should be deployed on the network to prevent outsiders from attacking.  The prevention of &#8220;insider attacks&#8221; requires more than just a Booklet of IT Security Rules.  Those rules should be flexible enough to be deployed throughout the organization, with as few exceptions as possible.  Ideally you want your computer systems working for you, not getting in your way.</p>
<p>Regardless of the policies you decide on, the IT group should be the FIRST group to adopt the policy, trickle out from there.  That way you can determine and fix potential problem for power users before the CTO kicks your door in.</p>
]]></content:encoded>
			<wfw:commentRss>http://divisionbyzero.net/blog/2006/07/18/eating-your-own-dog-food/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trust.</title>
		<link>http://divisionbyzero.net/blog/2006/07/12/trust/</link>
		<comments>http://divisionbyzero.net/blog/2006/07/12/trust/#comments</comments>
		<pubDate>Wed, 12 Jul 2006 16:01:22 +0000</pubDate>
		<dc:creator>brad</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[trust]]></category>

		<guid isPermaLink="false">http://divisionbyzero.net/2006/07/12/trust/</guid>
		<description><![CDATA[As a programmer, I&#8217;ve had the concept of &#8220;DON&#8217;T EVER TRUST YOUR USERS&#8221; beaten into my head. For programmers, this concept is incredibly important. Users almost always exceed your expectations for creativity with your new application. By planning for unexpected input, and properly cleaning all variables you can theoretically account for abuses of your system [...]]]></description>
			<content:encoded><![CDATA[<p>As a programmer, I&#8217;ve had the concept of &#8220;DON&#8217;T EVER TRUST YOUR USERS&#8221; beaten into my head.  For programmers, this concept is incredibly important.  Users almost always exceed your expectations for creativity with your new application.  By planning for unexpected input, and properly cleaning all variables you can theoretically account for abuses of your system by malicious users and provide a graceful failure for users attempting to enter in bogus data.</p>
<p>This concept is key to PROGRAMMING.  What I find astounding, is a large majority of corporations are adopting this practice for ALL IT related issues, and it&#8217;s even saturating into HR and other areas of employment.  Working as a Security Administrator, I&#8217;m surprised that most employers have decided to not trust their employees.  If you can&#8217;t trust them, then why would you hire them?</p>
<p><span id="more-4"></span></p>
<p>Some key differences between &#8220;users&#8221; and &#8220;employees&#8221;.  We&#8217;ll assume for the sake of argument, that we&#8217;re talking about a Web Application and an Employee&#8217;s Desktop Computer.</p>
<p>Web Applications:</p>
<ul>
<li>Usually allow most of the internet to establish a connection.</li>
<li>Usually implement a custom or home-grown authentication schema.</li>
<li>Usually implement a custom separation of privilege system.</li>
<li>Usually users are not screened prior to access.</li>
</ul>
<p>Employee&#8217;s Desktop Computer:</p>
<ul>
<li>Usually require physical acces (normally, badged entrance to a building, sector of a building, and possibly a room key).</li>
<li>Usually sit behind fairly restrictive firewalls that block unrequested inbound communication from external places.</li>
<li>Usually implement a centrally controlled authentication system like ActiveDirectory, or LDAP.</li>
<ul>
<li>Usually this process is linked directly into HR&#8217;s New Hire / Termination Process</li>
</ul>
<li>Permission and ACL system&#8217;s are usually tied directly into ActiveDirectory and/or LDAP</li>
<li>Users are screened through the interview process.  They also tend to be known to the organization.</li>
<li>Actions on the systems usually include a system for accountability wherein an event can be traced directly back to a particular user.</li>
</ul>
<p>Yes, there are exceptions.  I know Kevin Mitnik would just walk into a building behind an employee, pretend like he belonged there and sit down at an unused computer and &#8220;hack&#8221; internally.  However, people like Mitnik are exceptions to the rule.  Most of these pimply faced, angst ridden, EMO listening script kiddies don&#8217;t have the courage necessary to &#8220;hack&#8221; at a social level.</p>
<p>So why doesn&#8217;t your organization trust you?  They can easily punish &#038; revoke acccess after repeat offenses.  Theoretically, it&#8217;s not more work than is currently being done.  Actually, if users had administrative rights over their pc&#8217;s, they could install the software they need to get their jobs done without putting in tickets to a corporate help desk.  Would machines get thrashed by malware and stupid ass HotBar installs?  Of course, but how many untrusting environments currently deal with those problems as is?</p>
<p>The fact is, virus and malware writers are clever.  Certain processes run as administrator on a windows machine regardless of the user logged in.  Using the builtin messaging systems, the malware writers can force their installer to run as administrator if you have an Antivirus process running.  So in a sense, we have policies that impact and impede employees while not really eliminating the serious threats they&#8217;re being flagged as preventing.</p>
<p>Currently, using a combination of open source tools at work, we&#8217;re trusting our users.  If they&#8217;re not productive, they don&#8217;t stick around.  We get the IT overhead the hell out of their way and let them be productive.  The result has been more effective employees.  We do have problems occassionally, but every IT section fights the occassional virus or malware outbreak.  Even cooler, the system we&#8217;ve adapted has helped us automate a lot of the fight because we&#8217;ve had far more time free to implement proactive and reactive network security policies since we&#8217;re not spending all our time installing Adobe Acrobat on all 800 of our users&#8217; Desktops.</p>
<p>We&#8217;ve also noticed that when users feel trusted, they tend to have a much more positive outlook on the whole IT field.  I&#8217;ve been in environments where users hate their computer so much they become beligerent the second they get an error message.  Granted, we still have angry users, but much less frequently than previously.  We hired our employees because they were the best candidates and part of their job is being responsible.  If they&#8217;re not responsible, they don&#8217;t last long.</p>
<p>Of course, there&#8217;s an additional piece to consider.  Now that we&#8217;ve nailed down the monitoring and accountability, we&#8217;ve noticed that after users get warned about something once, they generally don&#8217;t repeat offenses.  They genuinely want to be secure.  Do you honestly think your employees want to compromise their personal data, trade secrets, or customer data?  Hell no!  That&#8217;s bad.  No one wants bad.  They generally don&#8217;t know not to click the f*cking monkey until you tell them not to.  It&#8217;s education.</p>
<p>The internet is a scary place filled with promises of riches beyond your wildest imagination.  That promise, techies know is no different than any opportunity that existed prior to the internet.  Usually, if it sounds too good to be true, it generally is.  Users need and want to be better educated about the threats they face online.  Just like you paid that consultant to come in and teach best practices to your programmers, you should put together classes for users to get education on the internet and computers.</p>
<p>If you don&#8217;t believe me, I dare you to put together an introductory course to internet safety for your users.  Offer the class, don&#8217;t force it down their throats and see what the response is.  Also, please don&#8217;t be ignorant to non-work related issues.  Your employees screw around at work, and if they like you, they work at home.  So, address clicking on the monkey and myspace.com and the threats that they face on those sites.  Don&#8217;t be arrogant and make the class fun.</p>
<p>Even if a small percentage come to the first class, they&#8217;ll generally spread that knowledge to co-workers and friends virally.  The average person wants to know and use best practices for maintaining security on their home &#038; work PCs.  They don&#8217;t want the world to know that they just bought Yanni tickets!</p>
<p>Generally speaking, not trusting the users is a GOOD thing for PROGRAMMING.  However, used as blanket policy for your employees, it creates an environment of distrust and disdain.  It will undermine any &#8220;team building&#8221; seminars you just paid for to help people &#8220;synergize&#8221;.  They&#8217;re your employees and many of you spend more time at work than with your own families.  If you&#8217;re around people you can&#8217;t trust, GET OUT OF THERE NOW.  IT Policies will not help you in this case.</p>
]]></content:encoded>
			<wfw:commentRss>http://divisionbyzero.net/blog/2006/07/12/trust/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
