OpenSecurity/Readme.md
author Oliver Maurhart <oliver.maurhart@ait.ac.at>
Thu, 03 Apr 2014 10:53:27 +0200
changeset 127 8addda300ca7
permissions -rwxr-xr-x
merge
     1 # How To OpenSecurity Demo
     2 
     3 ## Installation
     4 
     5 1. Copy the OpenSecurity parent Folder as-is to "C:\Program Files"
     6 
     7 2. Inside this folder you find:
     8 
     9     OpenSecurity/
    10     ├── client  ............... OpenSecurity client code
    11     ├── cygwin  ............... A cygwin subsystem used inside OpenSecurity
    12     ├── gfx  .................. OpenSecurity images and icons used
    13     ├── install  .............. Necessary 3rd party installment
    14     └── server  ............... OpenSecuirty server code
    15 
    16 3. Switch into the "install" folder. There you have:
    17 
    18     OpenSecurity/
    19     └── install/
    20         ├── OpenSecurity.reg
    21         ├── PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-x32.exe
    22         ├── PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-x64.exe
    23         ├── python-2.7.6.amd64.msi
    24         ├── python-2.7.6.msi
    25         ├── VirtualBox-4.3.4-91027-Win.exe
    26         └── web.py-0.37
    27     
    28     Please install the software via double-click:
    29 
    30     * python-2.7.6.msi on 32-Bit
    31         _or_ 
    32       python-2.7.6.amd64.msi on 64-Bit
    33       
    34     * PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-x32.exe on 32-Bit
    35         _or_
    36       PyQt4-4.10.3-gpl-Py2.7-Qt4.8.5-x64.exe on 64-Bit
    37     
    38     * VirtualBox-4.3.4-91027-Win.exe
    39     
    40     If you didn't change any settings you'll have a Win32 Python
    41     installation at C:\Python27 right now. This is important for 
    42     the next step.
    43     
    44     1. Open up a cmd box --> Start / Execute / "cmd"
    45     2. Switch into the OpenSecurity folder where the web.py resides:
    46     
    47         C:> cd C:\Program Files\OpenSecurity\install\web.py-0.37
    48         
    49     3. Install web.py by calling the setup.py with the "install" command
    50        from within a python shell:
    51        
    52         C:\Program Files\OpenSecurity\install\web.py-0.37> C:\Python27\python.exe setup.py install
    53         running install
    54         running build
    55         running build_py
    56         creating build
    57         creating build\lib
    58         creating build\lib\web
    59         copying web\application.py -> build\lib\web
    60         copying web\browser.py -> build\lib\web
    61         copying web\db.py -> build\lib\web
    62         copying web\debugerror.py -> build\lib\web
    63         copying web\form.py -> build\lib\web        
    64         ...
    65 
    66 4. Finally update your registry by double-clicking the OpenSecurity.reg file.
    67 
    68 5. To make changes in effect (automatically starting the OpenSecurity client and server daemons) you should restrat the machine.
    69 
    70 NOTE: 
    71     Windows will pop up an UAC dialog for X11, OpenSecurity Client Daemon and OpenSecuirty Server Daemon
    72 
    73     
    74 ## VirtualBox VM Images
    75 
    76 For the current setup to work you need at least a single Virtual Machine:
    77 
    78 1. Create a Virtual Machine for Debian Linux
    79     --> The machine should be named 'Debian 7'
    80     --> There must be a user called 'user'
    81 
    82 2. Have a Debian 7 (or 7.2) network installation ready and install a fresh new Debian system, with a user called 'user'.
    83 
    84 3. Create 2 (!) Network Interfaces for your Virtual Machine
    85     a) The first will be set to "NAT" --> this will be eth0
    86     b) The second will be set to "Host-Only Adapter" --> this will be eth1
    87 
    88 4. Power up the Virtual Machine and set the network interface configuration (/etc/network/interfaces) to:
    89 
    90     auto lo
    91     iface lo
    92     
    93     auto eth0
    94     allow-hotplug eth0
    95     iface eth0 inet dhcp
    96     
    97     auto eth1
    98     iface eth1 inet static
    99         address 192.168.56.101
   100         netmask 255.255.255.0
   101         gateway 192.168.56.1
   102         
   103 5. Create a passwordless SSH connection from within Cygwin into the VM:
   104 
   105     a) ensure the VM is started and you have a user login called 'user'.
   106     b) start a cygwin shell by double-clicking "C:\Program Files\OpenSecurity\cygwin\Cygwin.vbs"
   107     c) generate a ssh-key
   108     
   109         $ ssh-keygen
   110         
   111         --> do not set passphrases, leave all to default
   112     d) copy the public key to the virtual machine
   113     
   114         $ scp ~/.ssh/id_rsa.pub user@192.168.56.101:
   115         
   116     e) add the public key to the list of authorized keys:
   117     
   118         - login into the virtual machine
   119         - open up a terminal
   120         
   121         $ mkdir ~/.ssh &> /dev/null
   122         $ cat id_rsa.pub >> ~/.ssh/authorized_keys
   123         
   124     f) test the passwordless connection by open the cyginw command prompt on the Windows Host again:
   125     
   126         $ ssh user@192.168.56.101
   127         
   128        --> this should now give you a login shell on the virtual machine without a password request.
   129         
   130         (you can now safely delete the id_rsa.pub file in your virtual machine's home)
   131 
   132 
   133 ## Demonstration
   134 
   135 * Start the Virtual Machine
   136     --> You do not have to log in. Just start the machine. If the X11-Login Screen appears, all is done.
   137     
   138 * Start the opensecurity-client by calling
   139 
   140     NOTE: you may omit this step if you double-clicked the OpenSecuirty.reg file previously.
   141 
   142     C:> C:\
   143     C:> cd "C:\Program Files\OpenSecurity\client"
   144     C:\Program Files\OpenSecurity\client> start "opensecurity_client_restful_server.py 8090"
   145     
   146     
   147 * Open Up a browser and type:
   148 
   149     "http://127.0.0.1:8090"
   150     
   151     HAVE FUN! =D