|
NAMEldap2pf - Create and update PF tables from LDAP groupsSYNOPSISldap2pf [-46Fnpv] [-b base] [-d domain] [-f path] [-h host] [-P page size] [-s servers] [-u user[@domain]] group ...DESCRIPTIONThe ldap2pf utility creates and updates PF address tables based on group memberships in an LDAP directory.For each group name specified on the command line, the ldap2pf utility searches the LDAP directory for group objects bearing that name. It then resolves the membership of these groups recursively, collects the DNSHostName attributes of all member objects, and looks up A and / or AAAA DNS records for these names. If no errors occured during this process, a PF address table with the same name as the LDAP group is either created or updated to match the list of IP addresses that were discovered. If the table already exists, its contents are replaced with the list that was obtained from the LDAP directory, unless the -p option was specified, in which case the table is treated as append-only. The following options are available:
IMPLEMENTATION NOTESThe ldap2pf utility was designed for use with Microsoft Active Directory servers, and assumes that the server supports and requires GSSAPI authentication and that a valid Kerberos ticket is available.EXAMPLESUpdate a table named mx used to allow traffic to and from the organisation's mail servers:% grep -w mx /etc/pf.conf table <mx> persist pass in on egress proto tcp from any to <mx> port { smtp, smtps } pass out on dmz proto tcp from any to <mx> port { smtp, smtps } pass in on dmz proto tcp from <mx> to any port { smtp, smtps } pass out on egress proto tcp from <mx> to any port { smtp, smtps } pass in on int proto tcp from int:network to <mx> port { smtp, smtps } pass out on dmz proto tcp from int:network to <mx> port { smtp, smtps } % sudo env KRB5CCNAME=/var/db/ro_user.cc ldap2pf -pv -u ro_user mx # host: client.example.com # domain: example.com # user: ro_user@example.com # looking up SRV for _ldap._tcp.example.com # servers: dc01.example.com dc02.example.com # base: DC=example,DC=com # Attempting to connect to dc01.example.com # Looking for (&(objectclass=group)(name=mx)) in DC=example,DC=com # last page (1) # resolving CN=mx,OU=roles,OU=hostpolicies,DC=example,DC=com # Looking for (distinguishedname=CN=mx01,OU=hosts,DC=example,DC=com) in DC=example,DC=com # last page (1) # resolving CN=mx01,OU=hosts,DC=example,DC=com # Looking for (distinguishedname=CN=mx02,OU=hosts,DC=example,DC=com) in DC=example,DC=com # last page (1) # resolving CN=mx02,OU=hosts,DC=example,DC=com # looking up mx01.example.com # mx01.example.com. 3600 IN AAAA 2001:db8:0:42::2501 # mx01.example.com. 3600 IN A 198.51.100.251 # looking up mx02.example.com # mx02.example.com. 3600 IN AAAA 2001:db8:0:42::2502 # mx02.example.com. 3600 IN A 198.51.100.252 /sbin/pfctl -t mx -T add 198.51.100.251 198.51.100.252 2001:db8:0:42:0:0:0:2501 2001:db8:0:42:0:0:0:2502 No ALTQ support in kernel ALTQ related functions disabled 4/4 addresses added. SEE ALSOkinit(1), pf(4), pfctl(8)AUTHORThe ldap2pf utility was written by Dag-Erling Smørgrav <d.e.smorgrav@usit.uio.no> for the University of Oslo.
Visit the GSP FreeBSD Man Page Interface. |