# HG changeset patch # User om # Date 1384252294 -3600 # Node ID c9bf2537109a66a978f041bfa075090c588a17fc # Parent 446a7ba983099c5eb004becfdb2c870a8cf98eaa added C/C++ and Python sources diff -r 446a7ba98309 -r c9bf2537109a ait/os/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/CMakeLists.txt Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,285 @@ +# ------------------------------------------------------------ +# CMakeLists.txt the AIT OpenSecurity ShadowFUSE +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# version 2 as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + +# project data +project(os-server C CXX) +cmake_minimum_required(VERSION 2.6) + +# load necessary basic cmake modules +include(CheckIncludeFile) +include(CheckIncludeFiles) +include(CheckLibraryExists) +include(FindPkgConfig) +include(FindPythonInterp) + +# enable tests +ENABLE_TESTING() + + +# ------------------------------------------------------------ +# set global compiler flags + +set(VERSION "0.1") +add_definitions(-DVERSION=\"${VERSION}\") + +# we relay on a GNU/BSD SOURCE +add_definitions(-D_GNU_SOURCE) +add_definitions(-D_BSD_SOURCE) + +# set compile flags +if (CMAKE_COMPILER_IS_GNUCC) + + # tweak capabilities of gcc versions prior to 4.8 + if (${CMAKE_C_COMPILER_VERSION} LESS 4.8) + + message(STATUS "gcc compiler < 4.8 detected - tweaking flags") + + # make this clear: we use std::thread + # so enforce pthread bindings + # this may not be needed for gcc >= 4.8 + add_definitions(-pthread) + + # this is needed to have + # std::_this_thread::sleep(...) + # at hand - at least for gcc 4.6.3 and glibc 2.15 + add_definitions(-D_GLIBCXX_USE_NANOSLEEP) + + # this is needed to have + # std::_this_thread::yield() + # at hand - at least for gcc 4.6.3 and glibc 2.15 + add_definitions(-D_GLIBCXX_USE_SCHED_YIELD) + + endif (${CMAKE_C_COMPILER_VERSION} LESS 4.8) + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Werror -Wall -Wextra -pedantic -g -ggdb3 -rdynamic") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x -Werror -Wall -Wextra -pedantic -g -ggdb3 -rdynamic") + + # TODO: make speed tests with -fno-builtin especially to + # get a better memcpy performance + #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-builtin") + #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin") + +endif (CMAKE_COMPILER_IS_GNUCC) + +# additional debug and profiling options +option(DEBUG_MODE_ENABLED "enable debug mode" off) +if (CMAKE_COMPILER_IS_GNUCC) + if (DEBUG_MODE_ENABLED) + message(STATUS "debug and profiling mode enabled") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -pg --coverage") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -pg --coverage") + else(DEBUG_MODE_ENABLED) + message(STATUS "debug and profiling mode disabled: go for optimizations") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") + endif(DEBUG_MODE_ENABLED) +endif (CMAKE_COMPILER_IS_GNUCC) + + +# ------------------------------------------------------------ +# check for an existing python module (maybe extra) + +macro(CHECK_PYTHON_MODULE VARIABLE MODULE) + + message(STATUS "Looking for python module ${MODULE}") + + if (PYTHONINTERP_FOUND) + + execute_process( + COMMAND ${PYTHON_EXECUTABLE} -c "import ${MODULE}" + RESULT_VARIABLE _result + OUTPUT_QUIET + ERROR_QUIET + ) + + if ("${_result}" EQUAL "0") + set (${VARIABLE}_FOUND TRUE) + endif ("${_result}" EQUAL "0") + + endif (PYTHONINTERP_FOUND) + + if (${VARIABLE}_FOUND) + message(STATUS "Looking for python module ${MODULE} - found") + else (${VARIABLE}_FOUND) + message(STATUS "Looking for python module ${MODULE} - not found") + endif (${VARIABLE}_FOUND) + +endmacro(CHECK_PYTHON_MODULE MODULE) + + +# ------------------------------------------------------------ +# check libs and packages (headers + lib) + +# standard C files +check_include_file(stdio.h HAVE_STDIO_H) +check_include_file(stddef.h HAVE_STDDEF_H) +check_include_file(stdlib.h HAVE_STDLIB_H) +check_include_file(inttypes.h HAVE_INTTYPES_H) +check_include_file(memory.h HAVE_MEMORY_H) +check_include_file(string.h HAVE_STRING_H) +check_include_file(unistd.h HAVE_UNISTD_H) + +# time +check_include_file(sys/time.h HAVE_SYS_TIME_H) +check_include_file(time.h HAVE_TIME_H) + +# file system stuff +check_include_file(fcntl.h HAVE_FCNTL_H) +check_include_file(sys/stat.h HAVE_SYS_STAT_H) + +# math +check_include_file(math.h HAVE_MATH_H) + +# stdbool +check_include_file(stdbool.h HAVE_STDBOOL_H) + +# endian +check_include_file(endian.h HAVE_ENDIAN_H) + +# math.h +check_include_file(math.h HAVE_MATH_H) + +# networking +check_include_file(netdb.h HAVE_NETDB_H) +check_include_file(ifaddrs.h HAVE_IFADDRS_H) +check_include_file(netinet/in.h HAVE_NETINET_IN_H) +check_include_file(arpa/inet.h HAVE_ARPA_INET_H) +check_include_file(sys/socket.h HAVE_SYS_SOCKET_H) +check_include_file(sys/un.h HAVE_SYS_UN_H) + +# assert +check_include_file(assert.h HAVE_ASSERT_H) + +# signal +check_include_file(signal.h HAVE_SIGNAL_H) + +# sys/uio +check_include_file(sys/uio.h HAVE_SYS_UIO_H) + +# syslog +check_include_file(syslog.h HAVE_SYSLOG_H) + +# errno +check_include_file(errno.h HAVE_ERRNO_H) + +# limits +check_include_file(limits.h HAVE_LIMITS_H) + +# sys/mman.h +check_include_file(sys/mman.h HAVE_SYS_MMAN_H) + +# dirent.h +check_include_file(dirent.h HAVE_DIRENT_H) + +# fuse.h +pkg_check_modules(FUSE REQUIRED fuse) +if (FUSE_FOUND) + set(HAVE_FUSE_H 1) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FUSE_CFLAGS_OTHER}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FUSE_CFLAGS_OTHER}") + set(CMAKE_REQUIRED_LIBRARIES "${FUSE_LIBRARIES};${CMAKE_REQUIRED_LIBRARIES}") +endif (FUSE_FOUND) + +# check python module dbus +check_python_module(PYTHON_DBUS dbus) +if (NOT PYTHON_DBUS_FOUND) + message(FATAL_ERROR "python module 'dbus' missing.") +endif (NOT PYTHON_DBUS_FOUND) + +# check python module fuse +check_python_module(PYTHON_FUSE fuse) +if (NOT PYTHON_FUSE_FOUND) + message(FATAL_ERROR "python module 'fuse' missing. please install 'fuse-python'.") +endif (NOT PYTHON_FUSE_FOUND) + +# check python module web +check_python_module(PYTHON_WEB web) +if (NOT PYTHON_WEB_FOUND) + message(FATAL_ERROR "python module 'web' missing. please install 'web.py'.") +endif (NOT PYTHON_WEB_FOUND) + + +# ------------------------------------------------------------ +# dump the config file + +# create the config.h and baseinc.h +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h) +include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) + + +# ------------------------------------------------------------ +# go through the subs + +add_subdirectory(bin) + + +# ------------------------------------------------------------ +# additional stuff for installation + +install(DIRECTORY etc/dbus-1 DESTINATION /etc) + + +# ------------------------------------------------------------ +# packaging + +set(CPACK_PACKAGE_NAME "opensecurity") + +set(CPACK_PACKAGE_DESCRIPTION "OpenSecurity System") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "This is the OpenSecurity System suite to be insalled into a Security VM") +set(CPACK_PACKAGE_CONTACT "Oliver Maurhart ") +set(CPACK_PACKAGE_VENDOR "AIT") +set(CPACK_PACKAGE_VERSION_MAJOR "0") +set(CPACK_PACKAGE_VERSION_MINOR "1") +set(CPACK_PACKAGE_VERSION_PATCH "0") +set(CPACK_PROJECT_VERSION_STRING "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}" ) + +set(CPACK_GENERATOR "DEB;RPM;") +set(CPACK_SOURCE_GENERATOR "TGZ") + +set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}-${CMAKE_SYSTEM_PROCESSOR}") +set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}") +set(CPACK_SOURCE_IGNORE_FILES "/build/*;/.git/") + +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.13), libgcc1 (>= 1:4.4), python (>= 2.7)") +set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cpack/deb/control/postinst;${CMAKE_CURRENT_SOURCE_DIR}/cmake/cpack/deb/control/postrm;${CMAKE_CURRENT_SOURCE_DIR}/cmake/cpack/deb/control/prerm;") + +# debianization +string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_PACKAGE_NAME_LOWERCASE) +find_program(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems") +if (DPKG_PROGRAM) + # use dpkg to fix the package file name + execute_process( + COMMAND ${DPKG_PROGRAM} --print-architecture + OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${CPACK_PROJECT_VERSION_STRING}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}") +else (DPKG_PROGRAM) + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME_LOWERCASE}_${CPACK_PROJECT_VERSION_STRING}_${CMAKE_SYSTEM_NAME}") +endif (DPKG_PROGRAM) + +# package it +include(CPack) + diff -r 446a7ba98309 -r c9bf2537109a ait/os/baseinc.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/baseinc.h Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,263 @@ +/* + * baseinc.h + * + * Standard header include file to get the most common system definitions + * + * Autor: Oliver Maurhart, + * + * Copyright (C) 2013 AIT Austrian Institute of Technology + * AIT Austrian Institute of Technology GmbH + * Donau-City-Strasse 1 | 1220 Vienna | Austria + * http://www.ait.ac.at + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __BASEINC_H +#define __BASEINC_H + +// get definitions found by cmake +#include "config.h" + +// ------------------------------------------------------------ +// C++ + +// C++11 standard and boost stuff +#ifdef __cplusplus +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# ifdef HAVE_BOOST_LIB +# include +# include +# include +# include +# include +# include +# include +# include +# endif + +#endif + + +// ------------------------------------------------------------ +// check defs (headers only) + +// standard C headers +#ifdef HAVE_STDIO_H +# include +#endif + +#ifdef HAVE_STDDEF_H +# include +#endif + +#ifdef HAVE_STDLIB_H +# include +#endif + +#ifdef HAVE_INTTYPES_H +# include +#endif + +#ifdef HAVE_MEMORY_H +# include +#endif + +#ifdef HAVE_STRING_H +# include +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + + +// stdbool.h +#ifdef HAVE_STDBOOL_H +# include +#endif + + +// endian.h +#ifdef HAVE_ENDIAN_H +# include +#endif + + +// time system headers +#ifdef HAVE_SYS_TIME_H +# include +#endif + +#ifdef HAVE_SYS_TIMES_H +# include +#endif + +#ifdef HAVE_TIME_H +# include +#endif + + +// files +#ifdef HAVE_FCNTL_H +# include +#endif + +#ifdef HAVE_SYS_STAT_H +# include +#endif + + +// some math +#ifdef HAVE_MATH_H +# include +#endif + + +// networking +#ifdef HAVE_NETDB_H +# include +#endif + +#ifdef HAVE_IFADDRS_H +# include +#endif + +#ifdef HAVE_NETINET_IN_H +# include +#endif + +#ifdef HAVE_ARPA_INET_H +# include +#endif + +#ifdef HAVE_SYS_SOCKET_H +# include +#endif + +#ifdef HAVE_SYS_UN_H +# include +#endif + + +// assert.h +#ifdef HAVE_ASSERT_H +# include +#endif + + +// signal.h +#ifdef HAVE_SIGNAL_H +# include +#endif + + +// sys/uio.h +#ifdef HAVE_SYS_UIO_H +# include +#endif + + +// syslog.h +#ifdef HAVE_SYSLOG_H +# include +#endif + + +// errno.h +#ifdef HAVE_ERRNO_H +# include +#endif + + +// limits.h +#ifdef HAVE_LIMITS_H +# include +#endif + + +// sys/mman.h +#ifdef HAVE_SYS_MMAN_H +# include +#endif + + +// dirent.h +#ifdef HAVE_DIRENT_H +# include +#endif + + +// fuse.h +#ifdef HAVE_FUSE_H +# ifndef FUSE_USE_VERSION +# define FUSE_USE_VERSION 30 +# endif +# include +#endif + + +// ------------------------------------------------------------ +// Windows + +#ifdef __WIN32__ +# include +#endif + + +// ------------------------------------------------------------ +// Linux + +#ifdef __linux__ +# include +#endif + + +// ------------------------------------------------------------ +// common macros + +#if defined(__GNUC__) || defined(__GNUCPP__) +# define UNUSED __attribute__((unused)) +#else +# define UNUSED +#endif + + + +#endif + diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/CMakeLists.txt Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,36 @@ +# ------------------------------------------------------------ +# CMakeLists.txt +# +# make: os/bin +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# go through the subs + + +add_subdirectory(autoshadow) +add_subdirectory(mirrorfuse) +add_subdirectory(opensecurityd) +add_subdirectory(shadowfuse) diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/autoshadow/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/autoshadow/CMakeLists.txt Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,36 @@ +# ------------------------------------------------------------ +# CMakeLists.txt +# +# make: os/bin/autoshadow/autoshadow.py +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# test + +# script is as-is +configure_file(autoshadow.py ${CMAKE_CURRENT_BINARY_DIR}/autoshadow.py @ONLY) + +# install script +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/autoshadow.py DESTINATION bin) \ No newline at end of file diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/autoshadow/autoshadow.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/autoshadow/autoshadow.py Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,152 @@ +#!/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------ +# autoshadow.py +# +# Listen on DBus and mount any USB stick automatically +# and invoke shadowfuse for it +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# imports + +import argparse +import dbus +import dbus.glib +import dbus.service +import gobject +import sys + + +# ------------------------------------------------------------ +# const + + +__version__ = "0.1" + + +# ------------------------------------------------------------ +# code + + +class AutoShadowService(dbus.service.Object): + + """The AutoShadowService is the DBus object which listens on UDisk2 events and decides to mount and shadow a device. + + This class incorporates a DBus service (at.ac.ait.opensecurity.AutoShadow) and binds + itself to the /AutoShadow object. + """ + + def __init__(self): + + bus = dbus.SystemBus() + bus_name = dbus.service.BusName('at.ac.ait.opensecurity.AutoShadow', bus) + dbus.service.Object.__init__(self, bus_name, '/AutoShadow') + + # get the UDisk2 system object + try: + udisk2 = bus.get_object('org.freedesktop.UDisks2', '/org/freedesktop/UDisks2') + except: + sys.stderr.write('Failed to aquire DBus Service org.freedesktop.UDisks2 object /org/freedesktop/UDisks2 on system DBus.\n') + sys.exit(1) + + # connect our signal + udisk2.connect_to_signal('InterfacesAdded', self.interface_added, sender_keyword='sender') + + + def interface_added(*args, **kwargs): + + """Entry point for signal for new interfaces""" + + # a new interface has been added + object_path = args[1] + interfaces_and_properties = args[2] + interface_keys = interfaces_and_properties.keys() + + if (interface_keys[0] == 'org.freedesktop.UDisks2.Drive'): + + # added a new drive + drive_values = interfaces_and_properties[interface_keys[0]] + drive_id = str(drive_values['Id']) + drive_vendor = str(drive_values['Vendor']) + drive_removeable = bool(drive_values['Removable']) + print('detected new drive: id=\'{0}\' vendor=\'{1}\' removeable={2}'.format(drive_id, drive_vendor, drive_removeable)) + + if (interface_keys[0] == 'org.freedesktop.UDisks2.Block'): + + # added a new device - filesystem? + if ('org.freedesktop.UDisks2.Filesystem' in interface_keys): + + # pick values of the device + device_values = interfaces_and_properties[interface_keys[0]] + device_path = bytearray(device_values['Device'][0:-1]).decode('latin-1') + print('detected new device: path=\'{0}\''.format(device_path)) + enforce_mount('/org/freedesktop/UDisks2/block_devices/' + device_path.split('/')[-1]) + + + def listen(self): + """Start listening on DBus""" + self.loop = gobject.MainLoop() + self.loop.run() + + + @dbus.service.method('at.ac.ait.opensecurity.AutoShadow') + def Quit(self): + """Terminate this service""" + self.loop.quit() + + + @dbus.service.method('at.ac.ait.opensecurity.AutoShadow', out_signature='s') + def Version(self): + """Give a version string""" + return __version__ + + +def enforce_mount(udisk_object): + + """This function does the real mounting of drives. + It also enforces the MirrorFuse on these mounts. + """ + + print("ENFORCING mount of " + udisk_object) + + +def main(): + + # parse command line + parser = argparse.ArgumentParser(description = 'Automount USB storage devices and invoke shadowfuse for it.') + args = parser.parse_args() + + # setup DBus event loop + autoshadow_service = AutoShadowService() + autoshadow_service.listen() + + +# start +if __name__ == "__main__": + main() + + diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/mirrorfuse/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/mirrorfuse/CMakeLists.txt Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,36 @@ +# ------------------------------------------------------------ +# CMakeLists.txt +# +# make: os/bin/mirrorfuse/mirrorfuse.py +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# test + +# script is as-is +configure_file(mirrorfuse.py ${CMAKE_CURRENT_BINARY_DIR}/mirrorfuse.py @ONLY) + +# install script +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/mirrorfuse.py DESTINATION bin) \ No newline at end of file diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/mirrorfuse/mirrorfuse.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/mirrorfuse/mirrorfuse.py Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,270 @@ +#!/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------ +# mirrorfuse +# +# create a mirror filesystem folder as a new filesystem to mount +# +# This is directly based on xmp.py of the +# dev-python/fuse-python example +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# imports + +import errno +import fcntl +import fuse +import os +import sys + +from fuse import Fuse + +# ------------------------------------------------------------ +# const + + +__version__ = "0.1" + + +# ------------------------------------------------------------ +# code + + +class MirrorFuse(Fuse): + + """This is the Mirror FUSE in python. + + This is to represnt a file hierarchy elsewhere (and intercept each file system call) + """ + + def __init__(self, *args, **kw): + fuse.fuse_python_api = (0, 2) + super(MirrorFuse, self).__init__(*args, **kw) + self.root = '/' + self.os_server_url = '' + + def getattr(self, path): + return os.lstat("." + path) + + + # + # links are not allowed for a mirrored FS + # + def readlink(self, path): + eturn -errno.EACCES + + + def readdir(self, path, offset): + for e in os.listdir("." + path): + yield fuse.Direntry(e) + + + def unlink(self, path): + sys.stdout.write("===\nInsert Hook here! Deleting file %s\n===\n" % path) + os.unlink("." + path) + + + def rmdir(self, path): + sys.stdout.write("===\nInsert Hook here! Deleting folder %s\n===\n" % path) + os.rmdir("." + path) + + + # + # links are not allowed for a mirrored FS + # + def symlink(self, path, path1): + eturn -errno.EACCES + + + def rename(self, path, path1): + sys.stdout.write("===\nInsert Hook here! Moving file %s --> %s\n===\n" % path % path1) + os.rename("." + path, "." + path1) + + + # + # links are not allowed for a mirrored FS + # + def link(self, path, path1): + return -errno.EACCES + + + # + # changing access mode is not allowed in mirrored FS + # + def chmod(self, path, mode): + return -errno.EACCES + + + # + # changing ownership is not allowed in mirrored FS + # + def chown(self, path, user, group): + return -errno.EACCES + + + def truncate(self, path, len): + f = open("." + path, "a") + f.truncate(len) + f.close() + + + def mknod(self, path, mode, dev): + sys.stdout.write("===\nInsert Hook here! Creating file %s\n===\n" % path) + os.mknod("." + path, mode, dev) + + + def mkdir(self, path, mode): + sys.stdout.write("===\nInsert Hook here! Creating folder %s\n===\n" % path) + os.mkdir("." + path, mode) + + + def utime(self, path, times): + os.utime("." + path, times) + + + def access(self, path, mode): + if not os.access("." + path, mode): + return -errno.EACCES + + + def statfs(self): + return os.statvfs(".") + + + def fsinit(self): + os.chdir(self.root) + + + def main(self, *a, **kw): + self.file_class = MirrorFuseFile + return Fuse.main(self, *a, **kw) + + +class MirrorFuseFile(object): + + """This is a single "File" in the Mirror FUSE""" + + def __init__(self, path, flags, *mode): + sys.stdout.write("===\nInsert Hook here! Opening file %s\n===\n" % path) + self.file = os.fdopen(os.open("." + path, flags, *mode), flag2mode(flags)) + self.fd = self.file.fileno() + + + def read(self, length, offset): + self.file.seek(offset) + return self.file.read(length) + + + def write(self, buf, offset): + self.file.seek(offset) + self.file.write(buf) + return len(buf) + + + def release(self, flags): + self.file.close() + + + def _fflush(self): + if 'w' in self.file.mode or 'a' in self.file.mode: + self.file.flush() + + def fsync(self, isfsyncfile): + self._fflush() + if isfsyncfile and hasattr(os, 'fdatasync'): + os.fdatasync(self.fd) + else: + os.fsync(self.fd) + + + def flush(self): + self._fflush() + os.close(os.dup(self.fd)) + + + def fgetattr(self): + return os.fstat(self.fd) + + + def ftruncate(self, len): + self.file.truncate(len) + + + def lock(self, cmd, owner, **kw): + op = {fcntl.F_UNLCK : fcntl.LOCK_UN, fcntl.F_RDLCK : fcntl.LOCK_SH, fcntl.F_WRLCK : fcntl.LOCK_EX}[kw['l_type']] + if cmd == fcntl.F_GETLK: + return -EOPNOTSUPP + elif cmd == fcntl.F_SETLK: + if op != fcntl.LOCK_UN: + op |= fcntl.LOCK_NB + elif cmd == fcntl.F_SETLKW: + pass + else: + return -errno.EINVAL + + fcntl.lockf(self.fd, op, kw['l_start'], kw['l_len']) + + +def flag2mode(flags): + + """Turn os flags into mode chars""" + + md = {os.O_RDONLY: 'r', os.O_WRONLY: 'w', os.O_RDWR: 'w+'} + m = md[flags & (os.O_RDONLY | os.O_WRONLY | os.O_RDWR)] + if flags | os.O_APPEND: + m = m.replace('w', 'a', 1) + return m + + +def main(): + + usage = """ +mirror the a file tree from some point on. + +""" + Fuse.fusage + + # launch the Fuse server + server = MirrorFuse(version = "%prog " + __version__, usage = usage, dash_s_do = 'setsingle') + server.parser.add_option(mountopt = "root", metavar = "PATH", default='/', help="mirror filesystem from under PATH [default: %default]") + server.parser.add_option(mountopt = "os_server_url", metavar = "URL", default='http://localhost:8080', help="URL to OpenSecurity Server [default: %default]") + server.parse(values=server, errex=1) + + try: + if server.fuse_args.mount_expected(): + os.chdir(server.root) + except OSError: + print >> sys.stderr, "can't enter root of underlying filesystem" + sys.exit(1) + + server.main() + + +# start +if __name__ == "__main__": + main() + + diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/opensecurityd/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/opensecurityd/CMakeLists.txt Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,53 @@ +# ------------------------------------------------------------ +# CMakeLists.txt +# +# make: os/bin/opensecurity-server/opensecurity-server.py +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# test + +# script is as-is +configure_file(about.py ${CMAKE_CURRENT_BINARY_DIR}/about.py @ONLY) +configure_file(credentials.py ${CMAKE_CURRENT_BINARY_DIR}/credentials.py @ONLY) +configure_file(environment.py ${CMAKE_CURRENT_BINARY_DIR}/environment.py @ONLY) +configure_file(launch.py ${CMAKE_CURRENT_BINARY_DIR}/launch.py @ONLY) +configure_file(opensecurity-dialog.py ${CMAKE_CURRENT_BINARY_DIR}/opensecurity-dialog.py @ONLY) +configure_file(opensecurity-tray.py ${CMAKE_CURRENT_BINARY_DIR}/opensecurity-tray.py @ONLY) +configure_file(opensecurityd.py ${CMAKE_CURRENT_BINARY_DIR}/opensecurityd.py @ONLY) +configure_file(password.py ${CMAKE_CURRENT_BINARY_DIR}/password.py @ONLY) + +# copy share/opensecurity stuff for convenient testing +file(COPY ${CMAKE_SOURCE_DIR}/share/opensecurity DESTINATION ${CMAKE_BINARY_DIR}/bin/share USE_SOURCE_PERMISSIONS) + +# install script +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/about.py DESTINATION bin) +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/credentials.py DESTINATION bin) +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/environment.py DESTINATION bin) +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/launch.py DESTINATION bin) +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/opensecurity-dialog.py DESTINATION bin) +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/opensecurity-tray.py DESTINATION bin) +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/password.py DESTINATION bin) +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/opensecurityd.py DESTINATION bin) diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/opensecurityd/about.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/opensecurityd/about.py Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,124 @@ +#!/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------ +# about-dialog +# +# tell the user about the project +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# imports + +from PyQt4 import QtCore +from PyQt4 import QtGui + +# local +from environment import Environment + +# ------------------------------------------------------------ +# vars + + +ABOUT_TEXT = """ + + + +
+

