Sets the global security preferences for a Resource Access Management (RAM) user.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ram:SetSecurityPreference |
update |
*All Resource
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| EnableSaveMFATicket |
boolean |
No |
Specifies whether to save the multi-factor authentication (MFA) status for seven days after a RAM user logs on using MFA. Valid values:
|
false |
| AllowUserToChangePassword |
boolean |
No |
Specifies whether RAM users can manage their own passwords. Valid values:
|
true |
| AllowUserToManageAccessKeys |
boolean |
No |
Specifies whether RAM users can manage their own AccessKey pairs. Valid values:
|
false |
| AllowUserToManageMFADevices |
boolean |
No |
Specifies whether RAM users can manage their own MFA devices. Valid values:
|
true |
| LoginSessionDuration |
integer |
No |
The duration of a logon session for a RAM user. Valid values: 1 to 24. Unit: hours. Default value: 6. |
6 |
| LoginNetworkMasks |
string |
No |
The logon mask. The logon mask determines which IP addresses are affected by console logons. This includes password-based logons and single sign-on (SSO). API calls that are initiated using AccessKey pairs are not affected.
To configure multiple logon masks, separate them with semicolons (;). For example: 192.168.0.0/16;10.0.0.0/8. You can configure up to 40 logon masks. The total length cannot exceed 512 characters. |
10.0.0.0/8 |
| VerificationTypes |
array |
No |
The methods for MFA. |
|
|
string |
No |
The MFA method. Valid values:
|
["sms", "email"] |
|
| AllowUserToManagePersonalDingTalk |
boolean |
No |
Specifies whether RAM users can attach or detach their personal DingTalk accounts. Valid values:
|
true |
OperationForRiskLogin
deprecated
|
string |
No |
This parameter is deprecated. |
autonomous |
| MFAOperationForLogin |
string |
No |
Specifies whether MFA is required for logon. This parameter replaces `EnforceMFAForLogin`. The `EnforceMFAForLogin` parameter is still valid, but using this new parameter is recommended. Valid values:
|
adaptive |
| AllowUserToLoginWithPasskey |
boolean |
No |
The maximum idle period, in days, for a RAM user's AccessKey pair. If an AccessKey pair is inactive for this period, it is automatically disabled the next day. The value can be one of the following:
|
true |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response. |
||
| SecurityPreference |
object |
The security preferences. |
|
| AccessKeyPreference |
object |
The AccessKey pair preferences. |
|
| AllowUserToManageAccessKeys |
boolean |
Indicates whether RAM users can manage their own AccessKey pairs. |
false |
| LoginProfilePreference |
object |
The logon preferences. |
|
| EnableSaveMFATicket |
boolean |
Indicates whether the MFA status is saved for seven days after a RAM user logs on using MFA. |
false |
| LoginSessionDuration |
integer |
The validity period of a logon session for a RAM user. |
6 |
| LoginNetworkMasks |
string |
The logon mask. |
10.0.0.0/8 |
| AllowUserToChangePassword |
boolean |
Indicates whether RAM users can manage their own passwords. |
true |
OperationForRiskLogin
deprecated
|
string |
This parameter is deprecated. |
autonomous |
| MFAOperationForLogin |
string |
Indicates whether MFA is required for logon. This parameter replaces `EnforceMFAForLogin`. The `EnforceMFAForLogin` parameter is still valid, but using this new parameter is recommended. |
adaptive |
| AllowUserToLoginWithPasskey |
boolean |
Indicates whether RAM users can log on directly using passkeys. |
false |
| MFAPreference |
object |
The MFA preferences. |
|
| AllowUserToManageMFADevices |
boolean |
Indicates whether RAM users can manage their own MFA devices. |
false |
| VerificationPreference |
object |
The preferences for MFA methods. |
|
| VerificationTypes |
array |
The MFA methods. |
|
|
string |
The MFA method. |
["sms", "email"] |
|
| PersonalInfoPreference |
object |
The personal information preferences. |
|
| AllowUserToManagePersonalDingTalk |
boolean |
Indicates whether RAM users can manage the attachment and detachment of their personal DingTalk accounts. |
true |
| MaxIdleDays |
object |
The configuration of the maximum idle period in days. |
|
| MaxIdleDaysForUsers |
integer |
The maximum idle period for a RAM user, in days. If a RAM user who has console logon enabled does not log on to the console for this period, their console logon is automatically disabled the next day. SSO logons are not counted. Default value: 730 days. |
730 |
| MaxIdleDaysForAccessKeys |
integer |
The maximum idle period for an AccessKey pair of a RAM user, in days. If an AccessKey pair is not used for this period, it is automatically disabled the next day. Default value: 730 days. |
730 |
| RequestId |
string |
The request ID. |
17494710-B4BA-4185-BBBB-C1A6ABDE1639 |
Examples
Success response
JSON format
{
"SecurityPreference": {
"AccessKeyPreference": {
"AllowUserToManageAccessKeys": false
},
"LoginProfilePreference": {
"EnableSaveMFATicket": false,
"LoginSessionDuration": 6,
"LoginNetworkMasks": "10.0.0.0/8",
"AllowUserToChangePassword": true,
"OperationForRiskLogin": "autonomous",
"MFAOperationForLogin": "adaptive",
"AllowUserToLoginWithPasskey": false
},
"MFAPreference": {
"AllowUserToManageMFADevices": false
},
"VerificationPreference": {
"VerificationTypes": [
"[\"sms\", \"email\"]"
]
},
"PersonalInfoPreference": {
"AllowUserToManagePersonalDingTalk": true
},
"MaxIdleDays": {
"MaxIdleDaysForUsers": 730,
"MaxIdleDaysForAccessKeys": 730
}
},
"RequestId": "17494710-B4BA-4185-BBBB-C1A6ABDE1639"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.