Introduction
This guide shows you how to improve security for your WCF services. It also shows you how to effectively design your authentication, authorization, and communication strategies for Microsoft Windows Communication Foundation.
The information in this guide is based on practices learned from customer feedback and product support, as well as experience gained in the field and while implementing real solutions. The guidance is task-based and presented in the following parts:
- **Part I: Security Fundamentals for Web Services **gives you a quick overview of fundamental security concepts as they relate to services, service-oriented design, and Service-Oriented Architecture (SOA).
- **Part II: WCF Security Fundamentals **gives you a firm foundation in key WCF security concepts, with special attention to authentication, authorization, and secure communication, as well as WCF binding configurations.
- **Part III: Intranet Application Scenarios **shows you a set of end-to-end intranet application scenarios that you can use to jump-start your application architecture designs, with a focus on authentication, authorization, and communication for your intranet from a WCF perspective.
- **Part IV: Internet Application Scenarios **shows you a set of end-to-end Internet application scenarios that you can use to jump-start your application architecture design for the Internet from a WCF perspective.
WCF / Services Security
Many factors and decisions combine to improve security in WCF services and applications. This guide focuses on the following:
- Authentication, authorization, and communication design for your services
- Solution patterns for common distributed application scenarios using WCF
- Principles, patterns, and practices for improving key security aspects in services
The following diagram illustrates a common solution pattern for WCF intranet scenarios:
Figure 1
Example WCF Implementation Solution Pattern
Scope of This Guide
This guide is focused on key security aspects of WCF. The guide addresses security across the three primary physical tiers: the client, remote application server, and database server. Clients include Microsoft Windows Forms, ASP.NET, and WCF.
Out of Scope
The following are outside the scope for this guide:
- Federation
- Claims authorization
Why We Wrote This Guide
From our own experience with WCF, and through conversations with customers and Microsoft employees who work in the field, we determined that there was significant demand for a guide that would show how to use WCF in the real world. While there is information in the product documentation, in blog posts, and in forums, there has been no single place to find proven practices for the effective use of WCF in the context of line-of-business (LOB) applications under real-world constraints.
Who Should Read This Guide
This guide is targeted at individuals involved in building applications with WCF. The following are examples of roles that would benefit from this guidance:
- A development team that wants to adopt WCF
- A software architect or developer looking to get the most out of WCF, with regard to designing his or her application security
- Interested parties investigating the use of WCF who don’t know how well it would work for their particular deployment scenarios and constraints
- Individuals tasked with learning WCF security practices
How to Use This Guide
Use the first part of the guide to gain a firm foundation in key security concepts and WCF. Next, use the application scenarios to evaluate potential designs for your own scenario. The application scenarios are skeletal, end-to-end examples of how you might design your authentication, authorization, and communication from a security perspective. Use the appendix of “Guidelines,” “Practices,” “How To” articles, and “Questions and Answers” to dive into implementation details. This separation allows you to understand the topics first and then explore the details as you see fit.
Organization of This Guide
You can read this guide from end to end, or you can read only the chapters you need for your job.
Parts
This guide is divided into four parts:
- Part I: Security Fundamentals for Web Services
- Part II: WCF Security Fundamentals
- Part III: Intranet Application Scenarios
- Part IV: Internet Application Scenarios
Part I: Security Fundamentals for Web Services
- Chapter 1: Security Fundamentals for Web Services
- Chapter 2: Threats and Countermeasures for Web Services
- Chapter 3: Security Design Guidelines for Web Services
Part II: WCF Security Fundamentals
- Chapter 4: WCF Security Fundamentals
- Chapter 5: Authentication, Authorization, and Identities in WCF
- Chapter 6: Impersonation and Delegation in WCF
- Chapter 7: Message and Transport Security
- Chapter 8: Bindings
Part III: Intranet Application Scenarios
- Chapter 9: Intranet - Web to Remote WCF Using Transport Security (Original Caller, TCP)
- Chapter 10: Intranet - Web to Remote WCF Using Transport Security (Trusted Subsystem, HTTP)
- Chapter 11: Intranet - Web to Remote WCF Using Transport Security (Trusted Subsystem, TCP)
- Chapter 12: Intranet - Windows Forms to Remote WCF Using Transport Security (Original Caller, TCP)
Part IV: Internet Application Scenarios
- Chapter 13: Internet - WCF and ASMX Client to Remote WCF Using Transport Security (Trusted Subsystem, HTTP)
- Chapter 14: Internet - Web to Remote WCF Using Transport Security (Trusted Subsystem, TCP)
- Chapter 15: Internet – Windows Forms Client to Remote WCF Using Message Security (Original Caller, HTTP)
Checklist
Guidelines
Practices
Questions and Answers
"How-to" Articles
- How to: Audit and Log Security Events in WCF Calling from Windows Forms
- How to: Create and Install Temporary Certificates in WCF for Message Security During Development
- How to: Create and Install Temporary Certificates in WCF for Transport Security During Development
- How to: Create and Install Temporary Client Certificates in WCF During Development
- How to: Host WCF in a Windows Service Using TCP
- How to: Impersonate the Original Caller in WCF Calling from a Web Application
- How to: Impersonate the Original Caller in WCF Calling from Windows Forms
- How to: Perform Input Validation in WCF
- How to: Perform Message Validation with Schema Validation in WCF
- How to: Use basicHttpBinding with Windows Authentication and TransportCredentialOnly in WCF from Windows Forms
- How to: Use Certificate Authentication and Message Security in WCF Calling from Windows Forms
- How to: Use Certificate Authentication and Transport Security in WCF Calling from Windows Forms
- How to: Use Delegation for Flowing the Original Caller Credentials to the Back-end in WCF Calling from Windows Forms
- How to: Use Health Monitoring to Instrument a WCF Service for Security
- How to: Use netTcpBinding with Windows Authentication and Message Security in WCF from Windows Forms
- How to: Use netTcpBinding with Windows Authentication and Transport Security in WCF from Windows Forms
- How to: Use Protocol Transition for Impersonating and Delegating the Original Caller in WCF
- How to: Use the SQL Server Role Provider with Username Authentication in WCF Calling from Windows Forms
- How to: Use SQL Server Role Provider with Windows Authentication in WCF Calling from Windows Forms
- How to: Use Username Authentication with the SQL Server Membership Provider and Message Security in WCF Calling from Windows Forms
- How to: Use Username Authentication with Transport Security in WCF Calling from Windows Forms
- How to: Use wsHttpBinding with Username Authentication and TransportWithMessageCredential in WCF Calling from Windows Forms
- How to: Use wsHttpBinding with Windows Authentication and Message Security in WCF Calling from Windows Forms
- How to: Use wsHttpBinding with Windows Authentication and Transport Security in WCF Calling from Windows Forms
Resources
Feedback on the Guide
We have provided a short questionnaire on the Internet that should only take 5 to 10 minutes to fill out. Copy these questions into an e-mail message and send the answers to WCFSec@microsoft.com.
We are also particularly interested in feedback regarding the following:
- Technical issues specific to recommendations
- Usefulness and usability issues
Any input can be sent in e-mail to WCFSec@microsoft.com.
Technical Support
Technical support for the Microsoft products and technologies referenced in this guide is provided by Microsoft Product Support Services (PSS). For product support information, please visit the Microsoft Product Support Web site.
Community Support
Microsoft MSDN newsgroups:
Forum |
Address |
---|---|
Windows Communication Foundation ("Indigo") |
|
Architecture General |
https://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=228&SiteID=1 |
The Team Who Brought You This Guide
This guide was created by the following team members:
- J.D. Meier
- Carlos Farre
- Jason Taylor
- Prashant Bansode
- Steve Gregersen
- Madhu Sundararajan
- Rob Boucher
Contributors and Reviewers
- External Contributors / Reviewers: Andy Eunson; Anil John; Anu Rajendra; Brandon Bohling; Chaitanya Bijwe; Daniel Root; David P. Romig, Sr.; Dennis Rea; Kevin Lam; Michele Leroux Bustamante; Parameswaran Vaideeswaran; Rockford Lhotka; Rudolph Araujo; Santosh Bejugam
- Microsoft Contributors / Reviewers: Alik Levin; Brandon Blazer; Brent Schmaltz; Curt Smith; David Bradley; Dmitri Ossipov; Jan Alexander; Jason Hogg; Jason Pang; John Steer; Marc Goodner; Mark Fussell; Martin Gudgin; Martin Petersen-Frey; Mike de Libero; Mohammad Al-Sabt; Nobuyuki Akama; Ralph Squillace; Richard Lewis; Rick Saling; Rohit Sharma; Scott Mason; Sidd Shenoy; Sidney Higa; Stuart Kwan; Suwat Chitphakdibodin; T.R. Vishwanath; Todd Kutzke; Todd West; Vijay Gajjala; Vittorio Bertocci; Wenlong Dong; Yann Christensen; Yavor Georgiev
Tell Us About Your Success
If this guide helps you, we would like to know. Tell us by writing a short summary of the problems you faced and how this guide helped you out. Submit your summary to MyStory@Microsoft.com.