Forum Discussion
Steven_Su
May 06, 2022Copper Contributor
How to sync automation rules from Github to Sentinel
Hi, As for the analytics rule synced from Github to Sentinel, we could just simply export the rules and import it to github. However, I am not able to export the automation rules to json file and...
- May 09, 2022Have you looked at using a MS Sentinel repository to push all the rules (I am guessing you when you say repo you mean a Github repo and not MS Sentinel repository).
BTW, I wrote some PowerShell scripts to extract automation rules and a blog post about it. https://www.garybushey.com/2022/05/08/get-or-export-microsoft-sentinel-automation-rules/
GaryBushey
May 06, 2022Bronze Contributor
Steven_Su It does not look like the MS Sentinel PowerShell (https://www.powershellgallery.com/packages/Az.SecurityInsights/1.1.0) has added the functionality for automation yet so you would need to use the REST API. You can go to azure-rest-api-specs/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview at main · Azure/azure-rest-api-specs (github.com) to get the information on how to make the calls.
I would think you would need to make a call to LIST all the automation rules and then either break apart the returned JSON to save each one individually or just use it to get the individual rule's ID. Then you can make a call to GET each individual rule and save it.
Steven_Su
May 06, 2022Copper Contributor
Hi Gary,Thanks for your prompt reply.
Actually what we want to do is to use repo in github to deploy and maintain the analytic rules and automation rules attached. It is easy for analytic rules but difficult for automation rules.
We only have few playbooks like creating ticket but we will applied it to each analytics rule. So we wanna see if there is any approach to do so.
Actually what we want to do is to use repo in github to deploy and maintain the analytic rules and automation rules attached. It is easy for analytic rules but difficult for automation rules.
We only have few playbooks like creating ticket but we will applied it to each analytics rule. So we wanna see if there is any approach to do so.
- GaryBusheyMay 09, 2022Bronze ContributorHave you looked at using a MS Sentinel repository to push all the rules (I am guessing you when you say repo you mean a Github repo and not MS Sentinel repository).
BTW, I wrote some PowerShell scripts to extract automation rules and a blog post about it. https://www.garybushey.com/2022/05/08/get-or-export-microsoft-sentinel-automation-rules/- Steven_SuMay 11, 2022Copper ContributorHi Gary,
This is a helpful documents to export the config. As tested, i still need to modify the format of the output to meet the requirement of the syntax so that I could create the new automation rule with this approach.
Really thanks for your reply.- GaryBusheyMay 11, 2022Bronze ContributorI'd be interested in hearing what changes you needed to make so I can make them to the PowerShell script.