Quantcast
Channel: Forefront TMG Product Team Blog
Viewing all 233 articles
Browse latest View live

TMG SP2 Rollup 3 available

$
0
0

 

We are happy to announce the availability of Rollup 3 for Forefront Threat Management Gateway (TMG) 2010 Service Pack 2 (SP2). TMG SP2 Rollup 3 is available for download here: Rollup 3 for Forefront Threat Management Gateway (TMG) 2010 Service Pack 2

Please see KB Article ID: 2735208 for details of the fixes included in this rollup. The Build Number for this update is: 7.0.9193.575

To install this update, you must be running Forefront Threat Management Gateway 2010 Service Pack 2.

For more information about Forefront Threat Management Gateway 2010 SP2, please see the following Microsoft website:

Download information for Forefront TMG 2010 SP2

Thank you,

Forefront TMG Team


You can remotely manage the Enterprise Policy, but not the Array Policy

$
0
0

 

I’ll try to elaborate on the issue using as many illustrations and snapshots as possible. When I came across this issue, it was quite surprising.

32-bit Remote Management Client

In the TMG environment, we are using a single EMS (Enterprise Management Server) with a single Array. There are two TMG nodes joined to this array. To manage the environment we are using a Windows 7 32-bit machine with a 32-bit client. Please use this link download the 32-bit client (TMG_ENU_Management_x86.exe). Note that you will need to login with a Microsoft Live Id and register in order to download.

Once downloaded, install the client and connect to the EMS server using its FQDN. Make sure EMS is configured to allow remote management, refer to the below mentioned articles.

· About Forefront TMG roles and permissions - http://technet.microsoft.com/en-us/library/dd897006.aspx#BKMK_RolesAndPermissions

· Configuring roles and permissions - http://technet.microsoft.com/en-us/library/dd441007.aspx

The relevant Users on the list should be able to gain access to the TMG EMS server for administration.

After assigning the correct set of permissions and remote access to TMG EMS server, you can remotely access the Enterprise Policy and make allowed changes.

But while accessing Array nothing displays, it doesn’t even shows the arrays created in the enterprise. Refer to below mentioned Snips.

clip_image002

Here in this snip we can see that Enterprise policy is displayed.

clip_image004

Here you can see the focus is on “Arrays”, but no policies are displayed.

Let’s check and compare the version on TMG EMS server and then on this client.

clip_image006

This is the version number from TMG EMS server which is updated to latest i.e. SP2 RU2

clip_image008

This is the version number from client which is updated to SP1 UP1.

Cause

The major cause of this is due to version mismatch between the management console and the TMG enterprise. For example the TMG enterprise is at SP2 RollUP2 update level which is build number 7.0.9193.540 and the TMG management console on remote 32bit machine is at RTM which is build number 7.0.7734.100 (refer to the article).

Solution

This can be resolved by updating the TMG RTM management console on 32bit Remote machine. Refer to the links mentioned below to download and install the relevant updates.

· SP1

· SP1 UP1

· SP2

This completely depends on the version level of the TMG environment. Check the article mentioned below for all the relevant TMG versions.

http://blogs.technet.com/b/keithab/archive/2011/09/27/forefront-tmg-2010-service-pack-rollup-and-version-number-reference.aspx

Match the version with the updates to the level TMG EMS server is on. There are no rollups released for the MMC.

After updating the client to SP2 we were able to access the array policies on the client machine.

64-bit Remote Management Client

Now goes the story for 64-bit setup. Just to mention there is no separate TMG mmc console installation msp available. For this installation, the TMG 2010 ISO/DVD is used.

NOTE: The following 4 steps outline the default MMC install using the install media.

You may have followed these steps, believing that you would be able to manage TMG EMS remotely using the MMC.

1. TMG setup from installation ISO/DVD by starting Preparation Tools first.

clip_image010

2. On Welcome screen accepted the terms for installation.

3. On Installation type dialog box selected Forefront TMG Management.

clip_image012

4. Wizard finishes its work.

After a default installation of the MMC (from the install media), you may be surprised to find out it doesn’t work . Because TMG is at SP2 or above update level and the MMC installation is at RTM level.

There are updates available which can be used to bring the MMC to the same update level as the TMG EMS server is at. But the procedure used for 32bit installation doesn’t work for 64bit.

I know there are a lot of questions surfacing, but I have the answer.

Because the 64bit mmc is installed straight from the install media, we’ll have to update the installation itself to SP2/ relevant to your environment.

To do this, we’ll need to create a “TMG 2010 Slipstream” installation, in which we update the TMG installation MSI itself.

 

Steps for TMG 2010 Slipstream installation.

1. If the TMG 2010 MMC console was previously installed directly from the install media, you’ll need to uninstall it from Control Panel >> Programs and Feature.

2. Copy all the contents from TMG 2010 ISO/DVD to a folder on HDD. In this example, we will copy the contents to C:\TMG.

3. Download the following TMG 2010 updates; making sure you download all 64bit versions. Use the following links:

a. SP1 - http://www.microsoft.com/en-us/download/details.aspx?id=16734

b. UP1 - http://www.microsoft.com/en-us/download/details.aspx?id=11445

c. SP2 - http://www.microsoft.com/en-us/download/details.aspx?id=27603

4. Once you have downloaded all three files, copy the files to C:\TMG\FPC

5. The UP1 and SP2 are in .exe format, therefore we will need to extract the msp files so they can be used for slipstreaming TMG 2010.

6. Open a command prompt with elevated privileges and, in the C:\TMG\FPC folder, execute the following commands.

a. SP1 Update1 - TMG-KB2288910-amd64-ENU.exe /t TMGSP1U1

b. You’ll get a dialog after completion.

clip_image013

Click ok to close.

c. SP2 - TMG-KB2555840-amd64-ENU.exe /t TMGSP2

d. You’ll get a dialog after completion.

clip_image014

Click ok to close.

7. Below is the snip for commands and folders I used.

clip_image016

8. Under C:\TMG\FPC, there should be two new folders called TMGSP1UP1 and TMGSP2. Both of these folders will contain the extracted msp file.

clip_image018

9. Copy the msp files to FPC folder.

clip_image020

10. Now let’s create slipstream for TMG 2010. Follow the commands and make sure you update it to the same level as TMG EMS.

a. SP1 - msiexec /a ms_fpc_server.msi /p tmg-kb981324-amd64-enu.msp

This will initiate installation wizard, which will slipstream the TMG2010 installation with SP1

b. SP1UP1 - msiexec /a MS_FPC_Server.msi /p TMG-KB2288910-amd64-ENU.msp

This will initiate installation wizard, which will slipstream the TMG2010 installation with SP1UP1.

c. SP2 - msiexec /a MS_FPC_Server.msi /p TMG-KB2555840-amd64-ENU.msp

This will initiate installation wizard, which will slipstream the TMG2010 installation with SP2.

11. Next, you can delete the following highlighted files and folders from C:\TMG\FPC.

clip_image022

12. Once deleted, the C:\TMG\FPC folder appear as follows:

clip_image024

13. Now create an ISO/DVD of the entire C:\TMG folder. Make sure you do not create and ISO/DVD out of only FPC folder.

14. Now this ISO/DVD can be used to install TMG mmc console on a 64-bit client machine using the steps mentioned below.

a. Start TMG setup from installation ISO/DVD by starting Preparation Tools first.

clip_image025

b. On Welcome screen click next and accept the terms for installation.

c. On Installation type dialog box select Forefront TMG Management only.

clip_image026

d. Let wizard to finish its work and then click Finish. This will start mmc installation wizard.

e. Once installation finishes you can access the array policies as well, provided that appropriate permissions are assigned.

Thanks for reading through, I hope I was able to clear your doubts and provide a solution. If you are still facing the issue then I would recommend opening a case with Microsoft CSS.

Author:

Vivek Kumar Sharma

Support Engineer – MSD Security Division

Reviewers:

Junaid Jan

Security Support Escalation Engineer – MSD Security Division

Access to remote FTP server through TMG 2010 may fail with error 550 (Access Denied)

$
0
0

Hi everybody!

In this article we will see how to troubleshoot an issue with accessing an FTP server behind TMG 2010.

Imagine we have the following situation: a client PC on an internal corporate network want to access a remote FTP server through TMG 2010 using an FTP client such as, for example, FileZilla.

clip_image002[7]

The way the FTP is configured (authentication, encryption, ecc…) is out of interest for this case.

On the TMG server, we’ve created an access rule allowing “Read-Only” outbound requests for the FTP protocol:

clip_image004

clip_image006

When we try to connect to our remote FTP server using, for example, FileZilla, we may face the following error:

clip_image008

FTP connection issues through ISA/TMG could be related to many different aspects.

