Skip to content

Instantly share code, notes, and snippets.

@ievans
Created August 7, 2020 17:15
Show Gist options
  • Save ievans/5a3b8c954f3dd83ddd6372c2f2b9d81b to your computer and use it in GitHub Desktop.
Save ievans/5a3b8c954f3dd83ddd6372c2f2b9d81b to your computer and use it in GitHub Desktop.
# Prompt: Find all instances of boto3.client usage where someone has hardcoded the "aws_secret_access_key".
import boto3 as b3
import os
# semgrep should fire here
client = b3.client(
's3',
aws_secret_access_key = "jWnyeKHgaSRZVd_THIS_IS_FAKE_EsvPLRKNZCYRXRL",
aws_access_key_id = "AKIAIOSFO_THIS_IS_FAKE_DNN7652GQNB")
# ok
client = b3.client(
's3',
aws_secret_access_key = os.environ['foo'],
aws_access_key_id = os.environ['bar'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment