Use the following method to assign permissions of the FullAccess policy to a user but also forbid the user from accessing CTS. Create a custom policy for denying access to the service, and attach the two policies to the group to which the user belongs. Then, the user will be able to perform all operations on all services except CTS.
Example policy denying access to CTS:
{ "Version": "1.1", "Statement": [ { "Effect": "Deny", "Action": [ "cts:*:*" ] } ] }
For example, cts:*:* refers to permissions for performing all operations on all resource types of CTS.
Example policy denying ECS deletion:
{ "Version": "1.1", "Statement": [ { "Effect": "Deny", "Action": [ "ecs:cloudServers:delete" ] } ] }
{ "Version": "1.1", "Statement": [ { "Effect": "Deny", "Action": [ "obs:bucket:ListAllMybuckets", "obs:bucket:HeadBucket", "obs:bucket:ListBucket", "obs:bucket:GetBucketLocation" ], "Resource": [ "obs:*:*:bucket:TestBucket*" ], "Condition": { "StringStartWith": { "g:UserName": [ "TestUser" ] } } } ] }
Currently, only certain cloud services (such as OBS) support resource-based authorization. For services that do not support this function, you cannot create custom policies containing resource types.
To grant a user permissions for accessing specific services, you can create a custom policy and attach only the custom policy to the group to which the user belongs.
{ "Version": "1.1", "Statement": [ { "Effect": "Allow" "Action": [ "ecs:*:*", "evs:*:*", "vpc:*:*", "aom:*:*", "elb:*:*" ], } ] }
{ "Version": "1.1", "Statement": [ { "Effect": "Allow", "Action": [ "obs:object:DeleteObject" ], "Resource": [ "obs:*:*:object:my-bucket/my-object/*" ], "Condition": { "StringStartWith": { "g:UserName": [ "TestUser" ] } ] }
{ "Version": "1.1", "Statement": [ { "Effect": "Allow" "Action": [ "*:*:*" ], }, { "Action": [ "ecs:*:*", "evs:*:*", "vpc:*:*", "aom:*:*", "elb:*:*" ], "Effect": "Deny" } ] }