Tuần 3 - Ngày 3: IAM Identity Center (AWS SSO)
Mục tiêu học tập
- Hiểu cách hoạt động của IAM Identity Center
- Nắm vững Permission Sets và Account Assignments
- Biết cách integrate với external identity providers
1. Tổng quan IAM Identity Center
Định nghĩa
IAM Identity Center (trước đây là AWS SSO) cung cấp:
- Single sign-on cho nhiều AWS accounts
- Centralized access management
- Integration với external IdPs
- Temporary credentials (không có long-term keys)
Architecture
2. Identity Sources
Option 1: Built-in Identity Store
Pros:
- Simplest setup
- No additional cost
- Built-in MFA
Cons:
- Separate user management
- No sync with corporate directory
Use case: Small organizations without existing IdP
Option 2: AWS Managed Microsoft AD
Option 3: External Identity Provider (SAML 2.0)
Comparison
| Feature | Built-in | Managed AD | External IdP |
|---|---|---|---|
| Setup complexity | Low | Medium | Medium |
| User management | Manual | AD tools | IdP tools |
| Corporate sync | No | Yes (trust) | Yes (SCIM) |
| MFA | Built-in | AD MFA | IdP MFA |
| Cost | Free | AD cost | IdP cost |
3. Permission Sets
Định nghĩa
Permission Sets là collection of policies định nghĩa quyền access vào AWS accounts.
Types
1. AWS Managed Policies
- AdministratorAccess
- ViewOnlyAccess
- Billing
- PowerUserAccess
2. Customer Managed Policies
- Custom policies bạn tạo
3. Inline Policies
- Policies attached trực tiếp vào permission set
Permission Set Structure
{
"PermissionSet": {
"Name": "DatabaseAdmin",
"Description": "Full access to RDS and DynamoDB",
"SessionDuration": "PT4H",
"ManagedPolicies": [
"arn:aws:iam::aws:policy/AmazonRDSFullAccess",
"arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess"
],
"InlinePolicy": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": "rds:DeleteDBInstance",
"Resource": "*",
"Condition": {
"StringNotEquals": {
"aws:ResourceTag/Environment": "dev"
}
}
}
]
},
"PermissionsBoundary": {
"ManagedPolicyArn": "arn:aws:iam::aws:policy/boundary-policy"
}
}
}
Permission Set Best Practices
- Least privilege: Chỉ cấp quyền cần thiết
- Separation of duties: Tách biệt responsibilities
- Use managed policies: Dễ maintain
- Permission boundaries: Giới hạn maximum permissions
- Session duration: Set appropriate timeout
4. Account Assignments
How it works
Assignment Matrix Example
5. Temporary Credentials Flow
User Login Flow
CLI Access
# Configure SSO
aws configure sso
# → Enter SSO start URL
# → Enter SSO Region
# → Browser opens for authentication
# → Select account and role
# Use profile
aws s3 ls --profile my-sso-profile
# Or set default
export AWS_PROFILE=my-sso-profile
aws s3 ls
6. ABAC with IAM Identity Center
Attribute-Based Access Control
7. Multi-Account Permissions
Delegated Administration
8. Integration Patterns
Pattern 1: Okta Integration
Pattern 2: Azure AD Integration
9. Câu hỏi ôn tập
-
Identity Source có những options nào?
Xem đáp án
3 options: (1) IAM Identity Center directory (built-in, tạo/manage users trong Identity Center), (2) Active Directory (AWS Managed Microsoft AD hoặc AD Connector cho on-premises AD), (3) External IdP (Okta, Azure AD, OneLogin, Google Workspace) qua SAML 2.0. Chỉ chọn được 1 identity source tại một thời điểm. Thay đổi identity source yêu cầu reassign account assignments.
-
Permission Set là gì và chứa những gì?
Xem đáp án
Permission Set là template định nghĩa permissions sẽ được assign cho user/group khi access một account. Chứa: AWS managed policies (ví dụ
ReadOnlyAccess,AdministratorAccess), Customer managed policies, Inline policy, và Permission Boundary. Khi user access account qua IAM Identity Center portal, Permission Set tạo ra IAM Role tạm thời trong account đó với permissions được define. -
Account Assignment hoạt động như thế nào?
Xem đáp án
Account Assignment là mapping: User/Group → Permission Set → AWS Account. Ví dụ: Group "Developers" có Permission Set "DevAccess" assigned vào Account "Dev-123". Khi Developer login vào Identity Center portal, họ thấy Dev-123 trong danh sách accounts và có thể assume DevAccess role. IAM Identity Center tạo và maintain IAM Roles trong target accounts tự động dựa trên assignments.
-
ABAC với IAM Identity Center là gì?
Xem đáp án
Attribute-Based Access Control — dùng user attributes (từ Identity Source: department, title, team) như tags để control access. Ví dụ: user có attribute
Department=Financeđược assign vào accounts có tagDepartment=Finance. Ít phải manage individual assignments — thêm user vào đúng group với đúng attribute → access tự động granted. Đặc biệt mạnh khi user directory sync với AD/Okta (attributes tự populate). -
Delegated Administrator dùng để làm gì?
Xem đáp án
Cho phép delegate administration của IAM Identity Center từ management account sang một member account (thường là Security/Identity account). Administrators trong member account đó có thể manage users, groups, permission sets, và account assignments cho toàn Organization — không cần access management account. Best practice cho separation of duties: management account credentials minimal, Identity admin team work từ dedicated account.
10. Bài tập thực hành
- Enable IAM Identity Center
- Create permission sets
- Create user và assign to accounts
- Test CLI access với SSO
Tài liệu tham khảo chính thức
Ngày tiếp theo: AWS Resource Access Manager (RAM)