|
| 1 | +# Entity Analyzer - HTTP Trigger Playbook |
| 2 | + |
| 3 | +Activating the 'Deploy' button initiates the deployment of an Azure Logic App integrated with Microsoft Sentinel MCP Actions, utilizing an HTTP request trigger. |
| 4 | +The Logic App is configured to run when an HTTP POST request is received with entity information. This Logic App automatically analyzes URL and User entities and provides detailed security insights including classification, analysis results, and recommendations for each entity type. |
| 5 | + |
| 6 | +The playbook automatically triggers when: |
| 7 | +- An HTTP POST request is received with entity information |
| 8 | +- External systems need to analyze URLs or User accounts |
| 9 | +- Integration with custom applications or workflows is required |
| 10 | +- On-demand entity analysis is needed via API calls |
| 11 | + |
| 12 | +After the analysis is complete, the MCP Entity Analyzer conducts a comprehensive investigation of the entity and returns results asynchronously: |
| 13 | +- **Initial Response (202 Accepted)**: Immediate acknowledgment with runId for tracking |
| 14 | +- **Background Processing**: Analysis continues without timeout constraints |
| 15 | +- **URL Analysis**: Security classification, threat intelligence, and URL reputation analysis |
| 16 | +- **User Analysis**: Behavioral analysis, risk assessment, and user activity patterns |
| 17 | +- **Classification**: Security classification for each entity |
| 18 | +- **Analysis Results**: Detailed security analysis findings |
| 19 | +- **Recommendations**: Security recommendations based on the analysis |
| 20 | +- **Disclaimer**: AI-generated analysis disclaimer |
| 21 | + |
| 22 | +### Prerequisites |
| 23 | + |
| 24 | +Prior to beginning the installation process, it's crucial to confirm that you have met the following prerequisites: |
| 25 | +- The user deploying this Logic App needs to have a **Contributor Role** |
| 26 | +- The user has permissions to access **Microsoft Sentinel** workspace |
| 27 | +- **Microsoft Sentinel data connector lake must be enabled** in your workspace for entity data collection |
| 28 | +- The **SentinelMCP connector** is available in your environment |
| 29 | +- You need to provide a valid **Sentinel workspace ID** during deployment |
| 30 | +- Authentication support for the Entity Analyzer connection includes: |
| 31 | + - **Entra ID Authentication** (OAuth) |
| 32 | + - **Service Principal** (Application ID and Secret) |
| 33 | + - **Managed Identity** (System-assigned or User-assigned) |
| 34 | + |
| 35 | +### Deployment Files |
| 36 | + |
| 37 | +This playbook includes two deployment files: |
| 38 | + |
| 39 | +#### 1. azuredeploy.json |
| 40 | +The main ARM template file that defines the Azure resources to be deployed: |
| 41 | +- **Logic App Workflow**: The main playbook with HTTP trigger and conditional logic |
| 42 | +- **API Connection**: SentinelMCP connection for Microsoft Sentinel MCP integration |
| 43 | +- **Workflow Definition**: Complete Logic App structure with triggers, actions, and conditions |
| 44 | + |
| 45 | +#### 2. azuredeploy.parameters.json |
| 46 | +The parameters file that contains the configuration values for deployment. This file should be customized before deployment: |
| 47 | + |
| 48 | +**Parameters explained:** |
| 49 | +- **PlaybookName**: |
| 50 | + - **Description**: The name that will be assigned to your Logic App in Azure |
| 51 | + - **Default Value**: "Http-Trigger-Entity-Analyzer" |
| 52 | + - **Type**: String |
| 53 | + - **Usage**: This name will appear in your Azure Portal and be used to identify the Logic App |
| 54 | + |
| 55 | +- **workspaceId**: |
| 56 | + - **Description**: Your Microsoft Sentinel workspace ID (Log Analytics Workspace ID) |
| 57 | + - **Default Value**: `<Your-Sentinel-Workspace-ID>` (must be replaced) |
| 58 | + - **Type**: String |
| 59 | + - **Required**: Yes |
| 60 | + - **Usage**: Used to query Sentinel data for entity analysis |
| 61 | + - **How to find**: Azure Portal → Microsoft Sentinel → Settings → Workspace settings → Copy the Workspace ID |
| 62 | + |
| 63 | +- **lookBackDays**: |
| 64 | + - **Description**: The number of days to look back when analyzing entity data |
| 65 | + - **Default Value**: 40 |
| 66 | + - **Type**: Integer |
| 67 | + - **Usage**: Determines the time range for historical data analysis (e.g., user sign-in logs, URL access patterns) |
| 68 | + - **Recommendation**: 30-90 days for comprehensive analysis, adjust based on your data retention policy |
| 69 | + |
| 70 | +### Parameters |
| 71 | + |
| 72 | +During deployment, you'll need to provide: |
| 73 | +- **PlaybookName**: Name for the Logic App (default: "Http-Trigger-Entity-Analyzer") |
| 74 | +- **workspaceId**: Your Azure Sentinel workspace ID (required) |
| 75 | +- **lookBackDays**: Number of days to look back for entity analysis (default: 40 days) |
| 76 | + |
| 77 | +### Deployment |
| 78 | + |
| 79 | +**Option 1: Deploy via Azure Portal (Recommended)** |
| 80 | + |
| 81 | +To deploy the Entity Analyzer HTTP Trigger Logic App using the Deploy to Azure button: |
| 82 | +1. Press on the Deploy button below |
| 83 | +2. Select your subscription and resource group (use the same tenant where Microsoft Sentinel is configured) |
| 84 | +3. Provide your Sentinel workspace ID |
| 85 | +4. Configure the lookBackDays parameter if needed (default is 40 days) |
| 86 | + |
| 87 | + |
| 88 | +[](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2FAzure-Sentinel%2Fmaster%2FSolutions%2FSentinelSOARessentials%2FPlaybooks%2FHttp-Trigger-Entity-Analyzer%2Fazuredeploy.json) |
| 89 | +[](https://portal.azure.us/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2FAzure-Sentinel%2Fmaster%2FSolutions%2FSentinelSOARessentials%2FPlaybooks%2FHttp-Trigger-Entity-Analyzer%2Fazuredeploy.json) |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +**Option 2: Deploy via PowerShell** |
| 94 | + |
| 95 | +1. Update the `azuredeploy.parameters.json` file with your values: |
| 96 | + - Replace `<Your-Sentinel-Workspace-ID>` with your actual Workspace ID |
| 97 | + - Adjust `PlaybookName` if you want a different name |
| 98 | + - Modify `lookBackDays` if needed |
| 99 | + |
| 100 | +2. Run the following PowerShell commands: |
| 101 | + |
| 102 | +```powershell |
| 103 | +# Connect to Azure |
| 104 | +Connect-AzAccount |
| 105 | +
|
| 106 | +# Set your variables |
| 107 | +$resourceGroupName = "your-resource-group-name" |
| 108 | +$location = "westus2" # or your preferred location |
| 109 | +
|
| 110 | +# Deploy the template |
| 111 | +New-AzResourceGroupDeployment ` |
| 112 | + -ResourceGroupName $resourceGroupName ` |
| 113 | + -TemplateFile ".\azuredeploy.json" ` |
| 114 | + -TemplateParameterFile ".\azuredeploy.parameters.json" ` |
| 115 | + -Verbose |
| 116 | +``` |
| 117 | + |
| 118 | +**Option 3: Deploy via Azure CLI** |
| 119 | + |
| 120 | +1. Update the `azuredeploy.parameters.json` file with your values |
| 121 | + |
| 122 | +2. Run the following commands: |
| 123 | + |
| 124 | +```bash |
| 125 | +# Login to Azure |
| 126 | +az login |
| 127 | + |
| 128 | +# Deploy the template |
| 129 | +az deployment group create \ |
| 130 | + --resource-group your-resource-group-name \ |
| 131 | + --template-file azuredeploy.json \ |
| 132 | + --parameters azuredeploy.parameters.json |
| 133 | +``` |
| 134 | + |
| 135 | +### Post Deployment |
| 136 | + |
| 137 | +After successful deployment: |
| 138 | +- The Logic App will be automatically enabled and ready to use |
| 139 | +- **Authenticate the connections**: Go to the Logic App → API connections and authenticate: |
| 140 | + - **SentinelMCP connection**: Authenticate with Microsoft Sentinel MCP permissions |
| 141 | + - **Entity Analyzer connection**: Choose one of the supported authentication methods: |
| 142 | + - **Entra ID Auth**: Sign in with your Entra ID credentials |
| 143 | + - **Service Principal**: Provide Application (Client) ID and Secret |
| 144 | + - **Managed Identity**: Configure system-assigned or user-assigned managed identity |
| 145 | +- **Get the HTTP endpoint URL**: |
| 146 | + 1. Open the Logic App in Azure Portal |
| 147 | + 2. Go to "Logic app designer" |
| 148 | + 3. Click on the HTTP trigger |
| 149 | + 4. Copy the "HTTP POST URL" - this is your API endpoint |
| 150 | +- The playbook will trigger when POST requests are sent to the HTTP endpoint |
| 151 | +- **View the endpoint in deployment output**: The Logic App callback URL is available in the deployment outputs |
| 152 | + |
| 153 | +### How It Works |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | +1. **Trigger**: The Logic App triggers when an HTTP POST request is received |
| 158 | +2. **Immediate Response**: Returns a 202 Accepted response with a runId for tracking |
| 159 | +3. **Asynchronous Processing**: |
| 160 | + - Analysis continues in the background without timeout constraints |
| 161 | + - **Condition**: Checks the entity type from the request |
| 162 | + - **User Analysis** (True branch): If Type is "User", analyzes user behavior and risk |
| 163 | + - **URL Analysis** (False branch): If Type is not "User", analyzes URL security and reputation |
| 164 | +4. **Result Retrieval**: Check results via Azure Portal run history using the runId |
| 165 | + |
| 166 | +### API Request Format |
| 167 | + |
| 168 | +Send a POST request to your Logic App endpoint with the following JSON body: |
| 169 | + |
| 170 | +**For User Analysis:** |
| 171 | +```json |
| 172 | +{ |
| 173 | + "Type": "User", |
| 174 | + "Value": "Your User Object Id" |
| 175 | +} |
| 176 | +``` |
| 177 | + |
| 178 | +**For URL Analysis:** |
| 179 | +```json |
| 180 | +{ |
| 181 | + "Type": "Url", |
| 182 | + "Value": "https://example.com" |
| 183 | +} |
| 184 | +``` |
| 185 | + |
| 186 | +### API Response |
| 187 | + |
| 188 | +**Immediate Response (202 Accepted):** |
| 189 | +```json |
| 190 | +{ |
| 191 | + "status": "Accepted", |
| 192 | + "message": "Entity analysis started. Processing in background.", |
| 193 | + "runId": "08584416635090057123230409437CU07", |
| 194 | + "entityType": "User", |
| 195 | + "entityValue": "59d9ec06-a7e9-49fa-aba4-f94adee23cab" |
| 196 | +} |
| 197 | +``` |
| 198 | + |
| 199 | +**Response Headers:** |
| 200 | +- `Status Code`: 202 Accepted |
| 201 | +- `Retry-After`: 10 seconds |
| 202 | + |
| 203 | +### Retrieving Results |
| 204 | + |
| 205 | +To view the analysis results after receiving the 202 response: |
| 206 | + |
| 207 | +**Option 1: Azure Portal (Recommended)** |
| 208 | +1. Go to your Logic App in Azure Portal |
| 209 | +2. Click **"Run history"** in the left menu |
| 210 | +3. Find the run using the `runId` from the response |
| 211 | +4. View the action outputs to see the full analysis results |
| 212 | + |
| 213 | +**Option 2: Azure Management API** |
| 214 | +```powershell |
| 215 | +az rest --method get --url "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runId}?api-version=2016-06-01" |
| 216 | +``` |
| 217 | + |
| 218 | +### Sample Analysis Output |
| 219 | + |
| 220 | +**URL Analysis:** |
| 221 | +```json |
| 222 | +{ |
| 223 | + "id": "analysis-id", |
| 224 | + "status": "Completed", |
| 225 | + "classification": "Malicious", |
| 226 | + "analysis": "The URL exhibits characteristics of a phishing site...", |
| 227 | + "recommendation": "Block this URL and investigate affected users...", |
| 228 | + "disclaimer": "This is an AI-generated analysis...", |
| 229 | + "dataSourceList": ["Threat Intelligence", "URL Reputation"], |
| 230 | + "properties": { |
| 231 | + "entityType": "Url" |
| 232 | + } |
| 233 | +} |
| 234 | +``` |
| 235 | + |
| 236 | +**User Analysis:** |
| 237 | +```json |
| 238 | +{ |
| 239 | + "id": "analysis-id", |
| 240 | + "status": "Completed", |
| 241 | + "classification": "High Risk", |
| 242 | + "analysis": "User shows abnormal login patterns...", |
| 243 | + "recommendation": "Investigate recent user activities and consider MFA enforcement...", |
| 244 | + "disclaimer": "This is an AI-generated analysis...", |
| 245 | + "dataSourceList": ["Sign-in Logs", "Audit Logs"], |
| 246 | + "properties": { |
| 247 | + "entityType": "User" |
| 248 | + } |
| 249 | +} |
| 250 | +``` |
| 251 | + |
| 252 | +### Use Cases |
| 253 | + |
| 254 | +This playbook is ideal for: |
| 255 | +- **API Integration**: Integrate entity analysis into custom applications and workflows |
| 256 | +- **SOAR Platforms**: Connect with third-party SOAR solutions |
| 257 | +- **Automated Scanning**: Batch analysis of URLs from threat feeds |
| 258 | +- **User Risk Assessment**: On-demand user behavior analysis |
| 259 | +- **External Tools Integration**: Connect with ticketing systems, chatbots, or custom dashboards |
| 260 | +- **Webhook Receivers**: Process entities from external security tools |
| 261 | + |
| 262 | + |
| 263 | +### Performance Notes |
| 264 | + |
| 265 | +- The playbook returns immediately (202 Accepted) to avoid timeout issues |
| 266 | +- Analysis processing time depends on the lookBackDays parameter and data volume |
| 267 | +- Typical analysis completion: 2-5 minutes for comprehensive analysis |
| 268 | +- Use the runId to track analysis progress in Azure Portal |
| 269 | + |
| 270 | + |
| 271 | +### Security Considerations |
| 272 | + |
| 273 | +- **Endpoint Security**: The HTTP trigger URL contains a SAS token for authentication |
| 274 | +- **Keep the URL secure**: Treat it like an API key - don't expose it publicly |
| 275 | +- **Regenerate if compromised**: You can regenerate the trigger URL in the Logic App designer |
| 276 | +- **Network restrictions**: Consider using Azure networking features to restrict access |
| 277 | +- **Input validation**: The Logic App validates the request schema automatically |
0 commit comments