Small syslog server

December 12th, 2011

My home network has several devices that do not have large persistent storage to keep log files. For example, my wireless routers based on OpenWRT doesn’t log to the limited local storage it has, and a Flukso energy metering device log power readings to a ramdisk. These devices log a fair amount of information that I ideally would like to keep for later analysis. I have never before seen a need to setup a syslogd server, thinking that storing logs locally and keeping regular backups of the machine is good enough. However, it appears like this situation calls for a syslogd server. I found an old NSLU2 in my drawer and installed Debian Squeeze on it following Martin Michlmayr’s instructions. I’m using a 4GB USB memory stick for storage, which should hold plenty of log data. I keep backups of the machine in case the USB memory stick wears out.

After customizing the installation to my preferences (disable ssh passwords, disable portmap/rpc.statd/exim4, installing etckeeper, emacs23-nox, etc) I am ready to configure Rsyslog. I found what looked like the perfect configuration example, “Storing messages from a remote system into a specific file”, but it requires me to hard code a bit too much information in the configuration file for my taste. Instead, I found the DynFile concept. With a file /etc/rsyslogd.d/logger.conf as below I can point any new device to my log server and it will automatically create a new file for it. And since the dates are embedded into the filename, I get log rotation suitable for rsync-style backups for free.

$ModLoad imudp
$UDPServerRun 514

$ModLoad imtcp
$InputTCPServerRun 514

$template DynFile,”/var/log/network-%HOSTNAME%-%$year%-%$month%-%$day%.log”
:fromhost-ip, !isequal, “127.0.0.1″ ?DynFile
:fromhost-ip, !isequal, “127.0.0.1″ ~

Share and Enjoy:
  • Identi.ca
  • Digg
  • Twitter
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

Unattended SSH with Smartcard

October 11th, 2011

I have several backup servers that run the excellent rsnapshot software, which uses Secure Shell (SSH) for remote access. The SSH private key of the backup server can be a weak link in the overall security. To see how it can be a problem, consider if someone breaks into your backup server and manages to copy your SSH private key, they will now have the ability to login to all machines that you take backups off (and that should be all of your machines, right?).

The traditional way to mitigate SSH private key theft is by password protecting the private key. This works poorly in an unattended server environment because either the decryption password needs to be stored in disk (where the attacker can read it) or the decrypted private key has to be available in decrypted form in memory (where attacker can read it).

A better way to deal with the problem is to move the SSH private key to a smartcard. The idea is that the private key cannot be copied by an attacker who roots your backup server. (Careful readers may have spotted a flaw here, and I need to explain one weakness with my solution: an attacker will still be able to login to all your systems by going through your backup server, however it will require an open inbound network connection to your backup server and the attacker will never know what your private key is. What this does is to allow you to more easily do damage control by removing the smartcard from the backup server.)

In this writeup, I’ll explain how to accomplish all this on a Debian/Ubuntu-system using a OpenPGP smartcard, a Gemalto USB Shell Token v2 with gpg-agent/scdaemon from GnuPG together with OpenSSH.

Read the rest of this entry »

Share and Enjoy:
  • Identi.ca
  • Digg
  • Twitter
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

OpenWRT with Huawei E367 and TP-Link TL-WR1043ND

May 22nd, 2011

The ability to connect a 3G modem to a wireless router to form a Internet connected ad-hoc network of machines is very powerful. I’ve done this many times and have written about it before (e.g., see my OpenWRT writeup page) but I recently did it with modern hardware again. Here I will use the TP-Link TL-WR1043ND wireless router (available here for around $50) together with the Huawei E367 3G UMTS/HSDPA modem. Other wireless routers and modem should work fine. The software is OpenWRT 10.03 although I hope to redo this with LibreWRT eventually. My writeup is mostly focused around what is happening around the prompt, so it is mostly a cut’n'paste terminal session with a comment interlined.

TL-WR1043ND and Huawei 367

Router and modem


Read the rest of this entry »

Share and Enjoy:
  • Identi.ca
  • Digg
  • Twitter
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

Introducing the OATH Toolkit

January 20th, 2011

