

# 디렉터리 버킷의 보안 모범 사례
<a name="s3-express-security-best-practices"></a>

디렉터리 버킷을 사용할 때 여러 가지 보안 기능을 고려해야 합니다. 다음 모범 사례는 일반적인 지침이며 완벽한 보안 솔루션을 나타내지는 않습니다. 이러한 모범 사례는 환경에 적절하지 않거나 충분하지 않을 수 있으므로 지침이라기보다는 권장 사항으로만 사용해 주세요.

## 기본 퍼블릭 액세스 차단 및 객체 소유권 설정
<a name="s3-express-security-best-practices-manage-access"></a>

 디렉터리 버킷은 S3 퍼블릭 액세스 차단과 S3 객체 소유권을 지원합니다. 이러한 S3 기능은 버킷 및 객체에 대한 액세스 감사 및 관리에 사용됩니다.

기본적으로 디렉터리 버킷에 모든 퍼블릭 액세스 차단 설정이 활성화되어 있습니다. 또한 S3 객체 소유권은 버킷 소유자 적용으로 설정되므로 액세스 제어 목록(ACL)이 비활성화되어 있습니다. 이 설정은 수정할 수 없습니다. 이러한 기능에 대한 자세한 내용은 [Amazon S3 스토리지에 대한 퍼블릭 액세스 차단](access-control-block-public-access.md) 및 [객체 소유권 제어 및 버킷에 대해 ACL 사용 중지](about-object-ownership.md) 섹션을 참조하세요.

**참고**  
디렉터리 버킷에 저장된 객체에는 액세스 권한을 부여할 수 없습니다. 디렉터리 버킷에만 액세스 권한을 부여할 수 있습니다. S3 Express One Zone의 권한 부여 모델은 Amazon S3의 권한 부여 모델과 다릅니다. 자세한 내용은 [`CreateSession`을 사용하여 영역 엔드포인트 API 작업 권한 부여](s3-express-create-session.md) 섹션을 참조하세요.

## 인증 및 권한 부여
<a name="s3-express-security-best-practices-create-session"></a>

디렉터리 버킷의 인증 및 권한 부여 메커니즘은 영역 엔드포인트 API 작업에 요청하는지 아니면 리전 엔드포인트 API 작업에 요청하는지에 따라 다릅니다. 영역 API 작업은 객체 수준(데이터 영역) 작업입니다. 리전 API 작업은 버킷 수준(컨트롤 플레인) 작업입니다.

``지연 시간을 최소화하도록 최적화된 새로운 세션 기반 메커니즘을 통해 영역 엔드포인트 API 작업에 대한 요청을 인증하고 권한을 부여하게 됩니다. 세션 기반 인증에서 AWS SDK는 `CreateSession` API 작업을 사용하여 ``디렉터리 버킷에 대한 지연 시간이 짧은 액세스를 제공하는 임시 자격 증명을 요청합니다. 이러한 임시 보안 인증 정보의 범위는 특정 디렉터리 버킷으로 지정되며 5분 후 만료됩니다. 이러한 임시 자격 증명을 사용하여 영역(객체 수준) API 직접 호출에 서명할 수 있습니다. 자세한 내용은 [`CreateSession`을 사용하여 영역 엔드포인트 API 작업 권한 부여](s3-express-create-session.md) 섹션을 참조하세요.

**디렉터리 버킷 관리를 위한 자격 증명으로 서명 요청**  
자격 증명을 사용하여 AWS Signature Version 4를 사용하여 영역 엔드포인트(객체 수준) API 요청에 서명합니다. 서비스 이름은 `s3express`입니다. 요청에 서명할 때는 `CreateSession`에서 반환된 비밀 키를 사용하고 세션 토큰도 `x-amzn-s3session-token header`와 함께 제공하세요. [자세한 내용은 CreateSession 단원을 참조하세요.](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html)

