Ejemplo n.º 1
0
def find_secrets(userdata):

    detections = regex_checker(userdata)
    [
        Color.print(Color.GREEN,
                    '\tDetected {}: {}'.format(itemkey, detections[itemkey]))
        for itemkey in detections
    ]
def scan_tags(instance):
    try:
        tags = instance['Tags']
        [
            Color.print(
                Color.GREEN,
                '\tTag discovered {}: {}'.format(tag["Key"], tag["Value"]))
            for tag in tags if regex_checker(tag['Value'])
        ]

    except KeyError:
        return
Ejemplo n.º 3
0
def check_secrets(session_name, tableData):
    acc = []
    for item in tableData['Items']:
        acc += list(NestedDictValues(item))
    for val in acc:
        if isinstance(val, str):
            secrets = regex_checker(val)
            if secrets:
                [
                    Color.print(Color.GREEN,
                                "\t{}: {}".format(key, secrets[key]))
                    for key in secrets
                ]
def check_source_secrets(session_name, function):
    pattern = "(#.*|//.*|\\\".*\\\"|'.*'|/\\*.*|\".*\")"

    source_data = get_function_source(session_name, function)

    for key in source_data:
        for line in re.findall(pattern, source_data[key]):
            secrets = regex_checker(line)
            if secrets:
                [
                    Color.print(Color.GREEN,
                                "\t{}: {}".format(key, secrets[key]))
                    for key in secrets
                ]