diff --git a/Watchlists/UpdateCloudIPs/AzureFunctionUpdateCloudIPs/UpdateCloudIPs.zip b/Watchlists/UpdateCloudIPs/AzureFunctionUpdateCloudIPs/UpdateCloudIPs.zip index 10509bf036..ea6e135c1a 100644 Binary files a/Watchlists/UpdateCloudIPs/AzureFunctionUpdateCloudIPs/UpdateCloudIPs.zip and b/Watchlists/UpdateCloudIPs/AzureFunctionUpdateCloudIPs/UpdateCloudIPs.zip differ diff --git a/Watchlists/UpdateCloudIPs/AzureFunctionUpdateCloudIPs/UpdateCloudIPs/run.ps1 b/Watchlists/UpdateCloudIPs/AzureFunctionUpdateCloudIPs/UpdateCloudIPs/run.ps1 index 44faf257ae..9d1bdc6e3c 100644 --- a/Watchlists/UpdateCloudIPs/AzureFunctionUpdateCloudIPs/UpdateCloudIPs/run.ps1 +++ b/Watchlists/UpdateCloudIPs/AzureFunctionUpdateCloudIPs/UpdateCloudIPs/run.ps1 @@ -191,6 +191,13 @@ $subscriptionId = $env:SubscriptionId $resourceGroupName = $env:ResourceGroupName $workspaceName = $env:workspaceName $resourceURI = $env:resourceURI +if (-Not [string]::IsNullOrEmpty($resourceURI)){ + if($resourceURI.Trim() -notmatch 'https:\/\/management\.azure.([a-zA-Z\.]+)$') + { + Write-Error -Message "UpdateCloudIPs: Invalid resource Uri." -ErrorAction Stop + Exit + } +} $tokenAuthURI = $env:IDENTITY_ENDPOINT + "?resource=$resourceURI&api-version=2019-08-01" $tokenResponse = Invoke-RestMethod -Method Get -Headers @{"X-IDENTITY-HEADER"="$env:IDENTITY_HEADER"} -Uri $tokenAuthURI $accessToken = $tokenResponse.access_token