In the following article it’s possible to find a resolution for many of the most common problems:

http://technet.microsoft.com/en-us/library/bb794745.aspx

The problem we’re focusing on in this article, however, is not included in the above troubleshooting guide and depends on a specific by-design behavior of TMG server.

Basically, in our case we see that the connection attempt is failing due to a “550-Access Denied” error after having performed a MLSD command.

What is MLSD exactly ?

Here we can find a description of what MLSD is used for:

http://tools.ietf.org/html/draft-ietf-ftpext-mlst-16#section-7

As we can see from the above:

The MLST and MLSD commands are intended to standardize the file and directory information returned by the Server-FTP process. These commands differ from the LIST command in that the format of the replies is strictly defined although extensible.

In the default configuration of the TMG FTP Access filter in “Read-Only Mode”, the filter will only allow a specific subset of FTP commands. The MLSD command is not included in this set of “Read-Only” commands. FTP clients using LIST command will not experience this problem, since LIST is an allowed command.

Its easy to resolve the problem by allowing write-permissions in the FTP-Filter advanced properties of our access rule:

clip_image010

Now, granting write rights is not always a good choice, and most of the times this is not allowed nor suggested.

Nevertheless, a workaround exists for this situation: in fact, it’s possible to add the MLDS command in the “allowed-commandslist” of the “Read-only” TMG FTP filter.

The following MSDN article explains how to configure add-ins:

http://msdn.microsoft.com/en-us/library/dd435753.aspx

Specifically:

FTP Access Filter

FTP Access Filter is an application filter that is installed with Forefront TMG. It enables FTP protocols. When running in read-only mode, FTP Access Filter blocks all commands in the control channel except the following commands: ABOR, ACCT, CDUP, CWD /0, FEAT, HELP, LANG, LIST, MODE, NLST, NOOP, PASS, PASV, PORT, PWD /0, QUIT, REIN, REST, RETR, SITE, STRU, SYST, TYPE, USER, XDUP, XCWD, XPWD, SMNT. This should block any writing to the server side. The default list of allowed commands can be replaced by a customized list that is written to the collection of vendor parameters sets (FPCVendorParametersSets) associated with the filter. The Firewall service must restarted for the new settings to take effect.

The above article provides a script example through which it is possible to customize FTP filter list. This way, it will be possible to keep the filter configured in Read-Only mode, and also allow the FileZilla connection to work as expected.

Hope this can be useful!

Let's see you back with the next topic!!

Author:
Daniele Gaiulli

Support Engineer – EMEA Forefront Edge

Reviewer:
Philipp Sand

Support Escalation Engineer – EMEA Forefront Edge

Clients Are Not Prompted to Choose a Certificate When Authenticating to ISA/TMG

$
0
0

 

Recently I have been seeing an increasing number of cases with the same symptom especially in the military and the government sector and even in contractors for the government. In these highly secure environments clients largely rely on the use of a “smart” card known as Common Access Cards (CAC) for authentication to their various types of servers and services.

Symptom

Your Internet Security and Acceleration Server (ISA) or Forefront Threat Management Gateway 2010 (TMG) Server is publishing resources internally/externally and your Web Listener is configure to use SSL Client Certificate Authentication. When clients navigate to the site that is published they would normally be prompted to choose their client certificate. Some or all of the clients are not being prompted to choose the certificate. On the ISA/TMG server, you may see a Warning in your Event Log with an Event ID of 36885.

Event Type: Warning
Event Source: Schannel
Event Category: None
Event ID: 36885
Date: date
Time: time
User:
Computer: COMPUTERNAME
Description: When asking for client authentication, this server sends a list of trusted certificate authorities to the client. The client uses this list to choose a client certificate that is trusted by the server. Currently, this server trusts so many certificate authorities that the list has grown too long. This list has thus been truncated. The administrator of this machine should review the certificate authorities trusted for client authentication and remove those that do not really need to be trusted.

Cause

This issue is caused when there are too many trusted certificate authorities in the Certificate Store on ISA/TMG. This is particularly common for servers that need a long list of Department of Defense (DoD) Certificate Authorities. When the list grows beyond 12,228 bytes (the maximum size the current Schannel security package supports) the list will be truncated. If the client doesn't receive the root CA that it needs because it has been truncated, it will not prompt to choose the certificate.

Resolution

There are a few workarounds for this but the one that is easiest to implement and seems to fit the needs of most organizations is below.

On the server or servers that are running ISA/TMG you will need to set the following registry entry to 0 (false):

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL

Value name: SendTrustedIssuerList
Value type: REG_DWORD
Value data: 0

By default the value is 1 (true).

For other possible workarounds please see this KB:

http://support.microsoft.com/kb/933430

Conclusion

Troubleshooting SSL Client Certificate issues can be tricky and time consuming. This issue was certainly difficult to identify the first time I saw it. Hopefully the information I have given you here can save you time, money, and aggravation.

 

Author:

Keith Abluton:

Security Support Escalation Engineer - MSD Security Team

Reviewer:

Richard Barker

Sr. Security Support Escalation Engineer - MSD Security Team

How to configure the TMG Service Account to avoid problem with logging on SQL Server

$
0
0

One of the features introduced with TMG Service Pack 2 is to run the Firewall Service with a Domain account, this allow users to authenticate with Kerberos when using NLB.
Find more information about this feature here: http://technet.microsoft.com/en-us/library/hh454304.aspx

However you should pay attention when specifying the account name to avoid problems with logging to SQL Server, either local or remote.

The account specified is used by TMG to configure the service and also to create the Login in SQL Server.
For the TMG Firewall service to start any format is fine, but for SQL Server only the format domainName\loginName is valid.

For example if you want to use the account TMGSvc in the domain CONTOSO you have to enter CONTOSO\TMGSvc.

clip_image001

Using the UPN (User Principal Name) format or the FQDN (Fully Qualified Domain Name) does not work.
For example you cannot use TMGSvc@Contoso.com or Contoso.com\TMGSvc

The SQL Server documentation for the CREATE LOGIN command has the following note:

"When you are creating logins that are mapped from a Windows domain account, you must use the pre-Windows 2000 user logon name in the format [<domainName>\<loginName>]."

If you try using an invalid format you will see the Log Status as Disconnected and your LLQ folder growing:

clip_image002

 

Author:
Gianni Bragante
Support Engineer - Microsoft Forefront Edge Security Team

Reviewer:
Lars Bentzen
Sr. Escalation Engineer - Microsoft Forefront Edge Security Team

TMG stopped processing web proxy requests

$
0
0

This post is about an issue I worked on several days ago.

Symptom:

========

My customer had a TMG array with two nodes running with NLB. The problem they faced was that from time to time some TMG node couldn't process traffic anymore: requests to the virtual IP (VIP) failed and only rebooting the TMG machine eliminated the issue.

IE was configured to use the NLB virtual IP (VIP) as proxy address. When the issue happened users couldn’t browse internet pages -  the browser didn't show any error page, it just stayed with a blank page.

Troubleshooting:

=============

First of all, I looked at the TMG Web proxy log and found an  error logged there with the result code of 11001 (WSAHOST_NOT_FOUND) for  the request for  “contoso.com”, which we tried to browse in order to reproduce the issue.

Then I took a look at a captured network monitor trace in order to find an appropriate network conversation between the client and TMG:

    Time                             Delta time     Source           Destination        Protocol Length   Info

11:07:26.566261000  1.376436000    CLIENT_IP          TMG_VIP           HTTP     433    GET http://contoso.com/ HTTP/1.1

11:07:26.570933000  0.004672000    TMG_VIP           CLIENT_IP          HTTP     1440   HTTP/1.1 502 Proxy Error ( The host was not found. )  (text/html)

In a web proxy scenario, the web proxy is supposed to resolve the name, however, by some reason the node didn't manage to resolve the remote host.

As the next step, I filtered out the trace for DNS traffic and didn't find DNS packets on the node at all – this looked very suspicious.

Therefore I looked at Netstat and its output showed around ~62000 lines similar to the followings, whereas 2580 was the pid of wspsrv.exe:

  UDP    0.0.0.0:4002           *:*                                    2580

  UDP    0.0.0.0:4003           *:*                                    2580

  UDP    0.0.0.0:4004           *:*                                    2580

  UDP    0.0.0.0:4005           *:*                                    2580

  UDP    0.0.0.0:4006           *:*                                    2580

  UDP    0.0.0.0:4007           *:*                                    2580

  UDP    0.0.0.0:4020           *:*                                    2580

  UDP    0.0.0.0:4021           *:*                                    2580

  UDP    0.0.0.0:4022           *:*                                    2580

  UDP    0.0.0.0:4023           *:*                                    2580

  UDP    0.0.0.0:4024           *:*                                    2580

  UDP    0.0.0.0:4025           *:*                                    2580

  UDP    0.0.0.0:4026           *:*                                    2580

