Cloud/AWS

S3 Pre-Signed URLs (사전 서명된 URL) / S3 Storage class

Security Analyst 2022. 11. 19. 22:31

AI스쿨 보안 트랙 과정.

S3 pre-signed URLs S3 사전 서명된 URL

Can generate pre-signed URLs using SDK or CLI

-For downloads (easy, can use the CLI)

-For uploads (harder, must use the SDK)

Valid for a default of 3600 seconds, can change timeout with --expires-in [TIME_BY_SECONDS] argument

User given a pre-signed URL inherit the permissions of the person who generated the URL for GET/PUT

Examples :

-Allow only logged-in users to download a premium viedo on your S3 bucket

-Allow an ever chaning list of users to download files by generating URLs dynamically

-Allow temporarily a user to upload a file to a precise location in out bucket

사전 서명된 URL을 생성하려면 SDK 또는 CLI를 사용해야 한다.

-다운로드의 경우 CLI사용

-업로드의 경우는 SDK를 사용 (좀 더 어려움)

사전 서명된 URL을 생성하면 기본적인 만료 시간은 3,600초 (1시간)이다.

시간 초과를 변경하려면 명령어 --expires-in에 인자를 초 단위로 지정하면 된다.

사전 서명된 URL이 사용자에게 제공될 때는 기본적으로 생성한 사람의 권한이 상속딘다.

(사용자들은 권한에 따라 GET이나 PUT 권한 사용할 수 있다)

예시)

-로그인한 사용자만 S3 버킷의 프리미엄 영상을 다운로드 하도록 승인

-URL을 동적으로 생성하여 항상 변경되는 사용자 목록에서 파일을 다운로드 할 수 있다.

-사용자가 일시적으로 출력 버킷의 올바른 위치에 파일을 업로드 할 수 있다.


S3 Storage Classes

S3 Standard - General Purpose

S3 Standard-Infrequent Access (IA)

S3 One Zone-Infrequent Access

S3 Glacier Instant Retrieval

S3 Glacier Flexible Retrieval

S3 Glacier Deep Archive

S3 Intelligent Tiering

Can move between classes manually or using S3 Lifecycle configurations

S3객체를 생성할 때 클래스 선택 할 수 있고, 스토리지 클래스를 수동으로 설정할 수도 있다.

혹은 Amazon S3 수명 주기 구성을 사용해 스토리지 클래스 간에 객체를 자동으로 이동할 수 있다.


S3 Durability and Availability

Durability:

-High durability (99.999999999%) of objects across multiple AZ

-If you store 10,000,000 objects with Amazon S3, you can on average expect to incur a loss of a single object once every 10,000 years

-Same for all storage classes

Availability:

-Measures how readily available a service is

-Varies depending on storage class

-Example: S3 standard has 99.99% availability = not available 53 minutes a year

내구성과 가용성의 개념

내구성:

-여러 AZ에 걸친 객체의 높은 내구성. (99.999999999%)

-천 만개의 객체를 저장했을 때 평균적으로 10,000년에 한 번 객체 손실이 예상된다.

-S3에서 모든 스토리지 클래스의 내구성은 동일하다.

가용성:

-서비스가 얼마나 용이하게 제공되는지를 나타냄 (서비스를 쉽게 사용할 수 있는 정도를 측정)

-스토리지 클래스마다 다르다.

-S3 스탠다드의 경우 가용성은 99.99%로 1년에 약 53분 동안 서비스를 사용할 수 없음을 의미한다.


S3 Standard - General Purpose

99.99% Availability

Used for frequently accessed data

Low latency and high throughput

Sustain 2 concurrent facility failures

Use Cases: Big Data analytics, mobile & gaming applications, content distribution....

S3 스탠다드의 가용성은 99.99%

자주 액세스 하는 데이터 사용되며, 기본적으로 사용하는 스토리지 유형이다.

지연시간이 짧고 처리량이 높다.

