def main(unused_args):
    # Allow per platform configuration.
    config_lib.CONFIG.AddContext(
        "Client Context", "Context applied when we run the client process.")

    startup.ClientInit()

    if flags.FLAGS.install:
        installer.RunInstaller()

    errors = config_lib.CONFIG.Validate(["Client", "CA", "Logging"])

    if errors and errors.keys() != ["Client.private_key"]:
        raise config_lib.ConfigFormatError(errors)

    enrollment_necessary = not config_lib.CONFIG.Get("Client.private_key")
    # Instantiating the client will create a private_key so we need to use a flag.
    client = GRRClient()
    if enrollment_necessary:
        logging.info("No private key found, starting enrollment.")
        client.client.InitiateEnrolment(comms.Status())

    if flags.FLAGS.break_on_start:
        pdb.set_trace()
    else:
        client.Run()
示例#2
0
def main(unused_args):
  config.CONFIG.AddContext(contexts.CLIENT_CONTEXT,
                           "Context applied when we run the client process.")

  client_startup.ClientInit()

  if flags.FLAGS.install:
    installer.RunInstaller()

  if flags.FLAGS.break_on_start:
    pdb.set_trace()
  else:
    fleetspeak_client.GRRFleetspeakClient().Run()
示例#3
0
def main(unused_args):
    # Allow per platform configuration.
    config_lib.CONFIG.AddContext(
        "Client Context", "Context applied when we run the client process.")

    startup.ClientInit()

    if flags.FLAGS.install:
        installer.RunInstaller()

    errors = config_lib.CONFIG.Validate(["Client", "CA", "Logging"])

    if not errors:
        client = GRRClient()
    elif errors.keys() == ["Client.private_key"]:
        client = GRRClient()
        client.client.InitiateEnrolment(comms.Status())
    else:
        raise config_lib.ConfigFormatError(errors)

    if flags.FLAGS.break_on_start:
        pdb.set_trace()
    else:
        client.Run()