Configures the security preferences.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ram:SetSecurityPreference | update |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
EnableSaveMFATicket | boolean | No | Specifies whether to remember the multi-factor authentication (MFA) devices of Resource Access Management (RAM) users for seven days. Valid values:
| true |
AllowUserToChangePassword | boolean | No | Specifies whether RAM users can change their passwords. Valid values:
| true |
AllowUserToManageAccessKeys | boolean | No | Specifies whether RAM users can manage their AccessKey pairs. Valid values:
| false |
AllowUserToManagePublicKeys | boolean | No | Specifies whether RAM users can manage their public keys. Valid values:
Note
This parameter is valid only for the Japan site.
| false |
AllowUserToManageMFADevices | boolean | No | Specifies whether RAM users can manage their MFA devices. Valid values:
| true |
LoginSessionDuration | integer | No | The validity period of the logon session of RAM users. Valid values: 1 to 24. Default value: 6. Unit: hours. | 6 |
LoginNetworkMasks | string | No | The subnet mask that specifies the IP addresses from which you can log on to the Alibaba Cloud Management Console. This parameter takes effect on password-based logon and single sign-on (SSO). However, this parameter does not take effect on API calls that are authenticated by using AccessKey pairs.
If you need to specify multiple subnet masks, separate the subnet masks with semicolons (;). Example: 192.168.0.0/16;10.0.0.0/8. You can specify up to 40 subnet masks. The total length of the subnet masks can be a maximum of 512 characters. | 10.0.0.0/8 |
Response parameters
Examples
Sample success responses
JSON
format
{
"SecurityPreference": {
"AccessKeyPreference": {
"AllowUserToManageAccessKeys": false
},
"MFAPreference": {
"AllowUserToManageMFADevices": false
},
"LoginProfilePreference": {
"EnableSaveMFATicket": false,
"LoginSessionDuration": 6,
"LoginNetworkMasks": "10.0.0.0/8",
"AllowUserToChangePassword": true
},
"PublicKeyPreference": {
"AllowUserToManagePublicKeys": false
}
},
"RequestId": "A978915D-F279-4CA0-A89B-9A71219FFB3E"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|