当前位置:网站首页>[best practice] patrol item: object storage (COS) bucket public read / write
[best practice] patrol item: object storage (COS) bucket public read / write
2022-04-21 17:50:00 【Xinjwang Wang Jian Wang】
Problem description
A customer uses COS Store some files , Recently, I found some files that I didn't upload in the bucket 、 Some files have been deleted , There are also some traffic generation , After investigation, it is because the bucket is open for public reading and writing , Anyone can read and write to the bucket .
This patrol inspection item is used to check COS Whether the bucket has public read / write enabled , If the permission of the bucket is public, read and write , Then there may be a security risk in the storage bucket .
Solution
According to the principle of minimizing permissions , For the bucket [ACL Access control ](https://cloud.tencent.com/document/product/436/12470) close 「 Public reading and writing 」 Options , Or configure [ Bucket of policy jurisdiction ](https://cloud.tencent.com/document/product/436/33369), Allocate bucket read and write permissions as needed , Improve data security
Configuration method :
Set the bucket ACL The following example shows that another master account is allowed to access a bucket Have read permission :
Set on object ACL The following example shows that another master account is allowed to access a object Have read permission :
Bucket setting Policy jurisdiction
- Sign in Object Storage Console .
- In the left navigation bar , single click Bucket list , Select the bucket to which you want to add a bucket policy , Into the bucket .
- single click Rights management , find Policy permissions ,COS The way to add bucket policy is Graphic settings and Strategy grammar , Please refer to the following steps . You can choose one of the ways to add bucket policy . More instructions on configuration items , Please see the Overview of access policy language .
- After confirming that the configuration information is correct , single click determine or preservation that will do . At this time, log in with a sub account COS Console , Will only be able to access the resource range set by the policy .
Graphic settings
In the graphic settings section , single click Add a policy , Configure the policy in the pop-up window . First step Select template , The second step Configure policy .
First step : Select template
By selecting different authorized users 、 Resource range combination ,COS Provides you with a variety of policy templates , Help you quickly configure bucket policies .
- Authorized user
- All users ( Can be accessed anonymously ): When you want to open operation permission for anonymous users , You can choose this option , When configuring the policy in the second step, all users will be automatically added for you , Expressed as
*. Because the list of objects will be listed (ListBucket)、 Bucket configuration permissions and other operations are open to anonymous users with high risk , When this option is selected COS No corresponding template is provided , If you need it, you can do it later “ Configure policy ” Step add by yourself . - Designated user : When you want to specify a sub account 、 When the master account or cloud service opens the operation permission , You can choose to specify the user . In the second step, configure the policy , You need to further specify a specific account UIN.
- All users ( Can be accessed anonymously ): When you want to open operation permission for anonymous users , You can choose this option , When configuring the policy in the second step, all users will be automatically added for you , Expressed as
- Scope of resources
- The whole bucket : When you want to configure bucket configuration related permissions , Or specify the resource range as the entire bucket , You can choose this option , When you configure the policy in the second step, you will automatically add the entire bucket as a resource .
- Specify the directory : When you want to limit the scope of resources to a specified folder , You can choose this option . In the second step, configure the policy , You need to further specify the specific directory . When this option is selected ,COS Policy templates related to bucket configuration will not be provided , Because this kind of permission must specify the resource as the whole bucket .
- Templates : The set of operations you want to authorize .
- Custom policy ( No preset configuration is provided ): If you don't need a template , You can select this item , In the second step “ Configure policy ” Add your own policies according to your needs .
- Other templates : According to the different combinations of authorized users and resource ranges you choose ,COS Provide you with different recommended templates . Check the corresponding template , In the second step, configure the policy ,COS The corresponding operation will be automatically added for you .
explain : The authorization provided by the template does not meet your needs , You can in the second step " Configure policy " Add or remove authorization actions from .
Please refer to the following table for template description :
|
Authorized user |
Scope of resources |
Strategy templates |
explain |
|---|---|---|---|
|
All combinations |
Custom policy |
For any authorized user 、 Resource range combination , Selecting this template does not provide any preset policies , You can directly add policies in the second step of configuring policies . |
|
|
All users ( Can be accessed anonymously ) |
The whole bucket |
Read only objects ( List of objects not included ) |
For anonymous users ,COS Provide you with reading files ( For example, download )、 Writing documents ( For example, upload 、 modify ) Recommended template .COS The recommended template does not include listing all objects in your bucket 、 And read and write permissions 、 Bucket configuration and other sensitive permissions , Avoid opening other redundant permissions and improve data security . If you need , You can add it yourself in the next steps 、 Delete action permission . |
|
Read write object ( List of objects not included ) |
|||
|
Specify the directory |
Read only objects ( List of objects not included ) |
||
|
Read write object ( List of objects not included ) |
|||
|
Designated user |
The whole bucket |
Read only objects ( List of objects not included ) |
For the specified user and the entire bucket combination ,COS Provides the most recommended templates . In addition to reading 、 Write files and list files ,COS It also includes the following sensitive permission templates , For trusted users : Read and write buckets and objects ACL: obtain 、 Modify bucket ACL、 object ACL. Include GetObjectACL、PutObjectACL、GetBucketACL、PutBucketACL Bucket general configuration items : Bucket label 、 Cross domain 、 Back to source and other non sensitive permissions . Bucket sensitive configuration item : Involving bucket strategy 、 bucket ACL、 Delete sensitive permissions such as buckets , It needs to be used with caution . |
|
Read only objects ( Include a list of objects ) |
|||
|
Read write object ( List of objects not included ) |
|||
|
Read write object ( Include a list of objects ) |
|||
|
Read and write buckets and objects ACL |
|||
|
Bucket general configuration items |
|||
|
Bucket sensitive configuration item |
|||
|
Specify the directory |
Read only objects ( List of objects not included ) |
For the combination of specified user and specified directory ,COS Besides reading files ( for example , download )、 Writing documents ( For example, upload 、 modify ) outside , A recommended template with permissions to list objects is also provided . When you need to open the reading of the specified folder for the specified user 、 Write 、 When listing file permissions , This combination is recommended . If you need , You can add it yourself in the next steps 、 Delete action permission . |
|
|
Read only objects ( Include a list of objects ) |
|||
|
Read write object ( List of objects not included ) |
|||
|
Read write object ( Include a list of objects ) |
|||
The second step : Configure policy
For the authorized user you selected in the first step 、 Specify the directory and template combination ,COS Corresponding actions are automatically added in the configuration policy for you 、 Authorized user 、 Resources, etc . among , When you select the specified user 、 When specifying a directory , You need to specify specific users when configuring policies UIN And contents .
When COS When the recommended template provided does not meet your needs , You can also adjust the policy content in this step , add to 、 Delete authorized user 、 Resources and operations . The configuration items are described as follows :
- effect : Support choice “ allow ” or “ Refuse ”, Corresponding to... In policy syntax “allow” and “deny”.
- user : Support adding 、 Delete authorized user , Including all users (
*)、 Master account 、 Sub accounts and cloud services . - resources : It supports adding entire storage bucket or specified directory resources .
- operation : add to 、 Delete the operation you need to authorize .
- Conditions : Specify conditions when granting permissions , For example, restrict user access IP.
版权声明
本文为[Xinjwang Wang Jian Wang]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211744362422.html
边栏推荐
- 漏洞检测与防御:Redis未授权访问漏洞复现
- MySQL ODBC驱动简介
- 头条自媒体运营秘籍,坚持下去你就可以打败90%的人
- STM32学习笔记——RTC的亚秒值校准
- MP40N120-ASEMI场效应管MP40N120
- 华为URPF
- 【AI与食品】北工商中科院计算所最新《基于视觉分析的膳食评估》综述性论文
- 直播带货源码,渐变式状态栏的不同写法
- In cabin visual AI application front loading "increased by nearly 200% year-on-year". Which suppliers lead the Chinese market
- Considering loose coupling of microservice architecture? Be careful of these traps
猜你喜欢

C# ODBC将一个文件夹的文件装载到PostgreSQL数据库BLOB列,并将BLOB列下载到另一个文件夹

单片机diy作品鉴赏,初学者进来膜拜

We sincerely invite you to sign up for the first openharmony developer growth plan sharing day

将模型训练外包真的安全吗?新研究:外包商可能植入后门,控制银行放款

做自媒体副业真能月入上万?这篇分享,不藏私

老电脑应该怎么重装系统比较好

兼职比工资还高,2022年,月入过万的3个副业

论文浅尝|《Attention-Based Bidirectional Long Short-Term Memory Networks for Relation Classification》

Modify the van dropdown menu default height

What is ODBC – open database connectivity
随机推荐
【AI与食品】北工商中科院计算所最新《基于视觉分析的膳食评估》综述性论文
LogStash~LogStash的多个输入输出
onnx效率问题:和Module & DataParallel比较
Ros2 abandonment guide 5: creating topic for ros2
终于完成学生时代的梦想-制作掌机用单片机STM32手把手教你
Oceanbase 和 TiDB 粗浅对比之 - 执行计划
有人声称「解决了」MNIST与CIFAR 10,实现了100%准确率
Variable ‘err‘ is accessed from within inner class, needs to be final or effectively final
头条自媒体运营秘籍,坚持下去你就可以打败90%的人
High expansion and high availability engineering practice of recommended resource bits related to short video app
LogStash~LogStash的配置文件
LogStash~LogStash的output(输出)
MySQL基础合集
Is it really safe to outsource model training? New research: outsourcers may implant backdoors to control bank lending
有奖征文 | 重奖5000元,邀您投稿
【最佳实践】巡检项:对象存储(COS)存储桶公有读写
怎么获取map值才不那么low,获取map参数的三种方式
Logstash ~ filter of logstash
Modify the van dropdown menu default height
How to turn on the undisturbed time with win10 memo how to set the message of rest day to be undisturbed