Infinitus Incognita

The Infinite Unknown

As part of a larger project I needed to generate real time radius records from the CDR accounting files of several cluster pairs of Broadsoft application servers. So I wrote a perl script to do just that. It maps the CDR fields to radius attribs and encodes the accounting packet using the Net::Radius::Packet CPAN module.  In my case I’m using the Radiator radius server  from OSC Software on the other end with lots of custom ‘hook code’ to clean up and store the call data coming off our network into a Postgresql database.  This is my first time doing any development with radius.. but I’ve been running this script on several servers for a few weeks now and it appears to be quite stable.

Site Facelift

No comments

I’ve been working on giving the site a facelift lately.. trying to make it a little more ‘light’… how am I doing?  I’ll also be rotating in various photos I’ve taken in the page header.  I’ll try to stick to photos I’ve actually taken myself… maybe as an incentive to do more traveling.

Duct_TapeI’ve written before about the world being held together by duct tape… and it seems there are more people lately who have decided to rip off the covers and go looking for some duct tape.  The latest headline comes from the world of SCADA systems.  Researchers Lay Bare Woeful SCADA Security.  SCADA systems are small embedded computers that help guide various kinds of industrial processes..manufacturing, power plants and water systems. Basically anything where you have sensors, motors, pumps etc that have to be monitored and controlled.  Iran learned all about lax SCADA security over the last couple years and now everyone else is finding out about it too.  The dirty little secret is that most of these systems haven’t fundamentally changed in the last 20 years… despite huge improvements in the level of sophistication of what’s out there now even for hobbyists.  Things like the Arduino platform costs an order of magnitude less than commercial systems and can perform many of the same jobs.  Actually that’s not true though.. SCADA systems have changed in one very important way.. people started plugging them into a network.  Once you do that.. you are opening yourself up for a world of hurt if those systems were not designed to operate in a hostile environment.  As the researches in the linked story found out.. some of them can’t even be probed without crashing.. never mind standing up to direct attacks.

I was fortunate enough to take the SANS security course on Wireless Ethical Hacking, Penetration Testing, and Defenses a few years ago. While I totally recommend the SANS courses.. they are really top notch in the world of tech training.. one of the things I learned as a result of that course is that very few people/organizations take security seriously.   Security should be thought of as existing on a continuum along with ease of use.  That is.. something could be totally secure and totally unusable or very easy to use and totally insecure.  SCADA systems have been operating at that end of the scale for decades now and I doubt very seriously that’s going to change anytime soon.  If the customers who buy these systems cared at all about security they would demand the systems actually be more secure.  That doesn’t happen though.. and I blame human nature.

Incidentally… you may think your world isn’t personally touched by these systems but you would be wrong.  In fact.. in some areas you may already have a vulnerable SCADA component bolted right on your own home.  Heard of the SmartGrid?  The very same researcher who taught my wireless hacking class has found some serious issues with the power meters used in smart grid systems.  Imagine a worm that could infect a network of power company smart meters.. giving control over the power they regulate to some 3rd party.  At that point it would be trivial to crash the regional electrical grid on demand.. and we know from what happened accidentally in the north east a few years ago that can take days to recover from. Sleep tight!

As part of a new and fairly large project I have a need to partition a few postgres tables and have a rolling daily window.  That is.. I want to organize data by a timestamp storing each day in its own partition and maintain 90 days of historical data.  Doing this is possible in Postgresql but it’s not pretty or very clean to set it up.  To simplify the process I wrote this perl script that (when run daily) will pre-create a certain number of empty partitions into the future and remove the oldest partitions from your window.

The script is generalized so as to be easy to modify and there isn’t much here that’s specific to postgres.. so it could easily be adapted for use with other systems like Oracle. You will need to put in the DDL for the child tables you will create but otherwise it’s pretty straight forward.  Please let me know if you find this useful as I couldn’t find anything else out there like it.

Visit the project page for details and the download.

Update: Several important updates to the code and my examples since I first published this.  Be sure to grab the latest version which is starting to behave reasonably now.

My mail.app unread messages iconI’ve been using a mac for a while now and I recently decided to dump Entourage and go to using the native Mail.app.  I noticed a problem though.. within minutes of starting up it would consume several hundred megs of ram and have frequent CPU spikes of 80 to 100%.  If Mail was left open, memory usage would climb above 2 gig with continued CPU spikes.  After much digging I finally found the problem and fixed it.

I’d been using iSync back before I got an iPhone..  and had never thought to disable it.  It looks like what was happening is that mail and other apps (ical, address book) had been building a huge database of stuff that needed to be synced to my old phone.  Once I went in and reset the sync history and disabled iSync.. everything calmed down and now a running instance of Mail.app with 3 imap accounts and an Exchange account is using about 60 MB of ram.. and it’s not steadily climbing as it had been before.  This may have also been the source of the problems I’d been having with Entourage.