Newer Version Available
TransactionSecurityPolicy
Represents a transaction security policy definition. This type extends the Metadata metadata type and inherits its fullName field.
File Suffix and Directory Location
TransactionSecurityPolicy components have the suffix .transactionSecurityPolicy and are stored in the transactionSecurityPolicies folder.
Version
TransactionSecurityPolicy components are available in API version 35.0 and later.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| action | TransactionSecurityAction | Required. Describes the action to take when the matching Transaction Security policy is triggered. |
| active | boolean | Required. If true, the policy is enabled and is actively monitoring its event. |
| apexClass | string | Required. The name of the class that implements the TxnSecurity.PolicyCondition interface for this policy. |
| eventType | MonitoredEvents (enumeration of type string) | Indicates which type of event is being monitored. Valid values are:
|
| executionUser | string | Required. The name of the user to notify when the policy is triggered, if any notifications have been selected. This user must have the System Administrator profile. |
| resourceName | string | Required. A resource used to narrow down the conditions under which the policy
triggers. For example, with a Login event, you can add a
resource to specify that only a specific login URL triggers the policy. The
resources available depend on the Event
Type field. Valid resources are grouped below by event type.
|
TransactionSecurityAction
Describes the action to take when the matching Transaction Security policy is triggered.
| Field Name | Field Type | Description |
|---|---|---|
| block | boolean | Required. If true, the requested operation is blocked. This action only applies to Login and AccessResource events. |
| endSession | boolean | Required. If true, a current session must be closed before a new session can be started. This action only applies to Login events. |
| notifications | TransactionSecurityNotification[] | Specifies how to notify the ystem administrator when the action is triggered. There can be none, one, or multiple notifications. |
| twoFactorAuthentication | boolean | Required. If true, two-factor authentication is required for a higher level of access before the requested operation can continue. This action only applies to Login and AccessResource events. |
TransactionSecurityNotification
Describes who to notify and how to notify them when the matching Transaction Security policy is triggered.
| Field Name | Field Type | Description |
|---|---|---|
| inApp | boolean | True if an in-app notification is selected. |
| sendEmail | boolean | True if an email notification is selected. |
| user | string | The administrator to receive the notification. This user must belong to the System Administrator profile. |
Declarative Metadata Sample Definition
The following is an example of a TransactionSecurityPolicy component.
1<?xml version="1.0" encoding="UTF-8"?>
2<TransactionSecurityPolicy xmlns="http://soap.sforce.com/2006/04/metadata">
3 <action>
4 <block>true</block>
5 <endSession>false</endSession>
6 <notifications>
7 <inApp>false</inApp>
8 <sendEmail>true</sendEmail>
9 <user>admin@your.org</user>
10 </notifications>
11 <twoFactorAuthentication>false</twoFactorAuthentication>
12 </action>
13 <active>true</active>
14 <apexClass>TxnSecurityMdApiPolicy</apexClass>
15 <eventType>Login</eventType>
16 <executionUser>admin@your.org</executionUser>
17 <resourceName>LoginHistory</resourceName>
18</TransactionSecurityPolicy>The following is an example package manifest used to deploy or retrieve the transaction security metadata for an organization.
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>MySecurityPolicy</members>
5 <name>TransactionSecurityPolicy</name>
6 </types>
7 <version>35.0</version>
8</Package>