I thought a security group blocks traffic that its rules don't allow. Why is DNS to the Route 53 Resolver an exception? And if someone visits a domain hosted on a server in my VPC, does the server's security group still apply?
Why doesn't a security group block DNS to the VPC resolver?
Answers
Security groups do have an implicit deny for traffic that isn't allowed, but the Route 53 Resolver is a documented exception. Rules on your instance's security group can't block DNS requests to or from the VPC-provided resolver, even if you leave DNS out of the outbound rules.
That doesn't mean every DNS connection bypasses security groups. The exception is for the VPC resolver, also called AmazonProvidedDNS. If you're using another DNS server, its traffic is a separate case and may be subject to the applicable security group rules.
Reply to this answer
There are two different conversations happening. First, a client asks a DNS resolver for the address of a domain. Then the client connects to the returned address, perhaps over HTTPS.
If that address points to your server, the server's security group still controls whether the connection is allowed. The resolver exception doesn't open port 443 or let visitors bypass the server's inbound rules.
Reply to this answer
AmazonProvidedDNS is the VPC's Route 53 Resolver service. It can resolve public names and private names, and is reachable at the VPC's base IPv4 address plus two, as well as 169.254.169.253.
It's a resolver used by clients in the VPC. That's a different role from serving DNS records for a domain that visitors look up before connecting to your application.
Reply to this answer
For filtering domain queries made through the VPC resolver, AWS provides Route 53 Resolver DNS Firewall. That's the control to look at rather than trying to remove a port 53 allowance from the instance's security group.
Keep the scope in mind: filtering queries through that resolver is not the same thing as controlling every possible network connection an application can make.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Sunnyvale Day:
Also, security groups have allow rules, not explicit deny rules. The lack of an allow normally results in an implicit deny.