Exemplo n.º 1
0
    parser = utils.setup_get_object_argparser('userrole', __doc__)
    parser = utils.add_get_object_report_argparser(parser)
    args = parser.parse_args()
    all_args = args.__dict__

    if not args.username:
        username = raw_input('Tanium Username: '******'username'] = username.strip()

    if not args.password:
        password = getpass.getpass('Tanium Password: '******'password'] = password.strip()

    if not args.host:
        host = raw_input('Tanium Host: ')
        all_args['host'] = host.strip()

    handler = process_handler_args(parser, all_args)

    try:
        response = utils.process_get_object_args(
            parser, handler, 'userrole', all_args
        )
        report_file, result = handler.export_to_report_file(response, **all_args)
    except Exception as e:
        print e
        sys.exit(99)

    m = "Report file {!r} written with {} bytes".format
    print(m(report_file, len(result)))
Exemplo n.º 2
0
    parser = utils.setup_get_object_argparser('whitelisted_url', __doc__)
    parser = utils.add_get_object_report_argparser(parser)
    args = parser.parse_args()
    all_args = args.__dict__

    if not args.username:
        username = raw_input('Tanium Username: '******'username'] = username.strip()

    if not args.password:
        password = getpass.getpass('Tanium Password: '******'password'] = password.strip()

    if not args.host:
        host = raw_input('Tanium Host: ')
        all_args['host'] = host.strip()

    handler = process_handler_args(parser, all_args)

    try:
        response = utils.process_get_object_args(
            parser, handler, 'whitelisted_url', all_args
        )
        report_file, result = handler.export_to_report_file(response, **all_args)
    except Exception as e:
        print e
        sys.exit(99)

    m = "Report file {!r} written with {} bytes".format
    print(m(report_file, len(result)))
Exemplo n.º 3
0
    parser = utils.setup_get_object_argparser('question', __doc__)
    parser = utils.add_get_object_report_argparser(parser)
    args = parser.parse_args()
    all_args = args.__dict__

    if not args.username:
        username = raw_input('Tanium Username: '******'username'] = username.strip()

    if not args.password:
        password = getpass.getpass('Tanium Password: '******'password'] = password.strip()

    if not args.host:
        host = raw_input('Tanium Host: ')
        all_args['host'] = host.strip()

    handler = process_handler_args(parser, all_args)

    try:
        response = utils.process_get_object_args(
            parser, handler, 'question', all_args
        )
        report_file, result = handler.export_to_report_file(response, **all_args)
    except Exception as e:
        print e
        sys.exit(99)

    m = "Report file {!r} written with {} bytes".format
    print(m(report_file, len(result)))
Exemplo n.º 4
0
    parser = utils.setup_get_object_argparser('OBJECTNAME', __doc__)
    parser = utils.add_get_object_report_argparser(parser)
    args = parser.parse_args()
    all_args = args.__dict__

    if not args.username:
        username = raw_input('Tanium Username: '******'username'] = username.strip()

    if not args.password:
        password = getpass.getpass('Tanium Password: '******'password'] = password.strip()

    if not args.host:
        host = raw_input('Tanium Host: ')
        all_args['host'] = host.strip()

    handler = process_handler_args(parser, all_args)

    try:
        response = utils.process_get_object_args(
            parser, handler, 'OBJECTNAME', all_args
        )
        report_file, result = handler.export_to_report_file(response, **all_args)
    except Exception as e:
        print e
        sys.exit(99)

    m = "Report file {!r} written with {} bytes".format
    print(m(report_file, len(result)))
Exemplo n.º 5
0
    if not args.username:
        username = raw_input('Tanium Username: '******'username'] = username.strip()

    if not args.password:
        password = getpass.getpass('Tanium Password: '******'password'] = password.strip()

    if not args.host:
        host = raw_input('Tanium Host: ')
        all_args['host'] = host.strip()

    handler = process_handler_args(parser, all_args)

    response = utils.process_get_object_args(
        parser, handler, 'sensor', all_args
    )

    # filter out all sensors that have a source_id (i.e. are created as temp sensors for params)
    response = [x for x in response if not x.source_id]

    if args.json:
        for x in response:
            result = handler.export_obj(x, 'json')
            print "{}:\n{}".format(x, result)
        sys.exit()

    for x in sorted(response, key=lambda x: x.category):
        if args.categories:
            if str(x.category).lower() not in [y.lower() for y in args.categories]:
                continue
Exemplo n.º 6
0
    parser = utils.setup_get_object_argparser('client', __doc__)
    parser = utils.add_get_object_report_argparser(parser)
    args = parser.parse_args()
    all_args = args.__dict__

    if not args.username:
        username = raw_input('Tanium Username: '******'username'] = username.strip()

    if not args.password:
        password = getpass.getpass('Tanium Password: '******'password'] = password.strip()

    if not args.host:
        host = raw_input('Tanium Host: ')
        all_args['host'] = host.strip()

    handler = process_handler_args(parser, all_args)

    try:
        response = utils.process_get_object_args(
            parser, handler, 'client', all_args
        )
        report_file, result = handler.export_to_report_file(response, **all_args)
    except Exception as e:
        print e
        sys.exit(99)

    m = "Report file {!r} written with {} bytes".format
    print(m(report_file, len(result)))
Exemplo n.º 7
0
    parser = utils.setup_get_object_argparser('package', __doc__)
    parser = utils.add_get_object_report_argparser(parser)
    args = parser.parse_args()
    all_args = args.__dict__

    if not args.username:
        username = raw_input('Tanium Username: '******'username'] = username.strip()

    if not args.password:
        password = getpass.getpass('Tanium Password: '******'password'] = password.strip()

    if not args.host:
        host = raw_input('Tanium Host: ')
        all_args['host'] = host.strip()

    handler = process_handler_args(parser, all_args)

    try:
        response = utils.process_get_object_args(
            parser, handler, 'package', all_args
        )
        report_file, result = handler.export_to_report_file(response, **all_args)
    except Exception as e:
        print e
        sys.exit(99)

    m = "Report file {!r} written with {} bytes".format
    print(m(report_file, len(result)))
Exemplo n.º 8
0
    parser = utils.setup_get_object_argparser('group', __doc__)
    parser = utils.add_get_object_report_argparser(parser)
    args = parser.parse_args()
    all_args = args.__dict__

    if not args.username:
        username = raw_input('Tanium Username: '******'username'] = username.strip()

    if not args.password:
        password = getpass.getpass('Tanium Password: '******'password'] = password.strip()

    if not args.host:
        host = raw_input('Tanium Host: ')
        all_args['host'] = host.strip()

    handler = process_handler_args(parser, all_args)

    try:
        response = utils.process_get_object_args(
            parser, handler, 'group', all_args
        )
        report_file, result = handler.export_to_report_file(response, **all_args)
    except Exception as e:
        print e
        sys.exit(99)

    m = "Report file {!r} written with {} bytes".format
    print(m(report_file, len(result)))