RRSIG Expiry Monitoring
Karl | September 24, 2010 21:52It’s a few days over 30 since I tinkered with DNSSEC and wrote my previous blog entry on the subject.
I played for a couple of days, got it working, blogged it, and then, of course, totally forgot about it while other stuff filled my mind and time.
Until today.
Today, it turns out, is 30 days since I last updated the zonefile, and the last time I signed it.
So, today, the RRSIGs expired, and anything that’s doing DNSSEC started failing when resolving it.
So, I’ve knocked up some quick and dirty monitoring that runs from cron on the primary.
First, there’s a shocking bit of shell that decides if the zone has any records with RRSIGs about to expire, and if there are, re-signs the zone and issues an rndc reload.
As an aside, I’d previously used -N INCREMENT in the signzone command. The meant I’d have to open the original zone, and modify it. For the automatic re-signing, I’ve changed this to UNIXTIME so that no modifications are required to the unsigned zone. I’d previously used a serial number format of YYYYMMDDXX, and so swapping to UNIXTIME meant a quick visit to the secondaries to persuade them to transfer the zone, but all should be working well now.
The way the shell decides if the zone has expired or about to expire RRSIGs is by calling a bit of perl that opens the zonefile, and hauls through it looking at the RRSIG expiry timestamps.
The scripts output nothing if all is well, and something useful if not. It’s designed to run from cron, once per day, and so cron will email me if there are problems, and won’t bother me if all is well.
It’s a bit rough and ready, but functional.
ToDo:
- Make it less rough. I’ve been lazy, and so used shell for the shell’y kind of bits, and perl for hunting around regexp style in the zonefile. On the upside it took minutes to write and test.
- Package it into a perl module?
- Somehow automate hunting for zones that are signed and checking them. Whoring round /var/cache/bind looking for *.signed is quick, but probably a bit hacky?
Tags: BIND,DNS,DNSSEC
Categories: Technical
No Comments »













Twitter
LinkedIn
Facebook
Youtube
Flickr
LinkedIn