1.1 --- a/OpenSecurity/bin/opensecurity_server.py Tue Dec 10 12:16:11 2013 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,69 +0,0 @@
1.4 -#!/bin/env python
1.5 -# -*- coding: utf-8 -*-
1.6 -
1.7 -# ------------------------------------------------------------
1.8 -# opensecurity-server
1.9 -#
1.10 -# talk to the opensecurity server
1.11 -#
1.12 -# Autor: Oliver Maurhart, <oliver.maurhart@ait.ac.at>
1.13 -#
1.14 -# Copyright (C) 2013 AIT Austrian Institute of Technology
1.15 -# AIT Austrian Institute of Technology GmbH
1.16 -# Donau-City-Strasse 1 | 1220 Vienna | Austria
1.17 -# http://www.ait.ac.at
1.18 -#
1.19 -# This program is free software; you can redistribute it and/or
1.20 -# modify it under the terms of the GNU General Public License
1.21 -# as published by the Free Software Foundation version 2.
1.22 -#
1.23 -# This program is distributed in the hope that it will be useful,
1.24 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
1.25 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.26 -# GNU General Public License for more details.
1.27 -#
1.28 -# You should have received a copy of the GNU General Public License
1.29 -# along with this program; if not, write to the Free Software
1.30 -# Foundation, Inc., 51 Franklin Street, Fifth Floor,
1.31 -# Boston, MA 02110-1301, USA.
1.32 -# ------------------------------------------------------------
1.33 -
1.34 -# ------------------------------------------------------------
1.35 -# import
1.36 -
1.37 -from pprint import PrettyPrinter
1.38 -
1.39 -
1.40 -# ------------------------------------------------------------
1.41 -# code
1.42 -
1.43 -def query_apps():
1.44 - """get the list of known apps"""
1.45 -
1.46 - # TODO: REPLACE THIS HARDCODED STUFF WITH REAL CODE TO THE OS SERVER
1.47 - apps = [
1.48 - { 'vm': 'SecurityDVMBrowser', 'name': 'Browser', 'command': '/usr/bin/iceweasel'},
1.49 - ]
1.50 -
1.51 - return apps
1.52 -
1.53 -
1.54 -def query_vms():
1.55 - """get the list of registered vms, their ip and the prefered user"""
1.56 -
1.57 - # TODO: REPLACE THIS HARDCODED STUFF WITH REAL CODE TO THE OS SERVER
1.58 - vms = [
1.59 - { 'user': 'opensec', 'name': 'SecurityDVMBrowser', 'ip': '192.168.56.101'},
1.60 - ]
1.61 -
1.62 - return vms
1.63 -
1.64 -
1.65 -# start
1.66 -if __name__ == "__main__":
1.67 - print("known apps: ")
1.68 - PrettyPrinter().pprint(query_apps())
1.69 - print("known vms: ")
1.70 - PrettyPrinter().pprint(query_vms())
1.71 -
1.72 -