# IAM Policies

You can create IAM users under a registered cloud service account, and then use IAM policies to control users' access permissions to cloud resources.

IAM policies define the actions that can be performed on your cloud resources. In other words, IAM policies specify what actions are allowed or denied.

IAM policies with OBS permissions take effect on all OBS buckets and objects. To grant an IAM user the permission to operate OBS resources, you need to assign one or more OBS permission sets to the user group to which the user belongs.

For details about OBS permissions controlled by IAM policies, see Permissions Management.

#### IAM Policies Application Scenarios

IAM policies are used to authorize IAM users under an account.

- Controlling permissions to cloud resources as a whole under an account
- Controlling permissions to all OBS buckets and objects under an account

#### Policy Structure and Syntax

A policy consists of a version and statements. Each policy can have multiple statements.

Figure 1 Policy structure

Policy syntax example:

    {
            "Version": "1.0",
            "Statement": [
                    {
                            "Effect": "Allow",
                            "Action": [
                                    "s3:ListAllMyBuckets",
                                    "s3:HeadBucket",
                                    "s3:GetBucketLocation",
                                    "s3:ListBucket"
                            ]
                    }
            ]
    }

Table 1 Policy syntax parameters
Parameter | Description
--- | ---

Version

The version number of a policy.

- 1.0: RBAC policies. An RBAC policy consists of permissions for an entire service. Users in a group with such a policy assigned are granted all of the permissions required for that service.

Statement

Permissions defined by a policy, including Effect and Action.

- Effect

  The valid values for Effect are Allow and Deny. System policies contain only Allow statements.

- Action

  Permissions of specific operations on resources. A policy can contain one or more permissions. The wildcard (*) is allowed to indicate all of the services, resource types, or operations depending on its location in the action.

#### Authentication of IAM Policies

The authentication of IAM policies starts from the Deny statements. The following figure shows the authentication logic for resource access.

Figure 2 Authentication logic

The actions in each policy bear the OR relationship.

1. A user accesses the system and makes an operation request.
2. The system evaluates all the permission policies assigned to the user.
3. In these policies, the system looks for explicit deny permissions. If the system finds an explicit deny that applies, it returns a decision of Deny, and the authentication ends.
4. If no explicit deny is found, the system looks for allow permissions that would apply to the request. If the system finds an explicit allow permission that applies, it returns a decision of Allow, and the authentication ends.
5. If no explicit allow permission is found, IAM returns a decision of Deny, and the authentication ends.

Parent topic: Permission Control Mechanisms