Solved

Active Directory authentication across Cisco ASA Firewall

Posted on 2013-05-15
5
3,666 Views
Last Modified: 2013-05-16
I have a server in a DMZ that I need to authenticate to Active Directory.  What I am using as a test right now is gpupdate.  I can open up all TCP ports to the domain controller and gpupdate works fine.  However, if I lock down TCP ports and only allow recommended TCP ports (ldap,445,135,389,1026) it still will not work.  I have read that this is probably because of some dynamic ports that are needed because of the way microsoft works.  I also have read that this can be achieved by using DCERPC inspection, but I have tried enabling that also with no luck.  When I run debug on DCERPC and try to run gpupdate I can see debug information but I am not real sure what it means.

I need to be able to authenticate to AD/GP but not open up more than I have to because this is a server in a DMZ.
0
Comment
Question by:ddftech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 22

Expert Comment

by:mcsween
ID: 39168579
You need to make a couple registry changes to limit the RPC dynamic ports to a smaller range then open this range on your firewall.

http://support.microsoft.com/kb/154596

This link outlines all ports used by Active Directory -
http://technet.microsoft.com/en-us/library/dd772723(v=ws.10).aspx
0
 
LVL 37

Accepted Solution

by:
bbao earned 500 total points
ID: 39168595
hi ddftech

AD authentication is based on Kerberos protocol which works over TCP and UDP port 88 by default. Hence the ports should be opened on firewalls, too.

see below for more port requirements.

Active Directory and Active Directory Domain Services Port Requirements
http://technet.microsoft.com/en-us/library/dd772723%28v=ws.10%29.aspx

hope it helps,
bbao
0
 
LVL 57

Expert Comment

by:Pete Long
ID: 39168651
Logging into the domain through a Firewall

Note this is to log in - NOT for Exchange, SQL or a Domain Controller, I’ve not tried those so I can't comment.

The following ports have to be open from the outside (or DMZ) to the domain controllers.
NB: I know having these open from outside/DMZ has security implications but sometimes it needs to be done.

Ports open from DMZ\Outside


UDP      domain            53
TCP      domain            53
UDP      Kerberos            88
TCP      Kerberos            88
UDP      Time                  123
TCP      Kerberos Auth      135
UDP      netbios-ns            137
TCP      netbios-ssn            139
TCP      ldap                  389
UDP      ldap                  389
TCP      microsoft-ds            445
TCP      ldap to GC            3268

However the process still fails (or runs like a two legged dog and appears to work) this is because of the RPC system that runs on the domain controllers, when you log in the client fires up a communication over port 135 the Domain controller, which then fires back a port number it wants to communicate with the client over (this can be any numberbetween 49152 and 65535) your firewall lets this through outbound.

When it hits your client, it tries to open comms on that port, which is inevitably blocked on the firewall

When this happens you will see errors like

Error 1053
There are no more endpoints available from the endpoint mapper.

if you run netdiag on the machine you will see errors like
[WARNING] Cannot call DsBind to servername.domain_name.com (<ip address>). [EPT_S_NOT_REGISTERED]

There are two ways to solve the problem

1. Open every port  between 49152 and 65535) on your firewall, however this is about as sensible as eating yellow snow.

2. Change the way your domain controller handles RPC requests,

NOTE this must be done on EVERY domain controller

Click Start > Run > regedit {enter}

Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters\

Create a new DWORD value called "TCP/IP Port"  (remove the quotes and include the space)double click it and change the "base" to decimal type in a port number (between 1024and 65000) for the sake of argument use 1024 Exit the Registry Editor and you MUST reboot the server.

Now go back to the Firewall and open the following port

 
TCP      static RPC      1024


Now the process will work.
0
 
LVL 22

Expert Comment

by:mcsween
ID: 39168752
You should set the RPC range to at least 100 ports and do not use 1024, you should use something between 49152 and 65535.

I could be wrong as I haven't done this in a while but I think this is done on the server in the DMZ; not your domain controller...
0
 

Author Closing Comment

by:ddftech
ID: 39172391
Everything else I had put in was working properly, but somehow I had missed port 88.  I put it in and it works like a charm.
0

Featured Post

Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question