+ +

+

OpenSecurity

+

+

+

+Blah ...
+ +

+Copyright (C) 2013, AIT Austrian Institute of Technology
+AIT Austrian Institute of Technology GmbH
+Donau-City-Strasse 1 | 1220 Vienna | Austria
+http://www.ait.ac.at +

+ + + + +"""; + + +# ------------------------------------------------------------ +# code + + +class About(QtGui.QDialog): + + """Show some about stuff.""" + + def __init__(self, parent = None, flags = QtCore.Qt.WindowFlags(0)): + + # super call and widget init + super(About, self).__init__(parent, flags) + + # setup image search path + QtCore.QDir.setSearchPaths("image", QtCore.QStringList(Environment('opensecurity').image_path)); + + self.setWindowTitle('About OpenSecuirty ...') + self.setup_ui() + + + def setup_ui(self): + + """Create the widgets.""" + + lyMain = QtGui.QVBoxLayout(self) + lyMain.setContentsMargins(8, 8, 8, 8) + + lbAbout = QtGui.QLabel() + lbAbout.setStyleSheet("QWidget { background: white; color: black; };") + lbAbout.setText(ABOUT_TEXT) + lbAbout.setContentsMargins(12, 12, 12, 12) + + scAbout = QtGui.QScrollArea() + scAbout.setWidget(lbAbout) + scAbout.viewport().setStyleSheet("QWidget { background: white; color: black; };") + lyMain.addWidget(scAbout) + + # buttons + lyButton = QtGui.QHBoxLayout() + lyMain.addLayout(lyButton) + + lyButton.addStretch(1) + btnOk = QtGui.QPushButton('&Ok', self) + btnOk.setMinimumWidth(100) + lyButton.addWidget(btnOk) + + # connectors + btnOk.clicked.connect(self.accept) + + # reduce to the max + self.setMinimumSize(400, 200) + self.resize(lyMain.minimumSize()) + diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/opensecurityd/credentials.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/opensecurityd/credentials.py Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,160 @@ +#!/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------ +# credentials-dialog +# +# ask the user credentials +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# imports + +import sys + +from PyQt4 import QtCore +from PyQt4 import QtGui + +# local +from about import About + +# ------------------------------------------------------------ +# code + + +class Credentials(QtGui.QDialog): + + """Ask the user for credentials.""" + + def __init__(self, text, parent = None, flags = QtCore.Qt.WindowFlags(0)): + + super(Credentials, self).__init__(parent, flags) + self.setWindowTitle('OpenSecuirty Credentials Request') + self.setup_ui() + + # positionate ourself central + screen = QtGui.QDesktopWidget().screenGeometry() + self.resize(self.geometry().width() * 1.25, self.geometry().height()) + size = self.geometry() + self.move((screen.width() - size.width()) / 2, (screen.height() - size.height()) / 2) + + # fix up text + self.lbText.setText(text) + + + def clicked_about(self): + """clicked the about button""" + dlgAbout = About() + dlgAbout.exec_() + + + def clicked_cancel(self): + """clicked the cancel button""" + self.reject() + + + def clicked_ok(self): + """clicked the ok button""" + sys.stdout.write('{ ') + sys.stdout.write('\'user\': \'') + sys.stdout.write(self.edUser.text()) + sys.stdout.write('\', ') + sys.stdout.write('\'password\': \'') + sys.stdout.write(self.edPassword.text()) + sys.stdout.write('\' ') + sys.stdout.write('}\n') + self.accept() + + + def setup_ui(self): + + """Create the widgets.""" + + lyMain = QtGui.QVBoxLayout(self) + lyMain.setContentsMargins(8, 8, 8, 8) + + # content area: left pixmap, right text + lyContent = QtGui.QHBoxLayout() + lyMain.addLayout(lyContent) + + # pixmap + lbPix = QtGui.QLabel() + lbPix.setPixmap(QtGui.QPixmapCache.find('opensecurity_icon_64')) + lyContent.addWidget(lbPix, 0, QtCore.Qt.Alignment(QtCore.Qt.AlignTop + QtCore.Qt.AlignHCenter)) + lyContent.addSpacing(16) + + # text ... + lyText = QtGui.QGridLayout() + lyContent.addLayout(lyText) + self.lbText = QtGui.QLabel() + lyText.addWidget(self.lbText, 0, 0, 1, 2) + + lbUser = QtGui.QLabel('&User:') + lyText.addWidget(lbUser, 1, 0) + self.edUser = QtGui.QLineEdit() + lyText.addWidget(self.edUser, 1, 1) + lbUser.setBuddy(self.edUser) + + lbPassword = QtGui.QLabel('&Password:') + lyText.addWidget(lbPassword, 2, 0) + self.edPassword = QtGui.QLineEdit() + self.edPassword.setEchoMode(QtGui.QLineEdit.Password) + lyText.addWidget(self.edPassword, 2, 1) + lbPassword.setBuddy(self.edPassword) + + lyText.addWidget(QtGui.QWidget(), 3, 0, 1, 2) + lyText.setColumnStretch(1, 1) + lyText.setRowStretch(3, 1) + + lyMain.addStretch(1) + + # buttons + lyButton = QtGui.QHBoxLayout() + lyMain.addLayout(lyButton) + + lyButton.addStretch(1) + btnOk = QtGui.QPushButton('&Ok', self) + btnOk.setDefault(True) + btnOk.setMinimumWidth(100) + lyButton.addWidget(btnOk) + btnCancel = QtGui.QPushButton('&Cancel', self) + btnCancel.setMinimumWidth(100) + lyButton.addWidget(btnCancel) + btnAbout = QtGui.QPushButton('&About', self) + btnAbout.setMinimumWidth(100) + lyButton.addWidget(btnAbout) + + button_width = max(btnOk.width(), btnCancel.width(), btnAbout.width()) + btnOk.setMinimumWidth(button_width) + btnCancel.setMinimumWidth(button_width) + btnAbout.setMinimumWidth(button_width) + + # reduce to the max + self.resize(lyMain.minimumSize()) + + # connectors + btnOk.clicked.connect(self.clicked_ok) + btnCancel.clicked.connect(self.clicked_cancel) + btnAbout.clicked.connect(self.clicked_about) diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/opensecurityd/environment.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/opensecurityd/environment.py Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,97 @@ +#!/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------ +# environment.py +# +# pick some current environment infos +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# imports + +import os +import os.path +import sys + + +# ------------------------------------------------------------ +# code + + +class Environment(object): + + """Hold some nifty environment stuff in a dedicated class.""" + + def __init__(self, application = None): + + # if we ain't got a path to start from, all is valid/lost + if len(sys.path[0]) == 0: + self.prefix_path = '' + self.data_path = '' + self.image_path = '' + return + + # the prefix path + # + # - on Linux: this is ../../ to the current executable + # e.g. "/usr/bin/myprogram" --> "/usr" + # + # - on Windows: this is the installation folder + # e.g. "C:/Program Files/MyProgram/bin/myprogam" --> "C:/Program Files/MyProgram" + # + if sys.platform == 'linux2': + self.prefix_path = os.path.split(sys.path[0])[0] + elif sys.platform == 'win32': + self.prefix_path = os.path.split(sys.path[0])[0] + + # the data path where all data files are stored + if sys.platform == 'linux2': + if not application is None: + self.data_path = os.path.join(self.prefix_path, os.path.join('share', application)) + else: + self.data_path = os.path.join(self.prefix_path, 'share') + elif sys.platform == 'win32': + self.data_path = self.prefix_path + + # the image path + if sys.platform == 'linux2': + self.image_path = os.path.join(self.data_path, 'gfx') + elif sys.platform == 'win32': + self.image_path = os.path.join(self.data_path, 'gfx') + + +# test the module +def test(): + """Module test call.""" + + e = Environment("opensecurity") + print("prefix_path: {0}".format(e.prefix_path)) + print(" data_path: {0}".format(e.data_path)) + print(" image_path: {0}".format(e.image_path)) + +# standalone calls are module tests +if __name__ == '__main__': + test() diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/opensecurityd/launch.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/opensecurityd/launch.py Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,201 @@ +#!/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------ +# opensecurity-launcher +# +# launches an application inside a VM +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# imports + +import argparse +import os +import subprocess +import sys +import urllib + +from PyQt4 import QtCore +from PyQt4 import QtGui + +# local +from about import About +from environment import Environment + + +# ------------------------------------------------------------ +# code + + +class Chooser(QtGui.QDialog): + + """Ask the user what to launch.""" + + def __init__(self, parent = None, flags = QtCore.Qt.WindowFlags(0)): + + super(Chooser, self).__init__(parent, flags) + self.setWindowTitle('OpenSecuirty Launch Application') + self.setup_ui() + + # positionate ourself central + screen = QtGui.QDesktopWidget().screenGeometry() + self.resize(self.geometry().width() * 1.25, self.geometry().height()) + size = self.geometry() + self.move((screen.width() - size.width()) / 2, (screen.height() - size.height()) / 2) + + + def clicked_about(self): + """clicked the about button""" + dlgAbout = About() + dlgAbout.exec_() + + + def clicked_cancel(self): + """clicked the cancel button""" + self.reject() + + + def clicked_ok(self): + """clicked the ok button""" + self.accept() + + + def setup_ui(self): + + """Create the widgets.""" + + lyMain = QtGui.QVBoxLayout(self) + lyMain.setContentsMargins(8, 8, 8, 8) + + # content area: left pixmap, right text + lyContent = QtGui.QHBoxLayout() + lyMain.addLayout(lyContent) + + # pixmap + lbPix = QtGui.QLabel() + lbPix.setPixmap(QtGui.QPixmapCache.find('opensecurity_icon_64')) + lyContent.addWidget(lbPix, 0, QtCore.Qt.Alignment(QtCore.Qt.AlignTop + QtCore.Qt.AlignHCenter)) + lyContent.addSpacing(16) + + # launch ... + lyLaunch = QtGui.QGridLayout() + lyContent.addLayout(lyLaunch) + lbTitle = QtGui.QLabel('Specify details for application to launch.') + lyLaunch.addWidget(lbTitle, 0, 0, 1, 2) + + lbVM = QtGui.QLabel('&VM-ID:') + lyLaunch.addWidget(lbVM, 1, 0) + self.edVM = QtGui.QLineEdit() + lyLaunch.addWidget(self.edVM, 1, 1) + lbVM.setBuddy(self.edVM) + + # TODO: HARD CODED! + self.edVM.setText('Debian 7') + + lbApplication = QtGui.QLabel('&Application:') + lyLaunch.addWidget(lbApplication, 2, 0) + self.cbApplication = QtGui.QComboBox() + self.cbApplication.setEditable(True) + lyLaunch.addWidget(self.cbApplication, 2, 1) + lbApplication.setBuddy(self.cbApplication) + + # TODO: HARD CODED! + self.cbApplication.addItem('iceweasel') + self.cbApplication.addItem('vlc') + self.cbApplication.addItem('xfce4-terminal') + + lyLaunch.addWidget(QtGui.QWidget(), 3, 0, 1, 2) + lyLaunch.setColumnStretch(1, 1) + lyLaunch.setRowStretch(3, 1) + + lyMain.addStretch(1) + + # buttons + lyButton = QtGui.QHBoxLayout() + lyMain.addLayout(lyButton) + + lyButton.addStretch(1) + btnOk = QtGui.QPushButton('&Ok', self) + btnOk.setDefault(True) + btnOk.setMinimumWidth(100) + lyButton.addWidget(btnOk) + btnCancel = QtGui.QPushButton('&Cancel', self) + btnCancel.setMinimumWidth(100) + lyButton.addWidget(btnCancel) + btnAbout = QtGui.QPushButton('&About', self) + btnAbout.setMinimumWidth(100) + lyButton.addWidget(btnAbout) + + button_width = max(btnOk.width(), btnCancel.width(), btnAbout.width()) + btnOk.setMinimumWidth(button_width) + btnCancel.setMinimumWidth(button_width) + btnAbout.setMinimumWidth(button_width) + + # reduce to the max + self.resize(lyMain.minimumSize()) + + # connectors + btnOk.clicked.connect(self.clicked_ok) + btnCancel.clicked.connect(self.clicked_cancel) + btnAbout.clicked.connect(self.clicked_about) + + +def main(): + + # parse command line + app = QtGui.QApplication(sys.argv) + + # prebuild the pixmap cache: fetch all jpg, png and jpeg images and load them + data_path = Environment("opensecurity").image_path + for file in os.listdir(data_path): + if file.lower().rpartition('.')[2] in ('jpg', 'png', 'jpeg'): + QtGui.QPixmapCache.insert(file.lower().rpartition('.')[0], QtGui.QPixmap(os.path.join(data_path, file))) + + # we should have now our application icon + app.setWindowIcon(QtGui.QIcon(QtGui.QPixmapCache.find('opensecurity_icon_64'))) + + dlg = Chooser() + + # pop up the dialog + dlg.show() + app.exec_() + + if dlg.result() == QtGui.QDialog.Accepted: + # encode an proper GET request to the opensecurity daemon + get_vm = urllib.quote(str(dlg.edVM.text())) + get_app = urllib.quote(str(dlg.cbApplication.currentText())) + osd_request = 'http://127.0.0.1:8080/application?vm={0}&app={1}'.format(get_vm, get_app) + urllib.urlopen(osd_request) + res = 0 + else: + res = 1 + + sys.exit(res) + +# start +if __name__ == "__main__": + main() + diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/opensecurityd/opensecurity-dialog.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/opensecurityd/opensecurity-dialog.py Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,92 @@ +#!/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------ +# opensecurity-dialog +# +# an opensecurity dialog +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# imports + +import argparse +import os +import sys + +from PyQt4 import QtCore +from PyQt4 import QtGui + +# local +from credentials import Credentials +from environment import Environment +from password import Password + + +# ------------------------------------------------------------ +# code + + +def main(): + + # parse command line + parser = argparse.ArgumentParser(description = 'OpenSecuirty Dialog.') + parser.add_argument('mode', metavar='MODE', help='dialog mode: \'password\' or \'credentials\'') + parser.add_argument('text', metavar='TEXT', help='text to show') + args = parser.parse_args() + + app = QtGui.QApplication(sys.argv) + + # prebuild the pixmap cache: fetch all jpg, png and jpeg images and load them + data_path = Environment("opensecurity").image_path + for file in os.listdir(data_path): + if file.lower().rpartition('.')[2] in ('jpg', 'png', 'jpeg'): + QtGui.QPixmapCache.insert(file.lower().rpartition('.')[0], QtGui.QPixmap(os.path.join(data_path, file))) + + # we should have now our application icon + app.setWindowIcon(QtGui.QIcon(QtGui.QPixmapCache.find('opensecurity_icon_64'))) + + if args.mode == 'password': + dlg = Password(args.text) + + if args.mode == 'credentials': + dlg = Credentials(args.text) + + # pop up the dialog + dlg.show() + app.exec_() + + # give proper result code + if dlg.result() == QtGui.QDialog.Accepted: + res = 0 + else: + res = 1 + sys.exit(res) + + +# start +if __name__ == "__main__": + main() + diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/opensecurityd/opensecurity-tray.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/opensecurityd/opensecurity-tray.py Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,104 @@ +#!/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------ +# opensecurity-dialog +# +# an opensecurity dialog +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# imports + +import argparse +import os +import subprocess +import sys + +from PyQt4 import QtCore +from PyQt4 import QtGui + +# local +from environment import Environment + + +# ------------------------------------------------------------ +# code + + +class OpenSecurityTrayIcon(QtGui.QSystemTrayIcon): + + """This is the OpenSecuirty Tray Icon""" + + def __init__(self, icon, parent=None): + + super(OpenSecurityTrayIcon, self).__init__(icon, parent) + + # define the tray icon menu + menu = QtGui.QMenu(parent) + self.setContextMenu(menu) + + cAcLaunch = menu.addAction(QtGui.QIcon(QtGui.QPixmapCache.find('opensecurity_icon_64')), 'Lauch Application') + menu.addSeparator() + cAcExit = menu.addAction("Exit") + + cAcLaunch.triggered.connect(self.clicked_launch_application) + cAcExit.triggered.connect(self.clicked_exit) + + + def clicked_exit(self): + """clicked exit""" + sys.exit(0) + + + def clicked_launch_application(self): + """clicked the launch an application""" + dlg_launch_image = os.path.join(sys.path[0], 'launch.py') + process_command = [sys.executable, dlg_launch_image] + process = subprocess.Popen(process_command, shell = False) + process.communicate() + + +def main(): + + app = QtGui.QApplication(sys.argv) + + # prebuild the pixmap cache: fetch all jpg, png and jpeg images and load them + data_path = Environment("opensecurity").image_path + for file in os.listdir(data_path): + if file.lower().rpartition('.')[2] in ('jpg', 'png', 'jpeg'): + QtGui.QPixmapCache.insert(file.lower().rpartition('.')[0], QtGui.QPixmap(os.path.join(data_path, file))) + + w = QtGui.QWidget() + trayIcon = OpenSecurityTrayIcon(QtGui.QIcon(QtGui.QPixmapCache.find('opensecurity_icon_64')), w) + + trayIcon.show() + sys.exit(app.exec_()) + + +# start +if __name__ == "__main__": + main() + diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/opensecurityd/opensecurityd.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/opensecurityd/opensecurityd.py Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,178 @@ +#!/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------ +# opensecurityd +# +# the opensecurityd as RESTful server +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# imports + +import os +import os.path +import subprocess +import sys +import web + +# local +from environment import Environment + + +# ------------------------------------------------------------ +# const + + +__version__ = "0.1" + + +"""All the URLs we know mapping to class handler""" +opensecurity_urls = ( + '/application', 'os_application', + '/device', 'os_device', + '/device/credentials', 'os_device_credentials', + '/device/password', 'os_device_password', + '/', 'os_root' +) + + +# ------------------------------------------------------------ +# code + + +class os_application: + + """OpenSecurity '/application' handler. + + This is called on GET /application?vm=VM-ID&app=APP-ID + This tries to access the vm identified with the label VM-ID + and launched the application identified APP-ID + """ + + def GET(self): + + # pick the arguments + args = web.input() + + # we _need_ a vm + if not "vm" in args: + raise web.badrequest() + + # we _need_ a app + if not "app" in args: + raise web.badrequest() + + ## TODO: HARD CODED STUFF HERE! THIS SHOULD BE FLEXIBLE! + ssh_private_key = os.path.join(Environment("opensecurity").data_path, 'share', '192.168.56.15.ppk') + putty_session = '192.168.56.15' + process_command = ['plink.exe', '-i', ssh_private_key, putty_session, args.app] + si = subprocess.STARTUPINFO() + si.dwFlags = subprocess.STARTF_USESHOWWINDOW + si.wShowWindow = subprocess.SW_HIDE + print('tyring to launch: ' + ' '.join(process_command)) + process = subprocess.Popen(process_command, shell = True) + return 'launched: ' + ' '.join(process_command) + + +class os_device: + + """OpenSecurity '/device' handler""" + + def GET(self): + return "os_device" + + +class os_device_credentials: + + """OpenSecurity '/device/credentials' handler. + + This is called on GET /device/credentials?id=DEVICE-ID. + Ideally this should pop up a user dialog to insert his + credentials based the DEVICE-ID + """ + + def GET(self): + + # pick the arguments + args = web.input() + + # we _need_ a device id + if not "id" in args: + raise web.badrequest() + + # invoke the user dialog as a subprocess + dlg_credentials_image = os.path.join(sys.path[0], 'opensecurity-dialog.py') + process_command = [sys.executable, dlg_credentials_image, 'credentials', 'Please provide credentials for accessing \ndevice: "{0}".'.format(args.id)] + process = subprocess.Popen(process_command, shell = False, stdout = subprocess.PIPE) + result = process.communicate()[0] + if process.returncode != 0: + return 'Credentials request has been aborted.' + + return result + + +class os_device_password: + + """OpenSecurity '/device/password' handler. + + This is called on GET /device/password?id=DEVICE-ID. + Ideally this should pop up a user dialog to insert his + password based the DEVICE-ID + """ + + def GET(self): + + # pick the arguments + args = web.input() + + # we _need_ a device id + if not "id" in args: + raise web.badrequest() + + # invoke the user dialog as a subprocess + dlg_credentials_image = os.path.join(sys.path[0], 'opensecurity-dialog.py') + process_command = [sys.executable, dlg_credentials_image, 'password', 'Please provide a password for accessing \ndevice: "{0}".'.format(args.id)] + process = subprocess.Popen(process_command, shell = False, stdout = subprocess.PIPE) + result = process.communicate()[0] + if process.returncode != 0: + return 'Credentials request has been aborted.' + + return result + + +class os_root: + + """OpenSecurity '/' handler""" + + def GET(self): + return "OpenSecurity-Server { \"version\": \"%s\" }" % __version__ + + +# start +if __name__ == "__main__": + server = web.application(opensecurity_urls, globals()) + server.run() + diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/opensecurityd/password.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/opensecurityd/password.py Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,150 @@ +#!/bin/env python +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------ +# password-dialog +# +# ask the user a password +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# imports + +import sys + +from PyQt4 import QtCore +from PyQt4 import QtGui + +# local +from about import About + +# ------------------------------------------------------------ +# code + + +class Password(QtGui.QDialog): + + """Ask the user for a password.""" + + def __init__(self, text, parent = None, flags = QtCore.Qt.WindowFlags(0)): + + # super call and widget init + super(Password, self).__init__(parent, flags) + self.setWindowTitle('OpenSecuirty Password Request') + self.setup_ui() + + # positionate ourself central + screen = QtGui.QDesktopWidget().screenGeometry() + self.resize(self.geometry().width() * 1.25, self.geometry().height()) + size = self.geometry() + self.move((screen.width() - size.width()) / 2, (screen.height() - size.height()) / 2) + + # fix up text + self.lbText.setText(text) + + + def clicked_about(self): + """clicked the about button""" + dlgAbout = About() + dlgAbout.exec_() + + + def clicked_cancel(self): + """clicked the cancel button""" + self.reject() + + + def clicked_ok(self): + """clicked the ok button""" + sys.stdout.write('{ ') + sys.stdout.write('\'password\': \'') + sys.stdout.write(self.edPassword.text()) + sys.stdout.write('\' ') + sys.stdout.write('}\n') + self.accept() + + + def setup_ui(self): + + """Create the widgets.""" + + lyMain = QtGui.QVBoxLayout(self) + lyMain.setContentsMargins(8, 8, 8, 8) + + # content area: left pixmap, right text + lyContent = QtGui.QHBoxLayout() + lyMain.addLayout(lyContent) + + # pixmap + lbPix = QtGui.QLabel() + lbPix.setPixmap(QtGui.QPixmapCache.find('opensecurity_icon_64')) + lyContent.addWidget(lbPix, 0, QtCore.Qt.Alignment(QtCore.Qt.AlignTop + QtCore.Qt.AlignHCenter)) + lyContent.addSpacing(16) + + # text ... + lyText = QtGui.QVBoxLayout() + lyContent.addLayout(lyText) + self.lbText = QtGui.QLabel() + lyText.addWidget(self.lbText) + lyPassword = QtGui.QHBoxLayout() + lyText.addLayout(lyPassword) + lbPassword = QtGui.QLabel('&Password:') + lyPassword.addWidget(lbPassword) + self.edPassword = QtGui.QLineEdit() + self.edPassword.setEchoMode(QtGui.QLineEdit.Password) + lyPassword.addWidget(self.edPassword) + lbPassword.setBuddy(self.edPassword) + lyText.addStretch(1) + + lyMain.addStretch(1) + + # buttons + lyButton = QtGui.QHBoxLayout() + lyMain.addLayout(lyButton) + + lyButton.addStretch(1) + btnOk = QtGui.QPushButton('&Ok', self) + btnOk.setDefault(True) + btnOk.setMinimumWidth(100) + lyButton.addWidget(btnOk) + btnCancel = QtGui.QPushButton('&Cancel', self) + btnCancel.setMinimumWidth(100) + lyButton.addWidget(btnCancel) + btnAbout = QtGui.QPushButton('&About', self) + btnAbout.setMinimumWidth(100) + lyButton.addWidget(btnAbout) + + button_width = max(btnOk.width(), btnCancel.width(), btnAbout.width()) + btnOk.setMinimumWidth(button_width) + btnCancel.setMinimumWidth(button_width) + btnAbout.setMinimumWidth(button_width) + + # reduce to the max + self.resize(lyMain.minimumSize()) + + # connectors + btnOk.clicked.connect(self.clicked_ok) + btnCancel.clicked.connect(self.clicked_cancel) + btnAbout.clicked.connect(self.clicked_about) diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/opensecurityd/vm-start.vbs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/opensecurityd/vm-start.vbs Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,30 @@ +Option Explicit + +' ------------------------------------------------------------ +' start the VMs in the background and mount "network" shares +' +' Autor: Oliver Maurhart, +' +' Copyright (C) 2013 AIT Austrian Institute of Technology +' AIT Austrian Institute of Technology GmbH +' Donau-City-Strasse 1 | 1220 Vienna | Austria +' http://www.ait.ac.at +' ------------------------------------------------------------ + +Dim cShell +Dim nError + +' get the Windows Scripting Host Shell +Set cShell = CreateObject("WScript.Shell") + +' Start the VM +cShell.Run """C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe"" startvm ""Debian 7"" --type headless", 0, True + +' Mount the VM Internal "Downloads" folder +Do + nError = cShell.Run("net view \\192.168.56.15", 0, True) + If nError <> 0 Then + WScript.Sleep 100 + End If +Loop While nError <> 0 +nError = cShell.Run("net use Z: \\192.168.56.15\Downloads", 0, True) diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/shadowfuse/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/shadowfuse/CMakeLists.txt Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,44 @@ +# ------------------------------------------------------------ +# CMakeLists.txt +# +# make: bin/ make the shadowfuse binary +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + + +# ------------------------------------------------------------ +# shadowfuse + +# sources +set(SHADOWFUSE_SRC + main.cpp +) + +# bin definition +add_executable(shadowfuse ${SHADOWFUSE_SRC}) + +# linkage +target_link_libraries(shadowfuse ${CMAKE_REQUIRED_LIBRARIES}) + +# install +install(TARGETS shadowfuse RUNTIME DESTINATION bin) diff -r 446a7ba98309 -r c9bf2537109a ait/os/bin/shadowfuse/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/bin/shadowfuse/main.cpp Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,421 @@ +/* + * main.cpp + * + * This is the shadowfuse main startup file. + * + * Autor: Oliver Maurhart, + * + * Copyright (C) 2013 AIT Austrian Institute of Technology + * AIT Austrian Institute of Technology GmbH + * Donau-City-Strasse 1 | 1220 Vienna | Austria + * http://www.ait.ac.at + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + +// ------------------------------------------------------------ +// incs + +#include "baseinc.h" + + +// ------------------------------------------------------------ +// defs + + +/** + * shadowfuse version + */ +#define SHADOWFUSE_VERSION "0.1" + + +// ------------------------------------------------------------ +// vars + + +/** + * keys for FUSE_OPT_ options + */ +enum { + KEY_VERSION, + KEY_HELP, +}; + + +/** + * array of options we know + */ +static struct fuse_opt shadowfuse_opts[] = { + FUSE_OPT_KEY("-V", KEY_VERSION), + FUSE_OPT_KEY("--version", KEY_VERSION), + FUSE_OPT_KEY("-h", KEY_HELP), + FUSE_OPT_KEY("--help", KEY_HELP), + FUSE_OPT_END +}; + + +/** + * configuration of shadowfuse + */ +static struct shadowfuse_config { + + std::string sShadowedPath; + std::string sMountPoint; + + /** + * check for paths been set + */ + inline bool is_paths_set() const { return !(sShadowedPath.empty() || sMountPoint.empty()); }; + +} g_cShadowFuseConfig; + + +// ------------------------------------------------------------ +// fwd + +static int option_processor(void * cData, const char * sArg, int nKey, struct fuse_args * cOutArgs); +static void usage(const char * sProgName); + + +// ------------------------------------------------------------ +// code + + + +/** + * get file attributes. + */ +static int shadow_getattr(const char * sPath, struct stat * cFileStat) { + + // open the shadow file + std::string sShadow = g_cShadowFuseConfig.sShadowedPath + sPath; +std::cerr << "=== INSERT HOOK HERE. Getting file attributes of " << sShadow << std::endl; + + memset(cFileStat, 0, sizeof(struct stat)); + if (stat(sShadow.c_str(), cFileStat) == -1) return -errno; + + return 0; +} + + + +/** + * create a directory + */ +static int shadow_mkdir(const char * sPath, mode_t cMode) { + + // create directory + std::string sShadow = g_cShadowFuseConfig.sShadowedPath + sPath; +std::cerr << "=== INSERT HOOK HERE. Create directory " << sShadow << std::endl; + + if (mkdir(sShadow.c_str(), cMode) == -1) return -errno; + return 0; +} + + +/** + * create a file + */ +static int shadow_mknod(const char * sPath, mode_t cMode, dev_t cDev) { + + // create file + std::string sShadow = g_cShadowFuseConfig.sShadowedPath + sPath; +std::cerr << "=== INSERT HOOK HERE. Create file " << sShadow << std::endl; + + if (mknod(sShadow.c_str(), cMode, cDev) == -1) return -errno; + return 0; +} + + +/** + * open file + */ +static int shadow_open(const char * sPath, struct fuse_file_info * cFileInfo) { + + // open the shadow file + std::string sShadow = g_cShadowFuseConfig.sShadowedPath + sPath; +std::cerr << "=== INSERT HOOK HERE. Opening file " << sShadow << std::endl; + + if (open(sShadow.c_str(), cFileInfo->flags) == -1) return -errno; + return 0; +} + + +/** + * read from file + */ +static int shadow_read(const char * sPath, char * cBuffer, size_t nSize, off_t nOffset, UNUSED struct fuse_file_info * cFileInfo) { + + // read from shadow file + std::string sShadow = g_cShadowFuseConfig.sShadowedPath + sPath; +std::cerr << "=== INSERT HOOK HERE. Reading file " << sShadow << " [offset=" << nOffset << ", fetch max bytes=" << nSize << "]" << std::endl; + + // open, pick bytes, close & out + int fd = open(sShadow.c_str(), O_RDONLY); + if (fd == -1) return -errno; + int res = pread(fd, cBuffer, nSize, nOffset); + if (res == -1) res = -errno; + close(fd); + + return res; +} + + +/** + * read directory + */ +static int shadow_readdir(const char * sPath, void * cBuffer, fuse_fill_dir_t fFiller, UNUSED off_t nOffset, UNUSED struct fuse_file_info * cFileInfo) { + + DIR * cDIR; + struct dirent * cDirEntry; + int res = 0; + + // open the shadow folder + std::string sShadow = g_cShadowFuseConfig.sShadowedPath + sPath; +std::cerr << "=== INSERT HOOK HERE. Reading content of " << sShadow << std::endl; + + cDIR = opendir(sShadow.c_str()); + if (!cDIR) return -errno; + + // walk over the entries + while ((cDirEntry = readdir(cDIR)) != NULL) { + + // pick file stat as well + struct stat cFileStat; + stat(sShadow.c_str(), &cFileStat); + res = fFiller(cBuffer, cDirEntry->d_name, &cFileStat, 0); + if (res != 0) break; + } + + // free directory + closedir(cDIR); + return res; +} + + +/** + * move file + */ +static int shadow_rename(const char * sFromPath, const char * sToPath) { + + // move file + std::string sShadowFrom = g_cShadowFuseConfig.sShadowedPath + sFromPath; + std::string sShadowTo = g_cShadowFuseConfig.sShadowedPath + sToPath; +std::cerr << "=== INSERT HOOK HERE. Moving file from " << sShadowFrom << " to " << sShadowTo << std::endl; + + if (rename(sShadowFrom.c_str(), sShadowTo.c_str()) == -1) return -errno; + return 0; +} + + +/** + * delete a folder + */ +static int shadow_rmdir(const char * sPath) { + + // delete the shadow folder + std::string sShadow = g_cShadowFuseConfig.sShadowedPath + sPath; +std::cerr << "=== INSERT HOOK HERE. Delete folder " << sShadow << std::endl; + + if (rmdir(sShadow.c_str()) == -1) return -errno; + return 0; +} + + +/** + * delete a file + */ +static int shadow_unlink(const char * sPath) { + + // delete the shadow file + std::string sShadow = g_cShadowFuseConfig.sShadowedPath + sPath; +std::cerr << "=== INSERT HOOK HERE. Delete file " << sShadow << std::endl; + + if (unlink(sShadow.c_str()) == -1) return -errno; + return 0; +} + + +/** + * write int file + */ +static int shadow_write(const char * sPath, const char * cBuffer, size_t nSize, off_t nOffset, UNUSED struct fuse_file_info * cFileInfo) { + + // write into file + std::string sShadow = g_cShadowFuseConfig.sShadowedPath + sPath; +std::cerr << "=== INSERT HOOK HERE. Write into file " << sShadow << std::endl; + + // open, push bytes, close & out + int fd = open(sShadow.c_str(), O_WRONLY); + if (fd == -1) return -errno; + int res = pwrite(fd, cBuffer, nSize, nOffset); + if (res == -1) res = -errno; + close(fd); + + return res; +} + + +/** + * the shadowfuse function table + */ +static struct fuse_operations shadowfuse_operations { + + shadow_getattr, // getattr + nullptr, // readlink + nullptr, // getdir + shadow_mknod, // mknod + shadow_mkdir, // mkdir + shadow_unlink, // unlink + shadow_rmdir, // rmdir + nullptr, // symlink + shadow_rename, // rename + nullptr, // link + nullptr, // chmod + nullptr, // chown + nullptr, // truncate + nullptr, // utime + shadow_open, // open + shadow_read, // read + shadow_write, // write + nullptr, // statfs + nullptr, // flush + nullptr, // release + nullptr, // fsync + nullptr, // setxattr + nullptr, // getxattr + nullptr, // listxattr + nullptr, // removexattr + nullptr, // opendir + shadow_readdir, // readdir + nullptr, // releasedir + nullptr, // fsyncdir + nullptr, // init + nullptr, // destroy + nullptr, // access + nullptr, // create + nullptr, // ftruncate + nullptr, // fgetattr + nullptr, // lock + nullptr, // utimens + nullptr, // bmap + 0, // flag_nullpath_ok + 0, // flag_nopath + 0, // flag_utime_omit_ok + 0, // flag_reserved + nullptr, // ioctl + nullptr, // poll + nullptr, // write_buf + nullptr, // read_buf + nullptr, // flock + nullptr // fallocate +}; + + +/** + * start + * + * @param argc as usual + * @param argv as usual + * @return as usual + */ +int main(int argc, char ** argv) { + + // option parsing + struct fuse_args cFUSEArgs = FUSE_ARGS_INIT(argc, argv); + if (fuse_opt_parse(&cFUSEArgs, NULL, shadowfuse_opts, option_processor) == -1) { + return -1; + } + + // test if our config is setup ok + if (!g_cShadowFuseConfig.is_paths_set()) { + std::cerr << "sourcefolder and/or mount point not given" << std::endl; + exit(1); + } + + // do FUSE + int ret = fuse_main(cFUSEArgs.argc, cFUSEArgs.argv, &shadowfuse_operations, NULL); + if (ret) printf("\n"); + fuse_opt_free_args(&cFUSEArgs); + + return ret; +} + + +/** + * option parser processor + * + * @param cData is the user data passed to the fuse_opt_parse() function + * @param sArg is the whole argument or option + * @param nKey determines why the processing function was called + * @param cOutArgs the current output argument list + * @return -1 on error, 0 if arg is to be discarded, 1 if arg should be kept + */ +static int option_processor(UNUSED void * cData, UNUSED const char * sArg, int nKey, struct fuse_args * cOutArgs) { + + // select by key + switch (nKey) { + + case FUSE_OPT_KEY_OPT: + return 1; + + case FUSE_OPT_KEY_NONOPT: + // the non-options + if (g_cShadowFuseConfig.sShadowedPath.empty()) { + // first non-option is the path to be shadowed + g_cShadowFuseConfig.sShadowedPath = sArg; + return 0; + } + else + if (g_cShadowFuseConfig.sMountPoint.empty()) { + // the mount point + g_cShadowFuseConfig.sMountPoint = sArg; + return 1; + } + return 1; + + case KEY_HELP: + usage(cOutArgs->argv[0]); + exit(1); + + case KEY_VERSION: + printf("shadowfuse version %s\n", SHADOWFUSE_VERSION); + exit(0); + + default: + fprintf(stderr, "internal error\n"); + abort(); + } +} + + +/** + * print usage + * + * @param sProgName name of the current program + */ +static void usage(const char * sProgName) { + printf( +"usage: %s sourcefolder mountpoint\n" +"\n" +"general options:\n" +" -f foreground\n" +" -d -odebug foreground, but keep the debug option\n" +" -h --help print help\n" +" -V --version print version\n" +"\n", sProgName); +} + diff -r 446a7ba98309 -r c9bf2537109a ait/os/cmake/cpack/deb/control/postinst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/cmake/cpack/deb/control/postinst Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,31 @@ +#!/bin/sh + +# ------------------------------------------------------------ +# postinst +# +# post installation script run +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ + +# fail on error +set -e diff -r 446a7ba98309 -r c9bf2537109a ait/os/cmake/cpack/deb/control/postrm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/cmake/cpack/deb/control/postrm Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,28 @@ +#!/bin/sh + +# ------------------------------------------------------------ +# postrm +# +# post removal script run +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ diff -r 446a7ba98309 -r c9bf2537109a ait/os/cmake/cpack/deb/control/prerm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/cmake/cpack/deb/control/prerm Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,28 @@ +#!/bin/sh + +# ------------------------------------------------------------ +# prerm +# +# pre removal script run +# +# Autor: Oliver Maurhart, +# +# Copyright (C) 2013 AIT Austrian Institute of Technology +# AIT Austrian Institute of Technology GmbH +# Donau-City-Strasse 1 | 1220 Vienna | Austria +# http://www.ait.ac.at +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation version 2. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, +# Boston, MA 02110-1301, USA. +# ------------------------------------------------------------ diff -r 446a7ba98309 -r c9bf2537109a ait/os/config.h.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/config.h.in Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,107 @@ +/** + * config.h.in + * + * Template for config.h + * This file gets modified and expanded by cmake. + * + * Copyright (C) 2012, 2013 AIT Austrian Institute of Technology + * AIT Austrian Institute of Technology GmbH + * Donau-City-Strasse 1 | 1220 Vienna | Austria + * http://www.ait.ac.at + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + +#ifndef __CONFIG_H +#define __CONFIG_H + + +// ------------------------------------------------------------ +// check defs (headers only) + + +// standard C headers +#cmakedefine HAVE_STDIO_H 1 +#cmakedefine HAVE_STDDEF_H 1 +#cmakedefine HAVE_STDLIB_H 1 +#cmakedefine HAVE_INTTYPES_H 1 +#cmakedefine HAVE_MEMORY_H 1 +#cmakedefine HAVE_STRING_H 1 +#cmakedefine HAVE_UNISTD_H 1 + +// stdbool.h +#cmakedefine HAVE_STDBOOL_H 1 + +// endian.h +#cmakedefine HAVE_ENDIAN_H 1 + +// time system headers +#cmakedefine HAVE_SYS_TIME_H 1 +#cmakedefine HAVE_SYS_TIMES_H 1 +#cmakedefine HAVE_TIME_H 1 + +// files +#cmakedefine HAVE_FCNTL_H 1 +#cmakedefine HAVE_SYS_STAT_H 1 + + +// some math +#cmakedefine HAVE_MATH_H 1 + +// networking +#cmakedefine HAVE_NETDB_H 1 +#cmakedefine HAVE_IFADDRS_H 1 +#cmakedefine HAVE_NETINET_IN_H 1 +#cmakedefine HAVE_ARPA_INET_H 1 +#cmakedefine HAVE_SYS_SOCKET_H 1 +#cmakedefine HAVE_SYS_UN_H 1 + +// assert.h +#cmakedefine HAVE_ASSERT_H 1 + +// signal.h +#cmakedefine HAVE_SIGNAL_H 1 + +// sys/uio.h +#cmakedefine HAVE_SYS_UIO_H 1 + +// syslog.h +#cmakedefine HAVE_SYSLOG_H 1 + +// errno.h +#cmakedefine HAVE_ERRNO_H 1 + +// limits.h +#cmakedefine HAVE_LIMITS_H 1 + +// memory management +#cmakedefine HAVE_SYS_MMAN_H 1 + +// directory entries +#cmakedefine HAVE_DIRENT_H 1 + +// sys/uio.h +#cmakedefine HAVE_SYS_UIO_H 1 + +// iconv.h +#cmakedefine HAVE_ICONV_H 1 + +// fuse +#cmakedefine HAVE_FUSE_H 1 + + +#endif + diff -r 446a7ba98309 -r c9bf2537109a ait/os/etc/dbus-1/system.d/at.ac.ait.opensecurity.AutoShadow.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/etc/dbus-1/system.d/at.ac.ait.opensecurity.AutoShadow.conf Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/192.168.56.15-putty.reg Binary file ait/os/share/opensecurity/192.168.56.15-putty.reg has changed diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/192.168.56.15.ppk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/share/opensecurity/192.168.56.15.ppk Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,26 @@ +PuTTY-User-Key-File-2: ssh-rsa +Encryption: none +Comment: rsa-key-20131029 +Public-Lines: 6 +AAAAB3NzaC1yc2EAAAABJQAAAQEAgagcKFpJsMZduqucGZR0HmG2tNaUyrccmYzg +aAn5B/6o7jrArnTyAVdcQrrcUEN2zFfXMg36+JP1thoDaI1LkL3U+0ikdDkYq5hZ +WWOv9a9AJPDma5Ah/oxfmqqSv6spiUYQl2B72iuCvDnTMT1J7tUiy8UoRk/LxF+h +YIJyRxMrNTa8M5CU8Oqu2KF+PM4pk9sX70Oyci9uln1xUOg2lmjg8qf7ENwMx0G9 +0YMtPssaPlqQrBr1w0SIOhT/975SclNyVcGZaZc+VC3x3Uc1X1XJJRtFc+GFjcBd +DMaocZ2dxXcrM2XQdKfIg3PnRwiu7DSV7G2nepF+uXpTNAxTXQ== +Private-Lines: 14 +AAABAHck25qz1QNOf6SdsgmrAut8YrQDc/iMltJKGlHD+Zik0pW5csnTPz+AtaUa +aZXdIQ7NQkmr+2D2qm/8OnvAG+zKHaijngnvRxo4+CigyzTKjfhuqjlUA4/2nQqq +lLAgvmJ3vDgTeLqkhfkSiregGmzD2skWCVVeFTD97j0CP3+Tw20QJqJXvFHvbeVh +BjeooKWt559lJnDP9dfvTlo75pAYXSnEr6ALiZurGm6q3pmop2p3USBwrCr8Mu8D +3xuBXDw/cvcpeunl2UiRPYvXa8Mj0ewEPNfXJ3WaxQggmHcmUfDgbaXRpJcZKjAS +wfFsOGBTEJ8BKRmj+M0nEBQkGcUAAACBAMJHU5yzi5F9ybZTG0mxoWSNaa+8M03q +nRV7Wl+KMP0N+p5ZzDyLIdGyLSKaKqc0soSTzqQpJ6ky72yJJ6ovU9PJUK6eKnIR +HtQEd6XhCCWdCBEUsk3PKiIR4GePZhikFFl97l8M30by5JUwPSX6SDh0F3DSd2zz +j8eroHzISyozAAAAgQCq2RVPz1o+Cue1on6AmeY0UiUZUOYVDM4n7GJpr9BkRflk +vjpo0AgHNviF+yYbU9H9mJGbwYe+YY3zUnguSJn0o66ofXGK/5TfvPofmMWS9XmP +2tzTjKeabNWmmi4IAJRFdhwYl7j8CoIrD9cMXJ2EaaSiEpMVVIP7H4muVdYcLwAA +AIEAn/bZoFIGO5x8WaRlRLGN+v0bbfHiQ+zalLVCu8XqSaB5+THDUZClRdYhj8bO +zzfqyI9er04a74QjIPOpyUjy8uoYW0bJvVudD47GhezTDImopmvcrRiTLlG8khit +ZyznRaMcu6N/izFreCI1yeXnOMPtaAP+snRsUFwUGlpTe08= +Private-MAC: 050a2bfd9bac2d354384390ab8a180857c4442c4 diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/192.168.56.15.pub --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/share/opensecurity/192.168.56.15.pub Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAgagcKFpJsMZduqucGZR0HmG2tNaUyrccmYzgaAn5B/6o7jrArnTyAVdcQrrcUEN2zFfXMg36+JP1thoDaI1LkL3U+0ikdDkYq5hZWWOv9a9AJPDma5Ah/oxfmqqSv6spiUYQl2B72iuCvDnTMT1J7tUiy8UoRk/LxF+hYIJyRxMrNTa8M5CU8Oqu2KF+PM4pk9sX70Oyci9uln1xUOg2lmjg8qf7ENwMx0G90YMtPssaPlqQrBr1w0SIOhT/975SclNyVcGZaZc+VC3x3Uc1X1XJJRtFc+GFjcBdDMaocZ2dxXcrM2XQdKfIg3PnRwiu7DSV7G2nepF+uXpTNAxTXQ== rsa-key-20131029 diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/OpenSecurity.reg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ait/os/share/opensecurity/OpenSecurity.reg Tue Nov 12 11:31:34 2013 +0100 @@ -0,0 +1,9 @@ +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] +"VM-Start"="wscript C:\\Distribution\\OpenSecurity\\bin\\vm-start.vbs" +"Xming"="\"C:\\Program Files\\Xming\\Xming.exe\" +bs -multiwindow" +"OpenSecurityD"="\"C:\\Python27\\pythonw.exe\" C:\\Distribution\\OpenSecurity\\bin\\opensecurityd.py" + +[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] +"OpenSecurity-Tray"="\"C:\\Python27\\pythonw.exe\" C:\\Distribution\\OpenSecurity\\bin\\opensecurity-tray.py" diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/gfx/ait_logo.jpg Binary file ait/os/share/opensecurity/gfx/ait_logo.jpg has changed diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/gfx/ait_logo_no_claim.png Binary file ait/os/share/opensecurity/gfx/ait_logo_no_claim.png has changed diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/gfx/bmvit_logo.jpg Binary file ait/os/share/opensecurity/gfx/bmvit_logo.jpg has changed diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/gfx/ffg_logo.jpg Binary file ait/os/share/opensecurity/gfx/ffg_logo.jpg has changed diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/gfx/ikarus_logo.jpg Binary file ait/os/share/opensecurity/gfx/ikarus_logo.jpg has changed diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/gfx/kiras_logo.jpg Binary file ait/os/share/opensecurity/gfx/kiras_logo.jpg has changed diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/gfx/linz_logo.jpg Binary file ait/os/share/opensecurity/gfx/linz_logo.jpg has changed diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/gfx/liqua_logo.jpg Binary file ait/os/share/opensecurity/gfx/liqua_logo.jpg has changed diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/gfx/opensecurity.ico Binary file ait/os/share/opensecurity/gfx/opensecurity.ico has changed diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/gfx/opensecurity_icon_64.png Binary file ait/os/share/opensecurity/gfx/opensecurity_icon_64.png has changed diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/gfx/opensecurity_logo.jpg Binary file ait/os/share/opensecurity/gfx/opensecurity_logo.jpg has changed diff -r 446a7ba98309 -r c9bf2537109a ait/os/share/opensecurity/gfx/x-net_logo.jpg Binary file ait/os/share/opensecurity/gfx/x-net_logo.jpg has changed