Beispiel #1
0
    def do_admin_config_details(self):
        """
        Implementation of: /admin/config/details

        :returns: Orchestrator configuration.
        :rtype: dict(str -> \\*)
        """
        return get_orchestrator_config().to_dictionary()
    def start_ui(self):
        """
        This method is called when the UI start message arrives.
        It reads the plugin configuration, starts the consumer thread, and
        launches the XML-RPC server.
        """

        # Log the event.
        print "Starting XML-RPC server..."

        # Initialize the audit and plugin state caches.
        self.state_lock   = threading.RLock()
        self.steps        = collections.Counter() # How many times "recon" was reached
        self.audit_stage  = {}  # audit -> stage
        self.plugin_state = collections.defaultdict(
            functools.partial(collections.defaultdict, dict)
            )  # audit -> (plugin, identity) -> progress

        # Audit not started correctly
        self.audit_error  = {}

        # Create the consumer thread object.
        self.thread_continue = True
        self.thread = threading.Thread(
            target = self.consumer_thread,
            kwargs = {"context" : Config._context}
        )
        self.thread.daemon = True

        # Get the configuration.
        orchestrator_config = get_orchestrator_config().to_dictionary()
        plugin_config       = Config.plugin_config
        plugin_extra_config = Config.plugin_extra_config

        # Launch the XML-RPC server.
        self.bridge = server_bridge.launch_server(
            orchestrator_config, plugin_config, plugin_extra_config)

        # Start the consumer thread.
        self.thread.start()
Beispiel #3
0
    def start_ui(self):
        """
        This method is called when the UI start message arrives.
        It reads the plugin configuration, starts the consumer thread, and
        launches the XML-RPC server.
        """

        # Log the event.
        print "Starting XML-RPC server..."

        # Cleanup.
        self.steps.clear()
        self.audit_stage.clear()
        self.audit_error.clear()
        self.plugin_state.clear()
        self.current_plugins.clear()

        # Create the consumer thread object.
        self.thread_continue = True
        self.thread = threading.Thread(
            target = self.consumer_thread,
            kwargs = {"context" : Config._context}
        )
        self.thread.daemon = True

        # Get the configuration.
        orchestrator_config = get_orchestrator_config().to_dictionary()
        plugin_config       = Config.plugin_config
        plugin_extra_config = Config.plugin_extra_config

        # Launch the XML-RPC server.
        self.bridge = server_bridge.launch_server(
            orchestrator_config, plugin_config, plugin_extra_config)

        # Start the consumer thread.
        self.thread.start()

        # Notify the start event for the UI.
        self.notify_start_ui()
Beispiel #4
0
        self.state_lock   = threading.RLock()
        self.audit_state  = {}  # audit -> stage
        self.plugin_state = collections.defaultdict(
            collections.defaultdict(dict)
        )  # audit -> (plugin, identity) -> progress

        # Create the consumer thread object.
        self.thread_continue = True
        self.thread = threading.Thread(
            target = self.consumer_thread,
            kwargs = {"context" : Config._context}
        )
        self.thread.daemon = True

        # Get the configuration.
        orchestrator_config = get_orchestrator_config().to_dictionary()
        plugin_config       = Config.plugin_config
        plugin_extra_config = Config.plugin_extra_config

        # Launch the Django web application.
        self.bridge = django_bridge.launch_django()

        # Start the consumer thread.
        self.thread.start()


    #--------------------------------------------------------------------------
    def stop_ui(self):
        """
        This method is called when the UI stop message arrives.
        It shuts down the web UI.