AWS에서 두 개의 기능 장애를 동시에 버틸 수 있이다.

사용사례 : 빅 데이터 분석, 모바일 게임 & 애플리케이션, 콘텐츠 배포

S3 Infrequent Access

For data that is less frequently accessed, but requires rapid access when needed

Lower cost than S3 Standard

자주 액세스하지 않지만 필요한 경우 빠르게 액세스 해야 하는 데이터에 사용

S3 Standard보다 비용이 적게 들지만, 검색 시 비용 발생함.

Amazon S3 Standard-Infrequent Access (S3 Standard-IA)

-99.9% Availability

-Use cases: Disaster Recovery, backups

-99.9% 가용성

-사용사례: 재해 복구, 백업

Amazon S3 One Zone-Infrequent Access (S3 One Zone-IA)

-High durability (99.999999999) in a single AZ; data lost when AZ is destroyed

-99.5% Availability

-Use cases: Storing secondary backup copies of on-premise data, or data you can recreate

-높은 내구성 갖지만, AZ가 파괴된 경우 데이터를 잃게 된다.

-99.5%의 가용성

-사용 사례 : 온프레미스 데이터를 2차 백업할 때, 재생성 가능한 데이터를 저장할 때 쓰임.


S3 Glacier Storage Classes

Low-cost object storage meant for archiving / backup

Pricing: price for storage + object retrieval cost

-아카이빙과 백업을 위한 저비용 객체 스토리지이다.

-비용 : 스토리지 비용 + 검색 비용

Amazon S3 Glacier Instant Retrieval

-Millisecond retrieval, great for data accessed once a quarter

-Minimum Storage duration of 90 days

-밀리초 단위로 검색이 가능하다. 분기에 한 번 액세스하는 데이터에 적합하다.

-최소 보관기간이 90일이다. 백업이지만 밀리초 이내에 액세스 해야하는 경우 적합함.

Amazon S3 Glacier Flexible Retrieval (formerly Amazon S3 Glacier):

-Expedited (1 to 5 minutes), Standard (3 to 5 hours), Bulk (5 to 12hours) - free

-Minimum storage duration of 90 days

S3 Glacier Flexible Retrieval (전에는 S3 Glacier 였었다.)

-Expedited는 데이터를 1~5분 이내에 받을 수 있음 / Standard는 3~5시간 소요 / Bulk는 5~12시간 소요이지만 무료.

-최소 보관 기간은 90일이다.

Amazon S3 Glacier Deep Archive - for long term storage

-Standard (12 hours), Bulk (48 hours)

-Minimum storage duration of 180 days

S3 Glacier Deep Archive - 장기 보관용

-Standard는 12시간, Bulk는 48시간에 데이터 검색 시간이 소요됨

-비용이 가장 저렴하며, 최소 보관 기간이 180일이다.


S3 ntelligent-Tiering

Small monthly monitoring and auto-tiering fee

Moves objects automatically between Access Tiers based on usage

There are no retrieval charges in S3 Intelligent-Tiering

매월 소량의 모니터링 및 자동 티어링(계층화) 비용이 발생

사용량에 따라 액세스 계층 간에 개체를 자동으로 이동합니다.

별도의 검색 요금이 부과되지 않음

Frequent Access tier (automatic): default tier

Frequent Access tier (automatic): 기본 티어

Infrequent Access tier (automatic): objects not accessed for 30 days

30일 동안 액세스 하지 않는 객체 전용 티어

Archive Instant Access tier (automatic): objects not accessed for 90 days

90일 동안 액세스하지 않는 객체 전용 티어

Archive Access tier (optional): configurable from 90 days to 700+ days

선택 사항, 90일에서 700일 이상까지 구성 가능

Deep Archive Access tier (optional): config. from 180 days to 700+ days

선택 사항, 180일에서 700일 이상 액세스하지 않는 객체에 구성 가능