Skip to main content
skill CX Codex

auditing-aws-s3-bucket-permissions — Claude Code skill

auditing-aws-s3-bucket-permissions audits AWS S3 bucket permissions, public access, bucket policies, and encryption via AWS CLI and Prowler. Helps baseline new cloud accounts and verify compliance for SOC 2 or PCI DSS.

Apache-2.0 307 installs ★ 36,511 updated 2026-08-31

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill auditing-aws-s3-bucket-permissions -a claude-code
Open on GitHub

What auditing-aws-s3-bucket-permissions does

The skill guides an agent through a seven-step audit of Amazon S3 storage. It starts by inspecting account-level Block Public Access settings and listing all buckets with their AWS regions. After that, the agent audits individual bucket configurations. It flags ACL grants assigned to AllUsers and runs an inline Python check to catch wildcard principals in bucket policies.

Next, the workflow checks server-side encryption and bucket versioning. It then triggers Prowler checks aligned with CIS AWS Foundations Benchmark and gathers external sharing findings from IAM Access Analyzer. Running this requires AWS CLI v2 and Python 3.8+ with boto3. Prowler is required for benchmark tests. Without permissions like s3:GetBucketPolicy and s3:ListAllMyBuckets, the audit fails immediately on access denied.

What it helps with

  • Detect publicly accessible S3 buckets and broad ACL grants
  • Identify wildcard principals and overly permissive statements in bucket policies
  • Verify default server-side encryption and versioning across all storage buckets
  • Run automated CIS AWS Foundations Benchmark checks using Prowler
  • Collect IAM Access Analyzer findings for external and cross-account access

Example prompts for the agent

  • Audit all S3 bucket permissions in this AWS account to find public access risks
  • Inspect S3 bucket policies for wildcard principals and list buckets missing encryption
  • Run Prowler S3 benchmark checks and review IAM Access Analyzer findings

How to install auditing-aws-s3-bucket-permissions

1Skills CLI (Vercel)

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill auditing-aws-s3-bucket-permissions -a claude-code

2Manually: put the files in place

~/.claude/skills/auditing-aws-s3-bucket-permissions/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/auditing-aws-s3-bucket-permissions/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about auditing-aws-s3-bucket-permissions

How to install auditing-aws-s3-bucket-permissions in Claude Code?

Run npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill auditing-aws-s3-bucket-permissions -a claude-code. The file will be placed in ~/.claude/skills/auditing-aws-s3-bucket-permissions/SKILL.md.

What does the auditing-aws-s3-bucket-permissions skill check?

It evaluates AWS S3 bucket configurations, covering account and bucket Block Public Access, ACL grants, bucket policies, encryption settings, and versioning.

Can this skill be used for real-time S3 monitoring?

No, this skill is designed for configuration audits and permissions reviews. For real-time event tracking, use S3 Event Notifications with AWS Lambda, or review data events in CloudTrail to analyze access patterns.

Source text

SKILL.md · Apache-2.0
---
name: auditing-aws-s3-bucket-permissions
description: 'Systematically audit AWS S3 bucket permissions to identify publicly
  accessible buckets, overly permissive ACLs, misconfigured bucket policies, and missing
  encryption settings using AWS CLI, S3audit, and Prowler to enforce least-privilege
  data access controls.

  '
domain: cybersecurity
subdomain: cloud-security
tags:
- cloud-security
- aws
- s3
- bucket-permissions
- data-protection
- access-control
version: '1.0'
author: mahipal
license: Apache-2.0
nist_csf:
- PR.IR-01
- ID.AM-08
- GV.SC-06
- DE.CM-01
mitre_attack:
- T1530
- T1619
- T1078.004
- T1537
- T1567.002
---

# Auditing AWS S3 Bucket Permissions

## When to Use

- When conducting a security assessment of AWS environments to identify publicly exposed data
- When onboarding a new AWS account and establishing a security baseline for storage resources
- When responding to an alert about potential S3 data exposure from AWS Trusted Advisor or Security Hub
- When compliance frameworks (SOC 2, PCI DSS, HIPAA) require periodic review of data access controls
- When a breach or credential compromise necessitates immediate review of all accessible S3 resources

**Do not use** for auditing non-AWS object storage (use provider-specific tools), for real-time monitoring (use S3 Event Notifications with Lambda), or for auditing S3 access patterns (use S3 Access Analyzer or CloudTrail S3 data events).

## Prerequisites

- AWS CLI v2 configured with credentials that have `s3:GetBucketPolicy`, `s3:GetBucketAcl`, `s3:GetBucketPublicAccessBlock`, `s3:GetEncryptionConfiguration`, and `s3:ListAllMyBuckets` permissions
- Prowler installed (`pip install prowler`) for automated CIS benchmark checks
- S3audit or similar enumeration tool for quick public bucket detection
- Access to AWS Organizations if auditing across multiple accounts
- Python 3.8+ with boto3 for custom audit scripts

## Workflow

### Step 1: Enumerate All S3 Buckets and Account-Level Block Public Access

Check the account-level S3 Block Public Access settings first, then list all buckets with their regions.

```bash
# Check account-level S3 Block Public Access settings
aws s3control get-public-access-block \
  --account-id $(aws sts get-caller-identity --query Account --output text) \
  --output json

# List all buckets with creation dates
aws s3api list-buckets \
  --query 'Buckets[*].[Name,CreationDate]' \
  --output table

# Get bucket regions for each bucket
for bucket in $(aws s3api list-buckets --query 'Buckets[*].Name' --output text); do
  region=$(aws s3api get-bucket-location --bucket "$bucket" --query 'LocationConstraint' --output text)
  echo "$bucket -> ${region:-us-east-1}"
done
```

### Step 2: Check Each Bucket's Public Access Block and ACL Configuration

Iterate through all buckets to evaluate their individual public access blocks and ACL grants.

```bash
# Check per-bucket Block Public Access settings
for bucket in $(aws s3api list-buckets --query 'Buckets[*].Name' --output text); do
  echo "=== $bucket ==="
  aws s3api get-public-access-block --bucket "$bucket" 2>/dev/null || echo "  No Block Public Access configured"

  # Check ACL for public grants
  aws s3api get-bucket-acl --bucket "$bucket" \
    --query 'Grants[?Grantee.URI==`http://acs.amazonaws.com/groups/global/AllUsers` || Grantee.URI==`http://acs.amazonaws.com/groups/global/AuthenticatedUsers`]' \
    --output json
done
```

### Step 3: Analyze Bucket Policies for Overly Permissive Access

Review bucket policies for wildcard principals, missing conditions, and statements that allow broad access.

```bash
# Extract and analyze bucket policies
for bucket in $(aws s3api list-buckets --query 'Buckets[*].Name' --output text); do
  policy=$(aws s3api get-bucket-policy --bucket "$bucket" --output text 2>/dev/null)
  if [ -n "$policy" ]; then
    echo "=== $bucket policy ==="
    echo "$policy" | python3 -c "
import json, sys
policy = json.load(sys.stdin)
for stmt in policy.get('Statement', []):
    principal = stmt.get('Principal', {})
    effect = stmt.get('Effect', '')
    if principal == '*' or principal == {'AWS': '*'}:
        print(f'  WARNING: {effect} with wildcard principal')
        print(f'  Actions: {stmt.get(\"Action\", \"\")}')
        print(f'  Condition: {stmt.get(\"Condition\", \"NONE\")}')
"
  fi
done
```

### Step 4: Verify Encryption and Versioning Settings

Check that all buckets have server-side encryption enabled and versioning configured for data protection.

```bash
# Check encryption and versioning status for all buckets
for bucket in $(aws s3api list-buckets --query 'Buckets[*].Name' --output text); do
  echo "=== $bucket ==="

  # Encryption configuration
  aws s3api get-bucket-encryption --bucket "$bucket" 2>/dev/null \
    && echo "  Encryption: ENABLED" \
    || echo "  Encryption: DISABLED"

  # Versioning status
  aws s3api get-bucket-versioning --bucket "$bucket" \
    --query 'Status' --output text

  # Logging status
  aws s3api get-bucket-logging --bucket "$bucket" \
    --query 'LoggingEnabled' --output text 2>/dev/null
done
```

### Step 5: Run Prowler S3-Specific Checks

Execute Prowler's S3-focused checks aligned with CIS AWS Foundations Benchmark.

```bash
# Run Prowler S3-specific checks
prowler aws \
  --checks s3_bucket_public_access \
           s3_bucket_default_encryption \
           s3_bucket_policy_public_write_access \
           s3_bucket_server_access_logging_enabled \
           s3_bucket_versioning_enabled \
           s3_bucket_acl_prohibited \
  -M json-ocsf \
  -o ./prowler-s3-audit/

# View summary
prowler aws --checks s3 -M csv -o ./prowler-s3-audit/
```

### Step 6: Use IAM Access Analyzer for S3 Public and Cross-Account Findings

Leverage IAM Access Analyzer to identify buckets shared externally or publicly.

```bash
# List Access Analyzer findings for S3
aws accessanalyzer list-findings \
  --analyzer-arn $(aws accessanalyzer list-analyzers --query 'analyzers[0].arn' --output text) \
  --filter '{"resourceType": {"eq": ["AWS::S3::Bucket"]}}' \
  --query 'findings[*].[resource,status,condition,principal]' \
  --output table

# Create an analyzer if one does not exist
aws accessanalyzer create-analyzer \
  --analyzer-name s3-access-audit \
  --type ACCOUNT
```

### Step 7: Generate Audit Report and Remediate

Compile findings into an actionable report and apply remediation for critical issues.

```bash
# Quick remediation: Enable Block Public Access on a bucket
aws s3api put-public-access-block \
  --bucket TARGET_BUCKET \
  --public-access-block-configuration \
  'BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true'

# Enable default encryption with SSE-S3
aws s3api put-bucket-encryption \
  --bucket TARGET_BUCKET \
  --server-side-encryption-configuration \
  '{"Rules":[{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"aws:kms","KMSMasterKeyID":"alias/aws/s3"},"BucketKeyEnabled":true}]}'

# Enable versioning
aws s3api put-bucket-versioning \
  --bucket TARGET_BUCKET \
  --versioning-configuration Status=Enabled
```

## Key Concepts

| Term | Definition |
|------|------------|
| S3 Block Public Access | Account-level and bucket-level settings that override ACLs and policies to prevent public access regardless of individual resource configurations |
| Bucket Policy | JSON-based resource policy attached to a bucket that defines who can access the bucket and what actions they can perform |
| ACL (Access Control List) | Legacy S3 access control mechanism granting permissions to AWS accounts or predefined groups like AllUsers or AuthenticatedUsers |
| IAM Access Analyzer | AWS service that analyzes resource policies to identify resources shared with external entities or the public |
| Server-Side Encryption | Encryption applied by S3 at the object level using SSE-S3, SSE-KMS, or SSE-C before writing data to disk |
| CIS AWS Foundations Benchmark | Security best practice standard from Center for Internet Security with specific controls for S3 bucket configuration |

## Tools & Systems

- **AWS CLI**: Primary interface for querying S3 bucket configurations, policies, ACLs, and encryption settings
- **Prowler**: Open-source security tool with 50+ S3-specific checks aligned to CIS, PCI DSS, and HIPAA controls
- **IAM Access Analyzer**: AWS-native service for continuous monitoring of resource policies that grant external access
- **S3audit**: Lightweight tool for quick enumeration of public S3 buckets across an account
- **ScoutSuite**: Multi-cloud auditing tool that collects S3 configuration data and generates risk-scored HTML reports

## Common Scenarios

### Scenario: Identifying a Publicly Readable Bucket Containing Customer Data

**Context**: A security engineer receives a Trusted Advisor alert about a publicly accessible S3 bucket. The bucket was created by a development team for a demo and was never locked down.

**Approach**:
1. Run `aws s3api get-bucket-acl` and find a grant to `AllUsers` with `READ` permission
2. Check `get-bucket-policy` and discover a policy with `Principal: "*"` and `s3:GetObject`
3. Confirm Block Public Access is not enabled at the bucket or account level
4. Enumerate bucket contents to assess data sensitivity
5. Immediately enable Block Public Access on the bucket
6. Review CloudTrail S3 data events to determine if unauthorized access occurred
7. Report the finding with timeline, data inventory, and remediation confirmation

**Pitfalls**: Enabling Block Public Access can break applications that intentionally serve content publicly (static websites). Always verify the bucket's intended use before applying restrictions. Check for CloudFront distributions or other services relying on the bucket's public access.

## Output Format

```
S3 Bucket Permissions Audit Report
=====================================
Account: 123456789012 (Production)
Date: 2026-02-23
Auditor: Security Engineering Team
Total Buckets: 47

ACCOUNT-LEVEL SETTINGS:
  Block Public Access: ENABLED (all four settings)

CRITICAL FINDINGS:
[S3-001] Public Read Access via ACL
  Bucket: marketing-assets-prod
  Issue: AllUsers group granted READ permission via ACL
  Risk: Any internet user can list and download bucket contents
  Data Sensitivity: Contains customer-facing but non-sensitive marketing assets
  Remediation: Remove AllUsers ACL grant, enable Block Public Access

[S3-002] Wildcard Principal in Bucket Policy
  Bucket: data-exchange-partner
  Issue: Policy allows s3:GetObject with Principal "*" and no VPC/IP condition
  Risk: Intended for partner access but accessible to anyone with the bucket name
  Remediation: Add aws:SourceVpce or aws:SourceIp condition to restrict access

SUMMARY:
  Buckets with public access:           3 / 47
  Buckets without encryption:           5 / 47
  Buckets without versioning:          12 / 47
  Buckets without access logging:      18 / 47
  Buckets with overly broad policies:   7 / 47
```

© mahipal · Apache-2.0 · mukul975/Anthropic-Cybersecurity-Skills

Similar skills

All skills for Security →

From the same set152

The whole set →
analyzing-ransomware-leak-site-intelligence analyzing-ransomware-leak-site-intelligence collects structured victim data from ransomware data leak sites and tracks group trends. Helps threat intelligence teams build risk assessments. CX Codex +1 313installs analyzing-powershell-script-block-logging The analyzing-powershell-script-block-logging skill parses PowerShell Script Block Logging events from EVTX files and flags obfuscated commands, Base64 payloads and AMSI bypass attempts. CX Codex +1 313installs analyzing-ransomware-encryption-mechanisms analyzing-ransomware-encryption-mechanisms analyzes ransomware encryption schemes, key management routines, and file structures. Helps evaluate whether encrypted files can be recovered without paying a ransom. CX Codex +1 312installs performing-web-application-firewall-bypass performing-web-application-firewall-bypass guides security testing agents through bypassing web application firewalls. It provides obfuscation techniques, parameter pollution, and HTTP tricks to test SQLi and XSS payloads. CX Codex +1 310installs analyzing-office365-audit-logs-for-compromise analyzing-office365-audit-logs-for-compromise parses Office 365 Unified Audit Logs via Microsoft Graph API to spot inbox forwarding rules, mailbox delegation, and rogue OAuth app grants. CX Codex +1 304installs exploiting-jwt-algorithm-confusion-attack The exploiting-jwt-algorithm-confusion-attack skill tests JWT authentication for algorithm switching, alg:none, and key-header issues. Use it for authorized API security checks. CX Codex +1 303installs analyzing-powershell-empire-artifacts The analyzing-powershell-empire-artifacts skill hunts for PowerShell Empire traces in Windows event logs and builds a report with IOCs, decoded payloads, and MITRE ATT&CK mappings. CX Codex +1 303installs configuring-oauth2-authorization-flow The configuring-oauth2-authorization-flow skill guides OAuth 2.0 setup for web, mobile, SPA, and machine clients. Use it when adding authorization or reviewing an existing flow. CX Codex +1 301installs

Project sponsors

Companies that keep this analytics open