Created
July 20, 2025 10:15
-
-
Save avilum/7f890cb7ff9d638c1723bd29bb44783e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check if the current org has S3 public buckets. | |
for bucket in $(aws s3api list-buckets --query "Buckets[].Name" --output text); do | |
echo "Checking bucket: $bucket" | |
# Get the public access block | |
pab=$(aws s3api get-bucket-policy-status --bucket "$bucket" 2>/dev/null) | |
if echo "$pab" | grep -q '"IsPublic": true'; then | |
echo "🚨 $bucket is PUBLIC" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment