Beispiel #1
0
def chase(target):
    return [
        dalek("iot_things", region=target["region"]),
        dalek("iot_rules", region=target["region"]),
        dalek("iot_policies", region=target["region"]),
        dalek("iot_certificates", region=target["region"])
    ]
Beispiel #2
0
def chase(target):
    iot = boto3.client('iot', region_name=target["region"])
    rules = iot.list_topic_rules()['rules']
    rules = [rule["ruleName"] for rule in rules]
    daleks = [dalek("iot_rule", region=target["region"], names=[rule])
              for rule in rules]
    return daleks
Beispiel #3
0
def chase(target):
    client = boto3.client('lambda', region_name=target["region"])
    functions = client.list_functions()["Functions"]
    functions = [fun["FunctionName"] for fun in functions]
    daleks = [dalek("lambda_function", region=target["region"], names=[fun])
              for fun in functions]
    return daleks
Beispiel #4
0
def chase(target):
    iot = boto3.client('iot', region_name=target["region"])
    things = iot.list_things()['things']
    things = [
        dalek("iot_thing", region=target["region"], names=[thing["thingName"]])
        for thing in things
    ]
    return things
Beispiel #5
0
def chase(target):
    iot = boto3.client('iot', region_name=target["region"])
    pols = iot.list_policies()['policies']
    pols = [pol["policyName"] for pol in pols]
    daleks = [
        dalek("iot_policy", region=target["region"], names=[pol])
        for pol in pols
    ]
    return daleks
Beispiel #6
0
def chase(target):
    client = boto3.client('lambda', region_name=target["region"])
    functions = client.list_functions()["Functions"]
    functions = [fun["FunctionName"] for fun in functions]
    daleks = [
        dalek("lambda_function", region=target["region"], names=[fun])
        for fun in functions
    ]
    return daleks
def chase(target):
    iot = boto3.client('iot', region_name=target["region"])
    certs = iot.list_certificates()['certificates']
    daleks = []
    for cert in certs:
        if cert["status"] == "ACTIVE":
            daleks.append(dalek("iot_certificate", region=target["region"], names=[
                          cert["certificateId"]]))
    return daleks
Beispiel #8
0
def chase(target):
    iot = boto3.client('iot', region_name=target["region"])
    certs = iot.list_certificates()['certificates']
    daleks = []
    for cert in certs:
        if cert["status"] == "ACTIVE":
            daleks.append(
                dalek("iot_certificate",
                      region=target["region"],
                      names=[cert["certificateId"]]))
    return daleks
Beispiel #9
0
def chase(target):
    region_name = target["region"]
    ec2 = boto3.client('ec2', region_name=region_name)
    describe_instances = ec2.describe_instances(Filters=[{
        'Name': 'instance-state-name',
        'Values': ['running']
    }])
    reservations = describe_instances['Reservations']
    instancess = [r['Instances'] for r in reservations]
    instances = [i for instances in instancess for i in instances]
    instance_ids = [i['InstanceId'] for i in instances]
    daleks = [dalek("ec2_instance", region=region_name, names=instance_ids)]
    return daleks
Beispiel #10
0
def chase(target):
    region_name = target["region"]
    ec2 = boto3.client('ec2', region_name=region_name)
    describe_instances = ec2.describe_instances(
        Filters=[{
            'Name': 'instance-state-name',
            'Values': [
                'running'
            ]
        }]
    )
    reservations = describe_instances['Reservations']
    instancess = [r['Instances'] for r in reservations]
    instances = [i for instances in instancess for i in instances]
    instance_ids = [i['InstanceId'] for i in instances]
    daleks = [dalek("ec2_instance", region=region_name, names=instance_ids)]
    return daleks
Beispiel #11
0
def chase(target):
    iot = boto3.client('iot', region_name=target["region"])
    things = iot.list_things()['things']
    things = [dalek("iot_thing", region=target["region"], names=[thing["thingName"]])
              for thing in things]
    return things
Beispiel #12
0
def chase(target):
    list_users = iam.list_users()['Users']
    daleks = [dalek("iam-user", None, user['UserName']) for user in list_users]
    return daleks
Beispiel #13
0
def daleks(*args):
    return [dalek(arg) for arg in args]