Power Apps

Publishing CRM Using WAP, AD FS and DoD PKI

adfs-3authenticationcrmpkiwap

With TMG going the way of the dodo Microsoft has moved much of it’s functionality into Server 2012R2.  This includes publishing applications utilizing Windows Authentication and Kerberos Constrained Delegation (KCD).  This is done through a combination of a feature called Web Application Proxy and ADFS 3.0.

Requirements

Example Configuration

This diagram represents the configuration for our sample environment. Additional setup scenarios for load balancing the WAP and CRM server are possible but not covered in this setup guide.

Firewall Considerations

If your domain controller (DC) and your Web Application Proxy will be separated by a firewall you will need to establish Active Directory and Kerberos communication between them. In order to do this you will need the following port rules.

Ports required for Active Directory communication and Kerberos

Port/TransportProtocol
443/TCPHTTPS
389/TCPLDAP to Directory Service
389/UDP
3268/TCPLDAP to Global Catalog Server
88/TCPKerberos Authentication
88/UDP

DNS Setup

The setting below describe the DNS setup using the sample setup diagram.

External DNS

All the external DNS records should point to your Web Application Proxy external IP

URLIPUsage
https://wap-crm.raw.com52.4.168.181CRM Website
https://wap-fs.raw.com52.4.168.181AD FS Proxy Website

Internal DNS

If your WAP server will have access to internal DNS records and you have the ability to Add forward lookup zones you can utilize that within your domain DNS. Otherwise you will need to utilize the host file on the WAP machine in order to ensure that it knows the internal IP address mappings for the external Urls.

WAP with DNS Access

In this scenario our WAP server has access to our internal DNS system. We will add a forward lookup zone for our external domain name and add the two external URLs as A records pointing to the internal IP address for those machines.

WAP with No DNS Access Utilizing host File

In this scenario our WAP machine is located in a DMZ with no access to our internal DNS system. The screenshot below shows the host file update we have made to point the external URLs to the internal IP addresses.

Configure CRM Server

In order for Kerberos Constrained Delegation to work correctly we must ensure that Kerberos is functioning correctly in CRM.   The following will demonstrate a basic Kerberos setup for a single CRM server.

CRM Application Pool User

Your CRM environment should be using a domain user to run the Application Pool for CRM.  We will first determine what user is running the application pool.

Kernel Mode Authentication and Authentication Providers

If kernel mode authentication is being used additional setting will need to be configured to ensure that the application pool user account is being used when Kerberos tickets are issued.  Additionally make sure that the providers for windows authentication are utilizing Kerberos (Negotiate).

Set Kernel Mode Authentication

Check Authentication Providers

Use Application Pool Credentials

Because we are using kernel mode authentication CRM will attempt to get Kerberos tickets utilizing a build in service account.  The service account IIS will user for Kerberos is not delegated to pass the tickets.  In order to fix this issue settings will need to be adjusted on the CRM website to ensure the application pool user we identified earlier who is delegated for Kerberos will attempt to get the tickets.

Configure Domain Controller

Install DoD Certificates

The instructions illustrated here may differ from internal processes for installing certificates within your organization.

Install Certificates into NTAuth Store

In order for Smart Cards (PKI) to work correctly within our domain the certificates at the root of the smart card must be installed at the Active Directory level. The instructions illustrated here may differ from internal processes for installing certificates within your organization.

Push Certificates Using Group Policy

In order to avoid having to install the DoD certificates on all machines utilize group policy to push the certificates down to all servers within the domain.

Export Certificates from Local Store

In order to import the certificates into the group policy object we first need to export the certificates from the local store.

Import Certificates into Group Policy Object

Create SPN Records for CRM

In order for Kerberos to work correctly Service Principal Name (SPN) records must be set for CRM.

Log in to any machine on the domain using an account with Domain Administrative rights.

Set Delegation for CRM

In order for the WAP server to obtain a Kerberos ticket we must allow connection from the WAP server to delegate using the CRM SPNs we set earlier.

Configure Users for KCD

In order for KCD to translate the client certificate to an Active Directory account we must update the userPrincipalName for the users within AD to match that of their CAC certificates.

Configure AD FS Server

Install Certificate

In this step we will be installing the certificate for the Federation Service URL.

Add Roles and Features

Using the Add Roles and Features Wizard we will add the AD FS role.

Add CRM as Non-Claims Aware Relying Party

Update Authentication Policy

In order to accept only client certificates updates will be completed on the global AD FS authentication settings.

Test AD FS Service

This will test if the AD FS server is running and processing requests

Configure WAP Server

Add Roles and Features

Install Certificates

The WAP server will be the forward facing server that clients will be hitting, because of this any certificate which will be used for external URLs will need to be installed on this machine.  These certificates should contain the private key.

DNS Host File Entry

Based upon our sample setup our WAP server is located in a DMZ without access to the internal DNS server.  Because of this we will be using host file entries to map the external URLs from the WAP machine to the internal address of the machines actually hosting the services.

Configure WAP

Client Certificate Revocation (Development Environment)

On a production environment Tumbleweed or another service providing CRL should be installed and configured.  Within a development environment where Tumbleweed is not available disabling CRL checking can be done to allow for testing.  Disabling CRL checking is not something you would ever want to do in a production environment since it would negate much of the security that certificates provide.