Monday, June 26, 2017

DNS traffic, Port 53, AWS

Update: @colmmacc  was kind enough to get back to me with these comments on Twitter if you are looking for AWS DNS CIDRs:

Will look at better JSON description. In the meantime, all of Route 53 is in DNS needs TCP/53 open too for large answers. We'll add more IPs to Route 53 over time too. But unlikely to ever remove.


Taking a look at the IP addresses my EC2 instance attempts to connect to for DNS.

Unfortunately Amazon does not publish which IP ranges are specifically for DNS on this IP ranges list which makes it hard to set specific rules for DNS in NACLs or security groups.

Looks like my EC2 instance attempted to connect to the following IPs. Since this is a WatchGuard Firebox Cloud some of these IPs could be related to WatchGuard however the names are not resolving to WatchGuard DNS entries. So is this AWS DNS traffic or WatchGuard DNS traffic...can explore this further but is making it a bit complicated to create network rules that only allow my instance to go to the desired DNS server. 53 53 53 53 53 53 53 53 53 Comtouch?? India??

What's the problem? If an instance goes to the incorrect DNS server this could pose a serious security problem. If an instance resolves a DNS name to the wrong IP address it could potentially be connecting to a rogue host due to the incorrectly resolved name. Perhaps non-AWS traffic is related to a WatchGuard service. More inspection is needed.

So what to looks like the addresses with awsdns-xx in the name are in this AWS global IP range:

      "ip_prefix": "",
      "region": "GLOBAL",
      "service": "AMAZON"

It looks like the service is using UDP (protocol 17).

So for now will allow egress traffic (initiated from my instance to the Internet) on port 53 to the global AWS range above on protocol 17 and ephemeral ports inbound. We'll see what happens...