예제 #1
0
    def Start(self):
        super(OsqueryFlow, self).Start()
        self.state.progress = rdf_osquery.OsqueryProgress()

        self.CallClient(server_stubs.Osquery,
                        request=self.args,
                        next_state=compatibility.GetName(self.Process))
예제 #2
0
파일: osquery.py 프로젝트: avmi/grr
  def Start(self):
    super(OsqueryFlow,
          self).Start(file_size=FILE_COLLECTION_MAX_SINGLE_FILE_BYTES)
    self.state.progress = rdf_osquery.OsqueryProgress()

    if len(self.args.file_collection_columns) > FILE_COLLECTION_MAX_COLUMNS:
      message = ("Requested file collection for "
                 f"{len(self.args.file_collection_columns)} columns, "
                 f"but the limit is {FILE_COLLECTION_MAX_COLUMNS} columns.")
      self._UpdateProgressWithError(message)
      raise FileCollectionLimitsExceeded(message)

    self.state.path_to_count = {}
    self.state.total_collected_bytes = 0

    action_args = rdf_osquery.OsqueryArgs(
        query=self.args.query, timeout_millis=self.args.timeout_millis)
    self.CallClient(
        server_stubs.Osquery,
        request=action_args,
        next_state=compatibility.GetName(self.Process))