Archive for the 'Linux' Category

Aug 16 2013

Building an ARM-based VM for SDL Training

Before I get into the details of this post I want to provide a bit of a background to this project.  I run the Security Engineering Team for a manufacturer.  We build hardware and software products and my responsibilities include integrating a Security Development Lifecycle (SDL) into our product development process.  I’ve been working on this for about two years, slowly integrating a Microsoft-style SDL into each product’s development lifecycle.  Part of this effort involves developer and architect training.  Initially we chose to use a third-party to provide this training to our developers and kicked off that effort in April of last year.  Unfortunately, the initial training did not go well.  We had significant problems which forced us to re-evaluate our approach to the training.  After the problems we had with the initial round of the Class-Based Training (CBT) we decided to move forward with our own internally developed training.  I mentioned this in a previous blog post that I’ve been focused on putting together training on topics like:

  • Threat Modeling
  • Secure Coding in C and C++
  • Secure Coding in C#/.NET

I went about putting the relevant material for these classes and building out both class presentations as well as hands-on lab materials.  The curve ball I was thrown which resulted in my putting together this VM was sent my way when I gave this class at one of our facilities in France.  I always ask for feedback from the attendees and I got very positive feedback from this class.

About a week after the class was over I got the “unofficial” feedback through one of the guys who works in the Security Engineering Team in Europe.  The gist of this feedback was that while they really liked the labs they felt that it would be more realistic if the labs were done on an ARM-based processor VM rather than the Intel x86 based VMs that I was using.   All of our  hardware products utilize an ARM based processor due to a wide-variety of reasons – not least of which is that they’re embedded devices.

On top of that request the developers were more familiar with Windows (they do all of their development either in Eclipse or, in the case of the guys who develop our .NET based applications, Visual Studio) and they wanted more of a windowing environment like Windows (I don’t know of any version of Windows that runs on the ARM processor).  So, between these two requests I had to start looking at building my own ARM based VM – with the caveat is that it has to run under Windows…yeah…fun!

First thing I had to do was find a processor emulator.  That part was pretty easy – QEMU!  QEMU is a fantastic VM tool – while everyone talks about VMware or VirtualBox or Xen – people tend to overlook QEMU.  QEMU not only provides for building out your own VM that is x86 based but it also allows you to build out VMs that use other processor architectures like ARM, PowerPC, Alpha, SPARC, S390, Motorola 68K, and others.  I mean, this is a really cool tool.

I downloaded the latest version of QEMU (at least it was the latest when I downloaded it): 1.5.1 and installed it on my Windows 7 laptop and then did a search for pointers on how to build an ARM based VM using QEMU.  And boy did I find the links – unfortunately they were all expecting that you would build the VM under a Linux system – not a Windows system.  Some of the links I found that were really helpful were:

Between these sites and some tinkering I was finally able to get the ARM based Debian image built.  However, I had such difficulties with building it under Windows 7 that I finally punted and built it on a spare machine I had in the basement (an HP DL380 2U server with 12GB of memory and 216 GB of hard drive space – you’d think that was overkill but believe it or not the VM took almost half a day to finish building – and then it was a matter of getting the development packages installed!).  I’ll post about the whole effort (and the effort of building the VM under Windows in the next few weeks).

One response so far

Aug 08 2013

Security Development Lifecycle Training

Last year we tried to outsource our classroom-based training (CBT) for our SDL effort to a third party…that didn’t go so well. I don’t want to mention the name of the company we used but we were disappointed enough with the first round of the training and we decided to go our own route.  To that end I was tasked with creating the content for the training…and I have been heads down most of the time this year working on several classes:

  • Threat Modeling
  • Secure Coding in C and C++
  • Secure Coding C#

The Threat Modeling class has been completed (although it could stand to be updated and cleaned up a bit).  The Secure Coding in C and C++ class was completed but the feedback I got from my second group of attendees was that they’re doing development on the ARM processor platform and they wanted to see the exploits in the hands-on lab exercises on that platform.  The Secure Coding in C# is still being built out.

The good news is that I have been able to get a Debian Linux image built (with a GUI interface) for the Secure Coding in C and C++ class using the QEMU ARM emulator.  The next step is to setup the networking so that I can pull additional packages into the image and build out a complete development environment.  This has been driving me crazy for the past couple of months because the installer for the image and the QEMU disk image were constantly giving me problems.  Today was a “Good” day…

 

No responses yet

Dec 09 2008

VMware Server 2.0 — Finally!

Published by under Linux,Virtualization,VMware

Well, VMware put Server 2.0 (the final release) out at the end of October and I have to see…it looks really good. I haven’t had a chance to compare it to Server 2008 Hyper-V yet (as I need to finish building my Hyper-V box first) however I have to say that between Server 2.0 and VMware ESXi 3.5 update 2 VMware has some very nice virtualization products out on the market. Let’s cover Server 2.0 first before we get into ESXi 3.5. Here’s the specs for the Server 2.0 system:

  • HP Proliant DL380
  • Dual 3.06GHz Xeon CPUs
  • Dual 10/100MB interfaces
  • 6 x 36GB 10,000 RPM SCSI disks w/hardware RAID-5
  • 12GB memory
  • O/S: Ubuntu Server 8.04LTS

Previously I was running VMware Server 1.0.6 on this system but now that VMware has released Server 2.0 I wanted to take another look at it. While the download is big (570MB) it certainly is not too bad and the install went flawlessly. The Server 2.0 detected the 1.0.6 software on the machine, uninstalled it (but kept the settings) and then installed Server 2.0 and configured it using the settings from the 1.0.6 version. All in all, within about 10 minutes I was back up and running. I like the look of the new interface as well — reminds me very much of the clean look of ESXi…and the best part is that it runs in IE8 Beta 2 (well, almost). To login I simply point the browser to the host system port 8333 as shown.

