Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept access-key and secret-key as input instead of command line #22

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,4 @@ venv.bak/
.mypy_cache/

.idea/*
.DS_Store
19 changes: 13 additions & 6 deletions enumerate-iam.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
#!/usr/bin/env python
#!/opt/homebrew/bin/python3
import argparse
import getpass

from enumerate_iam.main import enumerate_iam


def main():
parser = argparse.ArgumentParser(description='Enumerate IAM permissions')

parser.add_argument('--access-key', help='AWS access key', required=True)
parser.add_argument('--secret-key', help='AWS secret key', required=True)
parser.add_argument('--access-key', help='AWS access key')
parser.add_argument('--secret-key', help='AWS secret key')
parser.add_argument('--session-token', help='STS session token')
parser.add_argument('--region', help='AWS region to send API requests to', default='us-east-1')

args = parser.parse_args()

if args.access_key is None:
args.access_key = input("Enter AWS access key: ")

if args.secret_key is None:
args.secret_key = getpass.getpass("Enter AWS secret key: ")

enumerate_iam(args.access_key,
args.secret_key,
args.session_token,
args.region)
args.secret_key,
args.session_token,
args.region)


if __name__ == '__main__':
Expand Down
Loading