Hi,

Is it considered a good security practice to not allow DCs making
direct DNS requests to Internet?

I have read about different DNS responses attacks that can help an
attacker to take control of the DC via an incorrect DNS response
(buffer overflow etc.).

Would it be more secure to use DNS forwarders?
If yes, where we should place them? Into DMZ?

Thank you

Re: DNS security question by Steven

Steven
Sat May 20 00:27:00 CDT 2006

You might also want to post in the DNS newsgroup but I have never heard or
read about anything to suggest that it is a significant security risk.
Having said that it may make sense to have it just forward to your ISP DNS
servers and let them do the iteration and not use root hints ever by
enabling do not use recursion in the forwarders configuration page. The
downside would be if your ISP DNS servers were down you would not have
internet name resolution. If you have at least two DNS servers listed from
your ISP that is pretty unlikely unless they have general problems with
their network Either way make sure your DNS server are configured with the
default configuration to secure cache against pollution. You certainly could
have cache only DNS servers that forward to the ISP DNS servers that your
domain controllers forward to for an extra layer of security but it may be
hard to justify that added expense and complexity for the added security
you might gain depending on the level of security you need. A post in the
DNS newsgroup might give you an idea on how common such is used. --- Steve


<boomboom999@yahoo.com> wrote in message
news:1148092712.620399.80080@j55g2000cwa.googlegroups.com...
> Hi,
>
> Is it considered a good security practice to not allow DCs making
> direct DNS requests to Internet?
>
> I have read about different DNS responses attacks that can help an
> attacker to take control of the DC via an incorrect DNS response
> (buffer overflow etc.).
>
> Would it be more secure to use DNS forwarders?
> If yes, where we should place them? Into DMZ?
>
> Thank you
>



Re: DNS security question by Roger

Roger
Sat May 20 01:13:07 CDT 2006

<boomboom999@yahoo.com> wrote in message
news:1148092712.620399.80080@j55g2000cwa.googlegroups.com...
> Hi,
>
> Is it considered a good security practice to not allow DCs making
> direct DNS requests to Internet?
>
> I have read about different DNS responses attacks that can help an
> attacker to take control of the DC via an incorrect DNS response
> (buffer overflow etc.).
>
> Would it be more secure to use DNS forwarders?
> If yes, where we should place them? Into DMZ?
>
> Thank you
>

This is not really a simply question to answer.
On one hand having DCs well protected, not in any way on the edge,
is a general, sane paractice. On the other hand "making requests"
is not something that would expose anything more than would using
a forwarder to make those requests. Now, if by "making requests"
you also were meaning answering queries, then my response is
emphatically that you should not allow queries from outside of your
infrastructure.
If your DC based DNS has a path to the internet for Tcp/Udp 53
and is also configured not to answer on the interface providing that
path then whether it makes request via a forwarder or by working the
DNS servers involved in answering the query is mostly a matter of
offloading work. However, if your infrastructure does not have that
path to the internet isolated on an interface of the DC then you
cannot configure the DNS service to not answer queries on that
interface, which potentially (depending on firewall config and/or
NAT config) could expose your internal zone information.
Finally, IMO much depends on the size of the organization, and
whether it makes sense to host one's own public DNS presence.
If so, that normally means that you have a public DNS server,
configured to not accept recursive queries, placed in the DMZ or
a screened network with Ucp/Tcp 53 accessible to the world. Such
a server would be a good choice for use as forwarder to the internal
DC based DNS services IF it were not configured to reject recursive
queries. If the public DNS presence is relatively static zone of not
that many resource records it can make most sense to offload the
hosting of that to a network provider. For reasons similar to those
already used, the DNS of the network provider also often make a
good choice as forwarders.

Do you have any link or reference for what you mentioned as
> I have read about different DNS responses attacks that can help an
> attacker to take control of the DC via an incorrect DNS response
> (buffer overflow etc.).
since I have not really encountered what this might be speaking of.

