Setup dynamc DNS updates with Active Directory DNS to be used by Smart Proxy of Katello/Foreman
Both BIND as configured in FreeIPA and Microsoft AD DNS servers can accept DNS updates using GSS-TSIG authentication. This uses Kerberos principals to authenticate to the DNS server. Under Microsoft AD, this is known as "Secure Dynamic Update".
Pre-requisites
Kerberos principal in the realm/domain that Smart Proxy can use
Kerberos keytab for the above principal
Setup krb5.conf
cat > /etc/krb5.conf << "EOF"
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
default_realm = EXAMPLE.COM
dns_lookup_realm = true
dns_lookup_kdc = true
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
[realms]
EXAMPLE.COM = {
kdc = dc01.example.com
admin_server = dc01.example.com
}
[domain_realm]
example.com = EXAMPLE.COM
.example.com = EXAMPLE.COM
EOF
Microsoft AD configuration
A user has to be created in Active Directory that will be used by the Smart Proxy, in our case foremanproxy. This will automatically create a service principal, e.g. foremanproxy@EXAMPLE.COM.
Test the Kerberos login with that user on the Smart Proxy using kinit:
kinit foremanproxy@EXAMPLE.COM.
If login works, the keytab file can be created using ktutil. First clear the Kerberos ticket cache:
kdestroy
Now create the keytab file with ktutil:
ktutil: addent -password -p foremanproxy@EXAMPLE.COM -k 1 -e RC4-HMAC
ktutil: wkt dns.keytab
ktutil: q
Once the keytab file has been created, test it using kinit:
#kinit foremanproxy@EXAMPLE.COM -k -t dns.keytab
If this works, clear the Kerberos ticket cache once again using kdestroy.
#kdestroy
Move the dns.keytab to /etc/foreman-proxy directory
#mv dns.keytab /etc/foreman-proxy/
ensure permissions are 0600 and the owner is foreman-proxy.
#chown foreman-proxy /etc/foreman-proxy/dns.keytab
#chmod 0600 /etc/foreman-proxy/dns.keytab
The DNS zone Dynamic Updates option on the DNS zones in Active Directory can now be set to Secure Only. Now follow the steps below under Proxy Configuration.
Proxy configuration
Next, update the proxy configuration file (/etc/foreman-proxy/settings.d/dns.yml) with the following settings:
:dns_server: ip address or fqdn of you active directory dns
:dns_provider: nsupdate_gss
:dns_tsig_keytab: /etc/foreman-proxy/dns.keytab
:dns_tsig_principal: foremanproxy@EXAMPLE.COM
#:dns_key: false
To work correctly, :dns_key: must be commented out.
Restart foreman-proxy
For Centos 6/RHEL 6
#service foreman-proxy restart
For Centos 7/RHEL 7
systemctl restart foreman-proxy
Success you are now configure you smart-proxy to provide dynamic dns updates to Microsoft DNS
All this changes are no permanent at this stage if you want to make permanent you need to run the command katello-installer with the following options
#katello installer
--capsule-dns true
--capsule-dns-forwarders <server ip or hostname --capsule-dns-interface <eth0,eth1,ens192 etc> --capsule-dns-provider nsupdate_gss
--capsule-dns-reverse <reverse ip>.in-addr.arpa
--capsule-dns-server <ip or hostname of Activer directory DNS>
--capsule-dns-tsig-keytab Kerberos keytab for DNS updates using GSS-TSIG authentication (default: "/etc/foreman-proxy/dns.keytab")
--capsule-dns-tsig-principal Kerberos principal for DNS updates using GSS-TSIG authentication (default: "foremanproxy@Domain")
After finish this process all the change are now permanent.
Comments
Post a Comment