All Products
Search
Document Center

Resource Access Management:GetSecurityPreference

Last Updated:Mar 11, 2024

Queries the security preferences.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
ram:GetSecurityPreferenceRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
The current API does not require request parameters

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

DC1213F1-A9D5-4A01-A996-44983689126C
SecurityPreferenceobject

The security preferences.

LoginProfilePreferenceobject

The logon preferences.

LoginSessionDurationinteger

The validity period of a logon session of a RAM user. Unit: hours.

6
EnableSaveMFATicketboolean

Indicates whether RAM users can save security codes for multi-factor authentication (MFA) during logon. Each security code is valid for seven days. Valid values:

  • true: RAM users can save MFA security codes during logon.
  • false: RAM users cannot save MFA security codes during logon.
false
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 a subnet mask is specified, RAM users can log on to the Alibaba Cloud Management Console only by using the IP addresses in the subnetwork.
  • If no subnet mask is specified, RAM users can log on to the Alibaba Cloud Management Console by using all IP addresses.

If more than one subnet mask is specified, the masks are separated with semicolons (;), for 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: RAM users can change their passwords.
  • false: RAM users cannot change their passwords.
true
AccessKeyPreferenceobject

The AccessKey pair preference.

AllowUserToManageAccessKeysboolean

Indicates whether RAM users can manage their AccessKey pairs. Valid values:

  • true: RAM users can manage their AccessKey pairs.
  • false: RAM users cannot manage their AccessKey pairs.
false
PublicKeyPreferenceobject

The public key preference.

Note The public key preference is valid only for the Japan site.
AllowUserToManagePublicKeysboolean

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

  • true: RAM users can manage their public keys.
  • false: RAM users cannot manage their public keys.
false
MFAPreferenceobject

The MFA preference.

AllowUserToManageMFADevicesboolean

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

  • true: RAM users can manage their MFA devices.
  • false: RAM users cannot manage their MFA devices.
true

Examples

Sample success responses

JSONformat

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

Error codes

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

Change history

Change timeSummary of changesOperation
No change history