In all events, there are only a couple guiding principals.
One is that as a best practice there is no need for, hence no reason
for, the internal AD supporting zone(s) to be visible to the world.
That just presents unneed exposure, which MIGHT mean unneeded,
added risk - it does certainly give a means for external people to map
key aspects of the internal infrastructure while their access is still
only external and it also MAY give them a way to DoS the DNS service
by recursive query saturation.
An outcome from this is that a DC that is not multihomed cannot be
configured to use external DNS servers (whether for direct working
of queries or forwarding) and also keep the internal zones fully
inaccessible (that is, cannot be so configured on the DC itself - such
protection must be defined elsewhere - firewall, nat, proxy).

--
Roger Abell
Microsoft MVP (Windows Server : Security)



Re: DNS security question by Roger

Roger
Sat May 20 01:48:15 CDT 2006

Oops.

In reviewing prior post I see I used term "interface" which is how it
is termed in the DNS management UI when in fact what should have
been said was "IP" since these "interfaces" are named by IP.
Thus similarly I used "multihomed" when this should have been
something like "virually multihomed" or "with multiple IPs"
The bottom line is that one needs to be able to use the DNS config
to disallow answering queries on the "interface" used for external
forwarders or outbound queries.
--
Roger

"Roger Abell [MVP]" <mvpNoSpam@asu.edu> wrote in message
news:%238AEPT9eGHA.5088@TK2MSFTNGP02.phx.gbl...
> <boomboom999@yahoo.com> wrote in message
> news:1148092712.620399.80080@j55g2000cwa.googlegroups.com...
>> Hi,
>>
>> Is it considered a good security practice to not allow DCs making
>> direct DNS requests to Internet?
>>
>> I have read about different DNS responses attacks that can help an
>> attacker to take control of the DC via an incorrect DNS response
>> (buffer overflow etc.).
>>
>> Would it be more secure to use DNS forwarders?
>> If yes, where we should place them? Into DMZ?
>>
>> Thank you
>>
>
> This is not really a simply question to answer.
> On one hand having DCs well protected, not in any way on the edge,
> is a general, sane paractice. On the other hand "making requests"
> is not something that would expose anything more than would using
> a forwarder to make those requests. Now, if by "making requests"
> you also were meaning answering queries, then my response is
> emphatically that you should not allow queries from outside of your
> infrastructure.
> If your DC based DNS has a path to the internet for Tcp/Udp 53
> and is also configured not to answer on the interface providing that
> path then whether it makes request via a forwarder or by working the
> DNS servers involved in answering the query is mostly a matter of
> offloading work. However, if your infrastructure does not have that
> path to the internet isolated on an interface of the DC then you
> cannot configure the DNS service to not answer queries on that
> interface, which potentially (depending on firewall config and/or
> NAT config) could expose your internal zone information.
> Finally, IMO much depends on the size of the organization, and
> whether it makes sense to host one's own public DNS presence.
> If so, that normally means that you have a public DNS server,
> configured to not accept recursive queries, placed in the DMZ or
> a screened network with Ucp/Tcp 53 accessible to the world. Such
> a server would be a good choice for use as forwarder to the internal
> DC based DNS services IF it were not configured to reject recursive
> queries. If the public DNS presence is relatively static zone of not
> that many resource records it can make most sense to offload the
> hosting of that to a network provider. For reasons similar to those
> already used, the DNS of the network provider also often make a
> good choice as forwarders.
>
> Do you have any link or reference for what you mentioned as
>> I have read about different DNS responses attacks that can help an
>> attacker to take control of the DC via an incorrect DNS response
>> (buffer overflow etc.).
> since I have not really encountered what this might be speaking of.
>
> In all events, there are only a couple guiding principals.
> One is that as a best practice there is no need for, hence no reason
> for, the internal AD supporting zone(s) to be visible to the world.
> That just presents unneed exposure, which MIGHT mean unneeded,
> added risk - it does certainly give a means for external people to map
> key aspects of the internal infrastructure while their access is still
> only external and it also MAY give them a way to DoS the DNS service
> by recursive query saturation.
> An outcome from this is that a DC that is not multihomed cannot be
> configured to use external DNS servers (whether for direct working
> of queries or forwarding) and also keep the internal zones fully
> inaccessible (that is, cannot be so configured on the DC itself - such
> protection must be defined elsewhere - firewall, nat, proxy).
>
> --
> Roger Abell
> Microsoft MVP (Windows Server : Security)
>
>