Server 2.0 Login

Once you login the amount of information at your fingertips is great.

VMware 2.0 summary page

Selecting a specific machine also gives you an immense amount of detail

Machine information in VMware Server 2.0

You can start machines directly from the summary page or you can start them from the console tab by clicking on the big white arrow

Starting a new VM image

Here’s where IE8 was a bit problematic (and I’m not sure it was IE8 or if it’s also an issue with IE7…I’ll have to test this). I had to do two things to get the console to work under Vista/IE8 Beta 2. First, I had to add the VMware server system into IE’s trusted site list. Second, I also had to be running in compatibility mode. Finally, once those two items were done I was able to install the VMRC plugin and get it to work. I still haven’t tried this under Firefox 3.0 yet and will try that later. Once the machine starts you click in the console window (or at one of the two squares in the console tab in the VMware shown below)

Console options in the Console tab

The option on the left opens up a new VMRC window as a separate window. The box on the right opens the VMRC in full screen mode (which you can then reduce to a regular sized window). Not sure what the benefit of the two options are but it’s there if you need it. Once the machine starts up you can have multiple VMRC windows running just like you have with ESXi.

VM console - Server 2008

VMware Server 2.0 Multiple VMRC windows

All in all, I’m quite impressed with VMware Server 2.0. I plan on playing with it for quite a while and will consider whether I will migrate this host server over to VMware ESXi 3.5. Given the small footprint of ESXi (both in terms of disk as well as memory) it may well be the way to go in the long run. I’ll review my ESXi experience in an upcoming post as well as my Hyper-V experience as well.

No responses yet

Nov 16 2008

New VM System

Published by under Linux,Virtualization

Well…I managed to get a hold of an HP DL380 G3 with dual 3.06GHz Xeon processors, 2GB of RAM, and 6 36GB hard drives with a RAID 5 controller for very little cost. This has accelerated my move towards virtualizing all of my systems at home. In the process of doing so I have also decided that I’m going to upgrade my domain controllers to Server 2008 Standard.

First off I’m using as a base OS on the DL380 Ubuntu 8.04 with VMware Server 1.0.6. The reason being is that I can’t install Server 2008 with Hyper-V on the DL380 G3 — it’s only supported on the DL380 G5 (which has the Intel procs with VT). So, given that I decided to go with Ubuntu and VMware. The install of Ubuntu went easy enough and VMware was just slightly more complicated. I used the instructions here to get the VMware MUI working properly (or course, now it’s not working properly and I’ve got to figure out why).

Anyway, now that I’ve gotten VMware installed and configured I have installed two VM guests — Server 2008 Standard and Server 2008 Core Standard. I’m using both network interfaces on the machine — one for connecting to the VM host system and the other is a bridged interface for the VM guests. I configured the Server 2008 Core system’s network settings according to Dan Petri’s instructions here. In addition I enabled NetBIOS over TCP/IP using the wmic command utility. The instructions for doing that are here.

Finally, once the VMware Tools were installed on the Server 2008 Core system I had to change the display resolution. Turns out, when you install the VMware Tools on Server 2008 Core the display resolution goes from 800×600 to 640×480 (which is really annoying – see the following picture).

Server 2008 Core After VMware Tools Install

Server 2008 Core After VMware Tools Install

Changing that is not so simple though as it requires that you modify the registry. You need to find the right registry setting. The video settings can be found in HKLM\SYSTEM\CurrentControlSet\Control\Video\ where is the ID for the video card and driver currently being used. Look for the Device Description registry key (it should be VMware SVGA II). Right above it are the DefaultSettings.XResolution and the DefaultSettings.YResolution registry key. They are both DWORDs and can be input either in hexadecimal or decimal (see below)

Server 2008 Core Registry Settings for Display Resolution

Server 2008 Core Registry Settings for Display Resolution

I changed the values in both registry keys to 1024 and 768 respectively and then restarted the VM (using the command shutdown /r /t 0). The final result is shown below.

Server 2008 Core with 1024x768 Display Resolution

Server 2008 Core with 1024x768 Display Resolution

Now I need to finish migrating the rest of my VM images off the old VALinux FullOn 2240 and onto the new system. The only things I need to do to the DL380 is increase the RAM from 2GB to 12GB and buy a cabinet for it…man is it loud…I forgot just how loud the DL380s are.

No responses yet

Aug 27 2008

Rebuilding the VMware Server

My trusty VALinux Full-On 2240 system finally reached the point where I couldn’t use it. The system disk is fine with Ubuntu 08.04 on it. The problem was with the RAID array that I created using 3 36GB disks. That’s where I stored my VM images and one disk back in June began to have problems. Well, a few weeks ago a second disk began to have problems — wonderful. The issue is that I had it configured as a RAID as a RAID 0 array…just concatenating the three partitions together. Doing that I wasn’t just able to replace a single drive and reconstruct it. Now I had to replace two out of the three drives. Oh joy.

The first thing I needed to do was to “rescue” the VM images I had installed on the RAID array. I copied the images to my desktop system (it pays to have 500GB of available space for this) and saved them that way. Then I ordered 3 73.4GB Seagate ST173404LCV drives from PC Progress in Elk Grove Village, IL. The disks arrived on Monday and I installed them on Tuesday. This time, I built the RAID array using mdadm as a RAID 5 array so that if one of the disks goes south I can always pull it, put another 73.4GB disk in and rebuild the array easily. Now the only thing left to do is to restore the images to the server. Again…oh joy!

No responses yet