Minggu, 01 Februari 2009

Humans, Not Computers, Are Intrusion Tolerant

Several years ago I mentioned the human firewall project as an example of a security awareness-centric defensive measure. I thought it ironic that the project was dead by the time I looked into it.

On a similar note, I was considering the idea of intrusion tolerance recently, loosely defined as having a system continue to function properly despite being compromised. A pioneer in the field describes the concept thus:

Classical security-related work has on the other hand privileged, with few exceptions, intrusion prevention... [With intrusion tolerance, i]nstead of trying to prevent every single intrusion, these are allowed, but tolerated: the system triggers mechanisms that prevent the intrusion from generating a system security failure.

It occurred to me recently that, in one sense, we have already fielded intrusion tolerant systems. Any computer operated, owned, or managed by a person who doesn't care about its integrity is an intrusion tolerant system.

People tolerate the intrusion for various reasons, such as:

  1. "I don't think any threats are attacking me."

  2. "I don't see my system or information being disclosed / degraded / denied."

  3. "I don't have anything valuable on my system."


All of those are false, but intrusion tolerant systems (meaning the human plus the hardware and software) tolerate intrusions. What's worse is that modern threats understand these parameters and seek to work within them, rather than do something stupid like open and close a CD-ROM tray or waste bandwidth, tipping off the human by interfering with the operation of the system.


Richard Bejtlich is teaching new classes in DC and Europe in 2009. Register by 1 Jan and 1 Feb, respectively, for the best rates.

Sabtu, 31 Januari 2009

Upgrading FreeBSD Packages

In my last post I discussed upgrading from FreeBSD 7.0 to 7.1. In this post I'll mention packages that needed to be updated.

In the last post I showed two installed packages using the native pkg_info command.

neely# pkg_info
cdrtools-2.01_6 CD/CD-R[W] and ISO-9660 image creation and extraction tools
dvd+rw-tools-7.0 DVD burning software

At this point I could have used pkg_delete to remove them, and added the newest packages via pkg_add. Because that is easy, I decided to show an alternative that might be better for systems with many packages.

I decided to use Portupgrade to update packages installed on the system. Portupgrade was not on the box so I added it via pkg_add. I used the -n switch to do a "dry run" to see what version would be added.

neely# pkg_add -vrn portupgrade
scheme: [ftp]
user: []
password: []
host: [ftp.freebsd.org]
port: [0]
document: [/pub/FreeBSD/ports/i386/packages-7.1-release/Latest/portupgrade.tbz]
---> ftp.freebsd.org:21
looking up ftp.freebsd.org
connecting to ftp.freebsd.org:21
<<< 220 Welcome to freebsd.isc.org.
>>> USER anonymous
<<< 331 Please specify the password.
>>> PASS richard@neely.taosecurity.com
<<< 230 Login successful.
>>> PWD
<<< 257 "/"
>>> CWD pub/FreeBSD/ports/i386/packages-7.1-release/Latest
<<< 250 Directory successfully changed.
>>> MODE S
<<< 200 Mode set to S.
>>> TYPE I
<<< 200 Switching to Binary mode.
setting passive mode
>>> PASV
<<< 227 Entering Passive Mode (204,152,184,73,191,203)
opening data connection
initiating transfer
>>> RETR portupgrade.tbz
<<< 150 Opening BINARY mode data connection for portupgrade.tbz (132387 bytes).
Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.1-release/Latest
/portupgrade.tbz...Waiting for final status
x +CONTENTS
x +COMMENT
x +DESC
x +DISPLAY
x +MTREE_DIRS
x man/man1/pkg_deinstall.1.gz
x man/man1/pkg_fetch.1.gz
x man/man1/pkg_glob.1.gz
x man/man1/pkg_sort.1.gz
x man/man1/pkgdb.1.gz
x man/man1/pkgdu.1.gz
x man/man1/portcvsweb.1.gz
x man/man1/portsclean.1.gz
x man/man1/portsdb.1.gz
x man/man1/portupgrade.1.gz
x man/man1/portversion.1.gz
x man/man5/pkgtools.conf.5.gz
x man/man1/pkg_which.1.gz
x man/man1/portinstall.1.gz
x man/man1/ports_glob.1.gz
x sbin/pkg_deinstall
x sbin/pkg_fetch
x sbin/pkg_glob
x sbin/pkg_sort
x sbin/pkg_which
x sbin/pkgdb
x sbin/pkgdu
x sbin/portcvsweb
x sbin/portinstall
x sbin/ports_glob
x sbin/portsclean
x sbin/portsdb
x sbin/portupgrade
x sbin/portversion
x lib/ruby/site_ruby/1.8/pkg.rb
x lib/ruby/site_ruby/1.8/pkgdb.rb
x lib/ruby/site_ruby/1.8/pkgdbtools.rb
x lib/ruby/site_ruby/1.8/pkginfo.rb
x lib/ruby/site_ruby/1.8/pkgmisc.rb
x lib/ruby/site_ruby/1.8/pkgtools.rb
x lib/ruby/site_ruby/1.8/pkgtsort.rb
x lib/ruby/site_ruby/1.8/pkgversion.rb
x lib/ruby/site_ruby/1.8/portinfo.rb
x lib/ruby/site_ruby/1.8/ports.rb
x lib/ruby/site_ruby/1.8/portsdb.rb
x etc/pkgtools.conf.sample
x etc/pkgtools.status-pkg.sh
x share/zsh/site-functions/_pkgtools
x share/examples/pkgtools/bash/complete.sample
x share/examples/pkgtools/tcsh/complete.sample
x share/doc/pkgtools/ChangeLog
x share/doc/pkgtools/NEWS
x share/doc/pkgtools/README
x libdata/ldconfig/portupgrade
<<< 226 File send OK.
tar command returns 0 status
Done.
Package 'portupgrade-2.4.6,2' depends on 'ruby-1.8.6.287,1' with 'lang/ruby18' origin.
and was not found.
Package 'portupgrade-2.4.6,2' depends on 'db41-4.1.25_4' with 'databases/db41' origin.
and was not found.
Package 'portupgrade-2.4.6,2' depends on 'ruby18-bdb-0.6.4' with 'databases/ruby-bdb' origin.
and was not found.
pkg_add: 1 package addition(s) failed

