Monday, June 30, 2008

Using Sidewinder Admin Console on OS X & Ubuntu.

Anyone that knows me is probably tired of hearing how much I love the Secure Computer Sidewinder firewall. This product has recently been renamed to the Secure Computing Secure Firewall (Sidewinder). Most people that work for Secure Computing that I've spoken too are also tired of hearing me complain about the name change too. I even wrote to Secure Computing's marketing department to gripe about it, but they never wrote back.

I have very few complaints about the product, but one that really gets under my skin is that you have to run the Admin Console from a Windows machine. I run Ubuntu on my desktop and OS X on my laptop. If I need to use a Windows app I have to fire up one of my virtual machines. That's a real pain in the butt when sometimes I just want to make a minor tweak to my firewall config.

Luckily for me, the Sidewinder Admin Console is python based and runs very well on WINE. You may be wondering why I have to use wine at all if the program is written in python. Well the answer is because they don't ship plain text files, they actually ship compiled python which was compiled on Windows and wont work with the python built in to your OS X or linux machine. I tried, it didn't work.

But what did work for me was wine. So that's the first thing that you have to do to make this whole thing work: install wine. On the Ubuntu box it was as simple as typing sudo apt-get install wine. On the OS X machine I installed macports and XCode. Then I was able to type sudo port install wine. Ages later, the latest verion of wine was on my OS X machine.

Now for the installation of the Admin console. On the Ubuntu machine I put in my Sidewinder Management Tools CD and opened a command prompt. I navigated to /media/cdrom0/Install and ran wine setup.exe. The install wizard appeared and installed as expected. On the Mac it was equally simple. Put in the CD, open a terminal and go to /Volumes/Sidewinder 7/Install and run wine setup.exe.

Here is where things start to differ between the two systems. On the Ubuntu machine I can open the Admin Console by going to the Applications menu, navigate to Wine, Program Files, Sidewinder, and just run the admin console. On the Mac, things are a little different.

On the Mac, I have to open a terminal again in my home folder and type cd .wine/drive_c/Program Files/Secure Computing/Sidewinder 7 Admin Console/ac/lib. From this directory I have to run the following command: wine "c:\program files\secure computing\sidewinder 7 admin console\python\pythonw.exe" "c:\program files\secure computing\sidewinder 7 admin console\ac\lib\cobraclient.pyc" This will open the Admin Console for me. If I enter the same command but I'm not in the folder that I mentioned above I get an error message. I know the preview looks really blurry, try clicking on it to see the error in detail if you're interested.

If everything works right you get to see the Sidewinder Admin screen come up.

You're obviously not done yet. The Admin Console on your Management CD is a little outdated, and when you connect to your firewall you're going to have to download and apply some updates. On a Windows machine this is an automatic process, but when you're using wine you have to do things manually. Connect to your firewall and say yes to download the updates. After you've downloaded the updates the Admin Console will tell you that it is going to close and apply the updates. It does close, but it does not apply the updates, you must do that yourself.

You should be in the ac/lib directory, so you need to go up one folder and into the ac_updater folder. The full path is ~/.wine/drive_c/Program Files/Secure Computing/Sidewinder 7 Admin Console/ac/ac_updater. Now you will have several executable files numbered sequentially. Run wine on each of those executables in numerical order. After each wizard finishes running you will have to wait 30 to 60 seconds for your command prompt to come back. That is normal. I also had two of the updates write a lot of error messages: not enough blocks in chain to write data. However I pressed on with the next update and everything worked fine for me.

Once the updates were complete, I was able to navigate to the proper directory, run the command above and voila! Sidewinder Admin Console running perfectly on Mac OS X. For Ubuntu all I have to do is to to my Applications Menu, click on Wine, and follow the tree to my admin console. I wish that it were that easy on my Mac. However, to reduce the inconvenience of navigating to directories and entering long commands on my Mac, I wrote a batch file that will handle it for me. I still need to open terminal to run this, so it's not quite as nice as I would like, but at least I don't have to boot into a virtual machine. Here is the code for that batch file.

#! /bin/bash

cd ~/.wine/drive_c/Program\ Files/Secure\ Computing/Sidewinder\ 7\ Admin\ Console/ac/lib/

wine "c:\program files\secure computing\sidewinder 7 admin console\python\pythonw.exe" "c:\program files\secure computing\sidewinder 7 admin console\ac\lib\cobraclient.pyc" &
UPDATE: I did run into some problems with updating my client about a month later after I applied some patches, but I was able to work through it and keep running my firewall without using a virtual machine. Check out this post for the dirty details.

No comments: