How to Secure Azure Traffic Routing Deployments?

How to Secure Azure Traffic Routing Deployments?

In February someone took over a number of CDC US subdomains and filled them with pornographic video links. Infoblox believe they got in via a dangling DNS record (one that was still pointing at an Azure resource that the CDC had effectively abandoned). Azure Traffic Manager uses DNS as a means of routing traffic so that particular scenario is a good one to look at when it comes to securing your traffic routing in Azure, prior to looking at the changes people make and the network paths underneath.

How Dangling DNS Records Get Grabbed

Threat actors are still going to be able to hijack domains due to poor DNS record maintenance and admin misconfigurations. That’s a gap that security leads need to close if they don’t want to end up with financial or reputational damage.

One of the more recent examples is from Infoblox in a report on a threat actor they refer to as Hazy Hawk. Hazy Hawk took over subdomains of the US CDC in February and used those to host dozens of URLs that directed people to porn. The actor has been identifying gaps in DNS records since at least December 2023 and their victims have included a number of major universities and international companies. The domains they’ve hijacked are hosting a huge number of URLs which are then distributed through various traffic distribution systems to sites hosting scams and malware. Push notifications are then used to try and get employees to click on a link to ‘update’ their antivirus, turn on their firewall or call Microsoft support and of course the links either download malware or take you to a site which then asks for payment.

In the CDC case Infoblox believe the agency had effectively given up an Azure hosted website/content bucket that it was using and hadn’t told the person who was managing its DNS. That allowed the attacker to find what experts call a “dangling” DNS record for the site.

The issue is the rather convoluted way that DNS records resolve to an IP address. You’ve got an A record which maps a site name to one or more IP addresses and you’ve got a CNAME record which maps a name to another name. Companies use it when for example a company that starts out as firm.com also wants firmus.com, or when firm.com buys another company and wants that anyone who types the name of the acquired company into a browser to be taken to firm.com. The problem is if the website team drop the CNAME record for that subdomain and don’t let the DNS team know then a threat actor can just come along and register it. Finding a dangling CNAME record does require a bit of skill (Hazy Hawk appears to have it) and Infoblox believe that attackers will go to a lot of manual effort to do this as each cloud provider has their own way of dealing with dropped resources.

Domain hijacking is pretty easy to do, says Robert Beggs of Canadian incident response provider DigitalDefence. The domain owner rarely even notices until it’s too late. It’s possible because the responsibility for managing a domain is split between the business, the registrar, the DNS provider and the web host. The scale of the Hazy Hawk campaign went completely unnoticed which is a strong indicator that traditional detection methods aren’t keeping up.

Renée Burton (Infoblox VP of Threat Intelligence) says the dangling CNAME problem is “getting bigger and bigger”. It’s a pain for the security vendors as once the attacker has the dangling record, every link in the DNS chain looks legitimate. She does expect the security market and the cloud providers to come up with some solutions at some point and does point out that Azure has already got some protections in place against this type of hijack. Ultimately though, she says it comes down to the enterprise getting their records and services in order.

Infoblox’s report does offer some practical advice on the DNS side:

  • a process that sends a notification to remove a CNAME record any time a resource is shut down;
  • tracking of the resources that are actually active;
  • A bit of a closer look at the DNS records post-M&A when your IT and your DNS people may not actually know what the assets are.

Beggs says the attack has been around since at least 2016 and that domains are still pretty much managed as either live or expired (that’s a very basic level of control, which is pretty poorly implemented). What he wants is new tools which provide stronger authentication, the ability to do long term management and alerts when domain records do change.

Access and Change Control Come First

The people who can actually change things are important too and of course the testing of those changes is vital as Microsoft demonstrated with two Azure wobbles in two days at the beginning of February.

The first one was due to a config change which inadvertently removed public access to the Microsoft managed storage accounts that hold the VM extension package. That broke the normal operation of VMS and the services built on top of them (from AKS and Azure Firewall right through to GitHub Actions).

The second wobble hit Managed Identity for Azure resources in both East US and West US. It lasted almost 6 hours (00:15 UTC to 06:05 UTC) and was observed when users attempted to create, update, delete or acquire tokens. Managed Identity is there to remove the need for developers to manage credentials (i.e. secrets and certs) manually as that’s a big contributor to security issues and outages. It impacted a number of services that use it including Azure Databricks, Azure Kubernetes Service, Azure Container Apps and Azure Database for PostgreSQL Flexible Servers. So quite a few.

Microsoft’s own security guidance for Traffic Manager begins with the same premise. The people who are managing the profiles and endpoints should be assigned the Traffic Manager Contributor role and those who just need to view should be given Reader access so that a compromised monitoring account can’t go and change the routing. Production profiles should also have a CanNotDelete lock on them as deleting a Traffic Manager profile effectively stops DNS based routing for all the endpoints behind it at once and that can take the whole service down.

Health Checks Need an Open Path

Microsoft are telling Traffic Manager customers to run their health probes over HTTPS when the endpoint is a web endpoint. If you block those probes then Traffic Manager will effectively deem perfectly healthy endpoints as unhealthy and will therefore route traffic away from them.

For Azure hosted endpoints Network Security Groups or Azure Firewall rules will need to allow the probes in via the AzureTrafficManager service tag. For endpoints outside of Azure the published probe IP ranges will need to be on the firewall’s allow list. Endpoints that require their own probe paths, intervals and failure thresholds can be placed into nested profiles as a single profile will apply one set of monitoring settings to all of the endpoints within it.

Watching the Probes and Testing Failover

Early problem detection is all about logs and alerts. Microsoft recommend that you send the probe health results for each profile to a Log Analytics workspace, storage account or event hub so that you can go back and look at past outages. You should also set up an Azure Monitor alert on the Endpoint Status by Endpoint metric to trigger when the average goes below 0.5 (i.e. more than half of the probes are failing). A single failed probe isn’t necessarily an outage as you’ll have multiple probes from various locations checking each endpoint. The number of DNS queries that each endpoint returns is also something to watch for as a sudden spike in the number of queries to a secondary endpoint can be an indicator that the primary one is in trouble.

Built-in Azure Policy definitions can be used to turn on diagnostic logging for all Traffic Manager profiles and to flag those which don’t meet the baseline. A standard audit should confirm that the web endpoints are still being probed over HTTPS at the required intervals and on the required paths. Microsoft also recommend that you deliberately turn endpoints off at various times to verify that failover actually works and that the alerts fire as you would expect (a failover arrangement which has never been tested in any way may well not work as expected in the event of a real outage).

The CDC subdomain and the February outages make exactly the same point as Microsoft’s checklist. The bulk of the risk in a Traffic Manager deployment is in the surrounding pieces, such as forgotten DNS records, broad permissions, untested changes and probes that just won’t get through, and those are the things to look at first.

Subscribe to our weekly news digest.

Join now and become a part of our fast-growing community.

Invalid Email Address
Thanks for Subscribing!
We'll be sending you our best soon!
Something went wrong, please try again later