Notice pkg_add used ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-7.1-release/Latest as its installation location. I could have altered this behavior by setting an environment variable thus:

setenv PACKAGESITE ftp://ftp2.freebsd.org/pub/FreeBSD/ports/i386/packages-7-stable/Latest/

I didn't do that here, however, so I'm installing the version as released with 7.1.

neely# pkg_add -vr portupgrade
...edited...
Trying to record dependency on package 'ruby-1.8.6.287,1' with 'lang/ruby18' origin.
Trying to record dependency on package 'db41-4.1.25_4' with 'databases/db41' origin.
Trying to record dependency on package 'ruby18-bdb-0.6.4' with 'databases/ruby-bdb' origin.
Package portupgrade-2.4.6,2 registered in /var/db/pkg/portupgrade-2.4.6,2

------------------------------------------------------------------------------
Fill ALT_PKGDEP section in pkgtools.conf file for portupgrade
be aware of alternative dependencies you use.
E.g.
ALT_PKGDEP = {
'www/apache13' => 'www/apache13-modssl',
'print/ghostscript-gnu' => 'print/ghostscript-gpl',
}

Note also, portupgrade knows nothing how to handle ports with different
suffixes (E.g. -nox11). So you should explicitly define variables
(E.g. WITHOUT_X11=yes) for the ports in /etc/make.conf or pkgtools.conf
(MAKE_ARGS section) files.
------------------------------------------------------------------------------

Great, now let's see what needs to be updated.

neely# pkg_version -v
cdrtools-2.01_6 ? orphaned: sysutils/cdrtools
db41-4.1.25_4 ? orphaned: databases/db41
dvd+rw-tools-7.0 ? orphaned: sysutils/dvd+rw-tools
portupgrade-2.4.6,2 ? orphaned: ports-mgmt/portupgrade
ruby-1.8.6.287,1 ? orphaned: lang/ruby18
ruby18-bdb-0.6.4 ? orphaned: databases/ruby-bdb

