Updated on 2024-12-02 GMT+08:00

Actions Supported by Identity Policy-based Authorization

IAM provides system-defined identity policies to define common actions supported by cloud services. You can also create custom identity policies using the actions supported by cloud services for more refined access control.

In addition to IAM, the Organizations service also provides Service Control Policies (SCPs) to set access control policies.

SCPs do not actually grant any permissions to a principal. They only set the permissions boundary for the principal. When SCPs are attached to a member account or an organizational unit (OU), they do not directly grant permissions to that member account or OU. Instead, the SCPs just determine what permissions are available for that member account or the member accounts under that OU. The granted permissions can be applied only if they are allowed by the SCPs.

There are some differences between IAM and Organizations when they are used for access control.

This section describes the elements used by IAM custom identity policies and Organizations SCPs. The elements include actions, resources, and conditions.

Actions

Actions are specific operations that are allowed or denied in an SCP.

  • The Access Level column describes how the action is classified (List, Read, or Write). This classification helps you understand the level of access that an action grants when you use it in an identity policy.
  • The Resource Type column indicates whether the action supports resource-level permissions.
    • You can use a wildcard (*) to indicate all resource types. If this column is empty (-), the action does not support resource-level permissions and you must specify all resources ("*") in your identity policy statements.
    • If this column includes a resource type, you must specify a URN for the Resource element in your identity policy statements.
    • Required resources are marked with asterisks (*) in the table. If you specify a resource in a statement using this action, then it must be of this type.

    For details about the resource types defined by SWR, see Resources.

  • The Condition Key column contains keys that you can specify in the Condition element of an identity policy statement.
    • If the Resource Type column has values for an action, the condition key takes effect only for the listed resource types.
    • If the Resource Type column is empty (-) for an action, the condition key takes effect for all resources that action supports.
    • If the Condition Key column is empty (-) for an action, the action does not support any condition keys.

    For details about the condition keys defined by SWR, see Conditions.

  • The Alias column lists the policy actions that are configured in identity policies. With these actions, you can use APIs for policy-based authorization.

The following table lists the actions that you can define in identity policy statements for SWR.

Table 1 Actions supported by SWR

Action

Description

Access Level

Resource Type (*: required)

Condition Key

Alias

swr:namespace:createNamespace

Grants permission to create organizations.

write

namespace *

-

-

swr:namespace:deleteNamespace

Grants permission to delete organizations.

write

namespace *

-

-

swr:namespace:listNamespaces

Grants permission to list organizations.

list

namespace *

-

-

swr:namespace:getNamespace

Grants permission to query details about an organization.

read

namespace *

-

-

swr:repo:createRepo

Grants permission to create repositories.

write

repo *

-

-

swr:repo:deleteRepo

Grants permission to delete repositories.

write

repo *

-

-

swr:repo:listRepos

Grants permission to list repositories.

list

repo *

-

-

swr:repo:listSharedRepos

Grants permission to list shared images.

list

repo *

-

-

swr:repo:getRepo

Grants permission to query brief information about a repository.

read

repo *

-

-

swr:repo:updateRepo

Grants permission to update brief information about a repository.

write

repo *

-

-

swr:repo:deleteRepoTag

Grants permission to delete images with specified tags.

write

repo *

-

-

swr:repo:createRepoTag

Grants permission to add tags for images.

write

repo *

-

-

swr:repo:listRepoTags

Grants permission to list image tags.

list

repo *

-

-

swr:repo:createRepoDomain

Grants permission to create accounts for image sharing.

permission_management

repo *

-

-

-

  • swr:TargetAccountId
  • swr:TargetOrgPath
  • swr:TargetOrgId

swr:repo:deleteRepoDomain

Grants permission to delete accounts for image sharing.

permission_management

repo *

-

-

swr:repo:listRepoDomains

Grants permission to list accounts for image sharing.

list

repo *

-

-

swr:repo:getRepoDomain

Grants permission to check whether an account exists for image sharing.

read

repo *

-

-

swr:repo:updateRepoDomain

Grants permission to update an account for image sharing.

permission_management

repo *

-

-

swr:repo:createRepoShare

Grants permission to create image sharing policies.

permission_management

repo *

-

-

-

  • swr:TargetAccountId
  • swr:TargetOrgPath
  • swr:TargetOrgId

swr:repo:deleteRepoShare

Grants permission to delete image sharing policies.

permission_management

repo *

-

-

swr:repo:listRepoShares

Grants permission to list image sharing policies.

list

repo *

-

-

swr:repo:getRepoShare

Grants permission to query details about an image sharing policy.

read

repo *

