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/s3
key
You MUST specify customer-managed KMS keys by full ARN, not alias
You MUST include
BucketKeyEnabled: true
and
BlockedEncryptionTypes: [SSE-C]
in all configurations
Note
The S3 API accepts
aws/s3
and aliases without error — agent-enforced constraints. Verify with
get-bucket-encryption
after 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
, 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