示例#1
0
文件: main.py 项目: zorroroot/pacu
def find_secrets(userdata):
    detections = regex_checker(userdata)
    [
        Color.print(Color.GREEN,
                    '\tDetected {}: {}'.format(itemkey, detections[itemkey]))
        for itemkey in detections
    ]
示例#2
0
文件: main.py 项目: zorroroot/pacu
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]
示例#3
0
def check_source_secrets(function):
    pattern = "(#.*|//.*|\\\".*\\\"|'.*'|/\\*.*|\".*\")"

    source_data = get_function_source(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]
示例#4
0
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