CloudFront 액세스 로깅 점검

CloudFront 액세스 로그를 수집하고 전달 상태를 확인해 보안 분석과 장애 조사에 필요한 요청 이력을 확보하세요.

설명

distributionConfig.logging은 S3로 전송하는 CloudFront 레거시 표준 로그를 제어합니다. 표준 로깅 v2는 별도로 설정합니다.

잠재적 영향

사용자 요청과 응답 기록이 빠지면 장애나 비정상 트래픽의 경위를 추적하기 어렵습니다.

해결 방법

레거시 로그에는 distributionConfig.logging.enabled를 true로 설정하세요. ACL을 활성화한 버킷에 CloudFront의 로그 전송을 허용하고 쿠키 기록 여부, 열람 권한과 보존 기간을 정하세요. 시험 요청이 S3에 기록되는지 확인하세요. 알림을 시험할 때는 해당 조건을 충족하는 트래픽을 사용하세요.

예시

발췌에 나오는 sample.s3.amazonaws.com을 실제 로그 버킷의 도메인 이름으로 바꾸세요.

변경 전

yaml
apiVersion: cloudfront.aws.crossplane.io/v1alpha1
kind: Distribution
spec:
  forProvider:
    distributionConfig:
      enabled: true
      logging:
        enabled: false
        bucket: sample.s3.amazonaws.com

배포는 활성화되어 있지만 레거시 로그 전송은 꺼져 있습니다. 사용 중인 다른 로깅 설정도 확인하세요.

변경 후

yaml
apiVersion: cloudfront.aws.crossplane.io/v1alpha1
kind: Distribution
spec:
  forProvider:
    distributionConfig:
      enabled: true
      logging:
        enabled: true
        bucket: sample.s3.amazonaws.com

표준 로그는 늦게 도착하거나 일부 요청을 누락할 수 있습니다.

참조