f-bader / SentinelARConverter

Sentinel Analytics Rule converter PowerShell module
MIT License
53 stars 11 forks source link

Support for ARM templates with multiple alert rules #6

Closed f-bader closed 1 year ago

f-bader commented 1 year ago

Summary of the new feature / enhancement

Add support for ARM templates that contain more than one analytics rule. This can be done by selecting multiple ARs in Sentinel and exporting them.

The naming can be tricky and should respect the switch the user sets, but never export multiple ARs in one YAML file

Proposed technical implementation details (optional)

Detect multiple ARs in the template and call the function multiple times

Manbearpiet commented 1 year ago

I've thought about this for a moment and I've come up with a design. I assume this just pertains to Convert-SentinelARArmToYaml, meaning that we will not support integrating multiple YAML's in a single ARM file. This would be great for deployment speed, but also requires any dependencies for the ART to be present. I will not integrate this into my PR.

Some design decisions/suggestions:

The nice thing is, is that when using the $Data parameter, we could extract the displayname and id as the filename too.

Looking forward to your input or to hear if you're fine with the suggestions 😄. I think this does suggest a new major since breaking OutFile will break current functionality.

f-bader commented 1 year ago

I very much like the proposed solution.

A few ideas for conflict handling UseDisplayNameAsFilename and alertRuleTemplateName

For OutFile we should use the same logic UseOriginalFilename and use the numeric suffix.

Can't wait for version 2.0

Manbearpiet commented 1 year ago

Created #13 to fix this 😄