如何连接到防火墙后面的 Active Directory 服务器

如何连接到防火墙后面的 Active Directory 服务器

我无法让 LDAP 查询到达在 Cisco PIX 506E 防火墙后面的 Windows Server 2012 R2 上运行的 Active Directory。我的目标是为托管在云中的某些应用程序(在 Digital Ocean 上)创建 SSO 环境。我完全控制了到服务器的整个网络路径,并且我在 PIX 上打开了端口 389(LDAP)和 636(LDAPS),并添加了静态语句以将 LDAP 流量转发到 AD 服务器。正如我将在下面展示的那样,每次我尝试建立连接时,我都会在防火墙访问列表中获得命中次数,但我没有成功。

以下是我目前所做的:

1. 在防火墙上打开 LDAP 和 LDAPS 端口

fw1(config)# show access-list
access-list cached ACL log flows: total 0, denied 0 (deny-flow-max 1024)
            alert-interval 300
access-list inbound; 4 elements
access-list inbound line 1 permit icmp any any (hitcnt=383)
access-list inbound line 2 permit udp any interface outside eq 1194 (hitcnt=3)
access-list inbound line 3 permit tcp any any eq ldap (hitcnt=6)
access-list inbound line 4 permit tcp any any eq ldaps (hitcnt=1)

2. 端口转发 LDAP 流量

fw1(config)# show static
static (inside,outside) udp interface 1194 172.23.6.148 1194 netmask 255.255.255.255 0 0
static (inside,outside) tcp interface ldap 172.23.6.127 ldap netmask 255.255.255.255 0 0
static (inside,outside) tcp interface ldaps 172.23.6.127 ldaps netmask 255.255.255.255 0 0

3.关闭AD服务器上的防火墙

显示 AD 服务器上的 Windows 防火墙已关闭的屏幕截图

4. 使用 Microsoft 的 PortQuery 工具测试 LDAP 端口是否确实打开

PortQuery GUI 测试结果

5.使用 netstat 验证 AD 服务器是否确实在监听端口 389

NetStat 命令用于验证 LDAP 端口是否正在侦听查询

此时,我感觉自己在防火墙上做的有些不对。虽然我有一个类似的 OpenVPN 服务器设置,并且运行良好(即 ACL 和静态语句成功地将流量通过防火墙传送到 OpenVPN 服务器)。

我愿意提供任何需要的额外信息来帮助我解决这个问题,谢谢。

PS. 以下是我的 PIX 防火墙的配置。

fw1(config)# sho conf
: Saved
: Written by enable_15 at 22:16:51.652 EST Sat Oct 25 2014
PIX Version 6.3(5)
interface ethernet0 auto
interface ethernet1 auto
nameif ethernet0 outside security0
nameif ethernet1 inside security100
enable password ***** encrypted
passwd ***** encrypted
hostname fw1
domain-name ctc.local
clock timezone EST -5
fixup protocol dns maximum-length 512
fixup protocol ftp 21
fixup protocol h323 h225 1720
fixup protocol h323 ras 1718-1719
fixup protocol http 80
fixup protocol rsh 514
fixup protocol rtsp 554
fixup protocol sip 5060
fixup protocol sip udp 5060
no fixup protocol skinny 2000
fixup protocol smtp 25
fixup protocol sqlnet 1521
fixup protocol tftp 69
names
access-list inbound permit icmp any any
access-list inbound permit udp any interface outside eq 1194
access-list inbound permit tcp any interface outside eq 1194
access-list inbound permit tcp any any eq ldap
access-list inbound permit udp any any eq 389
pager lines 24
logging monitor notifications
logging buffered debugging
icmp permit any outside
icmp permit any inside
mtu outside 1500
mtu inside 1500
ip address outside MY_PUBLIC_IP 255.255.255.248
ip address inside 172.23.6.120 255.255.255.0
ip audit info action alarm
ip audit attack action alarm
pdm location 172.23.6.0 255.255.255.0 inside
pdm logging informational 100
pdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 1 172.23.6.0 255.255.255.0 0 0
static (inside,outside) udp interface 1194 172.23.6.148 1194 netmask 255.255.255.255 0 0
static (inside,outside) tcp interface ldap 172.23.6.127 ldap netmask 255.255.255.255 0 0
access-group inbound in interface outside
route outside 0.0.0.0 0.0.0.0 ISP_ROUTER_IP 1
timeout xlate 0:05:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00
timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout sip-disconnect 0:02:00 sip-invite 0:03:00
timeout uauth 0:05:00 absolute
aaa-server TACACS+ protocol tacacs+
aaa-server TACACS+ max-failed-attempts 3
aaa-server TACACS+ deadtime 10
aaa-server RADIUS protocol radius
aaa-server RADIUS max-failed-attempts 3
aaa-server RADIUS deadtime 10
aaa-server LOCAL protocol local
http server enable
http 192.168.1.0 255.255.255.0 inside
http 172.23.6.0 255.255.255.0 inside
no snmp-server location
no snmp-server contact
snmp-server community public
snmp-server enable traps
floodguard enable
telnet timeout 5
ssh 172.23.6.0 255.255.255.0 inside
ssh 172.23.7.0 255.255.255.0 inside
ssh timeout 60
console timeout 0
dhcpd lease 3600
dhcpd ping_timeout 750
dhcpd auto_config outside
terminal width 80
Cryptochecksum:****

答案1

不要将域控制器上的服务开放到 Internet。在您的数字海洋足迹和您的本地 Active Directory 之间配置 VPN,并通过 VPN 查询 AD。

相关内容