Ant Blockchain RAM authentication

更新时间:
复制 MD 格式

Before a Resource Access Management (RAM) user can call Ant Blockchain service APIs, the root account must grant permissions to the RAM user by creating an authorization policy. The policy must specify the authorized resources using an Alibaba Cloud Resource Name (ARN).

This topic describes the RAM authentication rules for Ant Blockchain. These rules allow you to authenticate team members, authorize cross-account resource access, and authorize cross-service access. Before you use RAM authorization to access Blockchain as a Service, read the RAM product documentation and the RAM API documentation.

Authorizable Ant Blockchain resource types

When you grant permissions to a RAM user, use the following format to specify Ant Blockchain resources:

Resource type Resource description method in an authorization policy
Consortium acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId
Blockchain acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
Contract project acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/contractProject/$projectId

In these formats, $consortiumId is the consortium ID, $blockchainId is the blockchain ID, and $projectId is the contract project ID within the consortium.

Authorizable Ant Blockchain APIs

The following table lists the authorizable Ant Blockchain APIs and their descriptions.

API Resource description
CreateAntChainConsortium acs:baas:*:$accountId:antChainConsortium/*
DescribeAntChainConsortiums acs:baas:*:$accountId:antChainConsortium/*
UpdateAntChainConsortium acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId
DeleteAntChainConsortium acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId
InviteAntChainMember acs:baas:*:$accountId:*
AgreeAntChainInvitation acs:baas:*:$accountId:*
DescribeAntChainMembers acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId
UpdateAntChainMember acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId
DescribeAntChains acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/*
CreateAntChain acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/*
UpdateAntChain acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
ApplyAntChainCertificate acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
ApplyAntChainCertificateWithKeyAutoCreation acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DescribeAntChainDownloadPaths acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
ResetAntChainCertificate acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DescribeAntChainLatestBlocks acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DescribeAntChainLatestTransactionDigests acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DescribeAntChainInformation acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DescribeAntChainTransactionStatistics acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DescribeAntChainBlock acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DescribeAntChainTransaction acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DescribeAntChainTransactionReceipt acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
ResetAntChainUserCertificate acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DescribeAntChainAccounts acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DescribeAntChainNodes acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
CreateAntChainAccount acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
CreateAntChainAccountWithKeyPairAutoCreation acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
FreezeAntChainAccount acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
UnfreezeAntChainAccount acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DescribeAntChainCertificateApplications acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
CreateAntChainContractProject acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/contractProject/*
CopyAntChainContractProject acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/contractProject/*
DeleteAntChainContractProject acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/contractProject/$projectId
UpdateAntChainContractProject acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/contractProject/$projectId
DescribeAntChainContractProjects acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/contractProject/*
DescribeAntChainContractProjectContentTree acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/contractProject/$projectId
CreateAntChainContractContent acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/contractProject/$projectId
DeleteAntChainContractContent acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/contractProject/$projectId
UpdateAntChainContractContent acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/contractProject/$projectId
DescribeCloudIDEEnvConfigs acs:baas:*:$accountId:*
ProcessCloudIDEContractTransaction acs:baas:*:$accountId:*
APIs for the Experience Chain overview page RAM authentication is not required.
DescribeAntChainRegions RAM authentication is not performed for this API.
DescribeAntChainQRCodeAuthorization acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
UpdateAntChainQRCodeAuthorization acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DescribeAntChainMiniAppBrowserQRCodeAuthorizedUsers acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
BatchAddAntChainMiniAppQRCodeAuthorizedUsers acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DeleteAntChainMiniAppQRCodeAuthorizedUser acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DescribeAntChainMiniAppBrowserQRCodeAccessLog acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId
DescribeAntChainMiniAppBrowserTransactionQRCode acs:baas:*:$consortiumOwnerUid:antChainConsortium/$consortiumId/blockchain/$blockchainId

Ant Blockchain RAM rule examples

Example 1: Grant read-only permissions for BaaS operations. These permissions allow a user to view the blockchain status and download the SDK from the console or using an API.

{

   "Statement": [{

       "Action": ["baas:DescribeAntChain*"],

        "Effect": "Allow",

        "Resource": "acs:baas:*:*:*"

   }],

   "Version": "1"

}
Example 2: Grant permissions for consortium management operations (query, create, update, and delete). These permissions allow a user to manage consortiums from the console or using an API.
{

  "Statement": [{

     "Action": "baas:*AntChainConsortium*",

     "Effect": "Allow",
     "Resource": ["acs:baas:*:*:antChainConsortium/*"]

  }],

  "Version": "1"

}

Example 3: Grant fine-grained permissions to a chaincode developer. These permissions usually include all read operations and resource management operations for a specific consortium. To follow the principle of least privilege for contract management, you can restrict the user to operations on a specific contract project in a specific consortium. Replace antChainConsortium/$consortiumId/contractProject/$projectId with the ID of the resource in Blockchain as a Service.

{

 "Statement": [{

   "Action": ["baas:DescribeAntChain*"],

    "Effect": "Allow",

    "Resource": "acs:baas:*:*:*"

 },

 {

    "Action": "baas:*AntChainContract*",

    "Effect": "Allow",

    "Resource": ["acs:baas:*:*:antChainConsortium/$consortiumId/contractProject/$projectId"]

 }],

 "Version": "1"

}