Re: DNS security question by Karl

Karl
Sat May 20 08:53:43 CDT 2006


<boomboom999@yahoo.com> wrote in message
news:1148092712.620399.80080@j55g2000cwa.googlegroups.com...
> Hi,
>
> Is it considered a good security practice to not allow DCs making
> direct DNS requests to Internet?
>
> I have read about different DNS responses attacks that can help an
> attacker to take control of the DC via an incorrect DNS response
> (buffer overflow etc.).
>
> Would it be more secure to use DNS forwarders?

I would say yes. Besides the issue you bring up, there's also the
possibility of DNS cache poisoning [which is much easier to prevent with a
small number of DNS servers acting as proxy clients, rather than relying on
reconfiguring and patching every DNS client on the network as
vulnerabilities are found].

And maybe most importantly, having central DNS servers allows you to
configure your firewall to allow only those DNS servers to access TCP and
UDP destination ports 53 outbound on the Internet. This might help detect
and prevent compromised hosts trying to "phone home" to an attacker over
TCP/UDP 53, or at least it raises the bar a little. This only works if you
have your own DNS servers. [Having a firewall or a proxy server that can
make DNS requests and using that as your DNS server is probably almost as
good as making a new DNS server for your company.]

> If yes, where we should place them? Into DMZ?

If you have a DMZ, that's not a bad place to put them. If you don't have a
DMZ, it's up to you whether you need to make one for this purpose.




Re: DNS security question by boomboom999

boomboom999
Sat May 20 11:55:55 CDT 2006

To make things clearer ...

We have Active Directory with 5000 users, and every Domain Controller
is a DNS server as well. To allow resolving external DNS adresses there
are two options:

1. Open outbound TCP/UDP 53 connections from the domain controllers
toward the Internet.

2. Use an intermediate forwarder DNS servers



1. Pros and Cons for a direct connection

+ Simplier solution
+ No additional hardware/software required
+ No risk of hijacking external DNS resolution by a hacker

- If I open outbound UDP, I should also allow inbound UDP responses. As
UDP is connectionless, there is no way for the firewall to make sure
that inbound packets are related to the previous outbound packets. So,
it is possible to send some corrupted UDP packets to the internal
Domain Controllers and cause a DoS or take control of the Active
Directory

- There were vulnerabilities in BIND like this one

http://www.kb.cert.org/vuls/id/844360

An incorrect DNS response can causer a buffer overflow on the internal
server -> remote code execution -> phoning home -> taking control over
the Active Directory

2. Pros and Cons for a connection via forwarder

Same points in reverse order.