So TMG seemed to use up all UDP ports – hence there was no free UDP port left to use as source port for dns queries. This explained why name resolution failed and why TMG returned 502.

Why was such a great amount of ports used by TMG?

My guess was that it might be doing it on behalf of a client. Therefore, I looked at the Firewall log which showed that there were huge amount of UDP requests from a single client to different external hosts.

Luckily TMG firewall client was installed on the client machine which gave us an application name:

7:27:51 Establish CLINET2_IP 2058 EXTERNAL_HOST_1 54150 0x0 Access Internet UDP domain\user smax4pnp.exe:3:5.1 TMG1 Unidentified IP Traffic

7:27:52 Establish CLINET2_IP 2033 EXTERNAL_HOST_2 9362 0x0 Access Internet UDP domain\user smax4pnp.exe:3:5.1 TMG1 Unidentified IP Traffic

7:27:53 Terminate CLINET2_IP 2026 EXTERNAL_HOST_3 59866 0x80074e20 Access Internet UDP domain\user smax4pnp.exe:3:5.1 TMG1 Unidentified IP Traffic

So TMG used up all the available ports due to the excessive amount of request from this  client/application.

In order to resolve the issue the customer disabled the client  that has  been causing this huge UDP traffic.

 

Author:

Vasily Kobylin, Senior Support Engineer, EMEA Forefront Edge Team

 

Reviewer:

Balint Toth, Senior Support Escalation Engineer, EMEA Forefront Edge Team

Forefront Unified Access Gateway 2010 Service Pack 3 Rollup 1 is available for download

$
0
0

downloadWe are happy to announce that Rollup 1 for Forefront UAG 2010 Service Pack 3 has been released.

UAG 2010 Service Pack 3 Rollup 1 is available as a hotfix download from Microsoft Support as an update to UAG 2010 Service Pack 3.

This important update contains 8 new fixes for reported issues as well as enhanced context tracing to more easily filter trace data per session.

For details, please visit KB 2827350: Description of Rollup 1 for Forefront Unified Access Gateway 2010 Service Pack 3

Please download the Forefront Unified Access Gateway (UAG) 2010 Service Pack 3 package now, and learn more about UAG 2010 SP3 by visiting our TechNet Library.

J.C. Hornbeck| Knowledge Engineer | Microsoft GBS Management and Security Division

Get the latest System Center news onFacebookandTwitter:

clip_image001clip_image002

System Center All Up: http://blogs.technet.com/b/systemcenter/
System Center – Configuration Manager Support Team blog: http://blogs.technet.com/configurationmgr/
System Center – Data Protection Manager Team blog: http://blogs.technet.com/dpm/
System Center – Orchestrator Support Team blog: http://blogs.technet.com/b/orchestrator/
System Center – Operations Manager Team blog: http://blogs.technet.com/momteam/
System Center – Service Manager Team blog: http://blogs.technet.com/b/servicemanager
System Center – Virtual Machine Manager Team blog: http://blogs.technet.com/scvmm

Windows Intune: http://blogs.technet.com/b/windowsintune/
WSUS Support Team blog: http://blogs.technet.com/sus/
The AD RMS blog: http://blogs.technet.com/b/rmssupp/

App-V Team blog: http://blogs.technet.com/appv/
MED-V Team blog: http://blogs.technet.com/medv/
Server App-V Team blog: http://blogs.technet.com/b/serverappv

The Forefront Endpoint Protection blog : http://blogs.technet.com/b/clientsecurity/
The Forefront Identity Manager blog : http://blogs.msdn.com/b/ms-identity-support/
The Forefront TMG blog: http://blogs.technet.com/b/isablog/
The Forefront UAG blog: http://blogs.technet.com/b/edgeaccessblog/

KB: A recurring monthly report job does not run when expected on an array in Forefront Threat Management Gateway 2010

$
0
0

eJust wanted to let you know about a new KB article we published today. This one is a TMG article that talks about an issue where a recurring monthly report job is not created when you expect it.

You can find the complete article here:

