Loading...
Loading...
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.
npx skill4agent add aws/agent-toolkit-for-aws securing-s3-bucketsaws sts get-caller-identity| 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 |
aws iam simulate-principal-policyput-bucket-policyaws s3api get-bucket-policyput-bucket-policyaws s3api get-bucket-policy --bucket <name> --output text > backup-policy-$(date +%s).jsonNoSuchBucketPolicyecho '<policy>' | python3 -m json.toolput-bucket-policy--bucket-namespace account-regionalDenyInsecureTransport--bucket-namespace account-regionalcreate-bucketaws s3api create-bucket --bucket <name> --bucket-namespace account-regional --region <region>BucketOwnerEnforcedDenyInsecureTransports3:*aws:SecureTransportfalseaws 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"}}}]}'aws/s3BucketKeyEnabled: trueBlockedEncryptionTypes: [SSE-C]aws/s3get-bucket-encryptionObjectLockConfigurationNotFoundErrorAccessDeniedaws iam simulate-principal-policyput-bucket-policyBadRequestException: detector already existsaws guardduty list-detectorscreate-detector--region <trail-home-region>aws cloudtrail describe-trails --query 'trailList[*].[Name,HomeRegion]'