IAM 역할
임시 자격 증명을 발급하는 권한 묶음. 키 저장의 대안
이게 뭔가요? / What is this?
IAM 역할은 서버나 프로그램 같은 실체가 아니라, "누가 무엇을 할 수 있는가"를 정의해 둔 권한 규칙(추상적 개념)입니다. 사람에게 발급하는 고정된 로그인 계정(IAM 사용자)과 달리, EC2나 Lambda 같은 AWS 서비스가 잠깐 빌려 쓰고 자동으로 반납하는 "임시 신분증"이라고 생각하면 됩니다. 이 신분증은 시간이 지나면 자동으로 새 것으로 바뀌기 때문에, 코드에 고정된 비밀번호(액세스 키)를 박아두는 것보다 훨씬 안전합니다.
개요 / Overview
IAM 역할은 사용자나 서비스가 잠시 수임(assume)해 임시 자격 증명을 얻는 구조입니다. 자격 증명이 자동 교체되고 만료되므로 유출 위험이 낮습니다.
동작 원리 / How it works
역할은 소유자가 없는 자격 증명 컨테이너입니다. 신뢰 정책이 허용한 주체가 sts:AssumeRole을 호출하면 STS가 임시 액세스 키·시크릿·세션 토큰을 발급하고, 기본 1시간 후 만료됩니다. EC2에서는 인스턴스 프로파일이 이 과정을 자동화해 SDK가 메타데이터 서비스에서 자격 증명을 계속 갱신해 가져갑니다.
서드파티가 여러분 계정에 접근할 때는 신뢰 정책에 External ID 조건을 넣습니다. 이것이 없으면 그 서드파티의 다른 고객이 여러분 계정을 지목해 접근을 유도할 수 있는 혼동된 대리인 문제가 생깁니다.
시험은 무엇을 보는가 / What the exam is testing
시험은 역할을 "액세스 키의 대안"으로 반복 제시합니다. EC2·Lambda·ECS가 AWS API를 호출하는 모든 시나리오, 교차 계정 접근, 사내 디렉터리 연동(SAML·IAM Identity Center)이 모두 역할로 수렴합니다.
시험 포인트 / Exam points
EC2에 역할을 붙이는 껍데기가 인스턴스 프로파일입니다. 애플리케이션은 인스턴스 메타데이터에서 자격 증명을 자동으로 가져갑니다.
대상 계정에 신뢰 정책을 가진 역할을 만들고 원본 계정 주체가 수임합니다. 계정마다 사용자를 만들거나 키를 공유하는 선택지는 오답입니다.
서드파티가 내 계정에 접근할 때는 신뢰 정책에 External ID를 요구해 혼동된 대리인(confused deputy) 공격을 막습니다. 사내 디렉터리 연동은 SAML·IAM Identity Center를 씁니다.
자주 틀리는 함정 / Common traps
서드파티 접근 역할에 External ID를 생략하는 것 — 혼동된 대리인 공격에 노출됩니다.
역할을 붙였는데도 코드가 하드코딩된 키를 먼저 쓰는 구성 — 자격 증명 우선순위 때문에 역할이 무시됩니다.
IAM Role
A permission bundle issuing temporary credentials instead of stored keys
이게 뭔가요? / What is this?
An IAM role is not a physical thing like a server — it is an abstract permission rule that answers "who is allowed to do what." Unlike an IAM user (a fixed login account issued to a person), a role is more like a temporary ID badge that an AWS service such as EC2 or Lambda borrows for a short time and automatically returns. Because that badge keeps getting swapped for a fresh one, it is far safer than hard-coding a permanent password (an access key) into your code.
개요 / Overview
A role is assumed to obtain temporary credentials that rotate and expire automatically, drastically reducing leak risk.
동작 원리 / How it works
A role is an ownerless credential container. A principal permitted by the trust policy calls sts:AssumeRole, and STS issues a temporary access key, secret, and session token expiring after an hour by default. On EC2 the instance profile automates this, with the SDK continuously refreshing credentials from the metadata service.
When a third party accesses your account, put an External ID condition in the trust policy. Without it, another customer of that third party could induce access to your account — the confused-deputy problem.
시험은 무엇을 보는가 / What the exam is testing
The exam repeatedly presents roles as the alternative to access keys. Every scenario where EC2, Lambda, or ECS calls an AWS API, plus cross-account access and corporate directory federation via SAML or IAM Identity Center, converges on roles.
시험 포인트 / Exam points
An instance profile is the wrapper that attaches a role to EC2; the application picks up credentials automatically from instance metadata.
Create a role with a trust policy in the target account and let the source principal assume it. Creating users per account or sharing keys is wrong.
Require an External ID in the trust policy when a third party accesses your account, preventing confused-deputy attacks. Corporate directories federate through SAML or IAM Identity Center.
자주 틀리는 함정 / Common traps
Omitting the External ID on a third-party access role — it exposes you to confused-deputy attacks.
Attaching a role while the code still prefers hardcoded keys — the credential precedence chain ignores the role.
AWS SAA Hub Pro는 독립 학습 자료이며 Amazon Web Services, Inc.의 공식 서비스가 아닙니다. 시험 정책과 서비스 사양은 AWS 공식 문서를 기준으로 확인하세요.