An additionnal Con point for the forwarder - if someone take control
over the DNS forwarder (ISP's one or our own forwarder) it is possible
to hijack and manipulate all the external DNS requests, redirect
trafic, sniff it etc. So, if I go with forwarder, it would be necessary
to put it into a separate DMZ that is not exposed to inbound
connections.

What would you recommend?


Re: DNS security question by Steven

Steven
Sat May 20 13:19:49 CDT 2006

The article that mentions the bind vulnerability is over four years old. I
have not heard/read of any Active Directory domain being taken over through
external DNS requests/replies alone. Yes UDP is connectionless [with no
sequence numbers] but that does not mean the firewall can not offer
protection in that it will use IP/port pairs to monitor and manage traffic.
In other words if a server sends a DNS request to your ISP DNS server using
outbound UDP port 53 and source port xxxx being random from your IP then the
firewall will only allow a response to random port xxxx from the IP of your
ISP DNS server and from port 53 UDP. Also your firewall will not allow
attempts [assuming correctly configured] to access the DNS service on your
domain controllers via inbound port 53. If you still are concerned about a
possible attack happening in a DNS response packet look at a firewall like
ISA 2004 that can inspect the contents of DNS packets to make sure that only
typical DNS response info is included which is very simple information. Of
course keeping your servers patched with critical security updates is
important as that will help mitigate operating system vulnerabilities when
found and repaired by Microsoft.

If someone takes control of a non domain member forwarder or your ISP DNS
server the main concern would be loss of internet access. There should be
nothing that can be sniffed on that packets that would be major concern such
as your internal DNS records assuming your domain controllers are behind a
firewall using private IP addresses. If you want to use your own forwarder
that forwards to your ISP DNS server and/or uses root hints make sure it is
only a caching only non domain member DNS server. As Karl said it is up to
your whether you want to put in a DMZ or not depending on your network
configuration. Putting in a DMZ could expose it to more attacks unless it is
also behind a firewall while in the DMZ. IMHO it would be most important
that is not be a domain member and hardened [unneeded services uninstalled -
not just disabled if possible] so that IF it was compromised it would have
not have the advantage of regular user domain access. Ipsec can also be
used to help protect your domain using an ipsec filtering policy on a DNS
forwarder so that it can only respond to DNS requests from other computers
and ipsec can also be used for domain isolation to prevent unauthorized
network access from non domain computers. Again I don't see a big threat
when a properly configured and patched domain controller forwards to an ISP
DNS server and it is behind a properly configured firewall. --- Steve

http://www.microsoft.com/technet/security/topics/architectureanddesign/ipsec/default.mspx
--- Server and Domain Isolation Using IPsec and Group Policy


<boomboom999@yahoo.com> wrote in message
news:1148144155.914239.125400@i39g2000cwa.googlegroups.com...
> To make things clearer ...
>
> We have Active Directory with 5000 users, and every Domain Controller
> is a DNS server as well. To allow resolving external DNS adresses there
> are two options:
>
> 1. Open outbound TCP/UDP 53 connections from the domain controllers
> toward the Internet.
>
> 2. Use an intermediate forwarder DNS servers
>
>
>
> 1. Pros and Cons for a direct connection
>
> + Simplier solution
> + No additional hardware/software required
> + No risk of hijacking external DNS resolution by a hacker
>
> - If I open outbound UDP, I should also allow inbound UDP responses. As
> UDP is connectionless, there is no way for the firewall to make sure
> that inbound packets are related to the previous outbound packets. So,
> it is possible to send some corrupted UDP packets to the internal
> Domain Controllers and cause a DoS or take control of the Active
> Directory
>
> - There were vulnerabilities in BIND like this one
>
> http://www.kb.cert.org/vuls/id/844360
>
> An incorrect DNS response can causer a buffer overflow on the internal
> server -> remote code execution -> phoning home -> taking control over
> the Active Directory
>
> 2. Pros and Cons for a connection via forwarder
>
> Same points in reverse order.
>
> An additionnal Con point for the forwarder - if someone take control
> over the DNS forwarder (ISP's one or our own forwarder) it is possible
> to hijack and manipulate all the external DNS requests, redirect
> trafic, sniff it etc. So, if I go with forwarder, it would be necessary
> to put it into a separate DMZ that is not exposed to inbound
> connections.
>
> What would you recommend?
>



Re: DNS security question by Roger

Roger
Sat May 20 16:42:34 CDT 2006

Bind has had a number of fixes or the recent years, say since MS DNS
started to be widely used, but W2k and later MS DNS has also had a
couple (fewer than Bind). There is no real way to project risks from
future discoveries of code weaknesses, and those issues would be
something to deal with whether using forwarder or not.

I place comments inline.

<boomboom999@yahoo.com> wrote in message
news:1148144155.914239.125400@i39g2000cwa.googlegroups.com...
> To make things clearer ...
>
> We have Active Directory with 5000 users, and every Domain Controller
> is a DNS server as well. To allow resolving external DNS adresses there
> are two options:
>
> 1. Open outbound TCP/UDP 53 connections from the domain controllers
> toward the Internet.
>
> 2. Use an intermediate forwarder DNS servers
>
Note that this also requires 1 above, as even the DMZ is "toward" the
internet.

>
>
> 1. Pros and Cons for a direct connection
>
> + Simplier solution
> + No additional hardware/software required
> + No risk of hijacking external DNS resolution by a hacker
>

Simpiler from one perspective (fewer servers involved).
Less simple from another - each DC either has this opened, or you
establish hierarch of DCs forwarding to the few that do.
No hijack risk for the non-existant DNS, but potentially at the cost
of moving that risk onto DCs.

> - If I open outbound UDP, I should also allow inbound UDP responses. As
> UDP is connectionless, there is no way for the firewall to make sure
> that inbound packets are related to the previous outbound packets. So,
> it is possible to send some corrupted UDP packets to the internal
> Domain Controllers and cause a DoS or take control of the Active
> Directory
>
Since DNS server can select to use TCP, even for query responses
(i.e. not just zone transfers) and will do so if the additional info to be
returned makes packet size too large for UDP.
Hence, actually open outbound UDP and TCP 53.
You comments on UDP show why if is risky if the DC's DNS does
accidently become configure to answer on the IP that routes outward.
If you use the DNS server node properties Interfaces tab to list only
the interfaces that are not routed out (i.e. for internal use only) then
the outward interface can still be used for outward queries to DNS
servers and/or forwarding. The DNS service will however not accept
inbound queries on that interface. This is necessary if you want to
protect the DNS from a query flood DoS attempt and if you want
to keep internal zones from being exposed.

> - There were vulnerabilities in BIND like this one
>
> http://www.kb.cert.org/vuls/id/844360
>
> An incorrect DNS response can causer a buffer overflow on the internal
> server -> remote code execution -> phoning home -> taking control over
> the Active Directory
>
As said before, risks are risks.
You are only discussing where to move them.

> 2. Pros and Cons for a connection via forwarder
>
> Same points in reverse order.
>
> An additionnal Con point for the forwarder - if someone take control
> over the DNS forwarder (ISP's one or our own forwarder) it is possible
> to hijack and manipulate all the external DNS requests, redirect
> trafic, sniff it etc. So, if I go with forwarder, it would be necessary
> to put it into a separate DMZ that is not exposed to inbound
> connections.
>

If your traffic that routes to external IPs has info that you would
not want sniffed you have other issues to be addressed. There is
a chance that a successfully subverted DNS could be used for a
man in the middle, which, while a quite difficult thing to pull off,
is probably as large of a concern as use of traffic redirection for
sake of for sniffing.

> What would you recommend?
>

First, consider that you do not want just one forwarder, if using
forwarders, at least not if the DC DNS services are enslaved to
the forwarders for external resolution. That is, you do not want
to introduce a single point of failure.

Another omitted consideration is that with forwarders used the
holes punched in the perimeter are very precise - 53 to/from
only the forwarders' IPs. Without forwarders the permit is for
all IPs to/from only the DCs' externally routed IPs (not to/from
the DCs' IPs that are allowed to answer DNS queries).

If the forwarders are yours you must have them accept recursive
queries (requirement to act effectively as a forwarder). That in
turn exposes them to query flooding if they are exposed to
accept queries from more than just the DCs. If they are not
so exposed then they could not be used to support your public
DNS zone(s). Etc. Just clarifying the extra cost issues here,
as in an ideal setup they are dedicated to the role as forwarders
for the DCs.

One pro, at least to some, of use of a couple forwarders is that
there are only a couple of caches to snoop into in order to see
all external locations that have been accessed by name - instead
of having it spread over the sum of the DCs.

OK, so what way would I go? Well, there could be other
things specific to an environment, but in general I would spend
the money and have the DCs as well protected as I can - which
means using forwarders with a network config that allows only
one IP on the DC to route to/through the wall and so forcing its
use when sending to the forwarders. This reduces the size of
exposure through the wall (with forwarders' IPs only) for ports 53
and allows restricting DNS services from answering on that IP.