-
Notifications
You must be signed in to change notification settings - Fork 18
* Regions PoC #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
It may therefore be more beneficial to provide the localisation as an addition option parameter on calls like Get-MDATPDevice -DeviceName "SomeComputer" -Region "UK" and then in the script do the below after building DeviceUri
Note: Had to put "/api.sec" otherwise just "/api." would replace "/api/" for some unknown reason to me. You'll also need somewhere to globally manage the accepted Regions to simplify the addition or removal later on. |
This reverts commit c82ba7e.
resource = "https://api.securitycenter.windows.com" | ||
resource = $Uri |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing this to regional affects the OAUTH process resulting in a failure message although the script does continue
Invoke-RestMethod : {"error":"invalid_resource","error_description":"AADSTS500011: The resource principal named
https://api-uk.securitycenter.windows.com was not found in the tenant
@bozhinov You could leave the $DeviceUri to look at the config file but the OAUTH needs to stay as /api. |
But it was not the point to just auth to the regional server but to do the "heavy" op on it. I just wanted to say Hi to @alexverboon. Thought this FR was a no brainer. I was mistaken :) |
You need to auth to the non regional server and then you can do the workload on the regional one Like this:
See how the API connection remains on the original URL however the workload request URL (in this case MDATP_API_URI) use the config file URL |
Come to think about it this may be worth highlighting to MS as they should have probably allowed these new regional URL's to do the authentication as well and not just the workload. |
I've raised this with Microsoft support ;) |
10 years ago I would have told you you were a mad person (gigle) |
Hey. Long time no talk :)
according to MS:
https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-list
"For better performance, you can use server closer to your geo location:"
so lets add support to this in cfg