How to use the passivetotal.common.utilities.to_bool function in passivetotal

To help you get started, we’ve selected a few passivetotal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github passivetotal / python_api / passivetotal / cli / client.py View on Github external
tag_values = [x.strip() for x in args.tags.split(',')]
        pruned['tags'] = tag_values
        if args.add_tags:
            data = client.add_tags(**pruned)
        elif args.remove_tags:
            data = client.remove_tags(**pruned)
        elif args.set_tags:
            data = client.set_tags(**pruned)
        else:
            raise ValueError("Tag action required.")

    if args.classification:
        data = client.set_classification_status(**pruned)

    if args.monitor:
        pruned['status'] = to_bool(args.monitor)
        data = client.set_monitor_status(**pruned)

    if args.sinkhole:
        pruned['status'] = to_bool(args.sinkhole)
        data = client.set_sinkhole_status(**pruned)

    if args.dynamic_dns:
        pruned['status'] = to_bool(args.dynamic_dns)
        data = client.set_dynamic_dns_status(**pruned)

    if args.ever_compromised:
        pruned['status'] = to_bool(args.ever_compromised)
        data = client.set_ever_compromised_status(**pruned)

    if args.metadata:
        data = client.get_metadata(**pruned)
github PUNCH-Cyber / stoq-plugins-public / v1 / worker / passivetotal / passivetotal / passivetotal.py View on Github external
elif kwargs.get('remove_tags'):
                res = client.remove_tags(**params)
            elif kwargs.get('set_tags'):
                res = client.set_tags(**params)
            else:
                self.log.error("No tags provided.")

        if params.get('classification'):
            res = client.set_classification_status(**params)

        if params.get('monitor'):
            params['status'] = to_bool(params['monitor'])
            res = client.set_monitor_status(**params)

        if params.get('sinkhole'):
            params['status'] = to_bool(params['sinkhole'])
            res = client.set_sinkhole_status(**params)

        if params.get('dynamic_dns'):
            params['status'] = to_bool(params['dynamic_dns'])
            res = client.set_dynamic_dns_status(**params)

        if params.get('ever_compromised'):
            params['status'] = to_bool(params['ever_compromised'])
            res = client.set_ever_compromised_status(**params)

        if params.get('metadata'):
            res = client.get_metadata(**params)

        return res
github passivetotal / python_api / passivetotal / cli / client.py View on Github external
data = client.set_classification_status(**pruned)

    if args.monitor:
        pruned['status'] = to_bool(args.monitor)
        data = client.set_monitor_status(**pruned)

    if args.sinkhole:
        pruned['status'] = to_bool(args.sinkhole)
        data = client.set_sinkhole_status(**pruned)

    if args.dynamic_dns:
        pruned['status'] = to_bool(args.dynamic_dns)
        data = client.set_dynamic_dns_status(**pruned)

    if args.ever_compromised:
        pruned['status'] = to_bool(args.ever_compromised)
        data = client.set_ever_compromised_status(**pruned)

    if args.metadata:
        data = client.get_metadata(**pruned)

    return data
github passivetotal / python_api / passivetotal / cli / client.py View on Github external
elif args.remove_tags:
            data = client.remove_tags(**pruned)
        elif args.set_tags:
            data = client.set_tags(**pruned)
        else:
            raise ValueError("Tag action required.")

    if args.classification:
        data = client.set_classification_status(**pruned)

    if args.monitor:
        pruned['status'] = to_bool(args.monitor)
        data = client.set_monitor_status(**pruned)

    if args.sinkhole:
        pruned['status'] = to_bool(args.sinkhole)
        data = client.set_sinkhole_status(**pruned)

    if args.dynamic_dns:
        pruned['status'] = to_bool(args.dynamic_dns)
        data = client.set_dynamic_dns_status(**pruned)

    if args.ever_compromised:
        pruned['status'] = to_bool(args.ever_compromised)
        data = client.set_ever_compromised_status(**pruned)

    if args.metadata:
        data = client.get_metadata(**pruned)

    return data
github passivetotal / python_api / passivetotal / cli / client.py View on Github external
else:
            raise ValueError("Tag action required.")

    if args.classification:
        data = client.set_classification_status(**pruned)

    if args.monitor:
        pruned['status'] = to_bool(args.monitor)
        data = client.set_monitor_status(**pruned)

    if args.sinkhole:
        pruned['status'] = to_bool(args.sinkhole)
        data = client.set_sinkhole_status(**pruned)

    if args.dynamic_dns:
        pruned['status'] = to_bool(args.dynamic_dns)
        data = client.set_dynamic_dns_status(**pruned)

    if args.ever_compromised:
        pruned['status'] = to_bool(args.ever_compromised)
        data = client.set_ever_compromised_status(**pruned)

    if args.metadata:
        data = client.get_metadata(**pruned)

    return data
github PUNCH-Cyber / stoq-plugins-public / v1 / worker / passivetotal / passivetotal / passivetotal.py View on Github external
else:
                self.log.error("No tags provided.")

        if params.get('classification'):
            res = client.set_classification_status(**params)

        if params.get('monitor'):
            params['status'] = to_bool(params['monitor'])
            res = client.set_monitor_status(**params)

        if params.get('sinkhole'):
            params['status'] = to_bool(params['sinkhole'])
            res = client.set_sinkhole_status(**params)

        if params.get('dynamic_dns'):
            params['status'] = to_bool(params['dynamic_dns'])
            res = client.set_dynamic_dns_status(**params)

        if params.get('ever_compromised'):
            params['status'] = to_bool(params['ever_compromised'])
            res = client.set_ever_compromised_status(**params)

        if params.get('metadata'):
            res = client.get_metadata(**params)

        return res