Exemplo n.º 1
0
    def do_scan_list(self):
        """
        Implementation of: /scan/list

        :returns: Dictionary mapping audit names to their configurations.
        :rtype: dict(str -> dict(str -> \\*))
        """
        result = {}
        for audit_name in get_audit_names():
            audit_config = get_audit_config(audit_name)
            result[audit_name] = audit_config.to_dictionary()
        return result
Exemplo n.º 2
0
    def do_audit_list(self): # TODO: control audits with error at start
        """
        Implementation of: /audit/list

        :returns: Dictionary mapping audit names to their configurations.
        :rtype: dict(str -> dict(str -> \\*))
        """
        result = {}
        for audit_name in get_audit_names():
            audit_config = get_audit_config(audit_name)
            result[audit_name] = audit_config.to_dictionary()
        return result
Exemplo n.º 3
0
    def __enter__(self):

        # Keep the original execution context.
        self.old_context = Config._context

        # Update the execution context for this audit.
        Config._context = PluginContext(
                   msg_queue = self.old_context.msg_queue,
                  audit_name = self.audit_name,
                audit_config = get_audit_config(self.audit_name),
                 audit_scope = get_audit_scope(self.audit_name),
            orchestrator_pid = self.old_context._orchestrator_pid,
            orchestrator_tid = self.old_context._orchestrator_tid)