Продолжаем знакомиться с новыми возможностями ОС Windows Server 2012 R2. Ранее мы рассказывали о корпоративном аналоге DropBox в Windows Server 2012 R2 под названием Work Folders. Сегодня речь пойдет о еще одном новшестве новой серверной платформы – функции Web Application Proxy. Web Application Proxy – это новая функция роли Remote Access в Windows 2012 R2, позволяющая публиковать HTTP/ HTTPS приложения, расположенные в периметре корпоративной сети на клиентских устройствах (в первую очередь подразумеваются мобильные устройства) за ее периметром. Благодаря возможности интеграции c AD FS (служба может выступать в качестве ADFS-прокси), возможно обеспечить аутентификацию внешних пользователей, пытающихся получить доступ к опубликованным приложениям.
Web Application Proxy предоставляет такие же возможности публикации приложений, как и Forefront Unified Access Gateway (UAG), однако данная служба также позволяет взаимодействовать с другими серверами и сервисами, обеспечивая тем самым более гибкую и рациональную конфигурацию.
Web Application Proxy по сути выполняет функцию обратного прокси сервера (HTTP reverse proxy), организуя ретрансляцию запросов клиентов из внешней сети на внутренний сервер, и является межсетевым экраном на прикладном уровне.
Сервер со службой Web Application Proxy получает внешний HTTP/HTTPS трафик и терминирует его, после чего от своего имени инициирует новое подключение ко внутреннему приложению (веб-серверу). Т.е. внешние пользователи прямого доступа к внутреннему приложению реально не получают. Любой другой трафик, получаемый Web Application Proxy, отклоняется (в том числе отклоняются HTTP/HTTPS запросы, которые могут быть использованы при DoS, SSL и 0-day атаках).
Требования к организации Web Application Proxy и ключевые особенности:
- Систему можно развернуть на серверах с ОС Windows Server 2012 R2, включенных в домен Active Directory, с ролями AD FS и Web Application Proxy. Эти роли должны быть установлены на разных серверах.
- Необходимо обновить схему Active Directory до Windows Server 2012 R2 (обновлять контроллеры домена до Windows Server 2012 R2 не нужно)
- В качестве клиентских устройств поддерживаются устройства с ОС Windows, IOS (iPad и iPhone). Работы над клиентами для Android и Windows Phone пока еще не окончены
- Аутентификация клиентов осуществляется службой Active Directory Federation Services (ADFS), которая также выполняет функции ADFS – проксирования.
- Типовая схема размещения сервера с ролью Web Application Proxy представлена на рисунке. Данный сервер располагается в выделенной DMZ зоне и отделен от внешней (Интернет) и внутренней сети (Интранет) межсетевыми экранами. В этой конфигурации для работы Web Application Proxy требует наличия двух интерфейсов – внутреннего (Intranet) и внешнего (DMZ)
Установка роли ADFS в Windows Server 2012 R2
Для обеспечения дополнительной безопасности преаутентифкация внешних клиентов выполняется на сервере ADFS, в противном случае используется pass-through аутентификация на конечном сервере приложения (что менее секьюрно). Поэтому первый шаг при настройке Web Application Proxy – установка на отдельном сервере роли Active Directory Federation Services.
При установке ADFS нужно выбрать SSL сертификат, который будет использоваться для шифрования, а также DNS имена, которые будут использоваться клиентами при подключении (соответствующие записи в DNS зоне придется создать самостоятельно).
Затем нужно указать сервисную учетную запись для службы ADFS. Необходимо учесть, что имя ADFS должно быть указано в атрибут Service Principal Name аккаунта. Сделать это можно командой:
setspn –F –S host/adfs.winitpro.ru adfssvc
И, наконец, указать базу данных, в которой будет хранится информация: это может быть встроенная база на этом же сервере (WID — Windows Internal Database) или отдельная база на выделенном SQL-сервере.
Установка службы Web Application Proxy
Следующий этап, настройка самой службы Web Application Proxy. Напомним, что служба Web Application Proxy в Windows Server 2012 R2 является частью роли “Remote Access”. Установите службу Web Application Proxy и запустите мастер ее настройки.
На первом этапе мастер предложит Вам указать имя ADFS сервера и параметры учетной записи, имеющей доступ к данной службе.
Далее нужно указать сертификат (убедитесь, что в альтернативных именах сертификата содержится имя сервера ADFS).
Совет. Проверьте, что ваши DNSзоны настроены корректно: сервер с ролью WAP должен иметь возможность отрезолвить имя сервера ADFS, а он в свою очередь может разрешить имя прокси сервера. Сертификаты на обоих серверах должны включать имя службы федерации.
Публикация приложения через Web Application Proxy
После того, как установлены роли ADFS и Web Application Proxy (которая работает еще и как ADFS Proxy), можно перейти непосредственно к публикации наружу конкретного приложения. Сделать это можно с помощью консоли Remote Access Management Console.
Запустите мастер публикации и укажите, хотите ли вы использовать для преаутентификации службу ADFS (это именно наш вариант).
Затем нужно задать имя публикуемого приложения, используемый сертификат, внешний URL (имеенно его для подключения будут использовать внешние пользователи) и внутрений URL-адрес сервера, на который будут пересылаться запросы.
Совет. Если необходимо перенаправить внешнее приложение на альтернативный порт, необходимо задать его в URL, указаывающем на внутренний сервер. Например, если необходимо перенаправить внешние https запросы (443 порт) на 4443 порт, нужно указать:
Backend server URL: lync.winitpro.local:4443
Завершите работу мастера, и на этом публикация приложений окончена. Теперь, если попытаться с помощью браузера зайти на опубликованный внешний URL-адрес, то браузер сначала будет перенаправлен на службу аутентификации (ADFS Proxy), а после успешной аутентификации пользователь будет отправлен непосредственно на внутренний сайт (веб приложение).
Благодаря новой службе Web Application Proxy в Windows Server 2012 R2 возможно реализовать функционал обратного прокси сервера с целью публикации внутренних служб предприятия наружу без необходимости использования задействовать сторонние файерволы и продукты, в том числе такие, как Forefront и пр.
Setting up a proxy server can be an essential task for improving security, managing internet traffic, and optimizing network performance. For businesses and advanced users working with Windows Server 2012, understanding how to configure a proxy server effectively can lead to enhanced control over network activities. This article provides a detailed guide on how to easily set up a proxy server on Windows Server 2012 using various methods. We’ll cover system settings, browser-specific configurations, and alternative approaches to ensure you have all the tools necessary for optimal proxy server management.
How to Set Up a Proxy in Windows Server 2012 System Settings
To configure it, you will need a proxy server. If you don’t have one, Proxy5.net provides high-quality proxies. They support HTTP, HTTPS and SOCKS5 protocols, which simplifies configuration on Windows Server 2012 and ensures stable connection.
Setting up a proxy server through the system settings of Windows Server 2012 involves several straightforward steps. This method ensures that all network requests from the server are routed through the proxy, providing a unified approach to managing internet traffic. Step-by-Step Instructions:
1. Access the Control Panel
- Click on the Start button and select Control Panel.
2. Navigate to Network and Sharing Center
- In the Control Panel, go to Network and Internet.
- Click on Network and Sharing Center.
3. Open Internet Options
- Within the Network and Sharing Center, click on Internet Options in the bottom left corner.
4. Configure Proxy Settings
- In the Internet Options window, go to the Connections tab.
- Click on LAN settings.
5. Enable Proxy Server
- In the Local Area Network (LAN) Settings window, check the box labeled Use a proxy server for your LAN.
- Enter the IP address and port number of your proxy server in the respective fields.
6. Bypass Proxy for Local Addresses
- Optionally, check the box labeled Bypass proxy server for local addresses if you don’t want the proxy to be used for local network traffic.
7. Save Settings
- Click OK to save your settings in the LAN settings window.
- Click OK again to close the Internet Options window.
8. Restart Network Services
- For the changes to take effect, you may need to restart your network services or the server itself.
How to Set Up a Proxy on Windows Server 2012 Through Mozilla Firefox
Configuring a proxy server specifically for the Mozilla Firefox browser allows you to manage internet traffic for that browser independently from the system-wide settings. This can be particularly useful if you need different proxy settings for different applications. Step-by-Step Instructions:
1. Open Mozilla Firefox
- Launch Mozilla Firefox on your Windows Server 2012 machine.
2. Access Options
- Click on the Menu button (three horizontal lines) in the upper-right corner.
- Select Options from the drop-down menu.
3. Navigate to Network Settings
- In the Options window, scroll down to the Network Settings section.
- Click on Settings.
4. Configure Proxy Settings
- In the Connection Settings window, select Manual proxy configuration.
- Enter the IP address and port number of your proxy server in the HTTP Proxy field.
- If you want the same proxy settings for all protocols, check the box labeled Use this proxy server for all protocols.
5. Bypass Proxy for Specific Hosts
- In the No Proxy for field, enter any addresses that should bypass the proxy. Separate multiple entries with commas.
6. Save Settings
- Click OK to save your proxy settings.
- Close the Options window.
Alternative Methods for Configuring a Proxy on Windows Server 2012
Apart from using system settings and browser-specific configurations, there are several alternative methods to set up a proxy server on Windows Server 2012. These methods can provide additional flexibility and control over network traffic management.
1. Using Group Policy:
- Group Policy allows administrators to configure proxy settings across multiple machines within a network. This method is ideal for large organizations needing a consistent proxy setup.
- To configure proxy settings using Group Policy:
- Open the Group Policy Management Console (GPMC).
- Create or edit a Group Policy Object (GPO).
- Navigate to User Configuration > Policies > Administrative Templates > Windows Components > Internet Explorer.
- Configure the proxy settings under Proxy Settings.
2. Using a PAC File:
- A Proxy Auto-Configuration (PAC) file is a script that automatically configures proxy settings for clients. This method is beneficial for complex network environments where different proxies may be needed for different destinations.
- To use a PAC file:
- Create a PAC file with the necessary proxy configurations.
- Host the PAC file on a web server.
- Configure the clients to use the PAC file URL in their browser or system settings.
3. Using a Third-Party Proxy Software:
- There are various third-party proxy software solutions available that offer advanced features such as caching, filtering, and load balancing.
- Popular third-party proxy software includes Squid, WinGate, and CCProxy.
- These solutions typically involve installing the software on the server and configuring it according to your network requirements.
4. Using Command Line Interface (CLI):
- Advanced users can configure proxy settings using the Command Line Interface (CLI). This method provides a more scriptable approach to proxy configuration.
- To set a proxy using CLI:
- Open the Command Prompt with administrative privileges.
- Use commands like
netshto configure proxy settings.
5. Using PowerShell Scripts:
- PowerShell scripts offer another method for configuring proxy settings, especially useful for automation and batch configurations.
- Example PowerShell script to set a proxy:
netsh winhttp set proxy proxy-server="http=proxy-server-address:port" bypass-list="*.local"
6. Using Network Load Balancers:
- For high-availability and load-balanced proxy configurations, network load balancers can be used.
- Load balancers can distribute network traffic across multiple proxy servers, ensuring better performance and redundancy.
Choosing the best method to set up a proxy server on Windows Server 2012 depends on your specific needs and network environment. For most users, configuring the proxy through system settings or a browser like Mozilla Firefox provides a straightforward solution. However, for larger organizations or more complex requirements, using Group Policy, PAC files, third-party software, CLI, PowerShell scripts, or network load balancers may offer additional benefits. Each method has its advantages, and selecting the right one can significantly enhance your network management capabilities.
Frequently Asked Questions
What is a proxy server and why is it used?
A proxy server acts as an intermediary between a client device and the internet. It is used to improve security, manage internet traffic, and optimize network performance by filtering requests and caching content.
Can I use multiple proxy servers on Windows Server 2012?
Yes, you can configure multiple proxy servers using different methods, such as system settings, browser-specific settings, or using a PAC file that directs traffic to different proxies based on the destination.
Is it necessary to restart the server after configuring a proxy server?
It is recommended to restart network services or the server itself to ensure that the new proxy settings take effect properly.
Can proxy settings be enforced across a large network?
Yes, using Group Policy is an effective way to enforce proxy settings across multiple machines within a large network.
Are there any free third-party proxy software options available?
Yes, there are several free third-party proxy software options such as Squid and CCProxy, which offer robust features for managing proxy servers.
How can I verify that my proxy server configuration is working correctly?
You can verify your proxy configuration by visiting websites that display your IP address, such as whatismyip.com, to check if the IP address matches your proxy server’s IP address.
This Windows Server 2012 R2 feature allows online users to securely access internal resources.
With Windows Server 2012 R2, Microsoft has built in a reverse-proxy feature. The Web Application Proxy securely publishes internal resources out to the Internet for access by both corporate-owned devices and untrusted machines alike. Indeed, most deployments of, say, Work Folders or workplace join — key “work anywhere” features that Microsoft put into Windows Server 2012 R2 — demand a reverse proxy of some sort, so this requirement is likely to come up for you sooner or later.
As you may have heard, Microsoft killed its flagship reverse proxy product, Forefront Unified Access Gateway, back in December. Many organizations have used UAG to create DirectAccess tunnels as well as portals where applications could be securely accessed from all sorts of clients.
While UAG’s capabilities were vast, it may have represented overkill for many applications, so Microsoft has built a capable, if less full-featured, successor into Windows Server 2012 R2. That’s what this article is about.
Configuring the Web Application Proxy (WAP) role, however, involves a lot of moving parts, and in this piece I will walk through how to set up the WAP role in your lab with either an application of your choosing or a freely available sample claims application that Microsoft publishes as part of one of its software development kits. Let’s begin.
Installing and configuring Active Directory Federation Services
Follow these steps to get started on the ADFS server.
1. On the machine that will host the ADFS role, open Server Manager and go to Add Roles and Features, and then check the box for Active Directory Federation Services.
2. Click through the rest of the wizard — the screens are just descriptions of the service; there is no action required other than to read the text and click Next. Then press the Finish button to get the role installed.
3. Once the wizard finishes, click the yellow exclamation icon in Server Manager. This icon reminds you that even though the role is installed, ADFS is not functional yet; you need to further configure the service. Click the link within the status screen that pops up from the yellow icon to go directly to the configuration interface.
4. For this walkthrough, we can assume this is our first ADFS server, so choose the default option and click Next.
5. On the account selection page, choose an account that has domain administrator permissions and then click Next.
6. On the next screen, you need to select the secure certificate that ADFS will use in its connections. You cannot use the certificates from IIS Manager here, as you will need to have previously imported the certificate into the certificate store through the Microsoft Management Console (MMC) snap-in. You can also import a new wildcard or Subject Alternative Name certificate right from this screen.
Note that the wizard will automatically link the subject name of the certificate you are importing with the Federation Service Name, which may not be, and in fact probably is not, what you want. Instead, for the Federation Service Name, type in the URL you will want to use when applications request a connection to ADFS — some folks choose adfs.domain.tld, others choose id.domain.tld, still others choose federation.domain.tld. The key here is to not simply accept the default and to make sure the Federation Service Name lines up with the URL you will be using for Web applications that require any sort of transaction with your ADFS deployment.
7. Leave the wizard where it is now and click over to whatever application or service you are using to host your domain name service (DNS) records and add a “Record for the Federation Service Name” you just made in the previous step. Once you have created and saved that new record, come back to the ADFS configuration wizard.
8. Back in the wizard, add the Federation Service Display Name — this is a friendly name, so there are no special rules for how it is formatted or what it must be addressed to — and click Next.
9. Select the account you will run the ADFS service under, and then click Next.
10. On this database screen you can either create a new Windows internal database instance for ADFS or you can point the service to an existing database running in SQL Server. Click Next.
11. Review the options you selected to configure ADFS, and click Next to validate your choices. You can also take a look at the PowerShell script the wizard will actually run to perform the configuration, as most of the wizards in Windows Server 2012 R2 these days are really just front ends to PowerShell script generators.
12. The checks should pass and now you can click Finish to actually configure the service.
Next, you will need to spin up another client or server to test connectivity to the ADFS service. You can use any machine with a Web browser that can access the network on which your ADFS server is installed, as all you are doing here is browsing to a Web page on the ADFS deployment.
On this separate machine — NOT on the ADFS server itself, as it will fail — access the following URLs:
- https://adfs.domain.tld/federationmetadata/2007-06/federationmetadata.xml
- https://adfs.domain.tld/adfs/ls/idpinitiatedsignon.htm
Of course, replace adfs.domain.tld with whatever DNS name resolves to your instance of ADFS. The point here is to make sure that when you get to the first URL, you see the metadata from the ADFS server without any SSL or certificate validity errors. For the second URL, you must see the standard default ADFS sign-on page. If both of these pages come up without errors, you have successfully installed ADFS.
Back on the ADFS server, copy the SSL certificate you used in the configuration wizard to a network share or a thumb drive, so that you can copy it again onto the server on which we will be installing the WAP role (in the next section).
Installing the Web Application Proxy role
Continuing in this process, you will need to create a second machine — as mentioned before — on which the WAP role can be installed. However, this machine should NOT be joined to any domain; it can remain a standalone server.
First, we need to install the certificate you just copied from the ADFS server. You will need to manually import this certificate into the Windows certificate store by following these steps:
1. On the Start menu, type MMC and press Enter.
2. From the File menu, choose Add/Remove Snap-in.
3. In the left pane under “available snap-ins,” choose Certificates, and click the Add button in the middle of the window.
4. A window will pop up, asking which account this snap-in should manage. From the three choices, select Computer account at the bottom and then click Next.
5. Choose the local computer option, and then click Finish.
6. Click OK in the management window, and you will be returned to the MMC console with the certificates snap-in added.
7. In the left pane, expand “Certificates (Local Computer)” and then click on the Personal node.
8. Right click on the Personal node and select Import from the All Tasks menu.
9. Follow the wizard to select the certificate that you previously used and copied down, and finish the import.
Now that the certificate is safely in the certificate store, you can add the WAP role to this server. Open Server Manager, then go to Add Roles and Features and choose the Remote Access option. Follow the wizard through the confirmation screens until you are presented with a page where you are asked to select the remote access services you desire; here, check the box beside the WAP service.
Click Add Features in the screen that pops up asking you about related services that must be installed at the same time, and then click on through until you are finished. (The related services are just interdependencies; for example, to install WAP you need to install IIS, and the wizard preselects this for you. That screen just shows what other services will get installed.)
Within Server Manager, click the yellow warning icon and then follow the link to open the WAP configuration wizard. Enter the same Federation Service Name entry that you configured in the ADFS wizard and for which you set up a DNS entry, and then enter credentials for an account with local administrator privileges on the ADFS server.
Once you get to the certificate selection screen, choose the certificate that you imported earlier, review the PowerShell script that the wizard has again generated and then click the Configure button to set things into motion.
Note: If you get an SSL error relating to the failure to establish a trust relationship, make sure the root certificate authority that created the ADFS certificate that you imported into the WAP server’s certificate store is trusted by the WAP. You can look in the Certificates snap-in of the MMC to see whether the certificate is present. If it is not, import that root certificate using the previous procedure, only this time add it to the Trusted Certification Root Authority node in the MMC snap-in, and not the Personal node. See step 7.)
Setting up an application to use the WAP role
Now that you have set up ADFS on one machine and the WAP role on another machine, you can publish a new application on the WAP server. You do this by publishing rules for the specific URLs that need to pass through the WAP to some server on your network for which you are proxying transmissions.
For the purposes of this walkthrough, you can use the sample claims-based application that comes in the Windows Identity Foundation software development kit, or SDK. You can download the sample application here and get instructions here for setting up the prerequisites for this sample application. You can also use any other application you have at your disposal that works with federated identities as long as it has an external URL endpoint. You will just need to know that endpoint.
To set up a new application, follow these steps:
1. From the Start menu, open the Remote Access Management Console.
2. From the Tasks section on the right of the Remote Access Management Console, click Publish.
3. Click Next to page through the welcome screen.
4. The Preauthentication screen will appear. Select the first option, “Active Directory Federation Services (ADFS)” and click Next.
5. The Relying Party page will appear. Here, select the relying party for the application you are using and click Next. (The relying party is simply the application that needs the credentials that ADFS is federating — in other words, the application that will trust the credentials that ADFS authenticates.)
6. The Publishing Settings page appears. Enter a friendly name for your application, the URL at which external clients can access the application, the certificate that covers that name and the URL of the back-end server if different (for the purposes of this walkthrough, it is the same as the application’s external URL). Click Next.
7. Confirm these settings and click Publish.
Interestingly, you can wrap that entire seven-step sequence up into a single PowerShell command, which again is all the wizard does. (There is no PowerShell that makes sense to use for the steps given on previous pages; it would be a series of commands that is not really any more intuitive or any faster than using Server Manager and the various configuration wizards.)
Add-WebApplicationProxyApplication -BackendServerURL 'https://www.domain.tld/yourappgoeshere'
-ExternalCertificateThumbprint 'qwerty87239874923hjdf0df9'
-ExternalURL 'https://www.domain.tld/yourappgoeshere/'
-Name Test Application
-ExternalPreAuthentication ADFS
-ADFSRelyingPartyName Test Party
At this point, everything should be working, and you should be able to see your application being securely reverse-proxied using the WAP role to clients connecting from the wild Internet.
This article, How to set up Microsoft’s Web Application Proxy, was originally published at Computerworld.com.
Jonathan Hassell runs 82 Ventures LLC, a consulting firm based out of Charlotte, N.C. He’s also an editor with Apress Media LLC. Reach him at jhassell@gmail.com.
Microsoft Web Application Proxy [WAP] is a new service added in Windows Server 2012 R2 that allows you to access web applications from outside your network. WAP functions as a reverse proxy and an Active Directory Federation Services [AD FS] proxy to pre-authenticate user access.
vBoring Blog Series:
- How to setup Microsoft Active Directory Federation Services [AD FS]
- How to setup Microsoft Web Application Proxy
Requirements:
- The only hard requirement of WAP is having an AD FS server. Refer to step 1 for setting that up.
- WAP cannot be installed on a server that AD FS is installed on. They must be separate servers.
Installing the Web Application Proxy Server Role:
Open Server Manager and click Manage -> Add Roles and Features:
Click Next:
Role-based or feature-based installation should be selected then click Next:
Select the server you want to install this role on to and then click Next:
Note: Web Application Proxy role and AD FS cannot be installed on the same computer.
Select Remote Access then click Next:
No additional Features are needed. Click Next:
Click Next:
Select Web Application Proxy:
On the pop up click Add Features:
The Web Application Proxy role does not required a reboot. Click Install:
Once complete click Close:
Web Application Proxy is now installed but you need the AD FS certificate to continue.
Export & Import the AD FS Certificate:
You need the certificate from your AD FS server added to your Web Application Proxy server. Login to your AD FS server and open MMC.exe:
Go to File -> Add/Remove Snap-ins -> select Certificates then click Add:
When you click OK you will get the following pop up. Select Computer account then click Next:
On AD FS Server: Drill down to Personal -> Certificates then right click the SSL certificate you used during setup of AD FS. Go to All Tasks -> Export. Save to a location that your Web Application Proxy can access. Ensure you export the Private Key and certificate as a .PFX file.
On Web Application Proxy: Right click on Personal -> Certificates then go to All Tasks -> Import:
This will bring up the Certificate Import Wizard. Click Next:
Browse to the certificate that you exported from your AD FS server and select it. Click Next:
Enter the password for the private key and check the box to make the key exportable. Click Next:
Leave the default certificate store as Personal. Click Next:
Click Finish:
You should now see the certificate from your AD FS servers on your Web Application Proxy server.
Now we are ready to perform the Post Configuration.
Post-Deployment Configuration:
Back on your Web Application Server open Server Manager then click Notifications then the message Open the Web Application Proxy Wizard:
Click Next:
Enter the FQDN of your AD FS name and the Service Account you created during AD FS setup. Click Next:
On the drop down menu select the certificate you imported from your AD FS server. Click Next:
Click Configure:
Once finished click Close:
Remote Access Management Console should open when you clicked Close. On Operations Status you should see all the objects as green.
Publish Web Applications:
Now we are finally ready for the magic. In the Remote Access Management Console click Web Application Proxy then Publish:
Click Next:
Pass-through will let WAP act like a reverse proxy. I will have documentation on setting up AD FS link soon!
Select Pass-through and click Next:
Name: Enter a display name
External URL: Enter the URL that will be coming in your the WAP server externally
External Certificate: The drop down menu will show certificates that are added on the WAP server. Select the same certificate that you used while setting up your application. In my case I used my wildcard certificate.
Backend server URL: Enter the web URL of the server you want the external URL forwarded
Click Next:
Copy the PowerShell command down and with some minor edits you can easily add additional PassThrough applications with ease.
Click Publish:
Click Close to finish:
You will now see the published web application and ready for testing.
You are ready to test the application!
Configure Firewall for 443 Port Forwarding:
Before you can test you need to ensure you have port 443 (HTTPS) being sent to your WAP server. This step does not involve configuration of your WAP environment but on your firewall. Since this can vary greatly I will give you two examples of this step:
For pfSense you would create a NAT: Port Forward Rule:
For DD-WRT you would go to NAT / QOS then Port Forwarding:
Once added you are ready to test!
From outside your network (like on your phone or a PC elsewhere) try to access your web link. You should get your internal web page through your WAP externally! Success!
Coming Soon!! Setting up Microsoft RDS to use AD FS authentication through WAP!
Deploy Web Application Proxy Role in Windows Server 2012 R2 –Part I
Assumption:
I assume you have the following infrastructure ready.
- Domain Controller: DC1PVDC01
- Certificate Authority: DC1PVCA01
- AD FS Server: DC1PVADFS01
- Exchange Server: DC1PVEXCH01
Naming Convention:
- DC1= Data Center 1 (location)
- P=Production Systems
- V=Virtual Server
- DC=Domain Controller
So on so forth.
Proposed Web Application Proxy Server:
| Option | Description |
| Virtual Machine Name | DC1PVWAP01 |
| Memory | 4GB |
| vCPU | 1 |
| Hard Disk 1 | 50GB |
| Network Adapter | 2 |
| Guest Operating System | Windows Server 2012 R2 |
| Hyper-v Integration Service | Installed |
Windows Server Role:
| Role | Web Application Proxy |
Network Configuration
The network adapter name used within the operating system should be changed to closely match the associated WAP network name. The following binding order will be maintained within Windows operating systems:
- First in Order- WAP internal adapter connected to the trusted network.
- Second in Order- WAP external adapter connected to the un-trusted network.
The following are the network configuration for WAP server.
| Option | IP Address | Subnet | Default Gateway | DNS |
| Internal Network | 10.10.10.2 | 255.255.255.0 | Not required | 10.10.10.1 |
| External Network | 192.168.1.1 | 255.255.255.0 | 192.168.1.254 | Not required |
Important! External Network can be assigned public IP if WAP server isn’t placed behind frontend router/firewall. In an edge configuration WAP external network is configured with public IP and internal network is assigned an IP address of internal IP range.
Configuration Step 1 – Rename Network Adapters:
Rename all network adapters to descriptive names that ideally match the connection type and WAP wizard/console names. For example:
- WAP adapter connected to the trusted network: Internal Network
- WAP adapter connected to the un-trusted network: External Network
Configuration Step 2 – Configure Network Adapters:
The Internal Network adapter will normally be connected to your trusted environment. This could be your actual internal network (LAN) or could be a private DMZ (perimeter network) if using an intranet/back firewall.
Internal Network Adapter
- Default Gateway should not be defined
- DNS Servers should be defined
- Client for Microsoft Networks binding – Enabled
- File and Print Sharing for Microsoft Networks binding – Enabled
- Register this connection’s address in DNS – Enabled
- Enable LMHOSTS Lookup – Disabled
- NetBIOS over TCP/IP – Default
The External Network adapter will normally be connected to your un-trusted environment. This could be your actual Internet connection if using an edge deployment, or could be a public DMZ (perimeter network) if using an existing edge/front firewall.
External Network Adapter
- Default Gateway should be defined
- DNS Servers should not be defined
- Client for Microsoft Networks binding – Disabled
- File and Print Sharing for Microsoft Networks binding – Disabled
- Register this connection’s address in DNS – Disabled
- Enable LMHOSTS Lookup – Disabled
- NetBIOS over TCP/IP – Disabled
Please Note: The ‘File and Print Sharing for Microsoft Networks’ binding on the TMG internal adapter is left at the default settings of Enabled on the WAP Internal Network adapter. This allows for the use of the Internal Network adapter for intra-array services when using a WAP cluster.
Configuration Step 3 – Amend Bind Order:
Edit the network adapter bind order to place the Internal Network adapter at the top (highest) position and the External Network at the bottom (lowest) position. For example:
- Internal Network (Highest)
- External Network (Lowest)
To amend network binding follow the steps below:
1. Click Start, click Network, click Network and Sharing Center, and then click Change Adapter Settings.
2. Press the ALT key, click Advanced, and then click Advanced Settings. If you are prompted for an administrator password or confirmation, type the password or provide confirmation.
3. Click the Adapters and Bindings tab, and then, under Connections, click the connection you want to modify.
4. Under Bindings for <connection name>, select the protocol that you want to move up or down in the list, click the up or down arrow button, and then click OK.
DNS Forwarding:
The following Fully Qualified Domain Names (FQDN) will be forwarded from ISP to your router:
| Purpose | Public Host Name | Public IP Address |
| Exchange | webmail.yourdomain.com | 203.17.x.x |
| SharePoint | sharepoint.yourdomain.com | 203.17.x.x |
External Firewall Rules
The following NAT rules will be added into perimeter network to publish application and services through WAP. This rule is only apply if you please Web Application Proxy (WAP) behind a firewall or Cisco ASA otherwise you don’t need it.
| Rule(s) | Description | Source IP | Destination IP Address | Port | NAT Destination |
| 1 | Exchange | Any | 203.17.x.x | 443 | 192.168.1.2 |
| 2 | SharePoint | Any | 203.17.x.x | 443 | 192.168.1.3 |
Building Web Application Proxy Server on Windows Server 2012 R2 Steps:
- Install Windows Server 2012 R2.
- Configure TCP/IP of Windows Server 2012 R2
- Join Web Application Proxy server to Domain
- Install Web Application Proxy Role
- Configure Kerberos Constraint Delegation
- Configure the firewall to allow HTTPS traffic on port 443 for clients to communicate with the AD FS server
- Configure Firewall if WAP Server placed behind a Cisco ASA
- Install Public certificate into Web Application Proxy Server
- Publish Application
Configure Kerberos Constraint delegation
1. On the domain controller, open Server Manager. To do this, click Server Manager on the Start screen.
2. Click Tools, and then click ADSI Edit.
3. On the Action menu, click Connect To, and then on the Connection Settings dialog box, accept the default settings to connect to the default naming context, and then click OK.
4. In the left pane, expand Default naming context, expand DC=yourdomain, DC=com, expand CN=Computers, right-click CN=DC1PVWAP01, and then click Properties.
5. On the CN=DC1PVWAP01 Properties dialog box, on the Attribute Editor tab, in the Attributes list, select servicePrincipalName, and then click Edit.
6. On the Multi-valued String Editor dialog box, in Value to add, enter HTTP/DC1PVWAP01.yourdomain.com and click Add. Then enter HTTP/DC1PVWAP01 and click Add. The Values list now contains two new entries; for example, HTTP/DC1PVWAP01.yourdomain.com and HTTP/DC1PVWAP01.
7. On the Multi-valued String Editor dialog box, click OK.
8. On the CN=DC1PVWAP01 Properties dialog box, click OK.
9. In Server Manager, click Tools, and then click Active Directory Users and Computers.
10. In the navigation pane, under yourdomain.com, click Computers. In the details pane, right-click the Web Application Proxy server, and then click Properties.
11. On the DC1PVWAP01 Properties dialog box, on the Delegation tab, click Trust this computer for delegation to specified services only, and then click Use any authentication protocol.
12. Click Add, and on the Add Services dialog box, click Users or Computers.
13. On the Select Users or Computers dialog box, in Enter the object names to select, enter the name of the web servers that use Integrated Windows authentication; for example, WebServ1, and then click OK.
14. On the Add Services dialog box, in the Available services list, select the http service type, and then click OK.
15. On the DC1PVWAP01 Properties dialog box, click OK.
Configure AD FS (Optional when using pass-through pre-authentication)
1. On the Start screen, type AD FS Management, and then press ENTER.
2. Under the AD FSTrust Relationships folder, right-click Relying Party Trusts, and then click Add Relying Party Trust to open the Add Relying Party Trust Wizard.
3. On the Welcome page, click Start.
4. On the Select Data Source page, click Import data about the relying party published online or on a local network. In Federation metadata address (host name or URL), type the federation metadata URL or host name for the partner, and then click Next.
5. On the Specify Display Name page type a name in Display name, under Notes type a description for this relying party trust, and then click Next.
6. On the Choose Issuance Authorization Rules page, select either Permit all users to access this relying party then click Next.
7. On the Ready to Add Trust page, review the settings, and then click Next to save your relying party trust information.
8. On the Finish page, click Close. This action automatically displays the Edit Claim Rules dialog box. For more information about how to proceed with adding claim rules for this relying party trust, see the Additional references.
9. in the AD FS Management console, you must set the endpoint to be Proxy Enabled
Configure Certificate Template in CA
Note: This steps is only applicable when using Enterprise certificate authority.
1. Open the Certificate Templates snap-in.
2. In the details pane, right-click an existing certificate that will serve as the starting point for the new certificate, and then click Duplicate Template.
3. Choose whether to duplicate the template as a Windows Server 2003–based template or a Windows Server 2008–based template.
4. On the General tab, enter the Template display name and the Template name, and then click OK.
5. Define any additional attributes such as mark “private key exportable” for the newly created certificate template.
Export & Import Certificates into Web Application Proxy Server
This is a very important steps for published app to work correctly. You must export .pfx certificate from application servers (Exchange, SharePoint or Lync Server) to Web Application Proxy Server so that internet explorer, web application proxy server and application servers validate same certificates.
Exporting a .pfx File
- On the Start menu click Run and then type mmc.
- Click File > Add/Remove Snap-in.
- Click Certificates > Add.
- Select Computer Account and then click Next. Select Local Computer and then click Finish. Then close the add standalone snap-in window and the add/remove snap-in window.
- Click the + to expand the certificates (local computer) console tree and look for the personal directory/folder. Expand the certificates folder.
- Right-click on the certificate you want to backup and select ALL TASKS > Export.
- Choose Yes, export the private key and include all certificates in certificate path if possible.
Warning: Do not select the delete private key option. - Leave the default settings and then enter your password if required.
- Choose to save the file and then click Finish. You should receive an “export successful” message. The .pfx file is now saved to the location you selected.
Importing from a .pfx File
- On the Start menu click Run and then type mmc.
- Click File > Add/Remove Snap-in.
- Click Certificates > Add.
- Select Computer Account and then click Next. Select Local Computer and then click Finish. Then close the add standalone snap-in window and the add/remove snap-in window.
- Click the + to expand the certificates (local computer) console tree and look for the personal directory/folder. Expand the certificates folder.
- Right-click on the certificate you want to backup and select ALL TASKS > Import.
- Follow the certificate import wizard to import your primary certificate from the .pfx file. When prompted, choose to automatically place the certificates in the certificate stores based on the type of the certificate.
Install Web Application Proxy Role
1. On the Web Application Proxy server, in the Server Manager console, in the Dashboard, click Add roles and features.
2. In the Add Roles and Features Wizard, click Next three times to get to the server role selection screen.
3. On the Select server roles dialog, select Remote Access, and then click Next.
4. Click Next twice.
5. On the Select role services dialog, select Web Application Proxy, click Add Features, and then click Next.
6. On the Confirm installation selections dialog, click Install.
7. On the Installation progress dialog, verify that the installation was successful, and then click Close.
Configure Web Application Proxy
1. On the Web Application Proxy server, open the Remote Access Management console: On the Start screen, click the Apps arrow. On the Apps screen, type RAMgmtUI.exe, and then press ENTER. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Yes.
2. In the navigation pane, click Web Application Proxy.
3. In the Remote Access Management console, in the middle pane, click Run the Web Application Proxy Configuration Wizard.
4. On the Web Application Proxy Configuration Wizard, on the Welcome dialog, click Next.
5. On the Federation Server dialog, do the following, and then click Next:
- In the Federation service name box, enter the fully qualified domain name (FQDN) of the AD FS server; for example, fs.yourdomain.com.
- In the User name and Password boxes, enter the credentials of a local administrator account on the AD FS servers.
6. On the AD FS Proxy Certificate dialog, in the list of certificates currently installed on the Web Application Proxy server, select a certificate to be used by Web Application Proxy for AD FS proxy functionality, and then click Next.
7. The certificate you choose here should be the one that whose subject is the Federation Service name, for example, fs.yourdomain.com.
8. On the Confirmation dialog, review the settings. If required, you can copy the PowerShell cmdlet to automate additional installations. Click Configure.
9. On the Results dialog, verify that the configuration was successful, and then click Close.
Publish Application using AD FS Pre-Authentication
1. On the Web Application Proxy server, in the Remote Access Management console, in the Navigation pane, click Web Application Proxy, and then in the Tasks pane, click Publish.
2. On the Publish New Application Wizard, on the Welcome page, click Next.
3. On the Pre-authentication page, click Active Directory Federation Services (AD FS), and then click Next.
4. On the Relying Party page, in the list of relying parties select the relying party for the application that you want to publish, and then click Next.
5. On the Publishing Settings page, do the following, and then click Next:
- In the Name box, enter a friendly name for the application.
- This name is used only in the list of published applications in the Remote Access Management console.
- In the External URL box, enter the external URL for this application; for example, https://sp.yourdomain.com/app1/.
- In the External certificate list, select a certificate whose subject covers the external URL.
- In the Backend server URL box, enter the URL of the backend server. Note that this value is automatically entered when you enter the external URL and you should change it only if the backend server URL is different; for example, http://sp/app1/.
- Web Application Proxy can translate host names in URLs, but cannot translate path names. Therefore, you can enter different host names, but you must enter the same path name. For example, you can enter an external URL of https://apps.yourdomain.com/app1/ and a backend server URL of http://app-server/app1/. However, you cannot enter an external URL of https://apps.yourdomain.com/app1/ and a backend server URL of https://apps.yourdomain.com/internal-app1/.
6. On the Confirmation page, review the settings, and then click Publish. You can copy the PowerShell command to set up additional published applications.
7. On the Results page, make sure that the application published successfully, and then click Close.
Publish an integrated Windows authenticated application
1. On the Web Application Proxy server, in the Remote Access Management console, in the Navigation pane, click Web Application Proxy, and then in the Tasks pane, click Publish.
2. On the Publish New Application Wizard, on the Welcome page, click Next.
3. On the Pre-authentication page, click Active Directory Federation Services (AD FS), and then click Next.
4. On the Relying Party page, in the list of relying parties select the relying party for the application that you want to publish, and then click Next.
5. On the Publishing Settings page, do the following, and then click Next:
- In the Name box, enter a friendly name for the application.
- This name is used only in the list of published applications in the Remote Access Management console.
- In the External URL box, enter the external URL for this application; for example, https://owa.yourdomain.com/.
- In the External certificate list, select a certificate whose subject covers the external URL.
- In the Backend server URL box, enter the URL of the backend server. Note that this value is automatically entered when you enter the external URL and you should change it only if the backend server URL is different; for example, http://owa/.
- Web Application Proxy can translate host names in URLs, but cannot translate path names. Therefore, you can enter different host names, but you must enter the same path name. For example, you can enter an external URL of https://apps.yourdomain.com/app1/ and a backend server URL of http://app-server/app1/. However, you cannot enter an external URL of https://apps.yourdomain.com/app1/ and a backend server URL of https://apps.yourdomain.com/internal-app1/.
- In the Backend server SPN box, enter the service principal name for the backend server; for example, HTTP/owa.yourdomain.com.
6. On the Confirmation page, review the settings, and then click Publish. You can copy the PowerShell command to set up additional published applications.
7. On the Results page, make sure that the application published successfully, and then click Close.
Publish Application using Client Certificate Pre-Authentication
You can publish an application using pre-authenticated client certificate. This steps only be performed using Windows PowerShell. Open Elevated Windows PowerShell prompt in WAP Server. Change the following command as required and issue the command.
Add-WebApplicationProxyApplication
-BackendServerURL ‘https://app.yourdomain.com/’
-ExternalCertificateThumbprint ‘1a2b3c4d5e6f1a2b3c4d5e6f1a2b3c4d5e6f1a2b’
-ExternalURL ‘https://app.yourdomain.com/’
-Name ‘Client certificate preauthentication application’
-ExternalPreAuthentication ClientCertificate
-ClientCertificatePreauthenticationThumbprint ‘123456abcdef123456abcdef123456abcdef12ab’
Publish Application using Pass-through Pre-Authentication
1. On the Web Application Proxy server, in the Remote Access Management console, in the Navigation pane, click Web Application Proxy, and then in the Tasks pane, click Publish.
2. On the Publish New Application Wizard, on the Welcome page, click Next.
3. On the Preauthentication page, click Pass-through, and then click Next.
4. On the Publishing Settings page, do the following, and then click Next:
- In the Name box, enter a friendly name for the application.
- This name is used only in the list of published applications in the Remote Access Management console.
- In the External URL box, enter the external URL for this application; for example, https://maps.yourdomain.com/.
- In the External certificate list, select a certificate whose subject covers the external URL.
- In the Backend server URL box, enter the URL of the backend server. Note that this value is automatically entered when you enter the external URL and you should change it only if the backend server URL is different; for example, http://maps/.
- Web Application Proxy can translate host names in URLs, but cannot translate path names. Therefore, you can enter different host names, but you must enter the same path name. For example, you can enter an external URL of https://apps.yourdomain.com/app1/ and a backend server URL of http://app-server/app1/. However, you cannot enter an external URL of https://apps.yourdomain.com/app1/ and a backend server URL of https://apps.yourdomain.com/internal-app1/.
5. On the Confirmation page, review the settings, and then click Publish. You can copy the PowerShell command to set up additional published applications.
6. On the Results page, make sure that the application published successfully, and then click Close.
Publish Application using Windows Store App or Oauth2
You can publish an application using pre-authenticated Windows Store App. This steps only be performed using Windows PowerShell. Open Elevated Windows PowerShell prompt in WAP Server. Change the following command as required and issue the command.
Set-WebApplicationProxyConfiguration –OAuthAuthenticationURL ‘https://fs.yourdomain.com/adfs/oauth2/’
Add-WebApplicationProxyApplication
-BackendServerURL ‘https://storeapp.yourdomain.com/’
-ExternalCertificateThumbprint ‘1a2b3c4d5e6f1a2b3c4d5e6f1a2b3c4d5e6f1a2b’
-ExternalURL ‘https://storeapp.yourdomain.com/’
-Name ‘Windows Store app Server’
-ExternalPreAuthentication ADFS
-ADFSRelyingPartyName ‘Store_app_Relying_Party’
-UseOAuthAuthentication
Part 1: Install and Configure Forefront UAG Step by Step
Part 2: Publish RDS using Forefront UAG 2010 Step by Step
Part 3: Publish Exchange Server 2010 Using Forefront UAG 2010 Step by Step
Part 4: Redirect Web Application from HTTP to HTTPS using Forefront UAG 2010 Step by Step
Part 5: Publish SharePoint Server 2010 Using Forefront UAG 2010 Step by Step
Part 6: Forefront UAG Patching Order
Forefront TMG 2010: How to install and configure Forefront TMG 2010 —-Step by step