-

-

swr:repo:updateRepoShare

Grants permission to update an image sharing policy.

permission_management

repo *

-

-

swr:repo:createAutoSyncRepoJob

Grants permission to create automatic image synchronization tasks.

write

repo *

-

-

swr:repo:createManualSyncRepoJob

Grants permission to manually synchronize images.

write

repo *

-

-

swr:repo:deleteAutoSyncRepoJob

Grants permission to delete automatic image synchronization tasks.

write

repo *

-

-

swr:repo:listAutoSyncRepoJobs

Grants permission to list automatic image synchronization tasks.

list

repo *

-

-

swr:repo:getSyncRepoJobInfo

Grants permission to query details about an image synchronization task.

read

repo *

-

-

swr:repo:createTrigger

Grants permission to create triggers for image synchronization.

write

repo *

-

-

swr:repo:deleteTrigger

Grants permission to delete triggers for image synchronization.

write

repo *

-

-

swr:repo:listTriggers

Grants permission to list image synchronization triggers.

list

repo *

-

-

swr:repo:getTrigger

Grants permission to query details about an image synchronization trigger.

read

repo *

-

-

swr:repo:updateTrigger

Grants permission to update an image synchronization trigger.

write

repo *

-

-

swr:repo:createRetention

Grants permission to create image retention policies.

write

repo *

-

-

swr:repo:deleteRetention

Grants permission to delete image retention policies.

write

repo *

-

-

swr:repo:listRetentionHistories

Grants permission to list image retention records.

list

repo *

-

-

swr:repo:listRetentions

Grants permission to list image retention policies.

list

repo *

-

-

swr:repo:getRetention

Grants permission to query details about an image retention policy record.

read

repo *

-

-

swr:repo:updateRetention

Grants permission to modify an image retention policy.

write

repo *

-

-

swr::createLoginSecret

Grants permission to generate a temporary login command.

write

-

-

-

swr::listQuotas

Grants permission to list quotas.

list

-

-

-

swr::getDomainOverview

Grants permission to query brief tenant information.

read

-

-

-

swr::getDomainResourceReports

Grants permission to query resource statistics of the tenant.

read

-

-

-

swr:namespace:multipartUpload

Grants permission to upload an image in multipart mode.

write

namespace *

-

-

swr:namespace:createNamespaceAccess

Grants permission to create organization permissions.

permission_management

namespace *

-

-

swr:namespace:deleteNamespaceAccess

Grants permission to delete organization permissions.

permission_management

namespace *

-

-

swr:namespace:getNamespaceAccess

Grants permission to query details about an organization permission.

read

namespace *

-

-

swr:namespace:updateNamespaceAccess

Grants permission to update an organization permission.

permission_management

namespace *

-

-

swr:repo:createRepoAccess

Grants permission to create image permissions.

permission_management

repo *

-

-

swr:repo:deleteRepoAccess

Grants permission to delete image permissions.

permission_management

repo *

-

-

swr:repo:getRepoAccess

Grants permission to query details about an image permission.

read

repo *

-

-

swr:repo:updateRepoAccess

Grants permission to update an image permission.

permission_management

repo *

-

-

swr:repo:upload

Grants permission to upload an image.

write

repo *

-

-

swr:repo:download

Grants permission to download an image.

read

repo *

-

-

Each API of SWR usually supports one or more actions. Table 2 lists the supported actions and dependencies.

Table 2 Actions and dependencies supported by SWR APIs

API

Action

Dependencies

POST /v2/manage/namespaces

swr:namespace:createNamespace

-

DELETE /v2/manage/namespaces/{namespace}

swr:namespace:deleteNamespace

-

GET /v2/manage/namespaces

swr:namespace:listNamespaces

-

GET /v2/manage/namespaces/{namespace}

swr:namespace:getNamespace

-

POST /v2/manage/namespaces/{namespace}/repos

swr:repo:createRepo

-

DELETE /v2/manage/namespaces/{namespace}/repos/{repository}

swr:repo:deleteRepo

-

GET /v2/manage/repos

swr:repo:listRepos

-

GET /v2/manage/shared-repositories

swr:repo:listSharedRepos

-

GET /v2/manage/namespaces/{namespace}/repos/{repository}

swr:repo:getRepo

-

PATCH /v2/manage/namespaces/{namespace}/repos/{repository}

swr:repo:updateRepo

-

DELETE /v2/manage/namespaces/{namespace}/repos/{repository}/tags/{tag}

swr:repo:deleteRepoTag

-

GET /v2/manage/namespaces/{namespace}/repos/{repository}/tags

swr:repo:listRepoTags

