AWS SAA : Region & AZ, IAM & AWS CLI

써니·2023년 7월 18일
0

AWS

목록 보기
1/1
post-thumbnail

※ Region : Cluster of data centers

  • when choosing region, you should consider
    1. Compliance w/ data governance & legal requirements
    1. Proximity to customer - ↓ latency
    2. Services' availability within a region
    3. Pricing



※ AZ (Available Zone) : 1개 이상의 discrete center w/ Redundant power, networking, connectivity

  • 같은 region 내 AZ 간에는 high bandwidth + ultra-low latency networking

  • Region마다 평균 3개의 AZ (min 3, max 6)

  • Points of Presence (사용자에게 low latency로 전달하는 것에 도움 주는 service)
    - Edge

    • Regional Cache
  • Global service ↮ regional service
    - 일부 service는 global service로서 region/AZ 선택을 필요로 하지 않음

    • ex) IAM, ...





※ IAM : Identity and Access Management

  • Root account : default 로 생성, 함부로 사용/공유되지 않도록 주의
  • AWS login option : root user / IAM user
    • IAM user :
      • Account ID/alias
      • account user name
      • password

IAM Users : 조직 내 구성원

  • Account ID : 고유값, 번호로만 구성
    ⇒ Account Alias : 닉네임, 로그인 시 사용 가능



IAM Group : User만 등록 가능 (X contain other groups)



IAM Roles : specific permissions with credentials that are valid for short durations

  • 일반적으로 특정 AWS resource에 권한이 없는 users/applications/services에 권한을 대리 (delegate access)
    • perform actions on your behalf
  • password나 access key를 요구하는 standard long-term credential이 없음
    • (user와 유사하지만 특정 사람과 associated될 필요x)
  • provides you w/ temporary security credentials for your role session
  • common roles:
    • EC2 Instance Roles
    • Lambda Functions Roles
    • Roles for CloudFormation



IAM Policy

  • JSON 문서로 user/group의 permission 정의 ⇒ “Grant/apply the least privilege principle” (필요한 권한만 최소한으로 부여해라)

  • Inheritance : 특정 policy가 부여된 group에 할당/추가되면 해당 policy를 상속받음

    • group에 속해있지 않은 user는 해당 user에 할당된 policy만 보유
    • 속해있던 group에서 배제될 경우 해당 group의 policy 속 권한들을 상실하게 됨
  • Policy Structure
    1. Version : policy language version - “2012-10-17”
    2. Id (optional) : 고유값
    3. Statement : 1개 이상
    • Sid (optional) : statement의 id
    • Effect : “Allow” / “Deny”
    • Principle : 해당 policy가 적용될 account/user/role의 id
    • Action : 해당 policy가 허용/금지할 action의 list
      • * : all actions
    • Resource : 위 action들이 적용될 resource의 list
      • * : all resources
    • Condition (optional) : 해당 policy가 적용될 조건들



IAM Defense mechanism -

  1. Password Policy
    • 비밀번호가 강력할수록 보안 강화
    • AWS에서 원하는 password policy를 직접 정할 수 있다 :
      • password 최소 길이 정하기
      • 특정 문자 포함시키기 (대문자 / 소문자 / 숫자 / 특수문자)
      • 모든 IAM user들의 비밀번호 변경 허용하기
      • 일정 시간 후 user들의 비밀번호 변경 요청하기 (password expiration)
      • 비밀번호 재사용 방지
  1. Multi Factor Authentication (MFA)

    • Users 가 보유한 권한으로 설정값들을 변경하거나 resource를 삭제할 수 있음
    • Root account와 IAM user를 보호하기 위한 MFA
    • MFA = password you know + security device you own
    • 최대장점 : Even if a password is stolen or hacked, the account is not compromised
    • options
      1. Virtual MFA device : support for multiple tokens on a single device
      • Google Authenticator (phone only)
      • Authy (multi-device)
    1. U2F Security Key (Universal 2nd Factor) : support for multiple root and IAM users using a single security key

      • YubiKey by Yubico (3rd party)
    2. Hardware Key Fob MFA device

      • Gemalto (3rd party)
      • for AWS GovCloud (US) - SurePassID (3rd party)





※ AWS CLI , SDK, Access Keys

  • AWS에 접속하는 법 3가지
    1. AWS Management Console : password + MFA
    2. AWS CLI : access keys
    3. AWS SDK (Software Developer Kit) : for code - access keys

Access Keys

  • AWS Console에서 발급, Users마다 관리, 공유 하지마!!!
  • Access Key ID ≌ username
  • Secret Access Key ≌ password
    • ※ never put Access Key in your EC2 instance’s aws configure ⇒ Use IAM Roles

AWS CLI

  • Command line shell에서 AWS 서비스들과 interact할 수 있도록 하는 tool
  • direct access to public API of AWS service
  • develop scripts to manage resources

AWS SDK

  • software development kit
  • language-specific APIs (set of libraries) = different SDKs for different programming languages
  • 프로그램적으로 access/manage AWS services - embedded within application
  • supports

AWS CloudShell - 다른 terminal 옵션 for AWS CLI

  • not yet available in all regions
    -사용 중인 user의 credentials와 region을 기준으로 응답을 반환
  • linux server 처럼 파일 생성하면 cloudshell restart해도 유지됨 (download/upload file 도 가능)





IAM Security Tools - IAM Credentials Report , Access Advisor

  • IAM Credentials report (account level)
    : account의 user들과 그들의 credential 정보들에 대한 report
  • IAM Access Advisor (user-level)
    : user에 허가된 service permission들과 각 service들의 최근 접속 시간




IAM 가이드라인, best practices

  • AWS account setup 목적 외에 root 계정 사용하지 않기
  • 1 물리적 사용자 = 1 AWS user
  • user를 group에 할당, group에 permissions 할당
  • 강한 password policy 정하기
  • MFA를 사용하고 강조해라
  • AWS service에 대한 권한 부여는 Roles를 만들어 사용하라
  • CLI/SDK와 같은 programmatic access에 Access Key를 사용하라
  • IAM Credentials Report로 account의 권한들을 관리해라 (audit permissions ~`)
  • Never share IAM users & Access keys

2개의 댓글

comment-user-thumbnail
2023년 7월 18일

잘 읽었습니다. 좋은 정보 감사드립니다.

답글 달기
comment-user-thumbnail
2023년 7월 18일

좋은 글 잘 읽었습니다, 감사합니다.

답글 달기