Skip to content

Latest commit

 

History

History

s3_remove_public_access

Remove S3 Public Access

This job blocks public access to an S3 bucket.

Applicable Rule

Rule ID:
  • 5c8c26507a550e1fb6560c57
  • 5c8c26517a550e1fb6560c59
  • 5c8c26537a550e1fb6560c5a
  • 5c8c26537a550e1fb6560c5b
  • 5c8c26547a550e1fb6560c5c
  • 5c8c26637a550e1fb6560c6b
Rule Name:
  • An S3 bucket is configured so that all users have unrestricted permissions
  • Read access to an S3 bucket is unrestricted
  • An S3 bucket is configured to allow all users to read permissions
  • Write access to an S3 bucket is unrestricted
  • An S3 bucket is configured to allow unrestricted access control changes
  • The S3 bucket policy allows unrestricted get access

Getting Started

Prerequisites

The provided AWS credential must have access to s3:PutBucketPublicAccessBlock.

You may find the latest example policy file here

Running the script

You may run this script using following commands:

  pip install -r ../../requirements.txt
  python3 s3_remove_public_access.py

Running the tests

You may run test using following command under vss-remediation-worker-job-code-python directory:

    python3 -m pytest test

Deployment

  1. Provision a Virtual Machine Create an EC2 instance to use for the worker. The minimum required specifications are 128 MB memory and 1/2 Core CPU.
  2. Setup Docker Install Docker on the newly provisioned EC2 instance. You can refer to the docs here for more information.
  3. Deploy the worker image SSH into the EC2 instance and run the command below to deploy the worker image:
  docker run --rm -it --name worker \
  -e VSS_CLIENT_ID={ENTER CLIENT ID}
  -e VSS_CLIENT_SECRET={ENTER CLIENT SECRET} \
  vmware/vss-remediation-worker:latest-python

Contributing

The VMware Aria Automation for Secure Clouds team welcomes welcomes contributions from the community. If you wish to contribute code and you have not signed our contributor license agreement (CLA), our bot will update the issue when you open a Pull Request. For any questions about the CLA process, please refer to our FAQ. All contributions to this repository must be signed as described on that page. Your signature certifies that you wrote the patch or have the right to pass it on as an open-source patch.

For more detailed information, refer to CONTRIBUTING.md.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • VMware VMware Aria Automation for Secure Clouds - Initial work

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache License - see the LICENSE file for details