I am happy to announce a project that I have been working quietly on for about a year: the OATH Toolkit. OATH stands for Open AuTHentication and is an organization that specify standards around authentication. That is a pretty broad focus, but practically it has translated into work on specifying standards around deploying and using electronic token based user authentication such as the YubiKey.

YubiKey

OATH’s most visible specification has been the HOTP algorithm which is a way to generate event-based one-time passwords from a shared secret using HMAC-SHA1. HOTP has been published through the IETF as RFC 4226. Built on top of HOTP is the time-based variant called TOTP, which requires a clock in the token. OATH do some other work too, like specifying a data format for transferring the token configuration data (e.g., serial number and shared secret) called PSKC.
Read the rest of this entry »

Share and Enjoy:
  • Identi.ca
  • Digg
  • Twitter
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

On Password Hashing and RFC 6070

January 7th, 2011

The RFC Editor has announced a new document, RFC 6070, with test vectors for PKCS5 PBKDF2. The document grow out of my implementation of SCRAM for GNU SASL. During interop testing, more than one other implementation turned out to have mistakes in the PBKDF2 implementation. It didn’t help that there weren’t any stable test vectors for PBKDF2, so that we could do black-box testing of our PBKDF2 implementations against well-known and stable test vectors. Debugging this was time consuming. The document addresses this problem.

So what is PBKDF2?
Read the rest of this entry »

Share and Enjoy:
  • Identi.ca
  • Digg
  • Twitter
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

GNU SASL with SCRAM-SHA-1-PLUS

November 17th, 2010

I have finished the SCRAM implementation in GNU SASL. The remaining feature to be added were support for the “enhanced” SCRAM-SHA-1-PLUS variant instead of just the normal SCRAM-SHA-1 mechanism. The difference is that the latter supports channel bindings to TLS, which makes it possible to detect man-in-the-middle attacks even if TLS is not used with server authentication. In GnuTLS we recently added an API for applications to extract channel bindings, which you will need to use in order to use SCRAM-SHA-1-PLUS. I announced the experimental version 1.5.4 release together with a writeup on how to test it. With this, our support for SCRAM should be complete.

Share and Enjoy:
  • Identi.ca
  • Digg
  • Twitter
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

Debian on Lenovo X201

October 25th, 2010

I have acquired a new laptop/netbook, a Lenovo X201. My initial reactions are positive. It runs Debian better than my old Dell laptop does (see my Debian on Dell Precision M65 writeup). The rest of this article will be devoted to notes and information about running a GNU/Linux system on the Lenovo X201.

Read the rest of this entry »

Share and Enjoy:
  • Identi.ca
  • Digg
  • Twitter
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

GS2-KRB5 using GNU SASL and MIT Kerberos for Windows

September 27th, 2010

I have blogged about GNU SASL and GS2-KRB5 with the native Kerberos on Mac OS X before, so the next logical step has been to support GS2-KRB5 on Windows through MIT Kerberos for Windows (KfW). With the latest release of GNU SASL 1.5.2 I have added support for the KfW GSS-API library. There were several issues in completing this due to problems with KfW, but I won’t bore you with those details.

What is important is to demonstrate how GNU SASL can now talk IMAP authenticated with GS2-KRB5 using KfW on native Windows. Read the rest of this entry »

Share and Enjoy:
  • Identi.ca
  • Digg
  • Twitter
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

Bridging SASL and GSS-API: GS2

July 13th, 2010

Yesterday (12th July 2010) the RFC editor announced the publication of RFC 5801, which I’m co-author of. The GS2 document has taken 5 years to reach this status, see my page on GS2 status.

So what is GS2? Read the rest of this entry »

Share and Enjoy:
  • Identi.ca
  • Digg
  • Twitter
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

OpenWRT 10.03 “Backfire”

May 3rd, 2010

Earlier I have written about OpenWRT configuration for two routers in a home network and OpenWRT configuration for 3G dial-up (which succeeded my summerhouse OpenWRT writeup) before. The OpenWRT project recently announced a new release, OpenWRT 10.03 Backfire. Thus, this appeared like a good opportunity to wipe out the old configurations on my routers and rewrite the articles using the latest software. I have two articles:

Share and Enjoy:
  • Identi.ca
  • Digg
  • Twitter
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks