bug fixes in VMManager.py and rebuild USBEventSvc. New binaries deployed
1.1 --- a/server/opensecurityd.py Wed Dec 04 18:01:06 2013 +0100
1.2 +++ b/server/opensecurityd.py Fri Dec 06 10:47:26 2013 +0100
1.3 @@ -111,9 +111,11 @@
1.4 """OpenSecurity '/device_change' handler"""
1.5
1.6 def GET(self):
1.7 + print 'received device_change'
1.8 gvm_mgr.cygwin_path = 'c:\\cygwin64\\bin\\'
1.9 + gvm_mgr.handleDeviceChange()
1.10 +
1.11 #gvm_mgr.configureHostNetworking()
1.12 - print 'received device_change'
1.13 return "os_device_change"
1.14
1.15
2.1 Binary file server/opensecurityd.pyc has changed
3.1 --- a/server/vmmanager/vmmanager.py Wed Dec 04 18:01:06 2013 +0100
3.2 +++ b/server/vmmanager/vmmanager.py Fri Dec 06 10:47:26 2013 +0100
3.3 @@ -83,7 +83,7 @@
3.4
3.5 def listRSDS(self):
3.6 cmd = 'VBoxManage list usbhost'
3.7 - results = self.execute(cmd)
3.8 + results = self.execute(cmd)[1]
3.9 results = results.split('Host USB Devices:')[1].strip()
3.10
3.11 items = list( "UUID:"+result for result in results.split('UUID:') if result != '')
3.12 @@ -134,7 +134,7 @@
3.13 attached_devices = dict()
3.14 for vm in vms:
3.15 rsd_filter = self.getUSBFilter(vm)
3.16 - if filter != None:
3.17 + if rsd_filter != None:
3.18 attached_devices[vm] = rsd_filter
3.19 return attached_devices
3.20
3.21 @@ -163,7 +163,8 @@
3.22 self.execute(cmd)
3.23 cmd = 'VBoxManage storagectl ' + vm_name + ' --name contr1 --add sata --portcount 2'
3.24 self.execute(cmd)
3.25 - cmd = 'VBoxManage storageattach ' + vm_name + ' --storagectl contr1 --port 0 --device 0 --type hdd --mtype normal --medium \"'+ machineFolder + '\SecurityDVM\SecurityDVM.vmdk\"'
3.26 + cmd = 'VBoxManage storageattach ' + vm_name + ' --storagectl contr1 --port 0 --device 0 --type hdd --medium \"'+ machineFolder + '\SecurityDVM\SecurityDVM.vmdk\"'
3.27 + #--mtype immutable
3.28 self.execute(cmd)
3.29 return
3.30
3.31 @@ -207,7 +208,7 @@
3.32 # return the description set for an existing VM
3.33 def getVMInfo(self, vm_name):
3.34 cmd = 'VBoxManage showvminfo ' + vm_name + ' --machinereadable'
3.35 - results = self.execute(cmd)
3.36 + results = self.execute(cmd)[1]
3.37 props = dict((k.strip(),v.strip().strip('"')) for k,v in (line.split('=', 1) for line in results.splitlines()))
3.38 return props
3.39
3.40 @@ -256,19 +257,25 @@
3.41 attached_devices = self.getAttachedRSDs()
3.42 connected_devices = self.listRSDS()
3.43 for vm_name in attached_devices.keys():
3.44 - if attached_devices[vm_name] not in connected_devices.values():
3.45 + if connected_devices and attached_devices[vm_name] not in connected_devices.values():
3.46 + # self.netUse(vm_name)
3.47 self.stopVM(vm_name)
3.48 self.removeVM(vm_name)
3.49
3.50 attached_devices = self.getAttachedRSDs()
3.51 for connected_device in connected_devices.values():
3.52 - if connected_device not in attached_devices.values():
3.53 + if attached_devices or connected_device not in attached_devices.values():
3.54 new_sdvm = self.generateSDVMName()
3.55 self.createVM(new_sdvm)
3.56 - self.genCertificateISO(new_sdvm)
3.57 - self.attachCertificateISO(new_sdvm)
3.58 self.attachRSD(new_sdvm, connected_device)
3.59 self.startVM(new_sdvm)
3.60 + self.netUse(new_sdvm)
3.61 +
3.62 + def handleBrowsingRequest(self):
3.63 + new_sdvm = self.generateSDVMName()
3.64 + self.createVM(new_sdvm)
3.65 + self.genCertificateISO(new_sdvm)
3.66 + self.attachCertificateISO(new_sdvm)
3.67
3.68 # executes command over ssh on guest vm
3.69 def sshGuestExecute(self, vm_name, prog, user_name='opensec'):
3.70 @@ -292,7 +299,7 @@
3.71 # executes NET USE and connects to samba share on guestos
3.72 def netUse(self, vm_name):
3.73 ip = self.getHostOnlyIP(vm_name)
3.74 - cmd = 'net use H: \\' + ip + '\RSD_Device'
3.75 + cmd = 'net use H: \\' + ip + '\USB'
3.76 return self.execute(cmd)
3.77
3.78
4.1 Binary file server/vmmanager/vmmanager.pyc has changed
5.1 Binary file server/windows/USBEventSvc/Debug/OpenSecUSBEventSvc.exe has changed
6.1 Binary file server/windows/USBEventSvc/Debug/OpenSecUSBEventSvc.ilk has changed
7.1 Binary file server/windows/USBEventSvc/Debug/OpenSecUSBEventSvc.pdb has changed
8.1 --- a/server/windows/USBEventSvc/OpenSecUSBEventSvc/OpenSecUSBEventSvc.cpp Wed Dec 04 18:01:06 2013 +0100
8.2 +++ b/server/windows/USBEventSvc/OpenSecUSBEventSvc/OpenSecUSBEventSvc.cpp Fri Dec 06 10:47:26 2013 +0100
8.3 @@ -336,7 +336,7 @@
8.4
8.5 case SERVICE_CONTROL_DEVICEEVENT:
8.6 SvcReportEvent(EVENTLOG_INFORMATION_TYPE, _T("Received SERVICE_CONTROL_DEVICEEVENT"));
8.7 - //NotifyOpenSecManager();
8.8 + NotifyOpenSecManager();
8.9 break;
8.10
8.11 default:
9.1 Binary file server/windows/USBEventSvc/Release/OpenSecUSBEventSvc.exe has changed
10.1 Binary file server/windows/USBEventSvc/Release/OpenSecUSBEventSvc.pdb has changed
11.1 Binary file server/windows/USBEventSvc/USBEventSvc.sdf has changed
12.1 Binary file server/windows/USBEventSvc/USBEventSvc.v12.suo has changed
13.1 Binary file server/windows/USBEventSvc/x64/Debug/OpenSecUSBEventSvc.exe has changed
14.1 Binary file server/windows/USBEventSvc/x64/Debug/OpenSecUSBEventSvc.ilk has changed
15.1 Binary file server/windows/USBEventSvc/x64/Debug/OpenSecUSBEventSvc.pdb has changed
16.1 Binary file server/windows/USBEventSvc/x64/Release/OpenSecUSBEventSvc.exe has changed
17.1 Binary file server/windows/USBEventSvc/x64/Release/OpenSecUSBEventSvc.pdb has changed