Configures security preferences for a RAM user.
Operation description
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 | Write |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
EnableSaveMFATicket | boolean | No | Specifies whether RAM users can remember the MFA devices for seven days. Valid values:
| false |
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 |
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. Unit: hours. Default value: 6. | 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). 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 |
VerificationTypes | array | No | The MFA methods. | |
string | No | The MFA method. Valid values:
| ["sms", "email"] | |
AllowUserToManagePersonalDingTalk | boolean | No | Specifies whether RAM users can manage their personal DingTalk accounts, such as binding and unbinding of the accounts. Valid values:
| true |
OperationForRiskLogin | string | No | Specifies whether to enable MFA for RAM users who initiated unusual logons. Valid values:
| autonomous |
MFAOperationForLogin | string | No | Specifies whether MFA is required for all RAM users when they log on to the Alibaba Cloud Management Console. This parameter is used to replace EnforceMFAForLogin. EnforceMFAForLogin is still valid. However, we recommend that you use MFAOperationForLogin. Valid values:
| adaptive |
For more information about common request parameters, see API Reference.
Response parameters
Examples
Sample success responses
JSON
format
{
"SecurityPreference": {
"AccessKeyPreference": {
"AllowUserToManageAccessKeys": false
},
"LoginProfilePreference": {
"EnableSaveMFATicket": false,
"LoginSessionDuration": 6,
"LoginNetworkMasks": "10.0.0.0/8",
"AllowUserToChangePassword": true,
"OperationForRiskLogin": "autonomous",
"MFAOperationForLogin": "adaptive"
},
"MFAPreference": {
"AllowUserToManageMFADevices": false
},
"VerificationPreference": {
"VerificationTypes": [
"[\"sms\", \"email\"]"
]
},
"PersonalInfoPreference": {
"AllowUserToManagePersonalDingTalk": true
}
},
"RequestId": "17494710-B4BA-4185-BBBB-C1A6ABDE1639"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
2023-03-20 | The request parameters of the API has changed. The response structure of the API has changed | see changesets | ||||||||||
| ||||||||||||
2023-01-06 | The request parameters of the API has changed. The response structure of the API has changed | see changesets | ||||||||||
| ||||||||||||
2021-08-11 | The request parameters of the API has changed. The response structure of the API has changed | see changesets | ||||||||||
| ||||||||||||
2021-08-11 | The request parameters of the API has changed. The response structure of the API has changed | see changesets | ||||||||||
|