All Products
Search
Document Center

Resource Access Management:GetSecurityPreference

Last Updated:May 26, 2025

Queries the security preferences.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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.
OperationAccess levelResource typeCondition keyAssociated operation
ram:GetSecurityPreferenceget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
The current API does not require request parameters

Response parameters

ParameterTypeDescriptionExample
object
SecurityPreferenceobject

The security preferences.

AccessKeyPreferenceobject

The AccessKey pair preference.

AllowUserToManageAccessKeysboolean

Indicates whether Resource Access Management (RAM) users can manage their AccessKey pairs. Valid values:

  • true
  • false
false
MFAPreferenceobject

The multi-factor authentication (MFA) preference.

AllowUserToManageMFADevicesboolean

Indicates whether RAM users can manage their MFA devices. Valid values:

  • true
  • false
true
LoginProfilePreferenceobject

The logon preference.

EnableSaveMFATicketboolean

Indicates whether RAM users can save security codes for MFA during logon. Each security code is valid for seven days. Valid values:

  • true
  • false
false
LoginSessionDurationinteger

The validity period of the logon session of RAM users. Unit: hours.

6
LoginNetworkMasksstring

The subnet mask that indicates the IP addresses from which logon to the Alibaba Cloud Management Console is allowed. This parameter applies to password-based logon and single sign-on (SSO). However, this parameter does not apply to API calls that are authenticated based on AccessKey pairs.

  • If you specify a subnet mask, RAM users can use only the IP addresses in the subnet mask to log on to the Alibaba Cloud Management Console.
  • If you do not specify a subnet mask, RAM users can use all IP addresses to log on to the Alibaba Cloud Management Console.

If you want to specify more than one subnet mask, separate the masks with semicolons (;). Example: 192.168.0.0/16;10.0.0.0/8.

10.0.0.0/8
AllowUserToChangePasswordboolean

Indicates whether RAM users can change their passwords. Valid values:

  • true
  • false
true
PublicKeyPreferenceobject

The public key preference.

Note This parameter is valid only for the Japan site.
AllowUserToManagePublicKeysboolean

Indicates whether RAM users can manage their public keys. Valid values:

  • true
  • false
false
RequestIdstring

The request ID.

DC1213F1-A9D5-4A01-A996-44983689126C

Examples

Sample success responses

JSONformat

{
  "SecurityPreference": {
    "AccessKeyPreference": {
      "AllowUserToManageAccessKeys": false
    },
    "MFAPreference": {
      "AllowUserToManageMFADevices": true
    },
    "LoginProfilePreference": {
      "EnableSaveMFATicket": false,
      "LoginSessionDuration": 6,
      "LoginNetworkMasks": "10.0.0.0/8",
      "AllowUserToChangePassword": true
    },
    "PublicKeyPreference": {
      "AllowUserToManagePublicKeys": false
    }
  },
  "RequestId": "DC1213F1-A9D5-4A01-A996-44983689126C"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history