MobileSecurityPolicy

Represents a mobile app security policy on the Salesforce mobile app with Enhanced Mobile App Security enabled. For a full description of each policy, see Enable and Configure Mobile App Security Policies.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

MobileSecurityPolicy components have the suffix .mobileSecurityPolicy and are stored in the mobileSecurityPolicies folder.

Version 

Introduced in API version 53.0.

Special Access Rules 

The Enhanced Mobile App Security add-on subscription and the Enforce Enhanced Mobile App Security user permission are required to use this metadata type.

Fields 

effectiveDate 

  • Type: dateTime
  • Required: No
  • Description: The date that a mobile security policy is enforced.

isEnabled 

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether the mobile security policy is enabled. The default value is false, which means that the policy is disabled.

isProtected 

  • Type: boolean
  • Required: No
  • Description: An auto-generated value that doesn’t impact the behavior of the metadata type. The default value is false.

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Required. ​​A user-friendly name for MobileSecurityPolicy, which is defined when the MobileSecurityPolicy component is created.

mobilePlatform 

  • Type: MobileSecurityMobilePlatform (enumeration of type string)

  • Required: No

  • Description: The mobile operating system of the mobile security policy.

    Values are:

  • Possible values:

    • Android
    • iOS

mobileSecurityAssignment 

  • Type: string
  • Required: No
  • Description: The name of the mobile security assignment associated with the mobile security policy. See MobileSecurityAssignment.

ruleValue 

  • Type: string
  • Required: Yes
  • Description: Required. The value of the mobile security policy rule.

ruleValueType 

  • Type: MobileSecurityPolicyRuleValueType (enumeration of type string)

  • Required: Yes

  • Description: Required. The type of mobile security policy rule.

    Values are:

  • Possible values:

    • Boolean
    • Text
    • TextList

severityLevel 

  • Type: MobileSecurityPolicySeverityLevel (enumeration of type string)

  • Required: Yes

  • Description: Required. The severity level of a mobile security policy.

    Values are:

  • Possible values:

    • Critical — Wipes app data and logs user out
    • Error — Blocks access to the app until the issue is resolved, but doesn’t log user out
    • Info — Blocks prohibited action or logs user action and informs user
    • Warn — Notifies the user of the violation and recommends how to resolve, but user is able to continue using the app

type 

  • Type: MobileSecurityPolicyType (enumeration of type string)

  • Required: Yes

  • Description: Required. The type of mobile security policy.

    Values are:

  • Possible values:

    • AllowedDeviceList
    • Block3dTouch
    • BlockCalendar
    • BlockCamera
    • BlockContacts
    • BlockCustomKeyboard
    • BlockFileBackup
    • BlockMicrophone
    • BlockOsSharing
    • BlockedDeviceList
    • BrowserUriScheme
    • CheckBiometric
    • DevicePasscode
    • DisableUrlCaching
    • JailbrokenDevice
    • LogCertPin
    • LogEmail
    • LogPhonecall
    • LogPolicyResult
    • LogScreenshot
    • LogTextmessage
    • LogoutAfterRestart
    • LogoutOnBiometricChange
    • MalwareDetection
    • ManInMiddle
    • MaxOffline
    • MaximumAppVersion
    • MaximumOsVersion
    • MinimumAppVersion
    • MinimumOsVersion
    • MinimumSecurityPatchVersion
    • MininumAppVersion
    • PhonecallUriScheme
    • Screenshot

Declarative Metadata Sample Definition 

The following is an example of a MobileSecurityPolicy component.

1<?xml version="1.0" encoding="UTF-8"?>
2<MobileSecurityPolicy xmlns="http://soap.sforce.com/2006/04/metadata">
3    <effectiveDate>2022-08-09T22:04:56.000Z</effectiveDate>
4    <isEnabled>true</isEnabled>
5    <isProtected>false</isProtected>
6    <masterLabel>MyMobileSecurityPolicy</masterLabel>
7    <mobileSecurityAssignment>MyMobileSecurityAssignment</mobileSecurityAssignment>
8    <ruleValue>true</ruleValue>
9    <ruleValueType>Boolean</ruleValueType>
10    <severityLevel>info</severityLevel>
11    <type>BlockCalendar</type>
12    <mobilePlatform>Android</mobilePlatform>
13</MobileSecurityPolicy>

The following is an example package.xml that references the previous definition.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>*</members>
5        <name>MobileSecurityPolicy</name>
6    </types>
7    <version>61.0</version>
8</Package>

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.