Forum Discussion

LBarrera1104's avatar
LBarrera1104
Copper Contributor
May 17, 2023

Create alert when a login was attempted from certain IP address (or block of addresses)

I'm trying to create an alert when there is a login attempt to certain IP, using the following MG Graph PS command:

$newAlert = Invoke-RestMethod -Uri $alertUrl -Method Post -Headers $authHeader -Body $alertBody
 
The response I got is: 
Invoke-RestMethod: {"error":{"code":"","message":"POST is not supported".... 
 
$AlertBody = { "networkConnections": [{ "destinationAddress": "30.1XX.XX.XX" }],
"title": "Login Attempt from Specific IP",
"category": "SuspiciousActivity",
"description": "Login attempt detected from IP address: 30.1XX.XX.XX",
"vendorInformation": {
"subProvider": "Sub Prov EFI",
"provider": "Prov EFI"},
"assignedTo": "me",
"cloudAppStates": [{
"servicePlanId": "00000000-0000-0000-0000-000000000000",
"appId": "00000002-0000-0ff1-ce00-000000000000"}]
}
 Assume Headers are OK (they are, verified)
Question: What caused the error?. Is that the endpoint URI is not the correct one? or is that this kind of alerts cannot be set using Graph? 
  • ShelAnder's avatar
    ShelAnder
    Copper Contributor

    The error message you received indicates that the POST method is not supported. The endpoint URI you use may be unsuitable for creating alerts in Microsoft Graph. I recommend rechecking the documentation or contacting Microsoft Graph support for guidance on the correct endpoint and method to create these alerts. They should be able to provide you with the correct solution. You can also use a VPN, connect to the Mexican server, and find out how to watch fuboTV in Mexico at https://onlinetvcast.com. Good luck, and I hope you solve this problem soon!

  • YanJagger's avatar
    YanJagger
    Copper Contributor
    I see you're working on creating an alert for login attempts from specific IP addresses using PowerShell. It sounds like an interesting project! One option is to use a reliable VPN service that offers servers in Mexico. This way, you can connect to a Mexican server and access fuboTV as if you were in Mexico. However, please make sure to respect the terms and conditions of fuboTV and any applicable licensing agreements.
    • LBarrera1104's avatar
      LBarrera1104
      Copper Contributor

      YanJagger Hello and thanks for your reply. Perhaps I missed something here, but I really don't understand the relationship between a VPN with servers in Mexico with what I'm trying to achieve.  Of course, I can use a VPN for testing purposes, but first I need to draft the logic of the process, which is the point I asked help for...

       

      Thanks anyways,

       

      LB

Resources