A Bash and Python script (your choice of flavour) for listing out any AWS S3 buckets you own that have either Public Read or Public Write ACLs. Protect your data!
For the Bash script:
awscli
For the Python script (pulled right from requirements.txt):
boto3==1.4.4
botocore==1.5.85
docutils==0.13.1
futures==3.1.1
jmespath==0.9.3
python-dateutil==2.6.1
s3transfer==0.1.10
six==1.10.0
For both scripts, AWS credentials will be used from ~/.aws/credentials
per the default behaviour of the awscli
package and the boto3
package, respectively. If you wish to use an alternate means of loading credentials for the Python script, please consult the Boto 3 documentation for the options available to you.
- Clone the repository, or just save the
src/main/bash/DescribePublicBuckets.sh
file locally.
$ wget https://github.com/jgreenemi/DescribePublicBuckets/raw/master/src/main/bash/DescribePublicBuckets.sh
- Give the file executable permissions.
$ chmod +x DescribePublicBuckets.sh
- If you haven't yet configured your AWS CLI credentials, do so now.
$ aws configure
- Now you're ready - run the script and review the results.
$ ./DescribePublicBuckets.sh
- Clone the repository.
$ git clone https://github.com/jgreenemi/DescribePublicBuckets.git
- Install the dependencies. Virtual environment lines optional but recommended.
$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt
- If you haven't yet configured your AWS CLI credentials, do so now.
$ aws configure
- Now run the script and review the results.
$ python src/main/python/describe_public_buckets.py
Please open an Issue on this Github repository if you run into any problems.