-

POST /v2/manage/namespaces/{namespace}/repositories/{repository}/access-domains

swr:repo:createRepoDomain

-

DELETE /v2/manage/namespaces/{namespace}/repositories/{repository}/access-domains/{access_domain}

swr:repo:deleteRepoDomain

-

GET /v2/manage/namespaces/{namespace}/repositories/{repository}/access-domains

swr:repo:listRepoDomains

-

GET /v2/manage/namespaces/{namespace}/repositories/{repository}/access-domains/{access_domain}

swr:repo:getRepoDomain

-

PATCH /v2/manage/namespaces/{namespace}/repositories/{repository}/access-domains/{access_domain}

swr:repo:updateRepoDomain

-

POST /v2/manage/namespaces/{namespace}/repos/{repository}/shares

swr:repo:createRepoShare

-

DELETE /v2/manage/namespaces/{namespace}/repos/{repository}/shares/{share_id}

swr:repo:deleteRepoShare

-

GET /v2/manage/namespaces/{namespace}/repos/{repository}/shares

swr:repo:listRepoShares

-

PATCH /v2/manage/namespaces/{namespace}/repos/{repository}/shares/{share_id}

swr:repo:updateRepoShare

-

POST /v2/manage/namespaces/{namespace}/access

swr:namespace:createNamespaceAccess

-

DELETE /v2/manage/namespaces/{namespace}/access

swr:namespace:deleteNamespaceAccess

-

GET /v2/manage/namespaces/{namespace}/access

swr:namespace:getNamespaceAccess

-

PATCH /v2/manage/namespaces/{namespace}/access

swr:namespace:updateNamespaceAccess

-

Resources

A resource type indicates the resources that an identity policy applies to. If you specify a resource type for any action in Table 3, the resource URN must be specified in the identity policy statements using that action, and the identity policy applies only to resources of this type. If no resource type is specified, the Resource element is marked with an asterisk (*) and the identity policy applies to all resources. You can also set condition keys in an identity policy to define resource types.

The following table lists the resource types that you can specify in identity policy statements for SWR.

Table 3 Resource types supported by SWR

Resource Type

URN

repo

swr:<region>:<account-id>:repo:<namespace-name>/<repo-name>

repository

swr:<region>:<account-id>:repository:<instance-name>/<repository-path>

instance

swr:<region>:<account-id>:instance:<instance-name>

namespace

swr:<region>:<account-id>:namespace:<namespace-name>

Conditions

A Condition element lets you specify conditions for when an identity policy is in effect. It contains conditions keys and operators.

  • The condition key that you specify can be a global or service-specific condition key.
    • Global condition keys (with the g: prefix) apply to all actions. Cloud services do not need to provide user identity information. Instead, IAM automatically obtains such information and authenticates users.
    • Service-specific condition keys (with the abbreviation of a service name plus a colon as the prefix, for example, swr:) only apply to operations of the SWR service.
    • The number of values associated with a condition key in the request context of an API call makes the condition key single-valued or multivalued. Single-valued condition keys have at most one value in the request context of an API call. Multivalued condition keys can have multiple values in the request context of an API call. For example, a request can originate from at most one VPC endpoint, so g:SourceVpce is a single-valued condition key. You can tag resources and include multiple tag key-value pairs in a request, so g:TagKeys is a multivalued condition key.
  • A condition operator, condition key, and a condition value together constitute a complete condition statement. An identity policy can be applied only when its request conditions are met.

The following table lists the condition keys that you can define in identity policies for SWR. You can include these condition keys to specify conditions for when your identity policy is in effect.

Table 4 Service-specific condition keys supported by SWR

Condition Key

Value Type

Single-valued/Multivalued

Description

swr:TargetOrgPath

string

Single-valued

Controls permissions of target sharing accounts based on their organization paths.

swr:TargetOrgId

string

Single-valued

Controls permissions of target sharing accounts based on their organization IDs.

swr:TargetAccountId

string

Single-valued

Controls permissions of target sharing accounts based on their IDs.

swr:VpcId

string

Single-valued

Controls permissions based on VPC IDs.

swr:SubnetId

string

Single-valued

Controls permissions based on subnet IDs.

swr:EnablePublicNameSpace

boolean

Single-valued

Controls whether public organizations can be created in SWR Enterprise Edition.

swr:EnableObsEncrypt

boolean

Single-valued

Controls whether encrypted buckets must be used in SWR Enterprise Edition.

swr:AllowPublicAccess

boolean

Single-valued

Controls whether images can be public.

swr:TargetRegion

string

Single-valued

Controls permissions based on destination regions.