본문 바로가기
컴퓨터관련

AWS S3 도메인 Allow 정책

by 기록이답이다 2017. 1. 12.
반응형

AWS  S3 서비스를 이용할때 해당 리소스를 아무곳에서나 볼 수 있으면 안되기 때문에

저렇게 해주면 www.example.com 과 xxx.xxx.xxx.xx ip 에서만 접근이 가능하다.

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
{
 "Version": "2012-10-17",
 "Id": "http referer policy example",
 "Statement": [
  {
   "Sid": "Allow get requests originated from www.example.com and <u>example</u>.com",
   "Effect": "Allow",
   "Principal": "*",
   "Action": "s3:GetObject",
   "Resource": "arn:aws:s3:::버킷이름/*",
   "Condition": {
    "StringLike": {
     "aws:Referer": [
      "http://www.example.com/*",
      "http://example.com/*"
     ]
    },
    "IpAddress": {
     "aws:SourceIp": "xxx.xxx.xxx.xx/0"
    }
   }
  }
 ]
}

 

반응형