Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


September 2002

IPSec Packet Filtering

RSS
Subscribe to Windows Web Solutions | See More Security Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Erect another layer of defense around your Web server

In "Protect Private Ports with IPSec," April 2002, InstantDoc ID 24273, I discussed using IP Security (IPSec) to lock down access to private ports on IIS servers. But locking down IPSec access is an option only if the computers that communicate with your server run Windows XP or Windows 2000 and you have the authority to configure them with complementary IPSec policies. If you can't use IPSec to secure data uploads, remote administration, and other private traffic, you can still use IPSec's packet-filtering capability. IPSec lets you block packets by port number and IP address, providing a valuable way to prevent attacks on private ports—those used for administration and data transfers such as Telnet, FTP, and Win2K Server Terminal Services—as opposed to public ports such as ports 80 and 443, which are used for HTTP and HTTP Secure (HTTPS). Let's look at how to set up IPSec packet filtering to protect your Web server and how to test it.

Set It Up
Suppose you want to make ports 80 and 443 accessible to anyone on the Internet. Your business partner needs to access your server's FTP service from its IP address 63.88.172.66. You also have an application server (10.0.12.98) that needs FTP access to your Web server, and your administrators and operator PCs (subnet 10.0.11.*) need access to port 3389 for Terminal Services.

On a Win2K system, you can create multiple IPSec policies, but you can assign (i.e., activate) only one of them. IPSec policies consist of one or more rules. Each rule has a packet filter and a specified action that Win2K will execute on any packets that meet the associated filter criteria. You can specify the actions negotiate IP security, permit, or block. Let's create one IPSec policy that consists of one block rule and one permit rule. The block rule will block all packets by default. Then, we'll add a permit rule that will allow packets for the port and source IP address combinations I described earlier.

Open Local Security Settings on your server, maneuver to IP Security Policies on Local Machine, right-click the details pane, and select Create IP Security Policy. Click Next on the wizard's first page, enter Packet Filters as the policy's name, and click Next. Clear the Activate the default response rule check box, then click Next, Finish. Now you have an empty policy, as Figure 1, page 2, shows. Next, create the block rule. To start the Create Security Rule Wizard, click Add on the Rules tab, then click Next on the first three pages. On the fourth page, the wizard asks you to select an authentication method for this rule. Although permit and block rule actions don't use any authentication, Win2K still requires that you configure an authentication method. If your server is in a domain, you can leave Kerberos selected; otherwise, select Use this string to protect the key exchange (preshared key) and enter any text you want as the key. Click Next, and the wizard asks you for an IP filter list. This is the default rule; select All IP Traffic and click Next. The wizard asks for your filter action. Out of the box, Win2K has three actions—Permit, Request Security, and Require Security—but no block action, so click Add to start the Filter Action Wizard, then click Next on the first page. Enter Block for the action's name and click Next. Select Block for the filter action behavior, then click Next, Finish. On the Create Security Rule wizard, select Block, then click Next, Finish. Your policy now contains one rule that blocks all IP traffic.

Now let's create a permit rule that lets the general public browse your Web site on ports 80 and 443. On the Rules tab, click Add, and click Next on the first three pages of the Create Security Rule Wizard. Then, configure the authentication method as you did for the block rule and click Next. Now, create a filter list. To open the IP Filter List window, click Add. A filter list consists of one or more filters, each of which specifies any combination of source and destination IP address and port number. We'll add seven filters: To permit HTTP and HTTPS traffic, add a filter for port 80 and one for port 443; add a filter for Terminal Services; and add four filters for FTP. Change the list's name to Permitted Traffic, then click Add to start the IP Filter Wizard. Click Next and select Any IP Address as the source address. Click Next and enter My IP Address as the destination address. Click Next and select TCP as the protocol type. Click Next and enter 80 in the To this port field. Click Next, then click Finish. Repeat the process for port 443.

For Terminal Services, follow the same procedure to add a filter for TCP port 3389 but specify A specific IP subnet for the source address. When the system prompts you, enter 255.255.255.0 for the subnet mask and 10.0.11.0 for the IP address. Now, anyone who connects to Terminal Services from one of your administrators' PCs in subnet 10.0.11.* will have permissions.

Finally, you need to add the filters for FTP. This process is a little trickier because FTP uses two TCP ports: port 21 for commands and port 20 for data transfers. Therefore, to use FTP to connect to your IIS server, your business partner's application needs two filters. Follow the above procedure to add the filters but specify 20 and 21 in the To this port field and 63.88.172.66 as the source IP address. Finally, to enable FTP connections from your application server, add the same two filters again but specify 10.0.12.98 as the source IP address. (This procedure won't allow passive FTP connections to an FTP server.) Figure 2 shows the completed filter list.

On the IP Filter List tab in the Edit Rule Properties window, select Permitted Traffic for the filter list, then select the Filter Action tab. Select Permit for the filter action and click Close. Figure 3 shows the results you should see in the Packet Filters Properties window.

   Previous  [1]  2  Next 


Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

WinInfo Short Takes: Week of November 23, 2009

An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...


Security Whitepapers Reducing the Costs and Risks of Branch Office Data Protection

Solving Desktop Management Challenges in Healthcare

Solving Desktop Management Challenges in Education

Related Events Introduction to Identity Lifecycle Manager "2"

SQL Server Security: How to Secure, Monitor & Audit Your Databases

Protecting Mobile Users' Data

Check out our list of Free Email Newsletters!

Security eBooks Spam Fighting and Email Security for the 21st Century

Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

Related Security Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement