Systematic approach to securing and auditing AWS S3 buckets.
Install
mkdir -p .claude/skills/securing-s3-buckets && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16170" && unzip -o skill.zip -d .claude/skills/securing-s3-buckets && rm skill.zipInstalls to .claude/skills/securing-s3-buckets
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Create and secure S3 buckets following AWS best practices for access control, encryption, monitoring, and remediation of misconfigurations. Use when the user wants to secure a new bucket, audit an existing bucket, fix a security finding, configure encryption, or enable logging and monitoring. Do NOT use for general S3 data operations, S3 Tables setup, or discovering existing data assets.Key capabilities
- →Create S3 buckets following AWS best practices
- →Audit existing S3 bucket configurations for security
- →Remediate specific security findings in S3 buckets
- →Configure encryption for S3 buckets
- →Enable logging and monitoring for S3 buckets
How it works
The skill implements layered S3 security controls across five workflows: securing new buckets, auditing existing configurations, remediating findings, configuring encryption, and enabling monitoring. It follows AWS Well-Architected security best practices.
Inputs & outputs
When to use securing-s3-buckets
- →Secure a newly created bucket
- →Audit existing bucket permissions
- →Enable bucket-level encryption
- →Set up monitoring and logging
About this skill
Overview
Implements layered S3 security controls across five workflows: securing new buckets, auditing existing configurations, remediating findings, configuring encryption, and enabling monitoring. Follows AWS Well-Architected security best practices.
Execute commands using the AWS MCP server when connected (sandboxed execution, audit logging, observability). Fall back to AWS CLI or shell otherwise.
Common Tasks
0. Verify Dependencies
Check for required tools before starting.
Constraints:
- You MUST inform the user if required tools are missing
- You SHOULD confirm credentials with
aws sts get-caller-identity
See references/iam-permissions.md for IAM permissions by workflow.
1. Classify the Request
| User intent | Workflow |
|---|---|
| Secure a new bucket | A: Secure New Bucket |
| Audit / review existing bucket | B: Audit Existing Bucket |
| Fix a specific finding | C: Remediate Issue |
| Configure encryption | D: Configure Encryption |
| Enable logging / monitoring | E: Enable Monitoring |
Constraints:
- You MUST ask for all required parameters upfront
- You MUST confirm bucket name and region before any write operation
- You MAY infer region from user context if clearly stated
- You SHOULD run
aws iam simulate-principal-policyto validate permissions before write operations - You SHOULD display write commands and wait for confirmation before executing
put-bucket-policy Safety Rules
These rules apply to ALL workflows that call put-bucket-policy:
- You MUST attempt to retrieve the existing policy first (
aws s3api get-bucket-policy) —put-bucket-policyreplaces the entire policy - If a policy exists, you MUST back it up before modifying:
aws s3api get-bucket-policy --bucket <name> --output text > backup-policy-$(date +%s).json - If
NoSuchBucketPolicyis returned, proceed with a new policy — no backup is needed - You MUST merge new statements into the existing policy's Statement array (if one exists)
- You MUST validate merged JSON syntax before applying (e.g.
echo '<policy>' | python3 -m json.tool) - You SHOULD display the full
put-bucket-policycommand and wait for confirmation
2. Workflow A — Secure New Bucket
See references/workflows.md for full CLI steps.
Required steps (execute in order, do not skip):
- Create bucket with
--bucket-namespace account-regional - Enable versioning
- Enable encryption (SSE-S3 + Bucket Keys + block SSE-C)
- Enable logging (ask user which option — conditional)
- Enforce HTTPS-only via
DenyInsecureTransportbucket policy - Enable ABAC
Constraints:
-
You MUST pass
--bucket-namespace account-regionaloncreate-bucketcall — this is REQUIRED, not optional. Example:aws s3api create-bucket --bucket <name> --bucket-namespace account-regional --region <region> -
You MUST NOT change Block Public Access — S3 enables it by default on new buckets
-
You MUST NOT change ACL ownership controls — S3 disables ACLs (
BucketOwnerEnforced) by default -
You MUST apply a bucket policy with a
DenyInsecureTransportstatement that deniess3:*whenaws:SecureTransportisfalse— this is REQUIRED, not optional. Example:aws s3api put-bucket-policy --bucket <name> --policy '{"Version":"2012-10-17","Statement":[{"Sid":"DenyInsecureTransport","Effect":"Deny","Principal":"*","Action":"s3:*","Resource":["arn:aws:s3:::<name>/*","arn:aws:s3:::<name>"],"Condition":{"Bool":{"aws:SecureTransport":"false"}}}]}' -
You MUST ask the user which logging option they want before step 4
-
You MUST follow the put-bucket-policy safety rules for steps 4 and 5
-
You SHOULD confirm each step succeeded before proceeding
3. Workflow B — Audit Existing Bucket
See references/audit-checklist.md for the full checklist.
Constraints:
- You MUST run all read-only audit commands before reporting findings
- You MUST NOT execute any write or modify commands during an audit
- You MUST report each control as PASS / FAIL / NOT CONFIGURED with severity
- For logging: report PASS if either S3 server access logging OR CloudTrail data events are enabled; NOT CONFIGURED only if neither
4. Workflow C — Remediate Issue
See references/remediation.md for fix commands by issue type.
Constraints:
- You MUST identify the issue type before applying any fix
- You MUST follow the put-bucket-policy safety rules when modifying policies
- You MUST re-run the relevant audit check after applying the fix to confirm resolution
5. Workflow D — Configure Encryption
See references/encryption.md for encryption options and commands.
Constraints:
- You MUST default to SSE-S3 with S3 Bucket Keys and SSE-C blocked unless the user explicitly requests KMS
- When using SSE-KMS, you MUST use a customer managed key — NEVER the AWS managed
aws/s3key - You MUST specify customer-managed KMS keys by full ARN, not alias
- You MUST include
BucketKeyEnabled: trueandBlockedEncryptionTypes: [SSE-C]in all configurations - Note: The S3 API accepts
aws/s3and aliases without error — agent-enforced constraints. Verify withget-bucket-encryptionafter applying.
6. Workflow E — Enable Monitoring
See references/workflows.md for full CLI steps.
Constraints:
- You MUST check whether a GuardDuty detector already exists before creating one
- You MUST use the trail's home region (not the bucket's region) for CloudTrail commands
- You SHOULD enable all four core recommended AWS Config rules
Troubleshooting
ObjectLockConfigurationNotFoundError — Object Lock is not enabled. Treat as NOT CONFIGURED, not a failure.
AccessDenied on audit commands — Check IAM policy, bucket policy, Block Public Access, VPC endpoint policy, and SCPs/RCPs. Use aws iam simulate-principal-policy to diagnose.
put-bucket-policy silently removes existing statements — See put-bucket-policy safety rules.
GuardDuty BadRequestException: detector already exists — Run aws guardduty list-detectors first; only call create-detector if empty.
CloudTrail changes not taking effect — Verify you are using --region <trail-home-region>, not the bucket's region. Find it with aws cloudtrail describe-trails --query 'trailList[*].[Name,HomeRegion]'.
Additional Resources
- references/iam-permissions.md — IAM permissions by workflow
- references/audit-checklist.md — Per-control checklist with severity and pass conditions
- references/encryption.md — Encryption options, KMS guidance, SSE-C blocking
- references/remediation.md — Fix commands for common findings
- references/workflows.md — Full CLI command sequences for Workflows A and E
- AWS S3 Security Best Practices
- AWS Well-Architected Security Pillar
When not to use it
- →When performing general S3 data operations
- →When setting up S3 Tables
- →When discovering existing data assets
Limitations
- →The skill is for creating and securing S3 buckets.
- →The skill is for AWS best practices for access control, encryption, monitoring, and remediation of misconfigurations.
How it compares
This skill automates and standardizes S3 security configurations and audits based on AWS best practices, providing a systematic approach to securing buckets unlike manual, ad-hoc security adjustments.
Compared to similar skills
securing-s3-buckets side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| securing-s3-buckets (this skill) | 0 | 3mo | No flags | Intermediate |
| ssl-certificate-management | 0 | 5mo | Review | Intermediate |
| aws-advisor | 5 | 5mo | Review | Intermediate |
| infra-architect | 0 | 1mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by aws
View all by aws →You might also like
ssl-certificate-management
aj-geddes
>
aws-advisor
tech-leads-club
Expert AWS Cloud Advisor for architecture design, security review, and implementation guidance. Leverages AWS MCP tools for accurate, documentation-backed answers. Use when user asks about AWS architecture, security, service selection, migrations, troubleshooting, or learning AWS. Triggers on AWS, Lambda, S3, EC2, ECS, EKS, DynamoDB, RDS, CloudFormation, CDK, Terraform, Serverless, SAM, IAM, VPC, API Gateway, or any AWS service.
infra-architect
k1lgor
|
secrets-management
wshobson
Implement secure secrets management for CI/CD pipelines using Vault, AWS Secrets Manager, or native platform solutions. Use when handling sensitive credentials, rotating secrets, or securing CI/CD environments.
cloud-penetration-testing
davila7
This skill should be used when the user asks to "perform cloud penetration testing", "assess Azure or AWS or GCP security", "enumerate cloud resources", "exploit cloud misconfigurations", "test O365 security", "extract secrets from cloud environments", or "audit cloud infrastructure". It provides comprehensive techniques for security assessment across major cloud platforms.
secrets-manager
itsmostafa
AWS Secrets Manager for secure secret storage and rotation. Use when storing credentials, configuring automatic rotation, managing secret versions, retrieving secrets in applications, or integrating with RDS.