briandelmsft / SentinelAutomationModules

The Microsoft Sentinel Triage AssistanT (STAT) enables easy to create incident triage automation in Microsoft Sentinel
MIT License
212 stars 58 forks source link

[BUG] DeployPermissions.ps1 #445

Closed briandelmsft closed 3 months ago

briandelmsft commented 4 months ago

There may be an issue with the newest versions of the PowerShell modules no longer working with the builtin PowerShell, now seem to only work with 7.

image
piaudonn commented 4 months ago

I had a similar issue recently, and the customer had to update PowerShell to fix the problem. I am not sure how we can address it in the script else than removing the dependency to the modules or requiring a version of PowerShell. I was working on having a Graph API documented way to add permissions. Maybe a Postman package, or a raw level PowerShell workaround if we can't update PowerShell. For SP, we can add a manual way to do it in the GUI. But for not for MI.

briandelmsft commented 4 months ago

@piaudonn what do you think about refining this to run from cloud shell? Maybe the run a command in cloud shell to download and execute the script and it prompts for the tenantid, RG, etc. then we document cloud shell as being the preferred way, though it should still work locally. At least this way we have a consistent platform to run it from.

piaudonn commented 4 months ago

I gave it a first shot: 🔗 https://github.com/briandelmsft/SentinelAutomationModules/blob/445-bug-deploypermissionsps1/Deploy/GrantPermissions.ps1