You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: defender-for-cloud-apps/protect-salesforce.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,13 @@ Connecting Salesforce to Defender for Cloud Apps gives you improved insights int
26
26
- Ransomware
27
27
- Unmanaged bring your own device (BYOD)
28
28
29
+
30
+
### Prerequisites
31
+
32
+
- Install and authorize the Salesforce Connected App in the target Salesforce org before you start the connection process. Salesforce enforces usage restrictions on Connected Apps. For more information, see:[Prepare for Connected App Usage Restrictions Change](https://help.salesforce.com/s/articleView?id=005132365&type=1)
33
+
34
+
- Assign the **Approve Uninstalled Connected Apps** permission to the Salesforce service account used to connect Microsoft Defender for Cloud Apps. Salesforce requires this permission to connect third-party apps via OAuth.
35
+
29
36
## How Defender for Cloud Apps helps to protect your environment
30
37
31
38
-[Detect cloud threats, compromised accounts, and malicious insiders](best-practices.md#detect-cloud-threats-compromised-accounts-malicious-insiders-and-ransomware)
> Some information relates to prereleased product that may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
33
+
31
34
The `AIAgentsInfo` table in the [advanced hunting](advanced-hunting-overview.md) schema contains information about various entities—files, IP addresses, URLs, users, or devices—associated with alerts from Microsoft Defender for Endpoint, Microsoft Defender for Office 365, Microsoft Defender for Cloud Apps, and Microsoft Defender for Identity. Use this reference to construct queries that return information from this table.
32
35
33
36
This advanced hunting table is populated by records from various Microsoft Defender services. If your organization doesn't deploy the service in Microsoft Defender XDR, queries that use the table don't work or return any results. For more information about how to deploy services in Microsoft Defender XDR, see [Deploy supported services](deploy-supported-services.md).
Copy file name to clipboardExpand all lines: defender-xdr/advanced-hunting-custom-functions.md
+45-21Lines changed: 45 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,39 +36,63 @@ ms.date: 03/28/2025
36
36
> Some information relates to prereleased product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
37
37
38
38
## Types of functions
39
-
A function is a type of query in advanced hunting that can be used in other queries as if it's a command. You can create your own custom functions so you can reuse any query logic when you hunt in your environment.
39
+
A function is a type of query in advanced hunting that you can use in other queries as if it's a command. You can create your own custom functions so you can reuse any query logic when you hunt in your environment.
40
40
41
41
There are three different types of functions in advanced hunting:
-**Built-in functions** – Prebuilt functions included with Microsoft Defender XDR advanced hunting. These are available in all advanced hunting instances and can't be modified.
46
-
-**Shared functions** – Custom functions created by users, which are available for all users in a specific tenant and can be modified and controlled by users.
47
-
-**My functions** – Custom functions created by a user, which can be viewed and modified only by the user who created it.
45
+
-**Built-in functions** – Prebuilt functions included with Microsoft Defender XDR advanced hunting. These functions are available in all advanced hunting instances and can't be modified.
46
+
-**Shared functions** – Custom functions that users create. All users in a specific tenant can access these functions. Users can modify and control these functions.
47
+
-**My functions** – Custom functions that a user creates. Only the user who created these functions can view and modify them.
48
48
49
49
## Write your own custom function
50
50
51
-
To create a function from the current query in the editor, select **Save** and then **Save as function**.
51
+
To create a function from the current query in the editor:
52
52
53
-

53
+
1. Select **Save** and then **Save as function**.
54
+

54
55
55
-
Next, provide the following information:
56
+
1. In the **Save as function** flyout panel, provide the following information:
56
57
57
-
-**Name** - Name of the function. Can contain only numbers, English letters, and underscores. To avoid accidentally using Kusto keywords, begin or end function names with an underscore or begin with a capital letter.
58
-
-**Location** - The folder in which you would like to save the function, either shared or private.
59
-
-**Description** - A description that can help other users understand the purpose of the function and how it works.
60
-
-**Parameters** - Add a parameter for each variable in the function that requires a value when it's used.
61
-
Add parameters to a function so that you can provide the arguments or values for certain variables when calling the function. This allows the same function to be used in different queries, each allowing for different values for the parameters. Parameters are defined by the following properties:
58
+
-**Name** - Name of the function. Can contain only numbers, English letters, and underscores. To avoid accidentally using Kusto keywords, begin or end function names with an underscore or begin with a capital letter.
59
+
-**Location** - The folder in which you want to save the function, either shared or private.
60
+
-**Description** - A description that helps other users understand the purpose of the function and how it works.
61
+
-**Parameters** - Add a parameter for each variable in the function that requires a value when it's used. For more information, see [Add parameters to your custom function](#add-parameters-to-your-custom-function).
62
+
63
+

64
+
65
+
1. Select **Save**.
66
+
67
+
### Add parameters to your custom function
68
+
69
+
You can add parameters to a function so that you can provide the arguments or values for certain variables when calling the function. This feature allows the same function to be used in different queries, each with different values for the parameters.
70
+
71
+
To add parameters when saving your custom function, select **Add parameter**, then enter the following properties:
62
72
-**Type** - Data type for the value
63
73
-**Name** - The name that must be used in the query to replace the parameter value
64
-
-**Default value** - Value to be used for the parameter if a value isn't provided
74
+
-**Default value** - Value to use for the parameter if you don't provide a value
65
75
66
-
Parameters are listed in the order they were created, with parameters that have no default value listed above those that have a default value.
76
+
Parameters are listed in the order you create them, with parameters that have no default value listed before those that have a default value.
67
77
68
-

78
+
### Create custom functions with tabular parameters
69
79
80
+
Create custom functions that use tabular parameters. With tabular parameters, you can pass entire tables as inputs. This approach lets you build more modular, reusable, and expressive logic across your hunting queries. This capability is especially useful for complex hunting scenarios that require structured data inputs.
81
+
82
+
To create tabular parameters for your custom function:
83
+
1. Select **Add parameter** and then choose **table** as its **Type**.
84
+
1. Enter a **Name** and **Default value** for the table.
85
+
1. Map each column that your query references to the table. Select **Add column**, then enter the column's properties.
86
+
87
+

88
+
89
+
> [!NOTE]
90
+
>- You can save a function with more than one table.
91
+
>- If your query doesn't reference any columns in the table parameter, you can still save and run the function without mapping any columns.
92
+
>- You can set tabular and scalar parameters in the same function.
93
+
70
94
## Use a custom function
71
-
Use a function in a query by typing its name along with values for any parameter just as you would type in a command. The output of the function can either be returned as results or piped to another command.
95
+
Use a function in a query by typing its name along with values for any parameter, just as you would type in a command. The output of the function can either be returned as results or piped to another command.
72
96
73
97
Add a function to the current query by double-clicking on its name or selecting the three dots to the right of the function and selecting **Open in query editor**.
74
98
@@ -77,27 +101,27 @@ If a query requires arguments, provide them using the following syntax: *functio
77
101

78
102
79
103
> [!NOTE]
80
-
> Functions can't be used inside another function.
104
+
> You can't use functions inside another function.
81
105
82
106
## Work with function codes
83
-
You can view the code of a function either to gain insight into how it works or to modify its code. Select the three dots to the right of the function and select **Load function code** to open a new tab with the function code.
107
+
You can view the code of a function to understand how it works or to modify its code. Select the three dots to the right of the function and select **Load function code** to open a new tab with the function code.
84
108
85
109

86
110
87
111
## Edit a custom function
88
112
89
-
Edit the properties of a function by selecting the three dots to the right of the function and selecting **Edit details**. Make any modifications that you want to the properties and parameters of the function then select **Save**.
113
+
Edit the properties of a function by selecting the three dots to the right of the function and selecting **Edit details**. Make any modifications that you want to the properties and parameters of the function, then select **Save**.
90
114
91
115

92
116
93
-
If the function code is already loaded to the editor, you can also select **Save** to apply any changes to the code or properties of the function.
117
+
If the function code is already loaded in the editor, you can also select **Save** to apply any changes to the code or properties of the function.
94
118
95
119
> [!NOTE]
96
120
> Once a function is in use in a saved query or a detection rule, you can't edit the function to expand its scope. For example, if you saved a function that queries identity tables, and this function is used in a detection rule, you can't edit the function to include a device table after the fact. To do that, you can save a new function. Product scoping can be narrowed for the same function but not extended.
97
121
98
122
## Delete a custom function
99
123
100
-
You can delete functions from **My functions** and functions you created in **Shared functions**. You cannot delete functions that you have not created, unless you have security data manage permissions.
124
+
You can delete functions from **My functions** and functions you created in **Shared functions**. You can't delete functions that you didn't create, unless you have security data manage permissions.
101
125
102
126
To delete a function, select the three dots to the right of the function and select **Delete**.
0 commit comments