By default, sub-accounts have no permission to use TencentDB for MySQL Database Audit. Therefore, you need to create policies to allow sub-accounts to use it.
If you don't need to manage sub-accounts' access to resources related to TencentDB for MySQL Database Audit, you can ignore this document.
Cloud Access Management (CAM) is a web-based Tencent Cloud service that helps you securely manage and control access to your Tencent Cloud resources. By using CAM, you can create, manage, and terminate users and user groups. You can manage identities and policies to allow specific users to access your Tencent Cloud resources.
When using CAM, you can associate a policy with a user or user group to allow or forbid them to use specified resources to complete specified tasks. For more information on CAM policies, please see Syntax Logic.
Note:MySQL Database Audit is a module in TencentDB for MySQL, so the above two preset policies of TencentDB for MySQL already cover the permission policies required by it. If the sub-user only needs the permission to use this module, please see Custom MySQL Database Audit Policy.
The CAM policy for MySQL Database Audit is described as follows:
{
"version":"2.0",
"statement":
[
{
"effect":"effect",
"action":["action"],
"resource":["resource"]
}
]
}
effect
, action
, and resource
. One policy has only one statement
.In a CAM policy statement, you can specify any API operation from any service that supports CAM. APIs prefixed with name/cdb:
should be used for Database Audit. To specify multiple operations in a single statement, separate them with commas as shown below:
"action":["name/cdb:action1","name/cdb:action2"]
You can also specify multiple operations by using a wildcard. For example, you can specify all operations beginning with "Describe" in the name as shown below:
"action":["name/cdb:Describe*"]
Resource paths are generally in the following format:
qcs::service_type::account:resource
cdb
here.uin/326xxx46
.Example:
"resource": ["qcs::cdb::uin/326xxx46:instanceId/cdb-kf291vh3"]
Here, cdb-kf291vh3
is the ID of the TencentDB for MySQL instance resource, i.e., the resource
in the CAM policy statement.
The following example only shows the usage of CAM.
{
"version": "2.0",
"statement": [
{
"effect": "allow",
"action": [
"name/cdb: DescribeAuditRules"
],
"resource": [
"*"
]
},
{
"effect": "allow",
"action": [
"name/cdb: CreateAuditPolicy"
],
"resource": [
"*"
]
},
{
"effect": "allow",
"action": [
"name/cdb: DescribeAuditLogFiles"
],
"resource": [
"qcs::cdb::uin/326xxx46:instanceId/cdb-kf291vh3"
]
}
]
}
*
to indicate that the audit logs of all TencentDB for MySQL instances can be manipulated.SQLAuditFullAccess
) as required and Description and click Done.
Was this page helpful?