02. Amazon S3 Security
Amazon S3 (Simple Storage Service) provides multiple layers of security and access control to protect your data.
Security in S3 can be broadly classified into:
- User-Based Security (IAM Policies)
- Resource-Based Security (Bucket Policies, ACLs)
- Encryption
- Public Access Settings
๐ค 01. User-Based Securityโ
| Component | Description |
|---|---|
| IAM Policies | Define which API calls are allowed for specific IAM users, groups, or roles. |
| Attached To | IAM users, groups, or roles. |
| Use Case | Allow/deny users within the same AWS account to access S3. |
Example:
- Grant an IAM user permission to
s3:ListBucketands3:GetObject.
๐งฑ 02. Resource-Based Securityโ
๐น a. Bucket Policiesโ
- JSON-based policies applied directly to S3 buckets.
- Allow cross-account access.
- Define permissions at the bucket or object level.
| Element | Description |
|---|---|
| Effect | Allow / Deny |
| Principal | The AWS account, user, or role the policy applies to |
| Action | API actions (s3:GetObject, s3:PutObject, etc.) |
| Resource | ARN of bucket or objects |