Ah, I don't have a ports tree on this system. Even though I'm not building anything using the ports tree (I'm installing packages), I still need a local copy of the ports tree to know what is current. I install it using Portsnap.

neely# portsnap fetch
Looking up portsnap.FreeBSD.org mirrors... 2 mirrors found.
Fetching public key from portsnap2.FreeBSD.org... done.
Fetching snapshot tag from portsnap2.FreeBSD.org... done.
Fetching snapshot metadata... done.
Fetching snapshot generated at Sat Jan 31 19:15:45 EST 2009:
922e444be604245dd2c5567a0394f2ec588a710724529c100% of 55 MB 94 kBps 00m00s
Extracting snapshot... done.
Verifying snapshot integrity... done.
Fetching snapshot tag from portsnap2.FreeBSD.org... done.
Fetching snapshot metadata... done.
Updating from Sat Jan 31 19:15:45 EST 2009 to Sat Jan 31 20:26:31 EST 2009.
Fetching 3 metadata patches.. done.
Applying metadata patches... done.
Fetching 0 metadata files... done.
Fetching 8 patches..... done.
Applying patches... done.
Fetching 0 new ports or files... done.

neely# portsnap extract
...edited...
Building new INDEX files... done.

In the future to update I would change extract to update.

Now I can see what needs updating.

neely# pkg_version -v
cdrtools-2.01_6 < needs updating (port has 2.01_7)
db41-4.1.25_4 = up-to-date with port
dvd+rw-tools-7.0 < needs updating (port has 7.1)
portupgrade-2.4.6,2 = up-to-date with port
ruby-1.8.6.287,1 = up-to-date with port
ruby18-bdb-0.6.4 = up-to-date with port

I decided to run Portupgrade and tell it to only use packages (PP):

neely# portupgrade -varRPP
---> Session started at: Sat, 31 Jan 2009 22:37:43 -0500
[Rebuilding the pkgdb in /var/db/pkg ... - 6 packages found (-0 +6) ...... done]
[Updating the portsdb in /usr/ports ... - 19698 port entries found
.........1000.........2000.........3000.........4000.........5000.........
6000.........7000.........8000.........9000.........10000.........11000.........
12000.........13000.........14000.........15000.........16000.........17000.....
....18000.........19000...... ..... done]
---> Checking for the latest package of 'sysutils/cdrtools'
** No such file or directory - /usr/ports/packages/All
---> Fetching the package(s) for 'cdrtools-2.01_7' (sysutils/cdrtools)
---> Fetching cdrtools-2.01_7
++ Will try the following sites in the order named:
ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-7.1-release/
---> Invoking a command: /usr/bin/fetch -o '/var/tmp/portupgradepS4h9CcR/cdrtools-
2.01_7.tbz' 'ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-7.1-release/All/cdrtools-2.01_7.tbz'
/var/tmp/portupgradepS4h9CcR/cdrtools-2.01_7.t100% of 767 kB 86 kBps
---> Downloaded as cdrtools-2.01_7.tbz
---> Identifying the package /var/tmp/portupgradepS4h9CcR/cdrtools-2.01_7.tbz
---> Saved as /usr/ports/packages/All/cdrtools-2.01_7.tbz
---> Listing the results (+:done / -:ignored / *:skipped / !:failed)
+ cdrtools-2.01_7
---> Packages processed: 1 done, 0 ignored, 0 skipped and 0 failed
---> Found a package of 'sysutils/cdrtools': /usr/ports/packages/All/cdrtools-
2.01_7.tbz (cdrtools-2.01_7)
---> Located a package version 2.01_7 (/usr/ports/packages/All/cdrtools-2.01_7.tbz)
---> Upgrade of sysutils/cdrtools started at: Sat, 31 Jan 2009 22:38:08 -0500
---> Upgrading 'cdrtools-2.01_6' to 'cdrtools-2.01_7' (sysutils/cdrtools) using a package
---> Updating dependency info
---> Modifying /var/db/pkg/dvd+rw-tools-7.0/+CONTENTS
---> Uninstallation of cdrtools-2.01_6 started at: Sat, 31 Jan 2009 22:38:08 -0500
---> Fixing up dependencies before creating a package
---> Backing up the old version
---> Uninstalling the old version
---> Deinstalling 'cdrtools-2.01_6'
pkg_delete: package 'cdrtools-2.01_6' is required by these other packages
and may not be deinstalled (but I'll delete it anyway):
dvd+rw-tools-7.0
[Updating the pkgdb in /var/db/pkg ... - 5 packages found (-1 +0)
(...) done]
---> Uninstallation of cdrtools-2.01_6 ended at: Sat, 31 Jan 2009 22:38:12 -0500
(consumed 00:00:03)
---> Installation of cdrtools-2.01_7 started at: Sat, 31 Jan 2009 22:38:12 -0500
---> Installing the new version via the package

===========================================================================

Note: The location of the cdrtools `defaults' files has been set to

/usr/local/etc

This is the FreeBSD ports standard config file location, NOT the cdrtools
standard location, which is /etc/default.

The reason for this is that FreeBSD ports and packages should not use
configuration files outside of /usr/local.

===========================================================================

---> Removing temporary files and directories
---> Removing old package'
---> Installation of cdrtools-2.01_7 ended at: Sat, 31 Jan 2009 22:38:14 -0500 (consumed 00:00:01)
---> Cleaning out obsolete shared libraries
[Updating the pkgdb in /var/db/pkg ... - 6 packages found (-0 +1) . done]
---> Upgrade of sysutils/cdrtools ended at: Sat, 31 Jan 2009 22:38:16 -0500
(consumed 00:00:07)
---> ** Upgrade tasks 2: 1 done, 0 ignored, 0 skipped and 0 failed
---> Checking for the latest package of 'sysutils/dvd+rw-tools'
---> Fetching the package(s) for 'dvd+rw-tools-7.1' (sysutils/dvd+rw-tools)
---> Fetching dvd+rw-tools-7.1
++ Will try the following sites in the order named:
ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-7.1-release/
---> Invoking a command: /usr/bin/fetch -o '/var/tmp/portupgradeFKkYF29e/dvd+rw-
tools-7.1.tbz' 'ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/i386/packages-7.1-release
/All/dvd+rw-tools-7.1.tbz'
/var/tmp/portupgradeFKkYF29e/dvd+rw-tools-7.1.100% of 101 kB 52 kBps
---> Downloaded as dvd+rw-tools-7.1.tbz
---> Identifying the package /var/tmp/portupgradeFKkYF29e/dvd+rw-tools-7.1.tbz
---> Saved as /usr/ports/packages/All/dvd+rw-tools-7.1.tbz
---> Skipping cdrtools-2.01_7 (already installed)
---> Listing the results (+:done / -:ignored / *:skipped / !:failed)
+ dvd+rw-tools-7.1
- cdrtools-2.01_7
---> Packages processed: 1 done, 1 ignored, 0 skipped and 0 failed
---> Found a package of 'sysutils/dvd+rw-tools': /usr/ports/packages/All/dvd+rw-
tools-7.1.tbz (dvd+rw-tools-7.1)
---> Located a package version 7.1 (/usr/ports/packages/All/dvd+rw-tools-7.1.tbz)
---> Upgrade of sysutils/dvd+rw-tools started at: Sat, 31 Jan 2009 22:38:22 -0500
---> Upgrading 'dvd+rw-tools-7.0' to 'dvd+rw-tools-7.1' (sysutils/dvd+rw-tools) using a package
---> Updating dependency info
---> Uninstallation of dvd+rw-tools-7.0 started at: Sat, 31 Jan 2009 22:38:22 -0500
---> Fixing up dependencies before creating a package
---> Backing up the old version
---> Uninstalling the old version
---> Deinstalling 'dvd+rw-tools-7.0'
[Updating the pkgdb in /var/db/pkg ... - 5 packages found (-1 +0)
(...) done]
---> Uninstallation of dvd+rw-tools-7.0 ended at: Sat, 31 Jan 2009 22:38:26 -0500 (consumed 00:00:04)
---> Installation of dvd+rw-tools-7.1 started at: Sat, 31 Jan 2009 22:38:26 -0500
---> Installing the new version via the package
---> Removing temporary files and directories
---> Removing old package'
---> Installation of dvd+rw-tools-7.1 ended at: Sat, 31 Jan 2009 22:38:27 -0500 (consumed 00:00:01)
---> Cleaning out obsolete shared libraries
[Updating the pkgdb in /var/db/pkg ... - 6 packages found (-0 +1)
. done]
---> Upgrade of sysutils/dvd+rw-tools ended at: Sat, 31 Jan 2009 22:38:29 -0500
(consumed 00:00:07)
---> ** Upgrade tasks 2: 2 done, 0 ignored, 0 skipped and 0 failed
---> Listing the results (+:done / -:ignored / *:skipped / !:failed)
+ sysutils/cdrtools (cdrtools-2.01_6)
+ sysutils/dvd+rw-tools (dvd+rw-tools-7.0)
---> Packages processed: 2 done, 0 ignored, 0 skipped and 0 failed
---> Session ended at: Sat, 31 Jan 2009 22:38:31 -0500 (consumed 00:00:48)

When done I check the results:

neely# pkg_version -v
cdrtools-2.01_7 = up-to-date with port
db41-4.1.25_4 = up-to-date with port
dvd+rw-tools-7.1 = up-to-date with port
portupgrade-2.4.6,2 = up-to-date with port
ruby-1.8.6.287,1 = up-to-date with port
ruby18-bdb-0.6.4 = up-to-date with port

That's it!


Richard Bejtlich is teaching new classes in DC and Europe in 2009. Register before free seats are taken!

Upgrading FreeBSD 7.0 to 7.1

My last post on upgrading FreeBSD was Updating FreeBSD 7.0-BETA2 to 7.0-BETA3.

In this post I'll describe how I migrated a test install of FreeBSD 7.0-RELEASE #0 to FreeBSD 7.0-RELEASE-p7 #0, and then from there to FreeBSD 7.1-RELEASE #0.

Here's what I started with.

neely# uname -a
FreeBSD neely.taosecurity.com 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24
19:59:52 UTC 2008 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386

To update to the latest version of 7.0, I ran freebsd-update. First I run without switches to show available options.

neely# freebsd-update
usage: freebsd-update [options] command ... [path]

Options:
-b basedir -- Operate on a system mounted at basedir
(default: /)
-d workdir -- Store working files in workdir
(default: /var/db/freebsd-update/)
-f conffile -- Read configuration options from conffile
(default: /etc/freebsd-update.conf)
-k KEY -- Trust an RSA key with SHA256 hash of KEY
-r release -- Target for upgrade (e.g., 6.2-RELEASE)
-s server -- Server from which to fetch updates
(default: update.FreeBSD.org)
-t address -- Mail output of cron command, if any, to address
(default: root)
Commands:
fetch -- Fetch updates from server
cron -- Sleep rand(3600) seconds, fetch updates, and send an
email if updates were found
upgrade -- Fetch upgrades to FreeBSD version specified via -r option
install -- Install downloaded updates or upgrades
rollback -- Uninstall most recently installed updates

Notice the -s switch. If you decide to pick a specific server, how do you choose? This neat trick gives you options:

$ host -t srv _http._tcp.update.freebsd.org
_http._tcp.update.freebsd.org has SRV record 1 25 80 update2.FreeBSD.org.
_http._tcp.update.freebsd.org has SRV record 1 10 80 update1.FreeBSD.org.

Note results vary depending on what servers are available at any point in time.

Now I start the update process.

neely# freebsd-update fetch
Looking up update.FreeBSD.org mirrors... 2 mirrors found.
Fetching metadata signature for 7.0-RELEASE from update2.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 2 metadata patches.. done.
Applying metadata patches... done.
Fetching 2 metadata files... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 27 patches.....10....20... done.
Applying patches... done.

The following files will be updated as part of updating to 7.0-RELEASE-p9:
/boot/kernel/if_faith.ko
/boot/kernel/if_fwip.ko
/boot/kernel/if_stf.ko
/boot/kernel/ip_mroute.ko
/boot/kernel/ipfw.ko
/boot/kernel/kernel
/boot/kernel/pf.ko
/boot/kernel/random.ko
/usr/bin/dig
/usr/bin/host
/usr/bin/nslookup
/usr/bin/nsupdate
/usr/bin/openssl
/usr/include/netinet/tcp.h
/usr/include/netinet6/in6.h
/usr/include/netinet6/nd6.h
/usr/lib/libssl.a
/usr/lib/libssl.so.5
/usr/libexec/ftpd
/usr/libexec/lukemftpd
/usr/sbin/dnssec-keygen
/usr/sbin/dnssec-signzone
/usr/sbin/lwresd
/usr/sbin/named
/usr/sbin/named-checkconf
/usr/sbin/named-checkzone
/usr/sbin/named-compilezone
/usr/sbin/ntpd
/usr/sbin/rndc-confgen

WARNING: FreeBSD 7.0-RELEASE is approaching its End-of-Life date.
It is strongly recommended that you upgrade to a newer
release within the next 2 months.

neely# freebsd-update install
Installing updates... done.
neely# reboot

After I reboot I am running FreeBSD 7.0-RELEASE-p7 #0.

neely# uname -a
FreeBSD neely.taosecurity.com 7.0-RELEASE-p7 FreeBSD 7.0-RELEASE-p7 #0: Sun Dec 21
12:33:45 UTC 2008 root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386

For my own reference I see what packages are installed.

neely# pkg_info
cdrtools-2.01_6 CD/CD-R[W] and ISO-9660 image creation and extraction tools
dvd+rw-tools-7.0 DVD burning software

Now I will upgrade to 7.1.

neely# freebsd-update upgrade -r 7.1-RELEASE
Looking up update.FreeBSD.org mirrors... 2 mirrors found.
Fetching metadata signature for 7.0-RELEASE from update2.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Inspecting system... done.

The following components of FreeBSD seem to be installed:
kernel/generic world/base world/dict world/doc world/games world/info
world/manpages

The following components of FreeBSD do not seem to be installed:
src/base src/bin src/cddl src/compat src/contrib src/crypto src/etc
src/games src/gnu src/include src/krb5 src/lib src/libexec src/release
src/rescue src/sbin src/secure src/share src/sys src/tools src/ubin
src/usbin world/catpages world/proflibs

Does this look reasonable (y/n)? y

Fetching metadata signature for 7.1-RELEASE from update2.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system...done.
Fetching files from 7.0-RELEASE for merging... done.
Preparing to download files...done.
Fetching 10989 patches.....10....20....30....40....50....60....70....80....90....100....110
...edited...
810....6820....6830....6840....6850....6860.. done.
Applying patches... done.
Fetching 4516 files... failed.

That doesn't look good. Maybe the server was loaded? Based on a few searches I decide to start the process again.

neely# freebsd-update upgrade -r 7.1-RELEASE
Looking up update.FreeBSD.org mirrors... 2 mirrors found.
Fetching metadata signature for 7.0-RELEASE from update2.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.

The following components of FreeBSD seem to be installed:
kernel/generic world/base world/dict world/doc world/games world/info
world/manpages

The following components of FreeBSD do not seem to be installed:
src/base src/bin src/cddl src/compat src/contrib src/crypto src/etc
src/games src/gnu src/include src/krb5 src/lib src/libexec src/release
src/rescue src/sbin src/secure src/share src/sys src/tools src/ubin
src/usbin world/catpages world/proflibs

Does this look reasonable (y/n)? y

Fetching metadata signature for 7.1-RELEASE from update2.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Fetching files from 7.0-RELEASE for merging... done.
Preparing to download files... done.
Fetching 3312 patches.....10....20....30....40....50....60....70....80....90....
...edited...
2620....2630....2640....2650....2660....2670....2680....2690... done.
Applying patches... done.
Fetching 1433 files...done.
Attempting to automatically merge changes in files... done.

The following changes, which occurred between FreeBSD 7.0-RELEASE and
FreeBSD 7.1-RELEASE have been merged into /etc/group:
--- current version
+++ new version
@@ -1,6 +1,6 @@
-# $FreeBSD: src/etc/group,v 1.35 2007/06/11 18:36:39 ceri Exp $
+# $FreeBSD: src/etc/group,v 1.35.6.1 2008/11/25 02:59:29 kensmith Exp $
#
wheel:*:0:root,richard
daemon:*:1:
kmem:*:2:
sys:*:3:
Does this look reasonable (y/n)? y

The following changes, which occurred between FreeBSD 7.0-RELEASE and
FreeBSD 7.1-RELEASE have been merged into /etc/master.passwd:
--- current version
+++ new version
@@ -1,6 +1,6 @@
-# $FreeBSD: src/etc/master.passwd,v 1.40 2005/06/06 20:19:56 brooks Exp $
+# $FreeBSD: src/etc/master.passwd,v 1.40.18.1 2008/11/25 02:59:29 kensmith Exp $
#
root:$1$qmgoobYq$tNDy/Y2N8QDJVjFk5E.NB.:0:0::0:0:Charlie &:/root:/bin/csh
toor:*:0:0::0:0:Bourne-again Superuser:/root:
daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin
operator:*:2:5::0:0:System &:/:/usr/sbin/nologin
Does this look reasonable (y/n)? y

The following changes, which occurred between FreeBSD 7.0-RELEASE and
FreeBSD 7.1-RELEASE have been merged into /etc/passwd:
--- current version
+++ new version
@@ -1,6 +1,6 @@
-# $FreeBSD: src/etc/master.passwd,v 1.40 2005/06/06 20:19:56 brooks Exp $
+# $FreeBSD: src/etc/master.passwd,v 1.40.18.1 2008/11/25 02:59:29 kensmith Exp $
#
root:*:0:0:Charlie &:/root:/bin/csh
toor:*:0:0:Bourne-again Superuser:/root:
daemon:*:1:1:Owner of many system processes:/root:/usr/sbin/nologin
operator:*:2:5:System &:/:/usr/sbin/nologin
Does this look reasonable (y/n)? y
The following files will be removed as part of updating to 7.1-RELEASE-p2:
/etc/rc.d/kernel
/usr/include/netgraph/atm/ng_atmpif.h
/usr/sbin/pkg_check
/usr/sbin/pkg_sign
/usr/share/doc/de_DE.ISO8859-1/books/handbook/portsnap.html
...edited...
The following files will be added as part of updating to 7.1-RELEASE-p2:
/boot/gptboot
/boot/kernel/cmx.ko
/boot/kernel/cmx.ko.symbols
...edited...
The following files will be updated as part of updating to 7.1-RELEASE-p2:
/.cshrc
/.profile
/COPYRIGHT
/bin/[
/bin/cat
...edited...
/var/named/etc/namedb/named.root
/var/yp/Makefile.dist

neely# freebsd-update install -r 7.1-RELEASE
Installing updates...
Kernel updates have been installed. Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.
neely# reboot

After rebooting I run install again.

$ su -
Password:
neely# freebsd-update install
Installing updates...... done.
neely# reboot

$ uname -a
FreeBSD neely.taosecurity.com 7.1-RELEASE FreeBSD 7.1-RELEASE #0: Thu Jan 1
14:37:25 UTC 2009 root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386

All done! If I want to see if any other patches are available I can run fetch again.

$ su -
Password:

neely# freebsd-update fetch
Looking up update.FreeBSD.org mirrors... 2 mirrors found.
Fetching metadata signature for 7.1-RELEASE from update2.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 2 metadata patches.. done.
Applying metadata patches... done.
Fetching 2 metadata files... done.
Inspecting system... done.
Preparing to download files... done.

No updates needed to update system to 7.1-RELEASE-p2.

Looks like that's it.


Richard Bejtlich is teaching new classes in DC and Europe in 2009. Register by 1 Jan and 1 Feb, respectively, for the best rates.

Jumat, 30 Januari 2009

Advice to Bloggers

Recently a blog reader asked two questions as he started his own new blog:

1. Do you think I should stick to just one topic? i.e. Digital Forensics?

2. Do you think blogging is a good way to learn more about a topic of interest or should you only blog about a topic you already know a lot about?


I addressed some of these issues in my post Why Blog?, but I'll add the following.

I recommend writing about a handful of topics, but stick to topics within a certain theme. For example, my blog covers "digital security and the practices of network security monitoring, incident response, and forensics." Although I love martial arts and ice hockey, I don't write about that here. I also do not address politics, family, religion, or any other non-technical issues in this forum. I believe blog readers prefer me to stay on my listed subjects; they can visit other sites for non-technical information.

I believe it is ok to write about subjects that are outside your core expertise, but you need to warn the reader that you are a beginner. Do not presume to be an authority on a subject that is new to you. Tell the reader and let him or her be the judge. If you don't know a lot about a topic, but you want to solicit assistance, say that in your post.

If you make a habit of discussing topics that are foreign to you, you will probably not be respected, however. I don't think many readers want to visit a blog that is constantly asking how to accomplish a task. Most readers want to learn something or see a new viewpoint, not be asked questions all the time.



Richard Bejtlich is teaching new classes in DC and Europe in 2009. Register by 1 Jan and 1 Feb, respectively, for the best rates.

Northrop Grumman's Timothy McKnight on Security

Ken Bradley sent me a link to Northrop Grumman's Timothy McKnight on Security and Identity Management by Katherine Walsh of CSO Magazine. It's an older article but I liked this part:

CSO: Can you tell me about the formation of the Cyber Threat Analysis Intelligence Group and its role at Northrop Grumman?

McKnight: That team's focus is on the nation-state threat, which the DoD is now terming the "advanced persistent threat." These are well resourced, highly targeted attacks at corporations and governments [by groups] that are looking primarily to steal intellectual property and gain competitive advantage.

The Cyber Threat Analysis Intelligence Group is made up of techies and people with government analyst backgrounds. Their job is to focus on the technologies that are considered the crown jewels of Northrop Grumman. They look at the technologies we provide for the government, who the biggest threat to those technologies is, who needs them the most, how they [may be] targeting that information and what can we do to protect against it. That group is deploying customized solutions to handle all of that.


Notice this group is asset-centric and threat-centric, i.e., they look to see what matters to the company (and what might matter to an adversary) and they also identify who might want to steal it.

This is in stark contrast to the vulnerability-centric stance of most security shops. Sure, you always need to know your weaknesses, but the idea of paying attention to what matters to you, and by extension, what information a threat might want to exfiltrate/degrade/deny, is excellent. I expect the work this group does also helps NG to Unify Against Threats.


Richard Bejtlich is teaching new classes in DC and Europe in 2009. Register by 1 Jan and 1 Feb, respectively, for the best rates.

Virtualized Network Security Monitoring Platforms

Yesterday a blog reader asked:

Looking back at previous blogs, notably

http://taosecurity.blogspot.com/2005/12/network-monitoring-platforms-on-vmware.html

I see that you have, in your classes, used VM's to run your network monitoring tools from. Have you progressed this idea into a production environment or do you still feel that running tools in this configuration, be they on a Linux host or not, would still be too much of a compromise.

The scenario i work under means that i cannot have my sensors connected to the Internet which makes keeping them upto date difficult and i was looking at creating a generic VM that i could keep live and up to date on an Internet facing terminal and then copy to my production environment as and when i wish to deploy new verions of tools or updated signatures.

Grateful for your thoughts


The reader is correct; whenever I deploy NSM platforms as VMs, it's only for demo or class purposes. I do not use NSM platforms as VMs in production, where my "NSM VM" might be deployed alongside other production VMs. I make the following arguments.

  1. Most NSM platforms I deploy require at least 3 NICs, and possibly 5. My VMs actively use 1 NIC for management via SSH, 2 NICs for connection to a traditional network tap, and potentially 2 more NICs for tapping a backup or high-available link paired with the first tap. Most VM server platforms are designed to share a small number of NICs among many virtual machines for management and serving content. The NSM in VM concept stretches or breaks that model.

  2. NICs on NSM platforms are not performing periodic data transmission or reception; they are usually always receiving data. The monitoring NICs on a NSM platform are used to sniff network traffic. On anything but the most trivial network, these NICs are constantly listening for network traffic. This also stretches, if not breaks, the traditional VM model.

  3. Hard drives on NSM platforms are constantly writing, incurring high storage I/O costs. NSM platform are constantly writing full content Pcap data to disk, in addition to session records, IDS alerts, and other data. The full content collection requirement alone strains the idea of having a NSM VM writing data while other VMs on the same physical hardware compete for resources.

  4. Some NSM applications are RAM- and CPU-intensive. Snort in 2009 is not the same as Snort in 1999. If you've looked at the resources consumed by Snort 2.x, you'll see a large footprint. NSM platforms also run session data collection tools (like SANCP), other alert data tools (maybe Bro), and other tools, so they are already doing their own part to share resources among many competing interests.

  5. If you consider why virtualization is attractive, you'll see virtualizating a NSM appliance doesn't fit the model. Virtualization is supposed to be helpful for making more efficient use of underutilized hardware. The classic case involves a rack of servers each using a fraction of their resources. Why not virtualize those servers and reduce your overall computing footprint? That model makes sense. It does not make sense to take a platform which is already monopolizing its available resources and shoehorn it into a virtual server.


There are obvious benefits to virtualization in general, such as easy creation/destruction of VMs, the ability to snapshot/introduce a change/roll back, and so on. At this point, those advantages do not compensate for the disadvantages I outlined.


Richard Bejtlich is teaching new classes in DC and Europe in 2009. Register by 1 Jan and 1 Feb, respectively, for the best rates.

Raffy Marty Teaching Security Visualization

Raffy Marty, author of Applied Security Visualization is teaching a Security Visualization and Log Analysis Workshop at SOURCEBoston on 9-10 March. Raffy's a great instructor and this is the first class I've seen on the topic. Check it out!


Richard Bejtlich is teaching new classes in DC and Europe in 2009. Register by 1 Jan and 1 Feb, respectively, for the best rates.