def StartInterrogationHunt(self): """Starts an interrogation hunt on all available clients.""" flow_name = compatibility.GetName(flows_discovery.Interrogate) flow_args = flows_discovery.InterrogateArgs(lightweight=False) description = "Interrogate run by cron to keep host info fresh." if data_store.RelationalDBEnabled(): hunt_id = hunt.CreateAndStartHunt( flow_name, flow_args, self.token.username, client_limit=0, client_rate=50, crash_limit=config.CONFIG["Cron.interrogate_crash_limit"], description=description, duration=rdfvalue.DurationSeconds("1w"), output_plugins=self.GetOutputPlugins()) self.Log("Started hunt %s.", hunt_id) else: with hunts_implementation.StartHunt( hunt_name=hunts_standard.GenericHunt.__name__, client_limit=0, flow_runner_args=rdf_flow_runner.FlowRunnerArgs( flow_name=flow_name), flow_args=flow_args, output_plugins=self.GetOutputPlugins(), crash_limit=config.CONFIG["Cron.interrogate_crash_limit"], client_rate=50, expiry_time=rdfvalue.DurationSeconds("1w"), description=description, token=self.token) as hunt_obj: hunt_obj.GetRunner().Start() self.Log("Started hunt %s.", hunt_obj.urn)
def StartInterrogationHunt(self): """Starts an interrogation hunt on all available clients.""" flow_name = compatibility.GetName(flows_discovery.Interrogate) flow_args = flows_discovery.InterrogateArgs(lightweight=False) description = "Interrogate run by cron to keep host info fresh." hunt_id = hunt.CreateAndStartHunt( flow_name, flow_args, self.token.username, client_limit=0, client_rate=config.CONFIG["Cron.interrogate_client_rate"], crash_limit=config.CONFIG["Cron.interrogate_crash_limit"], description=description, duration=config.CONFIG["Cron.interrogate_duration"], output_plugins=self.GetOutputPlugins()) self.Log("Started hunt %s.", hunt_id)
def Start(self): with hunts_implementation.StartHunt( hunt_name=hunts_standard.GenericHunt.__name__, client_limit=0, flow_runner_args=rdf_flow_runner.FlowRunnerArgs( flow_name=flows_discovery.Interrogate.__name__), flow_args=flows_discovery.InterrogateArgs(lightweight=False), output_plugins=self.GetOutputPlugins(), token=self.token) as hunt: runner = hunt.GetRunner() runner.runner_args.crash_limit = 500 runner.runner_args.client_rate = 50 runner.runner_args.expiry_time = "1w" runner.runner_args.description = ("Interrogate run by cron to keep host" "info fresh.") runner.Start()