KB2830886 - A recurring monthly report job does not run when expected on an array in Forefront Threat Management Gateway 2010 (http://support.microsoft.com/kb/2830886)

J.C. Hornbeck| Knowledge Engineer | Microsoft GBS Management and Security Division

Get the latest System Center news onFacebookandTwitter:

clip_image001clip_image002

System Center All Up: http://blogs.technet.com/b/systemcenter/
System Center – Configuration Manager Support Team blog: http://blogs.technet.com/configurationmgr/
System Center – Data Protection Manager Team blog: http://blogs.technet.com/dpm/
System Center – Orchestrator Support Team blog: http://blogs.technet.com/b/orchestrator/
System Center – Operations Manager Team blog: http://blogs.technet.com/momteam/
System Center – Service Manager Team blog: http://blogs.technet.com/b/servicemanager
System Center – Virtual Machine Manager Team blog: http://blogs.technet.com/scvmm

Windows Intune: http://blogs.technet.com/b/windowsintune/
WSUS Support Team blog: http://blogs.technet.com/sus/
The AD RMS blog: http://blogs.technet.com/b/rmssupp/

App-V Team blog: http://blogs.technet.com/appv/
MED-V Team blog: http://blogs.technet.com/medv/
Server App-V Team blog: http://blogs.technet.com/b/serverappv

The Forefront Endpoint Protection blog : http://blogs.technet.com/b/clientsecurity/
The Forefront Identity Manager blog : http://blogs.msdn.com/b/ms-identity-support/
The Forefront TMG blog: http://blogs.technet.com/b/isablog/
The Forefront UAG blog: http://blogs.technet.com/b/edgeaccessblog/


Error 64 “ The specified network name is no longer available” while accessing a HTTPS site through ISA 2006

$
0
0

 

Here’s some info on an interesting support issue I worked the other day. If you happen to
run into this one day, maybe this will help you get it resolved.

Issue:

We have a website published through ISA 2006. The site is configured for both HTTP and HTTPS access from the ISA server. When a user connects to the site over HTTP, the site comes up fine.

But when he tries over HTTPS, he gets a ‘page cannot be displayed’.

Troubleshooting and Resolution:

We started with live logging on the ISA console while doing a repro of the issue. We were seeing ‘Failed Connection Attempts’ for the traffic coming from the test machine used for the repro, with the error message: Error 64 “The specified network name is no longer available”

This error is very generic and there can be multiple reasons which would translate to this error code.The most common one is when the backend server is performing a dirty TCP connection reset.

So, to check this further, we collected a network monitor trace on the internal NIC of ISA server.

We filtered down to the traffic that is of interest to us.

clip_image001

clip_image001[5]

 

 

So this clearly indicates that the backend server is Resetting the TCP connection prematurely and this is triggering the ‘64 Error’.

Investigating further, we identified that the backend device is a 3rd party load balancer. And for some unknown reasons, the ISA server was failing at the SSL handshake stage.

So, we had the 3rd party support team collect a dump of the SSL settings on the Load Balancer and identified the following:

clip_image004

Then, we went back to the Network Monitor trace (the earlier screenshot) and compared this with the ciphers advertised by ISA server in the client hello. RSA_WITH_RC4_128_MD5 is not part of the Cipher list sent by the ISA server.

Due to this, the 2 peers are not able to successfully choose a common encryption scheme and the SSL handshake fails.

After identifying this, we had the 3rd party vendor enable additional Ciphers which are accepted by ISA server.

Once we did this, the published site was accessible from the internet.

The issue was resolved!!

Hope this would be helpful when you are troubleshooting website accessibility issues through ISA server…especially with 3rd party load balancers in the infrastructure.

Author:

Karthik Divakaran

Security Support Engineer - Microsoft Forefront Edge Team

Reviewers:

Suraj Singh

Security Support Escalation Engineer - Microsoft Forefront Edge Team

Richard Barker

Security Sr. Support Escalation Engineer – Microsoft Forefront Edge Team

TMG Service recovery actions

$
0
0

If the Firewall service crashes a number of times within a short time period it does not automatically restart after the 4th crash. If you review the Service Control Manager settings for the Firewall service appears to be configured to restart after all failures.

clip_image001

After each of the first three failures, you will see this error in the event log:

Log Name:      System
Source:        Service Control Manager
Date:          3/4/2013 1:36:24 PM
Event ID:      7031
Level:         Error
Computer:      TMG.domain.local
Description:
The Microsoft Forefront TMG Firewall service terminated unexpectedly.  It has done this 3 time(s).  The following corrective action will be taken in 60000 milliseconds: Restart the service.

This is inline with the expected behavior.

However, after the fourth failure the service will no longer restart and you will see this error in the event log:

Log Name:      System
Source:        Service Control Manager
Date:          3/4/2013 1:45:34 PM
Event ID:      7034
Level:         Error
Computer:      TMG.domain.local
Description:
The Microsoft Forefront TMG Firewall service terminated unexpectedly.  It has done this 4 time(s).

The behavior may appear inconsistent and unexpected but it is actually by design.

During the TMG installation, the service is configured to only automatically restart after the first 3 crashes in a 24 hour period in order to raise the attention of the system administrator that something is going wrong with this service that needs investigating. This can be considered similar to IIS Rapid Fail Protection to avoid a situation where we are restarting and then crashing straight way

By checking the service configuration in the registry key, HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\fwsrv we can see the following:

clip_image003

The number of configured recovery actions is actually four, the first three being "Restart the service" and the fourth being "Do nothing", this results in the behavior described above.

The Windows Service Control Manager UI is limited to displaying only the first 3 actions and therefore gives the wrong impression of the configured actions.

If you have good reasons to configure the service to restart for subsequent failures you can do so by running the following command at an elevated command prompt:

Sc.exe failure fwsrv reset= 86400 actions= restart/60000/restart/60000/restart/60000

This configures 3 restart actions to restart the service after 60 seconds. The last action will be used to determine the behavior of subsequent crashes.

To revert to the default TMG behavior please run the following command from an elevated command prompt:-

Sc.exe failure fwsrv reset= 86400 actions= restart/60000/restart/60000/restart/60000//

This will re-configure Service Control Manager to restart the Firewall service for the first 3 crashes but to then take no action for the 4th and subsequent crashes.

 

Author:

Gianni Bragante

Support Engineer - Microsoft Forefront Edge Security Team

Reviewer:

Ian Parramore

Sr. Escalation Engineer - Microsoft Forefront Edge Security Team

ISA 2006 / TMG 2010: DISABLE CLIENT-INITIATED SSL RENEGOTIATION, PROTECTING AGAINST DOS ATTACKS AND MALICIOUS DATA INJECTION

$
0
0

In these days we received a considerable number of support requests asking for more info about SSL/TLS Renegotiation and the risk it introduces of being exposed to DoS attacks and malicious code injections.

The requests in object were focused on ISA/TMG products, considering they are used as reverse proxy for web publishing purposes, but the below considerations can be considered valid for every kind of Windows server/client supporting SSL/TLS connections.

First, what is exactly SSL/TLS Renegotiation?

"TLS [as defined in RFC 5246] allows either the client or the server to initiate a renegotiation -- a new handshake that establishes new cryptographic parameters. Unfortunately, although the new handshake is carried out using the cryptographic parameters established by the original handshake, there is no cryptographic binding between the two. This creates the opportunity for an attack in which the attacker who can intercept a client's transport layer connection can inject traffic of his own as a prefix to the client's interaction with the server"

The above definition is taken from RFC 5746.

The following is a graphic representation of a basic SSL/TLS Handshake:

clip_image002

 

 

 

 

 

 

 

 

 

 

Under certain circumstances, the client could be asking the server a renegotiation of the SSL/TLS parameters using the same TCP socket:

clip_image004

If the SSL/TLS is not secure (as per RFC 5746 recommendations) a MITM could use the renegotiation to send the server malicious data, pretending to be "good" user.

clip_image006

What chances do we have to mitigate this issue?

You should make sure, that the following security hotfix is installed:

http://support.microsoft.com/kb/980436

This fix is making the system compliant with RFC 5746, mitigating the risk of malicious data injection.

To provide backward compatibility, this security update works in the following modes: STRICT and COMPATIBLE

Compatible mode

o If this security update is applied to the server, and the server is in compatible mode, the server allows all clients to set up and renegotiate Transport Layer Security (TLS) sessions. This occurs whether the clients are updated or are not updated by using this security update.

o Similarly, if this security update is applied to the client, and the client is in compatible mode, the client can set up and renegotiate TLS sessions with all the servers for which this security update is applied or is not applied.

Strict mode

o If this security update is applied to the server, and the server is in strict mode, the server allows only those clients to which this security update is applied to set up and renegotiate TLS sessions. The server does not allow the clients to which this security update is not applied to set up the TLS session. In this case, the server terminates such requests from the clients.

Similarly, if this security update is applied to the client, and the client is in strict mode, the client can set up and renegotiate TLS sessions with all the servers for which this security update is applied. The clients cannot set up TLS sessions at all with servers for which this security update is not applied. The client cannot move ahead with a TLS negotiation attempt with such servers.

By default, this security update enables the TLS or Secure Sockets Layer (SSL) client or server to stay in compatible mode. An administrator can use the AllowInsecureRenegoClients and the AllowInsecureRenegoServers entry DWORD values in the following registry path to enable strict mode on the client or on the server:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurityProviders\SCHANNEL

The following table shows how these DWORD values can be used:

DWORD

Value = zero

Value = nonzero

AllowInsecureRenegoClients

Strict Server

Compatible Server

AllowInsecureRenegoServers

Strict Client

Compatible Client

Malicious data injection is not the only problem related to Renegotiation: it can be in fact used to perform DoS attacks against a server.

When a new SSL/TLS connection is being negotiated, the server will typically spend significantly more CPU resources than the client. A malicious user, leveraging the Renegotiation, could be able to enhance the server's CPU usage causing DoS.

In order to have a better mitigation for both malicious data injection and DoS attacks, the best option would be to reject the client-initiated SSL/TLS renegotiation at all.

The following Microsoft Security Advisory explains how:

http://support.microsoft.com/kb/977377/en-us

As reported in the article, the behavior can be modified by changing the value of the following registry key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurityProviders\SCHANNEL\DisableRenegoOnServer

Notes

· If the DisableRenegoOnClient subkey is present and has any nonzero value:

o The client will not initiate renegotiation.

o The client will not respond to renegotiation.

· If the DisableRenegoOnClient subkey is missing or is present and has a zero value:

o The client will initiate renegotiation.

o The client will respond to renegotiation.

· If the DisableRenegoOnServer subkey is present and has any nonzero value:

o Server initiated renegotiation is not allowed.

o The server will not respond to renegotiation requests from the client.

· If the DisableRenegoOnServer subkey is missing or is present and has a zero value:

o Server initiated renegotiation is allowed.

o The server will respond to renegotiation requests from the client.

Of course, this may have an impact on the use of specific applications requiring SSL/TLS renegotiation feature.

The KB article underlines the following:

o After you install this security update, you cannot use the legacy provisioning service parameter (–UseLegacyProvisioningService) when you create a federation trust with the Microsoft Federation Gateway. The security update will prevent the federation trust from working correctly. This problem will occur if you install this security update on a computer that is running Exchange Server 2010 or Exchange Server 2010 Service Pack 1 before you have created a federation trust. To avoid this problem, you must create the federation trust before you install this security update. 
For more information about how to create a federation trust by using the –UseLegacyProvisioningService parameter, visit the following Microsoft webpage:
Create a Federation Trust

o When you install this update on a computer that has the Microsoft Online Single Sign-In services client installed, you may experience the following issues:

· The Sign In client cannot obtain user configuration information. This only affects new users who are running the Sign In client for the first time. The Sign In client cannot obtain information to configure Outlook. If the Sign In client has already run and configured the applications, there are no additional issues with the Sign In client.

· Outlook users cannot see free/busy information. Therefore, this update also affects existing Outlook users.
To resolve this problem, set the DisableRenegoOnClient registry entry to a value of 0 (zero), and then restart the computer.

o This update disables TLS/SSL renegotiation, common protocol functionality that is required for specific applications. This may cause this software to no longer function as expected. If any side effects are experienced, customers should uninstall the workaround to resolve the issue.
The following software has been tested by Microsoft and that has been found to experience problems when you install this update:

· Windows 7 DirectAccess: The IP HTTPS interface will not function.

· Exchange ActiveSync: Does not function when it uses certificate client authentication.

· Internet Information Services (IIS): In certain configurations, IIS using certificate client authentication, including certificate mapping scenarios, will be affected. Site-wide client certificate authentication will not be affected and will continue to function.

· Internet Explorer: When you browse Web sites that require client certificate authentication, but not site-wide client certificate authentication, you may not successfully be able to connect.

Of course, it's not possible to predict the implications of disabling client-initiated renegotiation for various applications: this solution should be appropriately tested in each specific environment.

From a security point of view, though, this is the recommended way to mitigate all the above described problems.

Hope this can help!

 

Author: 

Daniele Gaiulli

Support Engineer – Microsoft Forefront Edge Security Team

Reviewer:

Philipp Sand

Sr. Support Escalation Engineer – Microsoft Forefront Edge Security Team

TMG SP2 Rollup 4 available

$
0
0

 

We are happy to announce the availability of Rollup 4 for Forefront Threat Management Gateway (TMG) 2010 Service Pack 2 (SP2). TMG SP2 Rollup 4 is available for download here: Rollup 4 for Forefront Threat Management Gateway (TMG) 2010 Service Pack 2

 

Please see KB Article ID: 2870877 for details of the fixes included in this rollup. The Build Number for this update is: 7.0.9193.601

 

To install this update, you must be running Forefront Threat Management Gateway 2010 Service Pack 2.

For more information about Forefront Threat Management Gateway 2010 SP2, please see the following
Microsoft website:

Download information for Forefront TMG 2010 SP2

 

Thank you,

Forefront TMG Team

The case of the big AD LDS database

$
0
0

recently we were working with customers, who did run into issues where the AD LDS database grew very large and they ended up with a full disc on System Drive.

The AD LDS database files can be found in %windir%\ADAM. The file which did grow quite big is the adamntds.dit.

The AD LDS on TMG is used to save and distribute the TMG configuration. Back in ISA days, you could only find it for Enterprise Edition Servers, in TMG every server has AD LDS installed, but only the Master Node or the EMS has a running and active AD LDS instance running. The AD LDS instance is called ISASTGCTRL.

When analyzing the customers environment, we found, that they were applying multiple configuration changes every hour, by running a custom script which modified the configuration in a way, that some elements were deleted and added.

By design AD LDS keeps track on all deleted records though. This lead to the scenario where the database file grew more and more, as all deleted records were not permanently deleted by only flagged as “to be deleted”.

When we did run the command

Ldifde –m –f exportfpc2.ldf –s localhost –t 2171 –d “CN=FPC2”

we did see a quite small export file of the configuration, which can be some MB depending on the configuration.

When you execute ldifde and add the –X parameter to also show deleted or tombstone objects like this:

Ldifde.exe –x -m -f exportfpc2.ldf -s localhost -t 2171 -d "CN=FPC2" you might see that the output file can grow very large indeed.

 

The reason for this behavior is, that the AD LDS is configured with a default Tombstone lifetime of 180 days. Therefore all objects remain in the database file until this tombstone lifetime had been exceeded.

Please be aware, that the Tombstone lifetime also controls the amount of days, which can be between a sync of the AD LDS for the case you have multiple AD LDS Server, e.g. in a EMS scenario.

Please visit these sites or some useful information about the tombstone lifetime:

Scenario Overview for Restoring Deleted Active Directory Objects - http://technet.microsoft.com/en-us/library/dd379542(v=WS.10).aspx

Appendix A: Additional Active Directory Recycle Bin Tasks - http://technet.microsoft.com/en-us/library/dcf3431a-c562-447f-a591-4742d2bcdbfa(v=ws.10)#BKMK_1

Depending on your backup strategy for AD LDS you might want to decrease this value if you face the issue, that the AD LDS is using all your Systemdrive disc space. As a rule of thumb the Tombstone Lifetime should not be smaller than the period of days between every full backup of AD LDS. E.g. Full Backup every 7 days -> Tombstone should be at least 8+ days. The minimum value you can define is 3 days.

You can modify the Tombstone lifetime like this:

On TMG where AD LDS is running, open ADSI Edit and connect to the local AD LDS -> localhost:2171 in Well-known-Context: “Configuration”

In Services->Windows NT -> Directory Services – right-click Directory Services and search for tombstoneLifetime. By default this is set to 180, depending on the customers backup strategy they can decrease this value. As a rule of thumb the Tombstone Lifetime should not be smaller than the period of days between every full backup of AD LDS. E.g. Full Backup every 7 days -> Tombstone should be 8+ days.

clip_image002

After the change, you need to restart the ISASTGCTRL to apply the change.

To manually trigger a garbage collection, you need to open ldp.exe on the host and connect to localhost:2171 again. Please make sure to connect using a local admin or AD LDS admin.

Next choose Browse -> Modify.

In Attribute add dogarbagecollection with value „1“. Next click Enter and afterwards run.

clip_image002[6]

Depending on the size of the DB, the garbage collection might not be able to clean all records at once / it might take some days to completely clean up the records.

To monitor the garbage collection, you can increase the tracing using by changing the registry.

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:

How to back up and restore the registry in Windows 322756 (http://support.microsoft.com/kb/322756/)

The RegKey you need to look for is HKLM\SYSTEM\CCS\services\ADAM_ISASTGCTRL\Diagnostics you can change the value of the key „6 Garbage collection” to 5 for purposes of monitoring/troubleshooting.

Afterwards you can monitor the events in Application and Services -> ADAM (ISASTGCTRL).

Please be aware the garbage collection is usually triggered once a day, therefore you do not need to trigger the garbage collection manually.

Afterwards you can check the size of the database files on your disc again, and you will realize, that the size did not change… at least it should not grow any more now Smile

In order to free up some disc space, you will need to perform an offline defragmentation of the AD LDS as described here: http://support.microsoft.com/kb/232122 or http://support.microsoft.com/kb/930832

If you decide to use esentutl, the command looks like this: esentutl.exe /d adamntds.dit

Hope that helps!

Author:

Philipp Sand

Microsoft CSS Forefront Security Edge Team

TMG 2010 – YOU CANNOT REMOTELY CONNECT TO TMG SERVER WHEN IT’S PUBLISHING RDP PROTOCOL

$
0
0

If some of you recently tried to publish RDP protocol through TMG server, and suddenly lost the possibility to perform TS connections to the TMG server itself, you may find this post useful!

In TMG 2010, a System Policy rule exists allowing RDP traffic from a white-list of workstations to the TMG server itself.

clip_image002

Thanks to this, it’s generically possible to connect to our TMG server from allowed PCs.

If you perform the following command, you’ll be able to see the TCP listener bound to the Remote Desktop Services (RDS) service accepting incoming RDP connections on default port 3389:

Netstat –ano | findstr :3389

clip_image003

Now, let’s assume that you have to publish RDP protocol externally through TMG, so that TS connections from external devices toward an internal server can be established, while the internal server’s IP address is masked.

You can do this by creating a specific “Non-Web server publishing rule” in TMG:

clip_image005

If you run again the netstat command mentioned above after you performed this configuration, you will see no differences at all, and everything should be working as expected.

Let’s now assume you have to reboot the TMG server.

After the reboot, if you run the netstat, you’ll see that the situation has changed:

clip_image006

clip_image007

Now the TMG server is listening for RDP connection only on the IP address which has been configured within TMG’s Server Publishing rule.Moreover, we can see that the listener is now associated to the PID of the FW service itself, and we no longer have entries related to the RDS service.

If you test TS connectivity to the TMG server from one of the allowed internal workstations, it will now fail.

This happens because of a socket conflict generated between the FW service and the RDS service, and it is an expected behavior.

In order to allow remote access while publishing RDP, basically 2 solutions exist: 

  1. You can publish the RDP server on different port than 3389, using non web server publishing rule and creating a “customized” RDP protocol for the new considered port.

  2. You can just change the RDS on the TMG to listen on a different port or adapter

 To apply this second solution, you can open Remote Desktop Session Host Configuration> Right-Click on RDP-TCP> Network Adapter> then select the internal NIC.

clip_image009

After this action, just restart the RDS service.

If you now run a new netstat, you’ll see the following situation:

clip_image010

You will now have the RDS service listening on the IP addresses bound to the internal NIC, while the FW service is listening on the external side for RDP publishing.

With this configuration, it’s again possible to establish TS connections to the TMG server even when the server publishes the RDP protocol.

As always…I hope you can find this useful!!

Author:

Daniele Gaiulli
Support Engineer – Microsoft Forefront Edge Security Team

Reviewer:

Philipp Sand
Sr. Support Escalation Engineer – Microsoft Forefront Edge Security Team

TMG Web Listener Certificate "Private Key handle error" 0x80090016

$
0
0

You may face an issue with a certificate assigned to a listener that suddenly becomes invalid and therefore the incoming SSL connection are dropped.

Restarting the service you will show the following error:


Event Source: Microsoft Firewall
Event ID: 14060
Description: Description: Cannot load an application filter Web Proxy Filter ({4CB7513E-220E-4C20-815A-B67BAA295FF4}). FilterInit failed with code 0x80092004.
To attempt to activate this application filter again, stop and restart the Firewall service.

The problem can be caused by the permission on private keys of the certificate store becoming corrupted. This may be affecting one or more certificates.
In these cases deleting the bad certificate and re-importing can help to resolve the the problem most of the times.

Find more information in this article: http://blogs.technet.com/b/isablog/archive/2009/03/10/unable-to-start-microsoft-firewall-service-in-isa-server-2006.aspx

In some cases you may have lost the original PFX file or forgot the password and need the fix the issue using a different approach.
In this article we will discuss how to better diagnose the issue and try to fix it, this may or may not work in your environment depending on the entity of the damage.

You can identify the invalid certificates by opening the TMG console, even if the Firewall service is not running, and try to assign the right certificate to all of your listeners.
By unselecting the checkbox “Show only valid certificates”, you will see a message similar to that in the screenshot below:

In the properties of the listener, when selecting a certificate, you may get the status “Private key handle error” or “Invalid key”

You can try fixing the issue from the Certificates console:

  • Execute MMC

  • Add the Certificate snap-in for the Local computer

  • In the Personal store right click on the certificate, All task, Manage Private keys

  • If you can assign Full control to the local Administrators group and to SYSTEM

  • Then go back to the TMG console and select the certificate, it should appear valid

  • Save and apply the configuration and try to start the Firewall service

However you may be unable to assign the permission from the certificates console, you may get an Access denied error.
In this case you will have to identify the file with the certificate’s private key, the file is located in the folder c:\ProgramData\Microsoft\Crypto\RSA\MachineKeys

To troubleshoot the issue, you can use Process Monitor from SysInternals (DOWNLOAD: http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx).Once downloaded and extracted follow these steps:

  • Close all running programs, just keep the Certificates MMC open

  • Start Process Monitor, a capture will start automatically

  • On the Certificate MMC go to Manage Private keys as described above

  • Once you get the Access Denied error go back to Process Monitor and press CTRL-E to stop the capture

  • Click on Tools then Process Tree

  • Scroll down to mmc.exe, right click then Add process to Include filter, then click Close

  • The events will be filtered and only those generated by MMC will be displayed

  • Scroll down in the list and you will see some rows generated while trying to access to the private key file and ACESS DENIED in the result column, right click on any of them then Jump To …

  • The right folder and file will automatically be opened and you will be able to assign the permissions. You may also need to take ownership of the file in order to do that.

  • Then go back to the TMG console and select the certificate, it should appear valid

  • Save and apply the configuration and try to start the Firewall service

It is important to always re-select the certificate in the TMG console, this way the additional permissions required by the TMG Firewall service will be assigned automatically.

Depending on the entity of the damage you may need to follow the above steps for all the certificates affected by the issue.

Author:

Gianni Bragante
Support Engineer – Microsoft Forefront Edge Security Team

Reviewer:

Philipp Sand
Sr. Support Escalation Engineer – Microsoft Forefront Edge Security Team

 


TMG HTTPS inspection is failing if the target Web site is using a CNG certificate

$
0
0

If you have configured HTTPS Inspection on TMG you may not be able to access some sites such as Twitter and Dropbox.
In this scenario  clients will get a blank page and in the TMG logs you will see the error 0x8009000a

This happens when:

  • Web site that are using certificate with suite-B algorithm

  • TMG certificate used by HTTPS inspection feature to sign the certificate that will be sent to client is not compatible with suite-B certificate.

To resolve the problem you need to install a CNG certificate for the HTTPS Inspection feature

As example here is a  PowerShell script that create a self-signed CNG certificate:

#SCRIPT - Generate Self-signed CNG Certificates for Certificate signing purpose, This will be used by TMG Https Inpection  
#AUTHOR - Franck Heilmann - Microsoft Corporation  
#VERSION - 1.1
#$ErrorActionPreference = "Stop"  
 
Write-Host "`n WARNING: This script sample is provided AS-IS with no warranties and confers no rights." -ForegroundColor red  
Write-Host "`n This script sample will generate self-signed CNG Authority certificate to be used by TMG HTTPS Inspection feature"  
Write-Host " in the Local Computer Personal certificate store.`n Private is can be exported. As well the .cer and .pfx files will be save ini the provided directory`n`n"  
 
$outputDir = Read-Host "`nEnter directory path where certificate will be saved"  
$Subject = Read-Host "`nEnter the Subject for certificate "  
$password = Read-Host -assecurestring "`nPfx password"  
$ValidateDays = Read-Host "`nCertificate Validity days: (please enter number of days)"  
 
#Generate cert in local computer My store  
$name = new-object -com "X509Enrollment.CX500DistinguishedName.1"  
$name.Encode("CN=$Subject", 0)  
 
# The Key  
$key = new-object -com "X509Enrollment.CX509PrivateKey.1"  
$key.ProviderName = "Microsoft Software Key Storage Provider" # CNG is Software Key Storage "Microsoft RSA SChannel Cryptographic Provider"  
$key.KeySpec = 0 # was 1 but 0 looks needed for CNG http://msdn.microsoft.com/en-us/library/aa379409(VS.85).aspx  
$key.keyUsage =0xfffff # Set the key usage to all usage http://msdn.microsoft.com/en-us/library/windows/desktop/aa379410(v=vs.85).aspx  
$key.Length = 2048  
$key.SecurityDescriptor = "D:PAI(A;;0xd01f01ff;;;SY)(A;;0xd01f01ff;;;BA)(A;;0x80120089;;;NS)" # Allow Write NT AUTHORITY\SYSTEM Allow Write BUILTIN\Administrators Allow Write NT AUTHORITY\NETWORK SERVICE  
$key.MachineContext = 1  
$key.ExportPolicy = 1 # Allow private key to be exported XCN_NCRYPT_ALLOW_EXPORT_FLAG 0x00000001 http://msdn.microsoft.com/en-us/library/windows/desktop/aa379002(v=vs.85).aspx  
$key.Create()  
Write-Host "`nPrivate Key created ......"  
 
#The certificate itself  
$cert = new-object -com "X509Enrollment.CX509CertificateRequestCertificate.1" # Interface for self signed cert request http://msdn.microsoft.com/en-us/library/windows/desktop/aa377124(v=vs.85).aspx  
$cert.InitializeFromPrivateKey(2, $key, "")  
$cert.Subject = $name  
$cert.Issuer = $cert.Subject  
 
$today =get-date  
$cert.NotBefore = $today.AddDays(-1) # yesterday  
$cert.NotAfter = $cert.NotBefore.AddDays($ValidateDays)  
 
# Add Key usage to the certificate, this is needed as TMG chek this during certificate import  
$KeyUsage = new-object -com "X509Enrollment.CX509ExtensionKeyUsage.1"  
$Keyusage.InitializeEncode(0x4) #0x4 XCN_CERT_KEY_CERT_SIGN_KEY_USAGE http://msdn.microsoft.com/en-us/library/windows/desktop/aa379410(v=vs.85).aspx  
$cert.X509Extensions.Add($keyusage)  

$BasicConstraints = new-object -com "X509Enrollment.CX509ExtensionBasicConstraints.1"

$BasicConstraints.InitializeEncode(1,0) #set isCA to true, max path of 0 means it can't create subordinate CAs, only endpoint certs

$cert.X509Extensions.Add($BasicConstraints)
$cert.Encode()  
Write-Host "`nCertificate created ......"  
 
$enrollment = new-object -com "X509Enrollment.CX509Enrollment.1"  
$enrollment.InitializeFromRequest($cert)  
 
$certdata = $enrollment.CreateRequest(0)  
 
 
$enrollment.InstallResponse(2, $certdata, 0, "")  
Write-Host "`nCNG self signed installed in the Computer certificate local store"  
 
#Create the ".pfx" and ".cer" version by exporting the just inserted certificate  
$store = new-object System.Security.Cryptography.X509Certificates.X509Store "My","LocalMachine"  
$store.Open("ReadOnly")  
$certs = $store.Certificates  
$cerPath = $outputDir+ "\"+ $Subject+ ".cer"  
$pfxPath = $outputDir + "\" + $Subject + ".pfx"  
 
foreach ($cert in $certs)  
{  
# write-host $cert.Subject  
if($cert.Subject -like ("CN="+ $Subject))  
{  
$ExportCert = $cert.Export(1) #http://msdn.microsoft.com/fr-fr/library/system.security.cryptography.x509certificates.x509certificate2.aspx 1=.cer 3=.fx  
[System.IO.File]::WriteAllBytes(($cerPath), $ExportCert)  
Write-Host "`nCertificate .cer exported to: " $cerPath  
$PFXStrData =$cert.Export(3,$password)  
[System.IO.File]::WriteAllBytes($pfxPath, $PFXStrData)  
Write-Host "`nCertificate with private Key .pfx exported to: " $pfxPath  
}  
}  
$store.close()  
 
#now Import it to Local computer Root store  
$RootCert = new-object System.Security.Cryptography.X509Certificates.X509Certificate2 $cerPath  
$RootStore = new-object System.Security.Cryptography.X509Certificates.X509Store "Root","LocalMachine"  
$RootStore.Open("ReadWrite")  
$RootStore.Add($RootCert)  
Write-Host "`nCertificate installed in Local computer - Trusted root"  
$RootStore.close()  
 
Write-Host "`nDone ... `n" -ForegroundColor Green

You will have to copy the above lines into a new file and then save it into a file name with .ps1 extension, such as CNG-HTTPSi.ps1 on a computer running Windows 2008 R2 SP1 or later.

Then follow these steps:

  • Open a PowerShell window as administrator

  • Ensure local scripts can be executed by running the command:
    Set-ExecutionPolicy Set-ExecutionPolicy RemoteSigned
    Find more information about execution policy in this article: http://technet.microsoft.com/en-us/library/ee176949.aspx

  • Execute the script with the command ./CNG-HTTPSi.ps1

  • Enter the path where the certificates will be saved

  • Enter the subject, such as ”CNG HTTPS Inspection”

  • Enter the pfx password

  • Enter the validity of the certificate in days, for example 730 for two years

  • In the specified folder you will find a .cer and a .pfx files

  • Deploy the cer file in the Trusted Root container to all clients and the TMG servers, you can deploy the certificate manually or using Active directory
    Find more information in this article: http://technet.microsoft.com/en-us/library/dd441069

  • Once the certificate is deployed you can reconfigure HTTP Inspection on TMG importing the pfx certificate generated by the script

  • Save and apply the configuration then you will be able to reach the site

  

Author:

Gianni Bragante
Support Engineer – Microsoft Forefront Edge Security Team

Reviewer:

Franck Heilmann
Sr. Escalation Engineer - Microsoft Forefront Edge Security Team

Philipp Sand
Sr. Support Escalation Engineer – Microsoft Forefront Edge Security Team

TMG SP2 Rollup 5 now available

$
0
0

We are happy to announce the availability of Rollup 5 for Forefront Threat Management Gateway (TMG) 2010 Service Pack 2 (SP2). TMG SP2 Rollup 5 is available for download here: Rollup 5 for Forefront Threat Management Gateway (TMG) 2010 Service Pack 2

 

Please see KB Article ID: 2954173 for details of the fixes included in this rollup. The Build Number for this update is: 7.0.9193.644

 

To install this update, you must be running Forefront Threat Management Gateway 2010 Service Pack 2.

For more information about Forefront Threat Management Gateway 2010 SP2, please see the following
Microsoft website: Microsoft Forefront Threat Management Gateway 2010 Service Pack 2

Download information for Forefront TMG 2010 SP2

 

Thank you,

Forefront TMG Team

How to create a CNG HTTPSi cert using a 2008r2 CA

$
0
0

In a previous article we explained how to create a self-signed CNG certificate, suitable for the HTTPS Inspection feature, which can be used to inspect sites using an SHA-256 certificate.

In this article we will explain how to generate a similar certificate using your internal CA based on Windows 2008 R2.

Using a certificate issued by your own CA, rather than a self-signed certificate, has the advantage that you will not have an additional certificate to distribute to the web proxy clients.
Bearing in mind that certificates have a limited validity period and that this eases operation maintenances, since you need only to change only the Subordinate CA certificate on TMG.

Arguably it can be said that if you set a validity period long enough, as some tenth of years, this would not be an issue.
But the truth is that what is considered secure today, might be easily compromised in a couple of years and for that reason, having an easy way to replace your certificates also improves your overall security.
The ability to quickly move to a larger key length or better hash algorithm at any time is the key to an always up to date and secure PKI infrastructure.

Now let's go ahead and create the certificate.
Begin by opening the Certificate Authority administration console, right click on Certificate Templates then Manage.

clip_image001

First step is duplicating the “Subordinate Certification Authority” template.

clip_image003

In Compatibility settings select Windows Server 2008:

clip_image005

Type a display name for the template:

clip_image007

Put the checkbox on “CA certificate manager approval” if you prefer to. If you do you will have to approve the request once submitted.

clip_image009

In the Extensions tab select Key usage then Edit:

clip_image011

Put the checkbox on “Certificate signing” only

clip_image013

Ensure the local Administrator, or your administrative user/group, has Enroll permissions:

clip_image015

Right click on Certificate Templates, New, Certificate Template to Issue:

clip_image017

Select then newly created template then click OK:

clip_image019

The new template will then appear as available:

clip_image021

Then open MMC, add the Certificates snap-in for the Local computer.

Open the Personal container, right click on Certificates, All Tasks, Advanced Operations, Create Custom request:

clip_image023

Select Active Directory Enrollment Policy then click Next:

clip_image025

Select the template then click Next:

clip_image027

Click on Details then Properties:

clip_image029

Enter a Common name then click Add:

clip_image031

Enter a friendly name for the certificate:

clip_image032

In the Private key tab ensure the CSP “Microsoft Software Key Storage Provider” is listed:

clip_image033

Ensure “Mark private key exportable is selected”:

clip_image034

In Select Hash Algorithm select “sha256”:

clip_image035

Then click OK, you will be asked to save the request to a file:

clip_image036

Open an elevated command prompt and execute the command:

certreq -submit -config "<ServerName\CAName>" "<CertificateRequest.req>" "<CertificateResponse.cer>"

The last parameter is required if you have not requested an approval before issuing the certificate.

If no approval is required a .cer will be retrieved, otherwise you will have to refer to the RequestID that will be displayed:

clip_image037

If the approval is required, once the request has been approved in the CA console, enter the following command to retrieve the .cer file:

certreq -retrieve -config "<ServerName\CAName>" <RequestID> "<CertificateResponse.cer>"

Then complete the request with the following command:

certreq -accept -config "<ServerName\CAName>" "<CertificateResponse.cer>"

clip_image038

At this point you will find the new certificate in the Personal store of the local computer and you can export it:

clip_image040

Ensure you export the private key:

clip_image041

Do not select any of the PFX options:

clip_image042

Provide the PFX password when requested and save the file.

Then export the certificate again, this time without the private key:

clip_image043

Click Next then select the DER format:

clip_image044

Click Next then save the .CER file.

Notice that the certificate you have just generated might be signed using the SHA1 Hash algorithm, although we have requested a certificate using SHA256 Hash Algorithm. This happens due to the fact that in some operating systems the Subordinate Certification Authority template forces the key hashing algorithm to be SHA1. This however does not prevent TMG from issuing (signing) certificates with SHA256 hash algorithms.

Also note that Microsoft is phasing out weaker certificates such as SHA1 certificates and certificates with keys under 1024 bits in length. So expect at some point in time this to change.

So don’t be surprised and go ahead with the next steps.

Copy the PFX and the CER files to the TMG box, open the HTTPS Inspection configuration and import the certificate form the PFX file:

clip_image045

Then save and apply the configuration

On the TMG server open an MMC console and add the Certificates snap-in for the local computer.
Then import the .cer file in the Intermediate certificate store.
You will need to restart the TMG server.

clip_image047

Importing the certificate in the Intermediate store is necessary for the TMG server to send the intermediate certificate in the certificate chain so that the client is able to build the trust chain.

This is further explained bellow.

Now you can try from a client browsing a site using a CNG certificate, such as Twitter.
You will see the certificate being signed by the new certificate from your CA:

clip_image048

Notice that this certificate is signed using SHA256:

clip_image049

Regarding the building of the certificate chain

Since the Subordinate CA Certificate (“TMG HTTPS Inspection CNG Ent.CA” in this case) is not published anywhere the clients can’t, on its own find the certificate SubCA certificate.

For a normal certificate issuing CA you would be able to publish the SubCA Certificate and publish to either a LDAP or HTTP location and the clients would be able to look it up, by downloading the certificate from the AIA Extension in the certificate.

In the case of TMG issued certificates, for HTTP inspection, these don’t have an AIA extension.

clip_image051

TMG will send both the certificate for the URL being accessed on the browser (or other client) and the Subordinate CA, configured in TMG to issue these certificates.

Otherwise the client would end up with a certificate that do not built up to a trusted root, having a "gap" in the chain. So as you can see bellow TMG will send the two certificates on “Server Hello” handshake.

clip_image053

The certificate generated, on the fly by TMG, for the HTTPS site you are visiting, will appear as being issued by an intermediate CA represented by the certificate you generated.

That is why it is essential to add the SubCA to the “Intermediate Certification Authorities” store for the “Local Computer”. Otherwise the TMG issued certificates would need to have the AIA sections which would require the intermediate certificate (the one you have just generated) to be published to a AIA location. This would require further configuration on your environment, so TMG provides some help in the Chain validation process and sends the intermediate CA in the "Certificate" section of the SSL handshake as we can see in the “Server Hello” handshake on the network capture above.

Your “Subordinate CA” (TMG HTTPS Inspection CNG Ent.CA) will then have an AIA Extension and from there up to the Root CA. As you can see from the image

clip_image054

This will then allow to build up a valid certificate chain ending up in your Internal CA and starting in the leaf certificate issued by TMG for HTTP Inspection. The bellow picture shows the expected Certificate chain.

clip_image055

 

Author:
Gianni Bragante
Support Engineer – Microsoft Forefront Edge Security Team

Luis Sousa
Support Engineer - Microsoft PKI/AD Team

Reviewer:
Philipp Sand
Sr. Support Escalation Engineer – Microsoft Forefront Edge Security Team

Missing BDA hook rules – impact and potential root cause

$
0
0

Some of you may have already heard and know what NLB is and how it works as described in the general Network Load Balancing Overview [http://technet.microsoft.com/en-us/library/cc725946.aspx].

An integral part of a TMG NLB solution is Bi-direction affinity, which is well described at the following link:

Bi-Directional Affinity in ISA Server [http://blogs.technet.com/b/isablog/archive/2008/03/12/bi-directional-affinity-in-isa-server.aspx].

Bi-directional affinity creates multiple instances of Network Load Balancing (NLB) on the same host, which work in tandem to ensure that responses from published servers are routed through the appropriate ISA servers in a cluster. Bi-directional affinity is commonly used when NLB is configured with Internet Security and Acceleration (ISA) servers. If bi-directional affinity is not consistent across all NLB hosts or if NLB fails to initialize bi-directional affinity, the NLB cluster will remain in the converging state until a consistent teaming configuration is detected.

Bi-directional affinity is a crucial thing if you enable NLB on multiple interfaces, as it ensures a single client to work through the same node and have consistent data flow.

By default when a client connects to an NLB interface a hash algorithm based on the packet source IP (client) is computed in the NLB driver to decide which NLB node should handle this request. On the way back (the server responses to the client) the source IP is the server IP (not the client IP) and without BDA it may be handled by another TMG NLB node – which would discard the server response, not having seen the client request. Hence, a mechanism is needed to guarantee that client/server packets are handled by the same host in the array.

Bidirectional affinity ensures the server responses are handled by the same TMG NLB node as the original client request. The mechanism ensuring this functionality is implemented as  so-called hook rules:

http://technet.microsoft.com/en-us/library/dd348817(v=ws.10).aspx

Filter hooks help to direct traffic in a Network Load Balancing (NLB) cluster by filtering network packets. If the filter hooks are not properly configured, the NLB cluster will continue to converge and operate normally, however, the server application that is running with NLB will not be able to properly register the hooks.

The essential logic of the hook rules is the following:

At each packet, NLB calls out to the registered drivers (in this case fweng) whether they want to modify how the hash is created.

For example, when a client sends a SYN packet, NLB “asks” TMG’s fweng driver how it should calculate the hash. TMG will tell (depending on its hook rules) to use for example the client source IP for hashing (which is the default behavior). The calculated hash instructs NLB for example that the first node should handle the traffic and pass the SYN to the backend server.

When the server responds to the internal NLB of the TMG array, NLB calls out again to ask TMG how the hash is supposed to be calculated.

Based on the same hook rule set and seeing the packet direction, TMG  tells NLB to hash based on the destination IP, which is again the client IP, so the packet will be handled by the same node as the original packet.

If the hook rule was not present , TMG would tell to use the default behavior (use the source IP), which would result in  calculating the hash based on the  source (server) IP, possibly yielding that a different node is supposed to handle the traffic, which is not what we want.

If  you have a TMG array with several nodes and NLB is enabled, then TMG service creates hook rules at start.

These rules can be checked by executing netsh tmg show nlb from an elevated command prompt, which yields similar output as can be seen below.

Notice the rules have a source and destination range, and a direction based on which TMG can decide what to tell NLB when its called: whether to hash on source (forward) or destination IP (reverse).

clip_image001

A potential problem occurs if hook rules are missing. In this post, we are going to explore a potential cause for missing hook rules.

The below is from a sample test lab which we built based on a particular issue we got reported by a customer:

clip_image002

In  the example above we can see only rules which were created and hash based on source (forward direction) for outgoing scenario. 

You however do not see any reverse rules, indicating that some rules may be missing .

I took those rules from my TMG Array with Internal 10.0.0.0/24, DMZ 192.168.0.0/24 and External 172.20.1.0/24 networks.

Let's imagine a scenario where we have created a publishing rule for a server from DMZ with a listener on External network and you have configured the rule to be half NAT (request appears from client).

Because there is no specific rule for the range external network -> DMZ, DMZ -> external, in both directions we use the default behavior to hash based on the source IP.

As described above, because the hook rule is missing, this may or may not work depending on client IP/published server twin. If the NLB hash algorithm gives the same NLB node ID for both the client and the server IP , it will work. Otherwise, client and server packets will be serviced by different hosts, and the published server responses will be dropped with   the  error 0xc0040017 FWX_E_TCP_NOT_SYN_PACKEP_DROPPED.

The reason of the issue is lack of some NLB hook rules.

These rules are created at the startup based on network rules. In a real world scenario, when we may have a lot of subnets, it's quite easy to miss a network rule between two networks.

In this case, this is exactly what happened -  there was no network relationship defined between External and DMZ, hence the appropriate rule was never created

Once we add the network rule, the hook rules will be created. I created the rule from External to DMZ network with Route relationship. In the output below you can see how hook rules changed.

clip_image003

Now we have appropriate rules for processing requests from External to DMZ network back and forth, ensuring that we hash using the same IP in both directions. Hence, we should not get error 0xc0040017 FWX_E_TCP_NOT_SYN_PACKEP_DROPPED any more.

If you see the above error, make sure to check whether the appropriate hook rules are present – one of the root causes for missing hook rules can be the missing network relationship definition.

Author:

Vasily Kobylin, Senior Support Engineer, Microsoft EMEA Forefront Edge

Reviewer:

Balint Toth, Senior Support Escalation Engineer, Microsoft EMEA Forefront Edge

Franck Heilmann, Senior Escalation Engineer, Microsoft EMEA Forefront Edge

KB: HTTPS inspection in Forefront Threat Management Gateway 2010 doesn't use the full URL path for URL categorization

$
0
0

KB7334333232

When HTTPS inspection is enabled, Microsoft Forefront Threat Management Gateway 2010 (TMG 2010) uses only the host part of the URL for URL filtering. For example, consider the following scenario:

- Assume that www.contoso.com belongs in the Education category.

  • - You set a URL category override for www.contoso.com/poker to the Gambling category, and a deny rule exists for that category.

When you browse to http://www.contoso.com/poker in this scenario, TMG blocks this URL because the category is evaluated as Gambling, however when you browse to https://www.contoso.com/poker, the page loads.

This behavior occurs because for HTTPS inspection, TMG passes only the host domain (www.contoso.com) to the categorization service. In the example above, the host domain falls into the Education category.

For additional details please see the following:

KB3041871 - HTTPS inspection in Forefront Threat Management Gateway 2010 doesn't use the full URL path for URL categorization (http://support.microsoft.com/en-us/kb/3041871)

J.C. Hornbeck| Solution Asset PM | Microsoft GBS Management and Security Division

Get the latest System Center news onFacebookandTwitter:

clip_image001clip_image002

Main System Center blog: http://blogs.technet.com/b/systemcenter/

Configuration Manager Support Team blog: http://blogs.technet.com/configurationmgr/
Data Protection Manager Team blog: http://blogs.technet.com/dpm/
Orchestrator Team blog: http://blogs.technet.com/b/orchestrator/
Operations Manager Team blog: http://blogs.technet.com/momteam/
Service Manager Team blog: http://blogs.technet.com/b/servicemanager
Virtual Machine Manager Team blog: http://blogs.technet.com/scvmm

Microsoft Intune: http://blogs.technet.com/b/microsoftintune/
WSUS Support Team blog: http://blogs.technet.com/sus/
RMS blog: http://blogs.technet.com/b/rms/
App-V Team blog: http://blogs.technet.com/appv/
MED-V Team blog: http://blogs.technet.com/medv/
Server App-V Team blog: http://blogs.technet.com/b/serverappv

Forefront Endpoint Protection blog: http://blogs.technet.com/b/clientsecurity/
Forefront Identity Manager blog: http://blogs.msdn.com/b/ms-identity-support/
Forefront TMG blog: http://blogs.technet.com/b/isablog/
Forefront UAG blog: http://blogs.technet.com/b/edgeaccessblog/
Application Proxy blog: http://blogs.technet.com/b/applicationproxyblog/
The Surface Team blog: http://blogs.technet.com/b/surface/

ConfigMgr 2012 R2

Viewing all 233 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>