LDAP-Driven RADIUS Appliance

Because one of our clients thinks that two Radius servers are not enough, I'm creating a couple of VMware appliances which will be hosting an OpenLDAP-driven FreeRADIUS daemon on them with which we'll be authorizing 802.1x appliances.

Due to the fact that my master OpenLDAP servers (and their slaves) are currently still on version 2.2, I cannot effectively use OpenLDAP's delta-syncrepl. This is where my lsync tool is coming in handy. I love reusing good ideas I've had before, and in this case a good tool.

55 * Google

55 Ways to Have Fun With Google is now available as a PDF under a Creative Commons License.

via lexlog

Backup of Cisco Routers

Since six years, I've been in charge of backing up all eight hundred routers in our environment. This was done with a bunch of Perl scripts which retrieve the Cisco routers' configuration via rcp and the other routers via TFTP. Because I've never been too pleased with that technology, I reworked the system ten months ago. Reasons for the rewrite included:

  • Config retrieval from the router via rcp or TFTP are unreliable; any network issues automatically cause problems
  • The routers have to be polled for their configurations, which imposes a certain load on the host system. Furthermore, if a router is unavailable, error-handling is difficult
  • All configs are copied to a database, irrespective of whether they have changed or not; this greatly increases the amount of backed up configurations in the data store
  • There is no version control of any sort
  • Configuration retrieval is reduced to a single user on a defined system, due to rcp.

Since Cisco IOS 12.3 or 12.4, a router can save its configuration via my favorite protocol: HTTP, which is what I want to use here.

Router backups a la JP

An IOS configuration snippet:


archive
 log config
  logging enable
  notify syslog
  hidekeys
  path http://www.example.com/store.php

Whenever a router desires to save a copy of its configuration, it submits this via HTTP to a web service implemented in PHP. The service creates a hash over the configuration data and if the key-pair hash and IP address of router (IP, MD5) have not yet been stored, they are saved to a MySQL database. During this transaction, the service contacts a second custom-made web service hosted on Lotus Domino and submits this new configuration to a Lotus Notes database, where it can subsequently be perused by authorized users.

The MySQL database is used to quickly determine if the configuration received from the Cisco router is duplicate. It is from this database (table) that an RSS feed is also generated to inform router administrators that a backup has been received.

The brunt of the work is done by the store.php PHP script. It simultaneously represents a server (from the point of view of the router) and a client (from the point of the XML-RPC service). The PHP script receives (comparable to a CGI) the router's config and creates an in-core copy of it to retrieve details such as the router's hostname and IOS version. A touple consisting of the IP address of the router plus an MD5 hash of the configuration data (IP, MD5) are queried in a MySQL database. If it cannot be found, a new record is inserted containing the key (IP, MD5) together with date/time of reception as well as other details of the transaction.

Modified configs are subsequently submitted to a web service running on a Lotus Domino server. This custom-made C program is an XML-RPC web service written with XMLRPC-EPI which receives the configuration together with metadata and stores them in a new document into a Lotus Notes database. First of all, this enables configurations to be replicated to distinct locations, and secondly, it enables trusted employees to carry replicas of the Notes database with them when on the road.

An IOS configuration also carries information that is changed periodically by the router, but which mustn't influence the MD5 hash. These values are removed before calculating the hash.

The system has been in production for almost a year now, without any problems.

Calling Home With OpenVPN

OpenVPN is a full-featured SSL VPN which implements a secure network using the standard SSL/TLS protocol. It supports flexible client authentication methods based on certificates and/or username/password credentials and is supplied with utilities that greatly ease creation of the required PKI for issueing server and client certificates. The documentation is very good and everything needed to begin with is contained in the OpenVPN 2.0 HOWTO (another Howto here). OpenVPN creates the SSL tunnels over UDP or TCP, the latter even through an HTTP proxy if so desired.

For Windows there is a pre-packaged installer which installs a TAP device and OpenVPN as a service. The GUI is conveniently located in the Windows taskbar and will create a connection to the OpenVPN server at the click of a button. The installer is available at openvpn.se and can be freely downloaded.

Mac OS/X users also get a graphical user-interface: Tunnelblick is written in Cocoa, and the distribution contains all necessary binaries and drivers.

amazon.{de|com}

I've been reading a lot of technical books lately, and I thought I'd copy my reviews to amazon.de since I sometimes use the reader comments to get a first impression of the book I'm interested in, and because it is the place I purchase most of my literature.

amazon.de strangely enough is not accepting my reviews, although I'm not getting an error upon submission. May it be that they don't like reviews in the English language on a German site? That would be awkward, considering the books they are selling are in the English language…

Anyway, amazon.com has accepted my reviews.

Systemhelden

systemhelden.com is a platform for all those who, day in and day out, ensure that computing systems and applications run smoothly: the system administrators or system heroes.

Join in.

Shovelling Sh*t

I spent the better part of an hour yesterday afternoon shovelling stinking brown muddy goo, and I mean real goo, out of our garage. It rained so hard during the night of Sunday through Monday, that our garage filled up with water again.

That muddy mixture came back up the drain-pipes which lead to the road. As an indication on how much water there must have been, let me tell you that our garage is over three metres above the road-level!

Pro OpenSSH

If you are new to OpenSSH, don't let the "Pro" in the title scare you off; the first half of the 270-page book is just what you need: the first two chapters of Pro OpenSSH are of an introductory nature and introduce the reader to the insecurity of the legacy R-tools and telnet as well as a quick implementation of OpenSSH and a short introduction to the excellent PuTTY, an SSH client for Windows (this is expanded on in an appendix).

In part 2, Michael Stahnke discusses the configuration of OpenSSH starting with a detailed look at the files required by the client and the server portions of the program including manual-page-like descriptions of the keywords in sshd_config and the options and syntax of the command-line tools. The chapter on Authentication digs into Public Key Authentication, key generation and distribution as well as key management (also taken onto a new level in a later chapter), and agent forwarding. This is a must-read for anyone who uses SSH to connect to more than one host.

The advanced topics start in part 3, and this is where the "Pro" begins. The complex topic TCP forwarding is well explained and a number of diagrams help the reader to better understand the nitty-gritty of setting up tunnels with OpenSSH.

The most interesting chapter I found next; Managing your OpenSSH Environment, in which the author introduces an OpenSSH secure gateway that can be used in large environments. Securing OpenSSH, SSH- and Key-Management are followed by SSHFP (RFC 4255), a method to store public host keys in DNS. Stahnke implements a method for distributing public keys using RPM. Although that is interesting in itself, I strongly missed a discussion on storing SSH public keys in an LDAP directory; a must-have IMHO.

Part 4 of Pro OpenSSH deals with Administration. Sundry Shell and Perl scripts in real-world examples give the reader a good look into the capabilities of using OpenSSH in her own tools on her own systems. Last but not least, the appendices focus on alternative SSH clients and SSH on Windows.

Even if you have, like I have, already read SSH, The Secure Shell, Apress' Pro OpenSSH is well worth reading. I give it an 8/10.