IAM Policy
Last updated
2023-07-11 16:33:59
{"value":"IAM Policy \u662f\u57fa\u4e8e\u7528\u6237\u7684\u6388\u6743\u7b56\u7565\uff0c\u5b58\u50a8\u7528\u6237\u53ef\u4ee5\u521b\u5efa\u3001\u7ba1\u7406 IAM \u5b50\u8d26\u53f7\uff0c\u5e76\u914d\u7f6e\u8fd9\u4e9b\u8d26\u53f7\u5bf9\u81ea\u5df1\u8d44\u6e90\u7684\u4f7f\u7528\u6743\u9650\u3002\n\n## \u540d\u8bcd\u89e3\u91ca\n\n### \u6839\u8d26\u53f7\n\n\u7528\u6237\u5728\u79c1\u6709\u4e91\u5b58\u50a8\u7cfb\u7edf\u4e2d\u5f00\u901a\u7684\u8d26\u53f7\u3002\n\n\u6839\u8d26\u53f7\u662f\u5b58\u50a8\u8d44\u6e90\u7684\u6240\u6709\u8005\uff0c\u5bf9\u5176\u540d\u4e0b\u7684\u8d44\u6e90\u6709\u5b8c\u5168\u8bbf\u95ee\u6743\u9650\uff0c\u5305\u62ec\u521b\u5efa IAM \u7528\u6237\u4ee5\u53ca\u8bbe\u7f6e IAM \u7528\u6237\u6743\u9650\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8d44\u6e90\u53ea\u80fd\u88ab\u6839\u8d26\u53f7\u8bbf\u95ee\uff0c\u4efb\u4f55\u5176\u4ed6\u7528\u6237\u8bbf\u95ee\u90fd\u9700\u8981\u6839\u8d26\u53f7\u6388\u6743\u3002\n\n\u6839\u8d26\u53f7\u4e5f\u662f\u5b58\u50a8\u8d44\u6e90\u8ba1\u91cf\u7684\u8f7d\u4f53\u3002\n\n### \u522b\u540d\n\n\u6bcf\u4e2a\u5b58\u50a8\u7528\u6237\u8d26\u53f7\u53ef\u4ee5\u5728\u8bbf\u95ee\u7ba1\u7406\u4e2d\u8bbe\u7f6e\u5168\u5c40\u552f\u4e00\u7684\u522b\u540d\uff0c\u7528\u4e8e IAM \u7528\u6237\u767b\u5f55\u3002\n\n### IAM \u7528\u6237\u548c IAM \u7528\u6237\u7ec4\n\nIAM \u7528\u6237\u548c IAM \u7528\u6237\u7ec4\u7531\u6839\u8d26\u53f7\u521b\u5efa\uff0c\u4e0d\u62e5\u6709\u8d44\u6e90\uff0c\u6ca1\u6709\u72ec\u7acb\u7684\u8ba1\u91cf\uff0c\u5fc5\u987b\u7531\u6240\u5c5e\u7684\u6839\u8d26\u53f7\u8fdb\u884c\u6388\u6743\u3002\n\nIAM \u7528\u6237\u7ec4\u7531\u4e00\u4e2a\u6216\u591a\u4e2a IAM \u7528\u6237\u7ec4\u6210\uff0c\u53ef\u4ee5\u8ba4\u4e3a\u662f\u5177\u6709\u67d0\u79cd\u7279\u5f81\u7684\u7528\u6237\u96c6\u5408\u3002\n\nIAM \u7528\u6237\u6709\u81ea\u5df1\u72ec\u7acb\u7684 \u8bbf\u95ee\u5bc6\u94a5\u5bf9 \uff0c\u7528\u4e8e\u5b58\u50a8\u64cd\u4f5c\u8bf7\u6c42\u7684\u7b7e\u540d\u3002\n\n### \u8d44\u6e90\uff08Resource\uff09\n\n\u79c1\u6709\u4e91\u5b58\u50a8\u63d0\u4f9b\u7ed9\u7528\u6237\u7684\u53ef\u4ee5\u64cd\u4f5c\u7684\u5bf9\u8c61\uff0c\u5982\u5bf9\u8c61\u5b58\u50a8\u7684\u5b58\u50a8\u7a7a\u95f4\u3001\u5bf9\u8c61\u3002IAM Policy \u5f53\u524d\u652f\u6301\u8d44\u6e90\u8bbe\u7f6e\u6700\u5c0f\u7c92\u5ea6\u4e3a Bucket\u3002\n\n### \u6743\u9650\uff08Action\uff09\n\n\u5141\u8bb8\u6216\u62d2\u7edd\u5bf9\u67d0\u4e2a\u8d44\u6e90\u6267\u884c\u67d0\u79cd\u64cd\u4f5c\u3002\n\n\u6839\u8d26\u53f7\u662f\u8d44\u6e90\u7684\u62e5\u6709\u8005\uff0c\u5bf9\u540d\u4e0b\u7684\u6240\u6709\u8d44\u6e90\u6709\u5b8c\u5168\u8bbf\u95ee\u6743\u9650\uff1bIAM \u7528\u6237\u548c IAM \u7528\u6237\u7ec4\u9ed8\u8ba4\u6ca1\u6709\u4efb\u4f55\u8d44\u6e90\u7684\u8bbf\u95ee\u6743\u9650\uff0c\u9700\u8981\u8d44\u6e90\u62e5\u6709\u8005\u8fdb\u884c\u6388\u6743\u3002\n\n### \u7b56\u7565\n\n\u63cf\u8ff0\u6743\u9650\u96c6\u7684\u8bed\u6cd5\u89c4\u8303\u3002\u901a\u8fc7\u7ed9 IAM \u7528\u6237\u6216\u8005 IAM \u7528\u6237\u7ec4\u7ed1\u5b9a\u4e00\u4e2a\u6216\u591a\u4e2a\u7b56\u7565\u5b8c\u6210\u6388\u6743\u3002\n\n## \u5e94\u7528\u573a\u666f\n\nIAM Policy \u9002\u7528\u4e8e\u4f01\u4e1a\u5185\u4e0d\u540c\u5c97\u4f4d\u7684\u5458\u5de5\u9700\u8981\u62e5\u6709\u8be5\u4f01\u4e1a\u4e91\u8d44\u6e90\u7684\u6700\u5c0f\u5316\u8bbf\u95ee\u6743\u9650\u3002\u5982\u67d0\u4e2a\u4f01\u4e1a\u4f7f\u7528\u6839\u8d26\u53f7A\u8d2d\u4e70\u4e86\u4e91\u8d44\u6e90\uff0c\u4f01\u4e1a\u5458\u5de5\u5305\u62ec\u5f00\u53d1\u4eba\u5458\u3001\u6d4b\u8bd5\u4eba\u5458\u3001\u8fd0\u7ef4\u4eba\u5458\u9700\u8981\u64cd\u4f5c\u8fd9\u4e9b\u8d44\u6e90\uff1a\u5f00\u53d1\u4eba\u5458\u9700\u8981\u62e5\u6709\u5176\u6240\u5728\u9879\u76ee\u7684 Bucket \u7684\u8bfb\u5199\u6743\u9650\uff0c\u8fd0\u7ef4\u4eba\u5458\u9700\u8981\u57df\u540d\u7684\u7ba1\u7406\u6743\u9650\u3002\n\n\u57fa\u4e8e\u5b89\u5168\u8003\u8651\uff0c\u6839\u8d26\u53f7 A \u7684\u62e5\u6709\u8005\u53ef\u4ee5\u521b\u5efa\u4e0d\u540c\u7684 IAM \u7528\u6237\uff0c\u7ed1\u5b9a\u4e0d\u540c\u7684\u6743\u9650\u7b56\u7565\uff0c\u5c06\u4e0d\u540c\u7684 IAM \u7528\u6237\u8d26\u53f7\u7ed9\u4e0d\u540c\u64cd\u4f5c\u8981\u6c42\u7684\u4eba\uff0c\u53ef\u4ee5\u5b9e\u73b0\u6743\u9650\u6700\u5c0f\u5316\u7ba1\u7406\u3002\n\n\u6839\u8d26\u53f7 A \u4e5f\u53ef\u4ee5\u6839\u636e\u4eba\u5458\u8c03\u6574\u60c5\u51b5\uff0c\u968f\u65f6\u53ef\u4ee5\u6dfb\u52a0\u6216\u64a4\u9500 IAM \u7528\u6237\u8d26\u53f7\u548c\u6743\u9650\u7b56\u7565\u3002\n\n## \u6743\u9650\u5217\u8868\n\n\u79c1\u6709\u4e91\u5b58\u50a8 IAM Policy \u652f\u6301\u7684\u6743\u9650\u5217\u8868\u5982\u4e0b\uff1a\n\n| action | kodo api | AWS s3 action | s3 api |\n| ---------------------------------------------- | ------------------------------------------------------------ | ----------------------------- | ------------------------------------------------------------ |\n| \u4e0b\u8f7d\u6587\u4ef6 kodo\/get | get | s3:GetObject | GET Object |\n| \u67e5\u8be2\u6587\u4ef6\u5143\u4fe1\u606f kodo\/stat | stat | s3:GetObject | HEAD Object |\n| \u5217\u4e3e\u7a7a\u95f4\u5185\u6587\u4ef6 kodo\/list | list\u3001v2\/list | s3:ListBucket | List Objects\u3001HEAD Bucket |\n| \u4e0a\u4f20\u5355\u6587\u4ef6 kodo\/upload | put\u3001post | s3:PutObject | PUT Object\u3001POST Object\u3001PUT Object-Copy |\n| \u5206\u7247\u4e0a\u4f20 kodo\/mkfile | mkfile\u3001initiateMultipartUpload\u3001uploadPart\u3001completeMultipartUpload | s3:PutObject | Initiate Multipart Upload\u3001Upload Part\u3001Complete Multipart Upload |\n| \u5217\u4e3e\u5df2\u4e0a\u4f20Parts kodo\/listParts | listParts | s3:ListMultipartUploadParts | List Parts |\n| \u4e2d\u6b62\u5206\u5757\u4e0a\u4f20\u4efb\u52a1 kodo\/abortMultipartUpload | abortMultipartUpload | s3:AbortMultipartUpload | AbortMultipartUpload |\n| \u5217\u4e3e\u6240\u6709UploadId kodo\/listMultipartUploads | listMultipartUploads | s3:ListBucketMultipartUploads | List Multipart Uploads |\n| \u6293\u53d6\u4e0a\u4f20\u6587\u4ef6 kodo\/fetchfiles | fetch\u3001sisyphus\/fetch | \u4e0d\u652f\u6301 | - |\n| \u4fee\u6539\u6587\u4ef6\u7684MIME\u7c7b\u578b\u4fe1\u606f kodo\/chgm | chgm | \u4e0d\u652f\u6301 | - |\n| \u8bbe\u7f6e\u6587\u4ef6\u7684\u751f\u547d\u5468\u671f kodo\/objectLifecycleSet | deleteAfterDays\u3001lifecycle | \u4e0d\u652f\u6301 | - |\n| \u4fee\u6539\u6587\u4ef6\u7684\u5b58\u50a8\u7c7b\u578b kodo\/chtype | chtype | \u4e0d\u652f\u6301 | - |\n| \u89e3\u51bb\u5f52\u6863\u5b58\u50a8\u6587\u4ef6 kodo\/restoreAr | restoreAr | s3:RestoreObject | RestoreObject |\n| \u7981\/\u542f\u7528\u6587\u4ef6 kodo\/chstatus | chstatus | \u4e0d\u652f\u6301 | - |\n| \u5220\u9664\u6587\u4ef6 kodo\/delete | delete | s3:DeleteObject | DELETE Object\u3001DELETE Multiple Object |\n| \u521b\u5efa\u5b58\u50a8\u7a7a\u95f4 kodo\/mkbucket | mkbucketv3\u3001mkbucketv2 | s3:CreateBucket | PUT Bucket |\n| \u5220\u9664\u5b58\u50a8\u7a7a\u95f4 kodo\/drop | drop | s3:DeleteBucket | DELETE Bucket |\n| \u5217\u4e3e\u6240\u6709\u7a7a\u95f4 kodo\/allbuckets | \u4e0d\u652f\u6301 | s3:ListAllMyBuckets | ListBuckets |\n| \u67e5\u8be2\u8ba1\u91cf\u6570\u636e kodo\/statistics | v6\/space\u3001v6\/count\u3001v6\/space_line\u3001v6\/count_line\u3001v6\/space_archive\u3001v6\/count_archive\u3001v6\/rs_chtype\u3001v6\/blob_io\u3001v6\/blob_transfer\u3001v6\/rs_put | \u4e0d\u652f\u6301 | - |\n| \u8bbe\u7f6e\u6837\u5f0f\u5206\u9694\u7b26 kodo\/setSeparator | separator | \u4e0d\u652f\u6301 | - |\n| \u6dfb\u52a0\/\u4fee\u6539\u6837\u5f0f kodo\/putImageStyle | style\u3001putBucketStyle | \u4e0d\u652f\u6301 | - |\n| \u5220\u9664\u6837\u5f0f kodo\/deleteImageStyle | unstyle\u3001deleteBucketStyle | \u4e0d\u652f\u6301 | - |\n| \u67e5\u8be2\u6837\u5f0f\u5217\u8868 kodo\/getBucketStyle | getBucketStyle | \u4e0d\u652f\u6301 | - |\n| \u67e5\u8be2\u751f\u547d\u5468\u671f\u89c4\u5219 kodo\/getBucketLifecycle | \/rules\/get | \u4e0d\u652f\u6301 | - |\n| \u8bbe\u7f6e\u751f\u547d\u5468\u671f\u89c4\u5219 kodo\/putBucketLifecycle | \/rules\/add\u3001\/rules\/update | \u4e0d\u652f\u6301 | - |\n| \u5220\u9664\u751f\u547d\u5468\u671f\u89c4\u5219 kodo\/deleteBucketLifecycle | \/rules\/delete | \u4e0d\u652f\u6301 | - |\n| \u67e5\u8be2\u4e8b\u4ef6\u901a\u77e5\u89c4\u5219 kodo\/getBucketNotification | \/events\/get | \u4e0d\u652f\u6301 | - |\n| \u8bbe\u7f6e\u4e8b\u4ef6\u901a\u77e5\u89c4\u5219 kodo\/putBucketNotification | \/events\/add\u3001\/events\/update | \u4e0d\u652f\u6301 | - |\n| \u5220\u9664\u4e8b\u4ef6\u901a\u77e5\u89c4\u5219 kodo\/deleteBucketNotification | \/events\/delete | \u4e0d\u652f\u6301 | - |\n\n- kodo\/mkbucket\uff08\u521b\u5efa\u5b58\u50a8\u7a7a\u95f4\uff09\u3001kodo\/drop\uff08\u5220\u9664\u5b58\u50a8\u7a7a\u95f4\uff09\uff0c\u5173\u8054\u8d44\u6e90\u53ea\u80fd\u662f\u300c\u6240\u6709\u7a7a\u95f4\u300d\u3002\n- kodoapi \u7684 buckets\uff0cv2\/buckets\uff0cv3\/buckets \u63a5\u53e3\uff0c\u652f\u6301 IAM \u4f46\u662f\u6ca1\u6709\u72ec\u7acb\u7684 action\uff0c\u63a5\u53e3\u8fd4\u56de\u5176\u4ed6\u5df2\u6388\u6743 action \u5173\u8054\u7684\u7a7a\u95f4\u5408\u96c6\u3002\n- kodo\/allbuckets\uff08\u5bf9\u5e94 s3:ListAllMyBuckets\uff09\uff1a\u7ba1\u7406\u754c\u9762\u6682\u672a\u63d0\u4f9b\u8be5 action \u7684\u6743\u9650\u8bbe\u7f6e\u64cd\u4f5c\u3002kodo\/allbuckets\uff0c\u672a\u663e\u5f0f\u8bbe\u7f6e\u65f6\uff0cs3 \u63a5\u53e3 ListBuckets \u9ed8\u8ba4\u5141\u8bb8\u5217\u4e3e\u5176\u4ed6\u5df2\u6388\u6743 action \u5173\u8054\u7a7a\u95f4\u7684\u5408\u96c6\u3002\n- \u6587\u4ef6 copy \u64cd\u4f5c\uff1a\u9700\u8981\u5177\u6709 source_bucket \u7684 get \u6743\u9650\u548c dist_bucket \u7684 upload \u6743\u9650\uff0c\u624d\u80fd\u505a\u6587\u4ef6 copy \u64cd\u4f5c\uff1b\n- \u6587\u4ef6 move \u64cd\u4f5c\uff1a\u5177\u6709\u4e86 copy \u548c source_bucket \u7684 object delete \u6743\u9650\uff0c\u624d\u5177\u6709 move \u6743\u9650\u3002\n- fetch\u3001sisyphus\/fetch \u63a5\u53e3\uff0c\u9700\u8981\u540c\u65f6\u5177\u6709\u6e90\u7a7a\u95f4\u7684 get \u6743\u9650\u3002\n- kodo\/statistics\uff0c\u6570\u636e\u6743\u9650\u63a7\u5236\u8bf4\u660e\n - \u5173\u8054\u8d44\u6e90\u4e3a * \u65f6\uff0c\u67e5\u8be2\u53ef\u4ee5\u4e0d\u6307\u5b9a $bucket \uff0c\u652f\u6301\u6307\u5b9a $region \u67e5\u8be2\u6c47\u603b\u6570\u636e\n - \u5173\u8054\u8d44\u6e90\u4e0d\u4e3a * \u65f6\uff0c\u67e5\u8be2\u5fc5\u987b\u6307\u5b9a $bucket\uff0c\u4e0d\u652f\u6301\u6307\u5b9a $region \u67e5\u8be2\u6c47\u603b\u6570\u636e\n - \u7279\u522b\u7684\uff0c\u8de8\u533a\u57df\u540c\u6b65\u6d41\u91cf\u662f\u4e0d\u5206\u533a\u57df\u548c\u7a7a\u95f4\u7684\u6c47\u603b\u91cf\uff0c\u6240\u4ee5v6\/blob_transfer \u63a5\u53e3\uff0c\u53ea\u6709\u5f53\u5173\u8054\u8d44\u6e90\u662f * \u7684\u65f6\u5019\uff0c\u624d\u5141\u8bb8\u8c03\u7528\u3002\n\n## \u4f7f\u7528\u8bf4\u660e\n\nIAM Policy \u4f7f\u7528\u4e3b\u6d41\u7a0b\u5982\u4e0b\uff1a\n\n1\u3001\u5f00\u542f IAM \u670d\u52a1\u3002\n\n2\u3001\u521b\u5efa IAM \u7528\u6237\uff0c\u751f\u6210\u5f00\u53d1\u8005\u5e73\u53f0\u7684\u767b\u5f55\u5bc6\u7801\u548c\u8bbf\u95ee\u5bc6\u94a5\u5bf9\u3002\u6309\u9700\u521b\u5efa\u7528\u6237\u7ec4\u3002\n\n3\u3001\u521b\u5efa\u6743\u9650\u7b56\u7565\n\n4\u3001\u4e3a IAM \u7528\u6237\u6216 IAM \u7528\u6237\u5173\u8054\u7684\u7528\u6237\u7ec4\u5173\u8054\u6743\u9650\u7b56\u7565\n\n5\u3001IAM \u7528\u6237\u5373\u53ef\u4f7f\u7528\u5b58\u50a8\u670d\u52a1\n\n- \u4f7f\u7528\u767b\u5f55\u5bc6\u7801\uff0c\u767b\u5f55\u5f00\u53d1\u8005\u5e73\u53f0\uff0c\u901a\u8fc7\u5e73\u53f0\u754c\u9762\u4f7f\u7528\u3001\u7ba1\u7406\u5b58\u50a8\u8d44\u6e90\u3002\n- \u4f7f\u7528\u81ea\u5df1\u7684 \u8bbf\u95ee\u5bc6\u94a5\u5bf9\uff0c\u901a\u8fc7\u5de5\u5177\u6216\u662f SDK \u5bf9\u63a5\u5b58\u50a8\u670d\u52a1\u3002\n\nIAM Policy \u914d\u7f6e\u65b9\u6cd5\u7684\u5b8c\u6574\u8bf4\u660e\uff0c\u53c2\u89c1 \u8bbf\u95ee\u7ba1\u7406\u3002"}