Skip to content

Instantly share code, notes, and snippets.

@ollytheninja
Created September 6, 2021 06:08
Show Gist options
  • Save ollytheninja/0c6c0ff4724b1fc9f7ad05382bcc386b to your computer and use it in GitHub Desktop.
Save ollytheninja/0c6c0ff4724b1fc9f7ad05382bcc386b to your computer and use it in GitHub Desktop.
import boto3
import botocore
def validate_key(id, secret):
sts = boto3.client('sts', aws_access_key_id=id, aws_secret_access_key=secret)
try:
identity = sts.get_caller_identity()
print('Identity ARN: ' + identity['Arn'])
except botocore.exceptions.ClientError as e:
print("Probably not valid")
print(e)
if __name__ == "__main__":
validate_key(input("AWS KEY: "), input("AWS SECRET: "))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment