Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


October 2006

Netsh Adds Security to IPsec

Encrypt and digitally sign your communications from the command line
RSS
Subscribe to Windows IT Pro | See More Security Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

In "The Potent Union of Netsh and IPsec" (September 2006, InstantDoc ID 92767), I walked you through the process of using a command-line IPsec setup to block any incoming or outgoing traffic on port 80. Blocking and permitting traffic are two of the simplest uses of IPsec—but they're not the only ones. IPsec can also digitally sign or encrypt traffic, and signing and encrypting require a bit more information. So, this month, let's modify last month's task: Let's create an IPsec rule that allows a Web server to offer traffic on TCP port 80, but only if it's encrypted with Triple DES (3DES) and signed with the Secure Hash Algorithm-1 (SHA-1).

Creating the Policy
As we did last month, we'll create an IPsec policy that applies to a Web server or group of Web servers. The policy will consist of just one rule, which must have a filter list and a filter action (as well as an authentication method, but we'll cover that later). The filter action will activate the rule if data arrives at a particular system through TCP port 80 or if data leaves from that system's TCP port 80 to anywhere. Should the filter list be satisfied, the action that the rule will take is to require 3DES encryption and SHA-1 signing.

With Windows Server 2003 commands, we'll create the policy, then the filter list, then the filter action, and finally the IPsec rule. Here's how to render the policy:

netsh ipsec static add policy name="Require encryption
 on Web" description="Force any Web visitors to 
 encrypt communications and Kerberos to
 authenticate" activatedefaultrule=no 

All our IPsec-related commands begin with Netsh Ipsec Static. The Add Policy option creates a policy, and the command proceeds to name and describe the policy.

Creating the Filter and Filter List
The filter we want to build will tell IP to engage the specified rule if data enters or leaves at TCP port 80; therefore, the filter recalls the one we created last month:

netsh ipsec static add filter filter-list="80 in or
  out" srcaddr=any srcport=0 
  dstaddr=me dstport=80 
  protocol=tcp mirrored=yes

In situations involving only one filter, Netsh lets you create both the filter list and the filter by simply naming the filter list after the add filter parameter. When Netsh tries to add this filter to a filter list named "80 in or out" and can't find a filter list by that name, it creates that filter list. The command says that this rule applies when the data originates from anywhere (srcaddr=any) and any port (srcport=0), and is destined for the system to which this policy is applied (dstaddr=me) on TCP port 80 (dstport=80 protocol=tcp). The mirrored=yes parameter specifies that two filters are actually in place: one from anywhere to this system on TCP port 80, and one from this system on TCP port 80 to anywhere.

Creating the Filter Action
Instead of last month's action, which was to block the transmission if the filter is satisfied, this month's action is to encrypt and sign the transmission if the filter is satisfied. That code looks like

netsh ipsec static add filteraction name="force encryption"
  esc="Forces communications using encryption"
  action=negotiate qmsecmethods="ESP[3DES,
  SHA1]" inpass=no soft=no qmpfs=yes 

The Add Filteraction option adds a filter action, and the command proceeds to name and describe the action. Note the inclusion of the action=negotiate parameter, rather than action=block or action=permit. You use the action=negotiate parameter whether you want digital signing or encryption and signing. But which shall it be?

The next parameter, qmsecmethods="ESP[3DES, SHA1]", answers that question. This parameter has many possible parameters, but essentially you specify either ESP[] or AH[] and enter your preferred encryption or hashing algorithm inside the square brackets. For example, "AH[SHA1]" will use SHA-1 to digitally sign traffic. ESP requires the names of two cryptographic algorithms—for encryption and hashing—because it both encrypts and signs traffic. Thus, "ESP[3DES,SHA1]" encrypts with triple 3DES and signs with SHA-1.

   Previous  [1]  2  Next 


Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Friday at PASS Europe 2006

Kevin talks about the closing day of the event and shares a funny Microsoft film. ...

More fun TechEd 2005 Resources

Kevin points out some more TechEd resources ...

WinInfo Short Takes: Week of October 13, 2008

An often irreverent look at some of the week's other news... ...


Related Articles Use Netsh to Easily Change IP Addresses

Security Whitepapers Protecting (You and) Your Data with Exchange Server 2007

Extended Validation SSL Certificates

Unauthorized applications: Taking back control

Related Events 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 Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.

Job Openings in IT


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

Microsoft Exchange & Windows Connections event returns to Las Vegas Nov 10 - 13
Connections returns to Las Vegas for this exciting event where each attendee will receive SQL Server 2008 standard with 1 CAL. Co-located with Microsoft ASP.NET, SQL Server, and SharePoint Connections with over 250 in-depth sessions.

Free Online Event! Virtualization:Get the Facts!
Register now and attend this free, live in-depth online conference on November 13 and 20, 2008, produced by Windows IT Pro. All registrants are eligible to receive a complimentary one-year digital subscription to Windows IT Pro (a $49.95 value)!

Check Out Hyper-V Video on ITTV
Watch Karen Forster's interview on Hyper-V's performance on ITTV.net.

Ease Your Scripting Pains with the Flexibility of PowerShell!
Join MVP Paul Robichaux on December 11, 2008 at 11:00 AM EDT as he equips you with PowerShell basics in 3 introductory lessons, each followed by a live Q&A session—all on your own computer!

Latest Advancements in SSL Technology
There are a variety of different kinds of SSL to explore to ensure customer data is kept confidential and secure. In this paper, we will discuss some of these SSL advances to help you decide which would be best for your organization.

PASS Community Summit 2008 in Seattle on Nov 18-21
The don’t-miss event for Microsoft SQL Server Professionals. Register now and you’ll enjoy top-notch Microsoft and Community speakers and more.



Solving PST Management Problems
In this white paper, read about the top PST issues and how to administer local/network PST Files.

Get Protected -- Data Protection Manager 2007
Protect your virtualized environment with Data Protection Manager

Order Your SQL Fundamentals CD Today!
Learn how to use SQL Server, understand Office integration techniques and dive into the essentials of SQL Express and Visual Basic with this free SQL Fundamentals CD.

Maximize Your SharePoint Investment: Get Your Data Moving
Watch this web seminar now to learn how to maximize your SharePoint investment! Join us as we take a look at the complex business of securing, accessing and managing vast amounts of information in a global network and various ways to get your data moving.
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 Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing