Пример #1
0
def pull_graph(profilearg):
    botocore_session = botocore.session.Session(profile=profilearg)

    try:
        stsclient = botocore_session.create_client('sts')
    except Exception as ex:
        print('Unable to access STS using the profile "' + profilearg + '"')
        print('Exiting.')
        sys.exit(-1)

    identity_response = stsclient.get_caller_identity()
    print('Using profile: ' + profilearg)
    print('Pulling data for account ' + identity_response['Account'])
    print('Using principal with ARN ' + identity_response['Arn'])

    enumerator = principalmap.enumerator.Enumerator(botocore_session)
    enumerator.fillOutGraph()

    return enumerator.graph
Пример #2
0
def pull_graph(parsed, session):
    enumerator = principalmap.enumerator.Enumerator(session)
    enumerator.fillOutGraph()

    return enumerator.graph