iam - deptno/deptno.github.io GitHub Wiki

iam

AWS μ—μ„œμ˜ API 인증

  • API에 Authorization, Crendential 헀더가 ν¬ν•¨λœλ‹€.
  • Authorization μ—λŠ” μ•Œκ³ λ¦¬μ¦˜μ΄, Crendential μ—λŠ” access key + μ•Œκ³ λ¦¬μ¦˜μœΌλ‘œ μ„œλͺ…λœ sceret + 토큰(μ˜΅μ…”λ„) 이 ν¬ν•¨λœλ‹€.
  • AWS SDK λŠ” 이와같은 일을 자체적으둜 μ²˜λ¦¬ν•΄μ€€λ‹€.

IAM: identity access managment

Root user

첫번째 IAM μœ μ €λ₯Ό μƒμ„±ν•œν›„ access key 자체λ₯Ό λΉ„ν™œμ„±ν™” ν•˜λŠ” 것을 μΆ”μ²œ MFA 도 ν™œμ„±ν™” ν•  것

IAM Policy

  • Principle: λŒ€μƒ
  • Effect: Allow or Deny
  • Action: ν—ˆμš©ν•  μ•‘μ…˜
  • Resource: νƒ€κ²Ÿ λ¦¬μ†ŒμŠ€(s3 λ“±)
  • Condition: 쑰건을 κ±Έμ–΄ λŒ€μƒμ„ 쒁힐수 있음

Principle - λŒ€μƒ νƒ€μž…

  • aws access key
  • iam user
  • iam role - μ„œλΉ„μŠ€μ— λΆ€μ—¬λ˜λŠ” μ •μ±…μœΌλ‘œ 보면됨

sts(session token)을 μ‚¬μš©ν•˜λ©΄ 더 μ•ˆμ „ν•œ μ‚¬μš©μ΄ κ°€λŠ₯

RBAC -> ABAC

  • Role Based Access Control
  • Attribute Based Access Control

ABAC 을 ν•˜λ©΄ νƒœκ·Έλ₯Ό ν†΅ν•΄μ„œ 접근을 μ œμ–΄ν•˜λŠ” IAM Policy λ₯Ό μž‘μ„±ν•˜λŠ” κ²ƒμœΌλ‘œ νŽΈλ¦¬ν•˜κ²Œ 관리가 κ°€λŠ₯
뭘 λ§Œλ“€λ•Œλ§ˆλ‹€ μ€‘λ³΅μ μœΌλ‘œ policy 생성을 ν•˜μ§€ μ•Šμ•„λ„ 됨

Identity-based policy vs Resource-based policy

  • Identity-based policy 은 λŒ€μƒμ— μ—°κ²°λœλ‹€.
  • Resource-based policy 은 νƒ€κ²Ÿ λ¦¬μ†ŒμŠ€μ— μ—°κ²°λœλ‹€.
  • policyμ—μ„œ principle 에 λΉ μ§€λ©΄ resource-based policy 둜 κ°„μ£Όλœλ‹€.
  • 동일 aws account λ‚΄μ—μ„œλŠ” 두 policy 의 ν•©μ§‘ν•©μœΌλ‘œ νΌλ―Έμ…˜μ΄ κ²°μ •λœλ‹€.
  • 크둜슀 aws account μ—μ„œλŠ” 두 policy 의 κ΅μ§‘ν•©μœΌλ‘œ νΌλ―Έμ…˜μ΄ κ²°μ •λœλ‹€.

계정 κΆŒν•œ λΆ€μ—¬λ₯Ό μœ„ν•œ λ‘€

  • iam:PassRole - κΆŒν•œ λΆ€μ—¬
  • sts:AssumeRole

reference