[지원되는 AWS SDK](s3-express-SDKs.md#s3-express-getting-started-accessing-sdks)는 사용자를 대신하여 자격 증명 및 서명 작업을 관리합니다. AWS SDK를 사용하여 자격 증명을 새로 고치고 요청에 서명하도록 하는 것이 좋습니다.

**IAM 자격 증명으로 요청에 서명**  
모든 리전(버킷 수준) API 직접 호출은 임시 세션 자격 증명이 아닌 AWS Identity and Access Management(IAM) 자격 증명으로 인증 및 서명되어야 합니다. IAM 자격 증명은 IAM ID의 액세스 키 ID 및 보안 액세스 키로 구성됩니다. 또한 모든 `CopyObject` 및 `HeadBucket` 요청은 IAM 자격 증명을 사용하여 인증 및 서명되어야 합니다.

영역(객체 수준) 작업 직접 호출의 지연 시간을 최소화하려면 `CreateSession`을 직접 호출하여 얻은 자격 증명을 사용하여 요청에 서명하는 것이 좋습니다. 단, `CopyObject` 및 `HeadBucket`에 대한 요청은 예외입니다.

## AWS CloudTrail 사용
<a name="s3-express-security-best-practices-cloudtrail"></a>

AWS CloudTrail은 Amazon S3에서 사용자, 역할 또는 AWS 서비스가 수행한 작업에 대한 레코드를 제공합니다. CloudTrail에서 수집한 정보를 사용하여 다음을 확인할 수 있습니다.
+ Amazon S3에 대한 요청
+ 요청을 보낸 IP 주소
+ 요청한 사람
+ 요청을 한 시간
+ 요청에 대한 추가 세부 정보

AWS 계정을 설정하면 CloudTrail 관리 이벤트가 기본적으로 활성화됩니다. 다음과 같은 리전 엔드포인트 API 작업(버킷 수준 또는 컨트롤 플레인, API 작업)이 CloudTrail에 로깅됩니다.
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketPolicy.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketPolicy.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketPolicy.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketPolicy.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicy.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicy.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListDirectoryBuckets.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListDirectoryBuckets.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html)

**참고**  
`ListMultipartUploads`는 영역 엔드포인트 API 작업입니다. 하지만 관리 이벤트로 CloudTrail에 로깅됩니다. 자세한 내용은 *Amazon Simple Storage Service API 참조*에서 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html)를 참조하세요.

기본적으로 CloudTrail 추적은 데이터 이벤트를 로깅하지 않지만 지정한 디렉터리 버킷에 대한 데이터 이벤트를 로깅하거나 AWS 계정의 모든 디렉터리 버킷에 대한 데이터 이벤트를 로깅하도록 추적을 구성할 수 있습니다. 다음과 같은 영역 엔드포인트 API 작업(객체 수준 또는 데이터 영역, API 작업)이 CloudTrail에 로깅됩니다.
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html)

 디렉터리 버킷에서 AWS CloudTrail을 사용하는 방법에 대한 자세한 내용은 [AWS CloudTrail로 디렉터리 버킷에 로그인](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-one-zone-cloudtrail-logging.html)을 참조하세요.

### AWS 모니터링 도구를 사용하여 모니터링 구현
<a name="s3-express-security-best-practices-monitoring"></a>

모니터링은 Amazon S3 및 AWS 솔루션의 안정성, 보안, 가용성 및 성능을 유지하는 데 중요한 부분입니다. AWS에서는 Amazon S3 및 다른 AWS 서비스를 모니터링할 수 있는 여러 가지 도구와 서비스를 제공합니다. 예를 들어 Amazon S3에 대한 Amazon CloudWatch 지표(특히 `BucketSizeBytes` 및 `NumberOfObjects` 스토리지 지표)를 모니터링할 수 있습니다.

디렉터리 버킷에 저장된 객체는 Amazon S3의 `BucketSizeBytes` 및 `NumberOfObjects` 스토리지 지표에 반영되지 않습니다. 그러나 디렉터리 버킷에 대해서는 `BucketSizeBytes` 및 `NumberOfObjects` 스토리지 지표가 지원됩니다. 선택한 지표를 보려면 `StorageType` 차원을 지정하여 Amazon S3 스토리지 클래스를 구분할 수 있습니다. 자세한 내용은 [Amazon CloudWatch를 사용한 지표 모니터링](cloudwatch-monitoring.md) 섹션을 참조하세요.

자세한 내용은 [Amazon CloudWatch를 사용한 지표 모니터링](cloudwatch-monitoring.md) 및 [Amazon S3의 로깅 및 모니터링](monitoring-overview.md)(을)를 참조하세요.