cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1305
Views
0
Helpful
1
Replies

Cisco Umbrella Dynamic IP Update API help required on a windows server

dejuls
Level 1
Level 1

HI all, I am struggling with a small issue.
We are running Azure Virtual Desktop POC, and we do not have a static IP assigned to the hosts. We also use Cisco Umbrella as our proxy for users, and I would like to update the network address of the Virtual Desktops in Umbrella.
Cisco suggest using either the Dynamic update tool, or an API.
We can't log in to the OpenDNS dynamic update tool as we use SAML authentication, so Cisco support have suggested using the API.

Which is all good and well - but the API is a shell command - and I'm not sure how I can run this on a windows server as scheduled task, and ideally do not want to setup the Linux subsystem in windows on the Azure Virtual Desktops.

Details of the API commands are here - https://developer.cisco.com/docs/cloud-security/#!dynamic-network-update-getting-started/response-codes
curl -i -X PUT 'https://updates.opendns.com/nic/update?hostname=<Umbrella network name>' \ -H 'Authorization: Basic %YourEncodedUsernamePassword%' \ -H 'Content-Type: application/json'

The command they have suggested in Shell is

'

1 Reply 1

You can do it with powershell...

Quick and very dirty and NOT TESTED!... You may be better served using Postman, and then let it generate the powershell for you.





$baseuri = "https://updates.opendns.com/"

$username =

$passwd =

$EncodedUsernamePassword = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($('{0}:{1}' -f $username, $passwd)))

#build headers

$Headers = @{'Authorization' = "Basic $($EncodedUsernamePassword)"; 'accept' = 'application/json'; 'Content-type' = 'application/json'; 'Accept-Encoding' = 'gzip, deflate'}

$filter = "/nic/update?hostname=<>"

$url = $baseuri + $filter

Try {

$response = Invoke-RestMethod -uri $url -Method 'PUT' -Headers $Headers

}

Catch

{

$RestError = $_.Exception

$HttpStatusCode = $RestError.Response.StatusCode.value__

$HttpStatusDescription = $RestError.Response.StatusDescription

exit

}