(resource:*)
또는 모든 작업(action:*)
권한을 부여하는 경우 권한 범위가 너무 커 데이터 보안 리스크가 발생할 수 있습니다.{"version": "2.0","statement": [{"action": [//간편 업로드 작업"name/cos:PutObject",//폼을 사용한 객체 업로드"name/cos:PostObject",//멀티파트 업로드: 파트 초기화 작업"name/cos:InitiateMultipartUpload",//멀티파트 업로드: List에서 진행 중인 멀티파트 업로드"name/cos:ListMultipartUploads",//멀티파트 업로드: List에서 업로드 완료한 파트 작업"name/cos:ListParts",//멀티파트 업로드: 멀티파트 업로드 작업"name/cos:UploadPart",//멀티파트 업로드: 모든 멀티파트 업로드 작업 완료"name/cos:CompleteMultipartUpload",//멀티파트 업로드 작업 취소"name/cos:AbortMultipartUpload"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*"]},{"action": [//다운로드 작업"name/cos:GetObject"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc2/*"]}]}
이름 | 설명 |
version | 정책 구문 버전으로, 기본값은 2.0입니다. |
effect | allow(허용), deny(명시적 거부) 두 가지 상태가 있습니다. |
resource | 모든 리소스, 지정된 경로 접두사가 있는 리소스, 지정된 절대 경로의 리소스 또는 이들의 조합이 될 수 있는 권한 부여된 작업의 특정 데이터입니다. 참고: 경로가 중국어인 경우 중국어 입력을 그대로 유지하십시오. 예: examplebucket-1250000000/폴더/파일명.txt . |
action | 여기에서는 COS API를 지칭하며, 필요에 따라 1개 또는 일련의 작업 조합이나 모든 작업( * )을 지정합니다. 예: name/cos:GetService , 영어 대소문자 구분에 유의하십시오. |
condition |
*
로 설정합니다.{"version": "2.0","statement": [{"action": ["name/cos:GetService"],"effect": "allow","resource": ["*"]}]}
*
로 설정하며, 해당 정책에서 한정하는 리소스 범위의 권한 범위가 너무 커 데이터 보안 리스크가 발생할 수 있으므로 설정에 유의하십시오.qcs::cos:ap-beijing:uid/1250000000:*
가 됩니다.qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/*
가 됩니다.{"version": "2.0","statement": [{"action": ["name/cos:PutBucket"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:HeadBucket"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:GetBucket"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:DeleteBucket"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:PutBucketACL"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:GetBucketACL"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:PutBucketCORS"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:GetBucketCORS"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:DeleteBucketCORS"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:PutBucketLifecycle"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:GetBucketLifecycle"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:DeleteBucketLifecycle"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/"]}]}
*
로 설정합니다.qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/*
가 됩니다.qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*
가 됩니다.doc/audio.mp3
인 객체의 작업만 허용하는 경우, 정책의 resource는 qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/audio.mp3
가 됩니다.{"version": "2.0","statement": [{"action": ["name/cos:PutObject"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*"]}]}
"name/cos:InitiateMultipartUpload","name/cos:ListMultipartUploads","name/cos:ListParts","name/cos:UploadPart","name/cos:CompleteMultipartUpload","name/cos:AbortMultipartUpload"
의 집합으로 설정합니다.{"version": "2.0","statement": [{"action": ["name/cos:InitiateMultipartUpload","name/cos:ListMultipartUploads","name/cos:ListParts","name/cos:UploadPart","name/cos:CompleteMultipartUpload","name/cos:AbortMultipartUpload"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:ListMultipartUploads"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:PostObject"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:AppendObject"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:HeadObject"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:GetObject"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:PutObject"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*"]},{"action": ["name/cos:GetObject"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc2/*"]}]}
"qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc2/*"
는 원본 객체입니다."name/cos:InitiateMultipartUpload","name/cos:ListMultipartUploads","name/cos:ListParts","name/cos:PutObject","name/cos:CompleteMultipartUpload","name/cos:AbortMultipartUpload"
의 집합으로 설정하고, 원본 객체의 action은 name/cos:GetObject로 설정합니다.{"version": "2.0","statement": [{"action": ["name/cos:InitiateMultipartUpload","name/cos:ListMultipartUploads","name/cos:ListParts","name/cos:PutObject","name/cos:CompleteMultipartUpload","name/cos:AbortMultipartUpload"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*"]},{"action": ["name/cos:GetObject"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc2/*"]}]}
"qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc2/*"
는 원본 객체입니다.{"version": "2.0","statement": [{"action": ["name/cos:PutObjectACL"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:GetObjectACL"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:OptionsObject"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:PostObjectRestore"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/doc/*"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:DeleteObject"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/audio.mp3"]}]}
action
을 name/cos:DeleteObject
로 설정합니다.{"version": "2.0","statement": [{"action": ["name/cos:DeleteObject"],"effect": "allow","resource": ["qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/audio.mp3","qcs::cos:ap-beijing:uid/1250000000:examplebucket-1250000000/video.mp4"]}]}
{"version": "2.0","statement": [{"action": ["*"],"effect": "allow","resource": ["*"]}]}
{"version": "2.0","statement": [{"action": ["name/cos:HeadObject","name/cos:GetObject","name/cos:GetBucket","name/cos:OptionsObject"],"effect": "allow","resource": ["*"]}]}
{"version": "2.0","statement": [{"action": ["*"],"effect": "allow","resource": ["qcs::cos:ap-shanghai:uid/1250000000:examplebucket-1250000000/doc/*"]}]}
문제 해결에 도움이 되었나요?