IAM
Identity and Access Management
A cloud resource access control service. Permission management based on users, roles, and policies.
Identity and Access Management
A cloud resource access control service. Permission management based on users, roles, and policies.
IAM (Identity and Access Management) is a core security service that controls "who (Identity) can perform what action (Action) on which resource (Resource) (Permission)" in cloud environments. All major clouds provide IAM, including AWS IAM, GCP IAM, and Azure RBAC, and it is the most fundamental and most important element of cloud security.
The core concepts of IAM are users (User), groups (Group), roles (Role), and policies (Policy). A user is an individual account, a group is a collection of users, a role is a set of permissions that can be granted temporarily, and a policy is a permission definition document in JSON format. In accordance with the "Principle of Least Privilege," only the minimum necessary permissions should be granted.
In modern IAM operations, role-based temporary credentials are recommended instead of long-term credentials (Access Keys). Use Instance Profile for EC2 instances, Execution Role for Lambda, and IRSA (AWS)/Workload Identity (GCP) for Kubernetes. This can significantly reduce the risk of credential leakage.
In practice, IAM goes beyond simple permission management and is a tool for implementing an organization's security governance. Service Control Policies (SCPs) restrict entire accounts, Permission Boundaries limit the maximum permissions a role can have, and CloudTrail/Cloud Audit Logs audit all API calls.
# AWS IAM 정책 예제 - S3 읽기 전용
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::my-bucket",
"arn:aws:s3:::my-bucket/*"
]
}
]
}
# AWS CLI로 역할 생성 및 정책 연결
aws iam create-role \
--role-name MyAppRole \
--assume-role-policy-document file://trust-policy.json
aws iam attach-role-policy \
--role-name MyAppRole \
--policy-arn arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess
# EC2 인스턴스 프로파일 생성 (Access Key 대신 사용)
aws iam create-instance-profile \
--instance-profile-name MyAppProfile
aws iam add-role-to-instance-profile \
--instance-profile-name MyAppProfile \
--role-name MyAppRole
# IAM Access Analyzer로 미사용 권한 분석
aws accessanalyzer list-findings \
--analyzer-arn arn:aws:access-analyzer:region:account:analyzer/name
"Hardcoding Access Keys in code leads to security incidents. EC2 should use Instance Profile, Lambda should use Execution Role, and EKS should use IRSA to switch to temporary credentials. Let's also analyze currently unused permissions with IAM Access Analyzer and clean them up to the minimum necessary."
"When designing IAM, we applied per-team role separation and the principle of least privilege. Developers were granted access to the dev environment only, the operations team was granted prod read plus deploy permissions only, and administrator permissions were set to require MFA. We blocked resource creation outside specific regions with SCPs, and used Permission Boundaries to prevent developers from creating roles with higher permissions than their own."
"If the Resource in an IAM policy is '*', all resources are accessible. Specify S3 bucket names or DynamoDB table names explicitly, and also add IP ranges or MFA conditions using Condition. In particular, iam:PassRole can be abused for privilege escalation, so it must be restricted."
Take a mock interview on this topic → WIA SOOM AI Interview · Start for free
There have been many cases where Access Keys exposed on GitHub resulted in charges of tens of millions of won. Never put them in code; use IAM Roles or environment variables/Secret Manager instead. Add automatic pre-commit checks with git-secrets.
Granting administrator permissions to all users for convenience leads to enormous damage when an incident occurs. Define least privileges for each role, and restrict administrator permissions with mandatory MFA plus Just-In-Time temporary elevation.
Restricting at the account level with AWS Organizations + SCPs, central authentication with IAM Identity Center (SSO), and enabling audit logs with CloudTrail are essential. Regularly clean up unused permissions/keys with IAM Access Analyzer and the Credential Report.