Azure-Sentinel/Playbooks/Restrict-MDEIPAddress
Lior Tamir aad48299ca Update playbook trigger names 2022-02-22 17:02:56 +02:00
..
alert-trigger Update playbook trigger names 2022-02-22 17:02:56 +02:00
incident-trigger Update playbook trigger names 2022-02-22 17:02:56 +02:00
readme.md Update readme.md 2022-02-08 15:14:41 +05:30

readme.md

Restrict-MDEIpAddress

author: Nicholas DiCola

This playbook will take IP entities and generate alert and block threat indicators for each IP in MDE for 90 days.

Quick Deployment

Deploy with incident trigger (recommended)

After deployment, attach this playbook to an automation rule so it runs when the incident is created.

Learn more about automation rules

Deploy to Azure Deploy to Azure Gov

Deploy with alert trigger

After deployment, you can run this playbook manually on an alert or attach it to an analytics rule so it will rune when an alert is created.

Deploy to Azure Deploy to Azure Gov

Prerequisites

  • For Gov Only You will need to update the HTTP action URL to the correct URL documented here
  • You will need to grant Ti.ReadWrite permissions and assign Microsoft Seninel Reader to the resource group for the managed identity. Run the following code replacing the managed identity object id, subscrptiptionid and resource group. You find the managed identity object id on the Identity blade under Settings for the Logic App.

$MIGuid = "<Enter your managed identity guid here>"
$SubscriptionId = "<Enter your subsciption id here>"
$ResourceGroup = "<Enter your resource group here>"
$MI = Get-AzureADServicePrincipal -ObjectId $MIGuid

$MDEAppId = "fc780465-2017-40d4-a0c5-307022471b92"
$PermissionName = "Ti.ReadWrite" 
$RoleName = "Microsoft Sentinel Responder"

$MDEServicePrincipal = Get-AzureADServicePrincipal -Filter "appId eq '$MDEAppId'"
$AppRole = $MDEServicePrincipal.AppRoles | Where-Object {$_.Value -eq $PermissionName -and $_.AllowedMemberTypes -contains "Application"}
New-AzureAdServiceAppRoleAssignment -ObjectId $MI.ObjectId -PrincipalId $MI.ObjectId `
-ResourceId $MDEServicePrincipal.ObjectId -Id $AppRole.Id

New-AzRoleAssignment -ObjectId $MIGuid -RoleDefinitionName $RoleName -Scope /subscriptions/$SubscriptionId/resourcegroups/$ResourceGroup

Screenshots

Incident Trigger
Incident Trigger
Alert Trigger
Alert Trigger