SlideShare uma empresa Scribd logo
1 de 30
www.orbitone.com
Raas van Gaverestraat 83
B-9000 GENT, Belgium
E-mail info@orbitone.com
Website www.orbitone.com
Tel. +32 9 265 74 20
Fax +32 9 265 74 10
VAT BE 456.457.353
Bank 442-7059001-50 (KBC)
22 May, 2009 Windows Communication Foundation
Security, by Tom Pester
22 May, 2009
Windows Communication Foundation Security, by Tom Pester2
 To understand WCF security we have to explore the basic set of security
principals for authentication, authorization, and message transfer
protection.
22 May, 2009
Windows Communication Foundation Security, by Tom Pester3
 Consider a message from sender to receiver
 Authentication.
We typically think about authentication as identifying the message sender.
Mutual authentication involves authenticating both the sender and the message receiver, to
prevent possible man-in-the-middle attacks.
 Authorization.
After authenticating the message sender, authorization determines what system features and
functionality they are entitled to execute.
 Integrity.
Messages should be digitally signed to ensure they have not been altered between sender and
receiver.
 Confidentiality.
Sensitive messages should be encrypted to ensure they cannot be openly viewed on the wire.
22 May, 2009
Windows Communication Foundation Security, by Tom Pester4
 A variety of mutual authentication mechanisms are supported using token formats such
as Windows tokens, username and password, certificates and issued tokens (in a
federated environment)
 Authorization can be based on Windows roles, ASP.NET roles or you can provide custom
authorization policies.
22 May, 2009
Windows Communication Foundation Security, by Tom Pester5
 The first step to securing a WCF service is defining the security policy. Once you have
established requirements for authentication, authorization, and message protection it is a
matter of service configuration to enforce it.
22 May, 2009
Windows Communication Foundation Security, by Tom Pester6
 Your binding selection will influence the available configuration options
 Beyond bindings, behaviors also provide information about client and service credentials,
and affect how authorization is handled.
22 May, 2009
Windows Communication Foundation Security, by Tom Pester7
 Each binding has a default set of security settings. Consider the following service endpoint
that supports NetTcpBinding.
 <system.serviceModel>
<services>
<service name="HelloIndigo.HelloIndigoService" >
<endpoint
contract="HelloIndigo.IHelloIndigoService"
binding="netTcpBinding" />
</service>
</services>
</system.serviceModel>
22 May, 2009
Windows Communication Foundation Security, by Tom Pester8
 Lets look at the expanded binding configuration illustrating the default settings.
 <netTcpBinding>
<binding name="netTcp">
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>
 NetTcpBinding is secure by default. Specifically, callers must provide Windows credentials
for authentication and all message packets are signed and encrypted over TCP protocol.
 In fact all standard bindings are secure by default except for Basic Http binding
22 May, 2009
Windows Communication Foundation Security, by Tom Pester9
Security Mode
 Across all service bindings there are five possible security modes:
 None. Turns security off.
 Transport. Uses transport security for mutual authentication and message protection.
 Message. Uses message security for mutual authentication and message protection.
 Both. Allows you to supply settings for transport and message-level security (only MSMQ
supports this).
 TransportWithMessageCredential. Credentials are passed with the message and message
protection and server authentication are provided by the transport layer.
 TransportCredentialOnly. Client credentials are passed with the transport layer and no
message protection is applied.
22 May, 2009
Windows Communication Foundation Security, by Tom Pester10
 For example, this <wsHttpBinding> snippet illustrates how to require UserName
credentials be passed with the message.
 <wsHttpBinding>
<binding name="wsHttp">
<security mode="Message">
<message clientCredentialType="UserName" />
</security>
</binding>
</wsHttpBinding>
22 May, 2009
Windows Communication Foundation Security, by Tom Pester11
Transfer protection
 Transport vs. Message
 Transport protection is only good from point-to-point.
 Message protections is good end-to-end
22 May, 2009
Windows Communication Foundation Security, by Tom Pester12
 Messages are unencrypted over a channel stack that is unsecure
22 May, 2009
Windows Communication Foundation Security, by Tom Pester13
 Messages are encyrpted over a channel stack that is unsecure
22 May, 2009
Windows Communication Foundation Security, by Tom Pester14
 Messages are unencyrpted over a channel stack that is secure (If the channel were
unsecure, you could see the messages in clear text.)
22 May, 2009
Windows Communication Foundation Security, by Tom Pester15
 Messages are encyrpted over an unsecure channel between the client and the service
endpoint (1st hop). Notice the messages remain encrypted between the first service and
second service (2nd hop).
22 May, 2009
Windows Communication Foundation Security, by Tom Pester16
 Messages are unencyrpted over an secure channel between the client and the service
endpoint (1st hop). Notice the messages DO NOT remain encrypted between the first
service
22 May, 2009
Windows Communication Foundation Security, by Tom Pester17
 Message security supports passing credentials as part of the SOAP message using
interoperable standards, and also makes it possible to protect the message independent
of transport all the way through to the ultimate message receiver.
22 May, 2009
Windows Communication Foundation Security, by Tom Pester18
 Transport security is point to point. Since the messages themselves are not encrypted,
once they go to another point, they can be potentially exposed to integrity/privacy attacks
as if they were unsecure.
 The big advantage of message security is that it provides end to end security. Messages
leaving intermediary services retain their security.
22 May, 2009
Windows Communication Foundation Security, by Tom Pester19
Client Credential Type
 The choice of client credential type depends on the security mode in place. Message
security supports any of the following settings for clientCredentialType:
 None
 Windows
 UserName
 Certificate
 IssuedToken
22 May, 2009
Windows Communication Foundation Security, by Tom Pester20
 <basicHttpBinding>
<binding name="basicHttp">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="Certificate"/>
</security>
</binding>
</basicHttpBinding>
22 May, 2009
Windows Communication Foundation Security, by Tom Pester21
Protection Level
 By default, all secure WCF bindings will encrypt and sign messages. You cannot disable this
for transport security, however, for message security you may wish to disable this for
debugging purposes.
 Protection-level settings are controlled by the contract.
22 May, 2009
Windows Communication Foundation Security, by Tom Pester22
 [ServiceContract(Name="HelloIndigoContract",
Namespace=
"",
ProtectionLevel=ProtectionLevel.Sign)]
public interface IHelloIndigoService
{
string HelloIndigo(string inputString);
}
22 May, 2009
Windows Communication Foundation Security, by Tom Pester23
 For more granular control, you can also indicate message protection per operation using
the OperationContractAttribute.
 [ServiceContract(Name="HelloIndigoContract",
Namespace=]
public interface IHelloIndigoService
{
[OperationContract(ProtectionLevel=
ProtectionLevel.Sign)]
string HelloIndigo(string inputString);
}
 ProtectionLevel options are: None, Sign, and EncryptAndSign.
22 May, 2009
Windows Communication Foundation Security, by Tom Pester24
Algorithm Suite
 Choice of algorithm suite can be particularly important for interoperability.
 Each binding uses Basic256 as the default algorithm suite for message-level security
 <wsHttpBinding>
<binding name="wsHttp">
<security mode="Message">
<message clientCredentialType="UserName” algorithmSuite="TripleDes" />
</security>
</binding>
</wsHttpBinding>
22 May, 2009
Windows Communication Foundation Security, by Tom Pester25
Secure Session
 Another feature of message security is the ability to establish a secure session to reduce
the overhead of key exchange and validation.
 A token is generated through an initial exchange between caller and service. This token is
used to authorize and secure subsequent message exchanges.
 <wsHttpBinding>
<binding name="wsHttp">
<security mode="Message">
<message clientCredentialType="UserName"
establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
22 May, 2009
Windows Communication Foundation Security, by Tom Pester26
Authorisation
 <system.web> <membership defaultProvider="SqlProvider"
userIsOnlineTimeWindow="15"> <providers> <clear /> <add
name="SqlProvider" type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlConn" applicationName="MembershipProvider"
enablePasswordRetrieval="false" enablePasswordReset="false"
requiresQuestionAndAnswer="false" requiresUniqueEmail="true"
passwordFormat="Hashed" /> </providers> </membership> <!-- Other configuration
code not shown.--></system.web>
 <behaviors>
 <behavior name="ServiceBehaviour">
 <serviceAuthorization principalPermissionMode ="UseAspNetRoles"
 roleProviderName ="SqlProvider" />
 </behavior>
 <!-- Other configuration code not shown. -->
 </behaviors>
22 May, 2009
Windows Communication Foundation Security, by Tom Pester27
 Imperatively
 public string AdminsOnly()
{
// unprotected code
PrincipalPermission p = new
PrincipalPermission(null, "Administrators");
p.Demand();
// protected code
}
 Or declaratively
 [PrincipalPermission(SecurityAction.Demand, Role =
"Administrators")]
public string AdminsOnly()
{
// protected code
}
22 May, 2009
Windows Communication Foundation Security, by Tom Pester28
Impersonation
 When Windows credentials are used, the service can be configured to impersonate callers
so that the request thread operates under the impersonated Windows token.
 This makes it possible for services to access protected Windows resources under the
identity of the caller, instead of the process identity of the service-for that request.
 This can be dangerous and I consider it bad practice.
22 May, 2009
Windows Communication Foundation Security, by Tom Pester29
 Using the OperationBehaviorAttribute you can apply impersonation rules per operation
by setting the Impersonation property to one of the following:
 ImpersonationOption.NotAllowed. The caller will not be impersonated.
 ImpersonationOption.Allowed. The caller will be impersonated if a Windows credential is
provided.
 ImpersonationOption.Required. The caller will be impersonated and a Windows
credential must be provided to support this.
 This behavior is applied to service operations.
[OperationBehavior(Impersonation = ImpersonationOption.Allowed)]
public string DoSomething()
{
...
}
www.orbitone.com
30 Windows Communication Foundation Security, by Tom Pester
22 May, 2009

Mais conteúdo relacionado

Destaque

Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Peter R. Egli
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonAdnan Masood
 
Rest API Security
Rest API SecurityRest API Security
Rest API SecurityStormpath
 
Mbc Consulting Group
Mbc Consulting GroupMbc Consulting Group
Mbc Consulting GroupKevin Cook
 
Как продавать идеи Alexander semenov_ingria_2013
Как продавать идеи Alexander semenov_ingria_2013Как продавать идеи Alexander semenov_ingria_2013
Как продавать идеи Alexander semenov_ingria_2013Ingria. Technopark St. Petersburg
 
提醒E mail分享族培養e習慣
提醒E mail分享族培養e習慣提醒E mail分享族培養e習慣
提醒E mail分享族培養e習慣ariesckf
 
Кризис роста в ИТ-компании Иоря Ашманова
Кризис роста в ИТ-компании Иоря АшмановаКризис роста в ИТ-компании Иоря Ашманова
Кризис роста в ИТ-компании Иоря АшмановаIngria. Technopark St. Petersburg
 
07.Notifications & Reminder, Contact
07.Notifications & Reminder, Contact07.Notifications & Reminder, Contact
07.Notifications & Reminder, ContactNguyen Tuan
 
L1. intro to ethics
L1. intro to ethicsL1. intro to ethics
L1. intro to ethicst0nywilliams
 
Leervoorkeuren - Social Friday Seats 2 Meet Happiness@Work
Leervoorkeuren - Social Friday Seats 2 Meet Happiness@WorkLeervoorkeuren - Social Friday Seats 2 Meet Happiness@Work
Leervoorkeuren - Social Friday Seats 2 Meet Happiness@WorkTauros Marketing
 
13.Windows Phone Store
13.Windows Phone Store13.Windows Phone Store
13.Windows Phone StoreNguyen Tuan
 
Online Neighbourhoods Networks Conference, "Co-productiuon & Neighbourhood Ne...
Online Neighbourhoods Networks Conference, "Co-productiuon & Neighbourhood Ne...Online Neighbourhoods Networks Conference, "Co-productiuon & Neighbourhood Ne...
Online Neighbourhoods Networks Conference, "Co-productiuon & Neighbourhood Ne...Networked Neighbourhoods
 
Yedirenk THM korosu Resimleri
Yedirenk THM korosu ResimleriYedirenk THM korosu Resimleri
Yedirenk THM korosu Resimleriaokutur
 
Defining Terms Of The Lymphatic & Immune System
Defining Terms Of The Lymphatic & Immune SystemDefining Terms Of The Lymphatic & Immune System
Defining Terms Of The Lymphatic & Immune Systemguestff1b67
 

Destaque (19)

Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural Comparison
 
Rest API Security
Rest API SecurityRest API Security
Rest API Security
 
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF)
 
Section3 2
Section3 2Section3 2
Section3 2
 
Mbc Consulting Group
Mbc Consulting GroupMbc Consulting Group
Mbc Consulting Group
 
Tech
TechTech
Tech
 
Как продавать идеи Alexander semenov_ingria_2013
Как продавать идеи Alexander semenov_ingria_2013Как продавать идеи Alexander semenov_ingria_2013
Как продавать идеи Alexander semenov_ingria_2013
 
提醒E mail分享族培養e習慣
提醒E mail分享族培養e習慣提醒E mail分享族培養e習慣
提醒E mail分享族培養e習慣
 
Кризис роста в ИТ-компании Иоря Ашманова
Кризис роста в ИТ-компании Иоря АшмановаКризис роста в ИТ-компании Иоря Ашманова
Кризис роста в ИТ-компании Иоря Ашманова
 
07.Notifications & Reminder, Contact
07.Notifications & Reminder, Contact07.Notifications & Reminder, Contact
07.Notifications & Reminder, Contact
 
L1. intro to ethics
L1. intro to ethicsL1. intro to ethics
L1. intro to ethics
 
Leervoorkeuren - Social Friday Seats 2 Meet Happiness@Work
Leervoorkeuren - Social Friday Seats 2 Meet Happiness@WorkLeervoorkeuren - Social Friday Seats 2 Meet Happiness@Work
Leervoorkeuren - Social Friday Seats 2 Meet Happiness@Work
 
Контроль вашего сердца [Web Ready 2010]
Контроль вашего сердца [Web Ready 2010]Контроль вашего сердца [Web Ready 2010]
Контроль вашего сердца [Web Ready 2010]
 
13.Windows Phone Store
13.Windows Phone Store13.Windows Phone Store
13.Windows Phone Store
 
Online Neighbourhoods Networks Conference, "Co-productiuon & Neighbourhood Ne...
Online Neighbourhoods Networks Conference, "Co-productiuon & Neighbourhood Ne...Online Neighbourhoods Networks Conference, "Co-productiuon & Neighbourhood Ne...
Online Neighbourhoods Networks Conference, "Co-productiuon & Neighbourhood Ne...
 
Yedirenk THM korosu Resimleri
Yedirenk THM korosu ResimleriYedirenk THM korosu Resimleri
Yedirenk THM korosu Resimleri
 
Defining Terms Of The Lymphatic & Immune System
Defining Terms Of The Lymphatic & Immune SystemDefining Terms Of The Lymphatic & Immune System
Defining Terms Of The Lymphatic & Immune System
 
Christophe Gilbert
Christophe GilbertChristophe Gilbert
Christophe Gilbert
 

Semelhante a WCF security

Vtu network security(10 ec832) unit 5 notes.
Vtu network security(10 ec832) unit 5 notes.Vtu network security(10 ec832) unit 5 notes.
Vtu network security(10 ec832) unit 5 notes.Jayanth Dwijesh H P
 
Network and cyber security module(15ec835, 17ec835)
Network and cyber security module(15ec835, 17ec835)Network and cyber security module(15ec835, 17ec835)
Network and cyber security module(15ec835, 17ec835)Jayanth Dwijesh H P
 
The enterprise differentiator of mq on zos
The enterprise differentiator of mq on zosThe enterprise differentiator of mq on zos
The enterprise differentiator of mq on zosMatt Leming
 
Study on Messaging Protocol Message Queue Telemetry Transport for the Interne...
Study on Messaging Protocol Message Queue Telemetry Transport for the Interne...Study on Messaging Protocol Message Queue Telemetry Transport for the Interne...
Study on Messaging Protocol Message Queue Telemetry Transport for the Interne...BRNSSPublicationHubI
 
LogMeIn Security White Paper
LogMeIn Security White PaperLogMeIn Security White Paper
LogMeIn Security White PaperLogMeIn
 
On technical security issues in cloud computing
On technical security issues in cloud computingOn technical security issues in cloud computing
On technical security issues in cloud computingsashi799
 
Security issues in cloud
Security issues in cloudSecurity issues in cloud
Security issues in cloudWipro
 
Message queuing telemetry transport (mqtt) id and other type parameters
Message queuing telemetry transport (mqtt) id and other type parametersMessage queuing telemetry transport (mqtt) id and other type parameters
Message queuing telemetry transport (mqtt) id and other type parametersHamdamboy (함담보이)
 
Session 1: The SOAP Story
Session 1: The SOAP StorySession 1: The SOAP Story
Session 1: The SOAP Storyukdpe
 
Communications Technologies
Communications TechnologiesCommunications Technologies
Communications TechnologiesSarah Jimenez
 
VULNERABILITIES OF THE SSL/TLS PROTOCOL
VULNERABILITIES OF THE SSL/TLS PROTOCOLVULNERABILITIES OF THE SSL/TLS PROTOCOL
VULNERABILITIES OF THE SSL/TLS PROTOCOLcscpconf
 
Vulnerabilities of the SSL/TLS Protocol
Vulnerabilities of the SSL/TLS ProtocolVulnerabilities of the SSL/TLS Protocol
Vulnerabilities of the SSL/TLS Protocolcsandit
 
introduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationintroduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationredaxe12
 
Petar Vucetin Soa312 Building Secure Web Services Using Windows Communica...
Petar Vucetin   Soa312   Building Secure Web Services Using Windows Communica...Petar Vucetin   Soa312   Building Secure Web Services Using Windows Communica...
Petar Vucetin Soa312 Building Secure Web Services Using Windows Communica...petarvucetin
 
Petar Vucetin Soa312 Building Secure Web Services Using Windows Communica...
Petar Vucetin   Soa312   Building Secure Web Services Using Windows Communica...Petar Vucetin   Soa312   Building Secure Web Services Using Windows Communica...
Petar Vucetin Soa312 Building Secure Web Services Using Windows Communica...petarvucetin2
 
Web Security and SSL - Secure Socket Layer
Web Security and SSL - Secure Socket LayerWeb Security and SSL - Secure Socket Layer
Web Security and SSL - Secure Socket LayerAkhil Nadh PC
 
Network Security_Module_2.pdf
Network Security_Module_2.pdfNetwork Security_Module_2.pdf
Network Security_Module_2.pdfDr. Shivashankar
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)IJERD Editor
 

Semelhante a WCF security (20)

Vtu network security(10 ec832) unit 5 notes.
Vtu network security(10 ec832) unit 5 notes.Vtu network security(10 ec832) unit 5 notes.
Vtu network security(10 ec832) unit 5 notes.
 
Network and cyber security module(15ec835, 17ec835)
Network and cyber security module(15ec835, 17ec835)Network and cyber security module(15ec835, 17ec835)
Network and cyber security module(15ec835, 17ec835)
 
The enterprise differentiator of mq on zos
The enterprise differentiator of mq on zosThe enterprise differentiator of mq on zos
The enterprise differentiator of mq on zos
 
Study on Messaging Protocol Message Queue Telemetry Transport for the Interne...
Study on Messaging Protocol Message Queue Telemetry Transport for the Interne...Study on Messaging Protocol Message Queue Telemetry Transport for the Interne...
Study on Messaging Protocol Message Queue Telemetry Transport for the Interne...
 
LogMeIn Security White Paper
LogMeIn Security White PaperLogMeIn Security White Paper
LogMeIn Security White Paper
 
On technical security issues in cloud computing
On technical security issues in cloud computingOn technical security issues in cloud computing
On technical security issues in cloud computing
 
Security issues in cloud
Security issues in cloudSecurity issues in cloud
Security issues in cloud
 
Message queuing telemetry transport (mqtt) id and other type parameters
Message queuing telemetry transport (mqtt) id and other type parametersMessage queuing telemetry transport (mqtt) id and other type parameters
Message queuing telemetry transport (mqtt) id and other type parameters
 
Session 1: The SOAP Story
Session 1: The SOAP StorySession 1: The SOAP Story
Session 1: The SOAP Story
 
Communications Technologies
Communications TechnologiesCommunications Technologies
Communications Technologies
 
VULNERABILITIES OF THE SSL/TLS PROTOCOL
VULNERABILITIES OF THE SSL/TLS PROTOCOLVULNERABILITIES OF THE SSL/TLS PROTOCOL
VULNERABILITIES OF THE SSL/TLS PROTOCOL
 
Vulnerabilities of the SSL/TLS Protocol
Vulnerabilities of the SSL/TLS ProtocolVulnerabilities of the SSL/TLS Protocol
Vulnerabilities of the SSL/TLS Protocol
 
introduction to Windows Comunication Foundation
introduction to Windows Comunication Foundationintroduction to Windows Comunication Foundation
introduction to Windows Comunication Foundation
 
Petar Vucetin Soa312 Building Secure Web Services Using Windows Communica...
Petar Vucetin   Soa312   Building Secure Web Services Using Windows Communica...Petar Vucetin   Soa312   Building Secure Web Services Using Windows Communica...
Petar Vucetin Soa312 Building Secure Web Services Using Windows Communica...
 
Petar Vucetin Soa312 Building Secure Web Services Using Windows Communica...
Petar Vucetin   Soa312   Building Secure Web Services Using Windows Communica...Petar Vucetin   Soa312   Building Secure Web Services Using Windows Communica...
Petar Vucetin Soa312 Building Secure Web Services Using Windows Communica...
 
07 advanced topics
07 advanced topics07 advanced topics
07 advanced topics
 
21 muhammad ahmadjan_8
21 muhammad ahmadjan_821 muhammad ahmadjan_8
21 muhammad ahmadjan_8
 
Web Security and SSL - Secure Socket Layer
Web Security and SSL - Secure Socket LayerWeb Security and SSL - Secure Socket Layer
Web Security and SSL - Secure Socket Layer
 
Network Security_Module_2.pdf
Network Security_Module_2.pdfNetwork Security_Module_2.pdf
Network Security_Module_2.pdf
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 

Mais de Orbit One - We create coherence

ShareCafé: SharePoint - Een doos vol documenten of dé tool om efficiënt samen...
ShareCafé: SharePoint - Een doos vol documenten of dé tool om efficiënt samen...ShareCafé: SharePoint - Een doos vol documenten of dé tool om efficiënt samen...
ShareCafé: SharePoint - Een doos vol documenten of dé tool om efficiënt samen...Orbit One - We create coherence
 
ShareCafé: Office365 - Efficiënt samenwerken met minimum aan kosten en comple...
ShareCafé: Office365 - Efficiënt samenwerken met minimum aan kosten en comple...ShareCafé: Office365 - Efficiënt samenwerken met minimum aan kosten en comple...
ShareCafé: Office365 - Efficiënt samenwerken met minimum aan kosten en comple...Orbit One - We create coherence
 
ShareCafé 3 - Geef je samenwerking een technologische upgrade
ShareCafé 3 - Geef je samenwerking een technologische upgradeShareCafé 3 - Geef je samenwerking een technologische upgrade
ShareCafé 3 - Geef je samenwerking een technologische upgradeOrbit One - We create coherence
 
OneCafé: De toekomst van ledenorganisaties met behulp van CRM en informatie-u...
OneCafé: De toekomst van ledenorganisaties met behulp van CRM en informatie-u...OneCafé: De toekomst van ledenorganisaties met behulp van CRM en informatie-u...
OneCafé: De toekomst van ledenorganisaties met behulp van CRM en informatie-u...Orbit One - We create coherence
 
OneCafé: The future of membership organizations facilitated by CRM and collab...
OneCafé: The future of membership organizations facilitated by CRM and collab...OneCafé: The future of membership organizations facilitated by CRM and collab...
OneCafé: The future of membership organizations facilitated by CRM and collab...Orbit One - We create coherence
 
Social Computing in your organization using SharePoint: challenges and benefits
Social Computing in your organization using SharePoint: challenges and benefitsSocial Computing in your organization using SharePoint: challenges and benefits
Social Computing in your organization using SharePoint: challenges and benefitsOrbit One - We create coherence
 
Marketing Automation in Dynamics CRM with ClickDimensions
Marketing Automation in Dynamics CRM with ClickDimensionsMarketing Automation in Dynamics CRM with ClickDimensions
Marketing Automation in Dynamics CRM with ClickDimensionsOrbit One - We create coherence
 

Mais de Orbit One - We create coherence (20)

ShareCafé: SharePoint - Een doos vol documenten of dé tool om efficiënt samen...
ShareCafé: SharePoint - Een doos vol documenten of dé tool om efficiënt samen...ShareCafé: SharePoint - Een doos vol documenten of dé tool om efficiënt samen...
ShareCafé: SharePoint - Een doos vol documenten of dé tool om efficiënt samen...
 
HoGent tips and tricks van een self-made ondernemer
HoGent tips and tricks van een self-made ondernemer HoGent tips and tricks van een self-made ondernemer
HoGent tips and tricks van een self-made ondernemer
 
Het Nieuwe Werken in de praktijk
Het Nieuwe Werkenin de praktijkHet Nieuwe Werkenin de praktijk
Het Nieuwe Werken in de praktijk
 
ShareCafé: Office365 - Efficiënt samenwerken met minimum aan kosten en comple...
ShareCafé: Office365 - Efficiënt samenwerken met minimum aan kosten en comple...ShareCafé: Office365 - Efficiënt samenwerken met minimum aan kosten en comple...
ShareCafé: Office365 - Efficiënt samenwerken met minimum aan kosten en comple...
 
ShareCafé 3 - Geef je samenwerking een technologische upgrade
ShareCafé 3 - Geef je samenwerking een technologische upgradeShareCafé 3 - Geef je samenwerking een technologische upgrade
ShareCafé 3 - Geef je samenwerking een technologische upgrade
 
ShareCafé 2 - Werk slimmer door geïntegreerde tools
ShareCafé 2 - Werk slimmer door geïntegreerde toolsShareCafé 2 - Werk slimmer door geïntegreerde tools
ShareCafé 2 - Werk slimmer door geïntegreerde tools
 
ShareCafé 1: Hou de Nieuwe Werker gemotiveerd
ShareCafé 1: Hou de Nieuwe Werker gemotiveerdShareCafé 1: Hou de Nieuwe Werker gemotiveerd
ShareCafé 1: Hou de Nieuwe Werker gemotiveerd
 
Business value of Lync integrations
Business value of Lync integrationsBusiness value of Lync integrations
Business value of Lync integrations
 
OneCafé: De toekomst van ledenorganisaties met behulp van CRM en informatie-u...
OneCafé: De toekomst van ledenorganisaties met behulp van CRM en informatie-u...OneCafé: De toekomst van ledenorganisaties met behulp van CRM en informatie-u...
OneCafé: De toekomst van ledenorganisaties met behulp van CRM en informatie-u...
 
Identity in the cloud using Microsoft
Identity in the cloud using MicrosoftIdentity in the cloud using Microsoft
Identity in the cloud using Microsoft
 
OneCafé: The future of membership organizations facilitated by CRM and collab...
OneCafé: The future of membership organizations facilitated by CRM and collab...OneCafé: The future of membership organizations facilitated by CRM and collab...
OneCafé: The future of membership organizations facilitated by CRM and collab...
 
OneCafé: The new world of work and your organisation
OneCafé: The new world of work and your organisationOneCafé: The new world of work and your organisation
OneCafé: The new world of work and your organisation
 
Social Computing in your organization using SharePoint: challenges and benefits
Social Computing in your organization using SharePoint: challenges and benefitsSocial Computing in your organization using SharePoint: challenges and benefits
Social Computing in your organization using SharePoint: challenges and benefits
 
Windows Communication Foundation (WCF) Best Practices
Windows Communication Foundation (WCF) Best PracticesWindows Communication Foundation (WCF) Best Practices
Windows Communication Foundation (WCF) Best Practices
 
Wie is Orbit One Internet Solutions
Wie is Orbit One Internet SolutionsWie is Orbit One Internet Solutions
Wie is Orbit One Internet Solutions
 
Azure Umbraco workshop
Azure Umbraco workshopAzure Umbraco workshop
Azure Umbraco workshop
 
Marketing Automation in Dynamics CRM with ClickDimensions
Marketing Automation in Dynamics CRM with ClickDimensionsMarketing Automation in Dynamics CRM with ClickDimensions
Marketing Automation in Dynamics CRM with ClickDimensions
 
Office 365, is cloud right for your company?
Office 365, is cloud right for your company?Office 365, is cloud right for your company?
Office 365, is cloud right for your company?
 
Who is Orbit One internet solutions?
Who is Orbit One internet solutions?Who is Orbit One internet solutions?
Who is Orbit One internet solutions?
 
Azure and Umbraco CMS
Azure and Umbraco CMSAzure and Umbraco CMS
Azure and Umbraco CMS
 

Último

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

WCF security

  • 1. www.orbitone.com Raas van Gaverestraat 83 B-9000 GENT, Belgium E-mail info@orbitone.com Website www.orbitone.com Tel. +32 9 265 74 20 Fax +32 9 265 74 10 VAT BE 456.457.353 Bank 442-7059001-50 (KBC) 22 May, 2009 Windows Communication Foundation Security, by Tom Pester
  • 2. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester2  To understand WCF security we have to explore the basic set of security principals for authentication, authorization, and message transfer protection.
  • 3. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester3  Consider a message from sender to receiver  Authentication. We typically think about authentication as identifying the message sender. Mutual authentication involves authenticating both the sender and the message receiver, to prevent possible man-in-the-middle attacks.  Authorization. After authenticating the message sender, authorization determines what system features and functionality they are entitled to execute.  Integrity. Messages should be digitally signed to ensure they have not been altered between sender and receiver.  Confidentiality. Sensitive messages should be encrypted to ensure they cannot be openly viewed on the wire.
  • 4. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester4  A variety of mutual authentication mechanisms are supported using token formats such as Windows tokens, username and password, certificates and issued tokens (in a federated environment)  Authorization can be based on Windows roles, ASP.NET roles or you can provide custom authorization policies.
  • 5. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester5  The first step to securing a WCF service is defining the security policy. Once you have established requirements for authentication, authorization, and message protection it is a matter of service configuration to enforce it.
  • 6. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester6  Your binding selection will influence the available configuration options  Beyond bindings, behaviors also provide information about client and service credentials, and affect how authorization is handled.
  • 7. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester7  Each binding has a default set of security settings. Consider the following service endpoint that supports NetTcpBinding.  <system.serviceModel> <services> <service name="HelloIndigo.HelloIndigoService" > <endpoint contract="HelloIndigo.IHelloIndigoService" binding="netTcpBinding" /> </service> </services> </system.serviceModel>
  • 8. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester8  Lets look at the expanded binding configuration illustrating the default settings.  <netTcpBinding> <binding name="netTcp"> <security mode="Transport"> <transport clientCredentialType="Windows" /> </security> </binding> </netTcpBinding>  NetTcpBinding is secure by default. Specifically, callers must provide Windows credentials for authentication and all message packets are signed and encrypted over TCP protocol.  In fact all standard bindings are secure by default except for Basic Http binding
  • 9. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester9 Security Mode  Across all service bindings there are five possible security modes:  None. Turns security off.  Transport. Uses transport security for mutual authentication and message protection.  Message. Uses message security for mutual authentication and message protection.  Both. Allows you to supply settings for transport and message-level security (only MSMQ supports this).  TransportWithMessageCredential. Credentials are passed with the message and message protection and server authentication are provided by the transport layer.  TransportCredentialOnly. Client credentials are passed with the transport layer and no message protection is applied.
  • 10. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester10  For example, this <wsHttpBinding> snippet illustrates how to require UserName credentials be passed with the message.  <wsHttpBinding> <binding name="wsHttp"> <security mode="Message"> <message clientCredentialType="UserName" /> </security> </binding> </wsHttpBinding>
  • 11. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester11 Transfer protection  Transport vs. Message  Transport protection is only good from point-to-point.  Message protections is good end-to-end
  • 12. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester12  Messages are unencrypted over a channel stack that is unsecure
  • 13. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester13  Messages are encyrpted over a channel stack that is unsecure
  • 14. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester14  Messages are unencyrpted over a channel stack that is secure (If the channel were unsecure, you could see the messages in clear text.)
  • 15. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester15  Messages are encyrpted over an unsecure channel between the client and the service endpoint (1st hop). Notice the messages remain encrypted between the first service and second service (2nd hop).
  • 16. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester16  Messages are unencyrpted over an secure channel between the client and the service endpoint (1st hop). Notice the messages DO NOT remain encrypted between the first service
  • 17. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester17  Message security supports passing credentials as part of the SOAP message using interoperable standards, and also makes it possible to protect the message independent of transport all the way through to the ultimate message receiver.
  • 18. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester18  Transport security is point to point. Since the messages themselves are not encrypted, once they go to another point, they can be potentially exposed to integrity/privacy attacks as if they were unsecure.  The big advantage of message security is that it provides end to end security. Messages leaving intermediary services retain their security.
  • 19. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester19 Client Credential Type  The choice of client credential type depends on the security mode in place. Message security supports any of the following settings for clientCredentialType:  None  Windows  UserName  Certificate  IssuedToken
  • 20. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester20  <basicHttpBinding> <binding name="basicHttp"> <security mode="TransportWithMessageCredential"> <message clientCredentialType="Certificate"/> </security> </binding> </basicHttpBinding>
  • 21. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester21 Protection Level  By default, all secure WCF bindings will encrypt and sign messages. You cannot disable this for transport security, however, for message security you may wish to disable this for debugging purposes.  Protection-level settings are controlled by the contract.
  • 22. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester22  [ServiceContract(Name="HelloIndigoContract", Namespace= "", ProtectionLevel=ProtectionLevel.Sign)] public interface IHelloIndigoService { string HelloIndigo(string inputString); }
  • 23. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester23  For more granular control, you can also indicate message protection per operation using the OperationContractAttribute.  [ServiceContract(Name="HelloIndigoContract", Namespace=] public interface IHelloIndigoService { [OperationContract(ProtectionLevel= ProtectionLevel.Sign)] string HelloIndigo(string inputString); }  ProtectionLevel options are: None, Sign, and EncryptAndSign.
  • 24. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester24 Algorithm Suite  Choice of algorithm suite can be particularly important for interoperability.  Each binding uses Basic256 as the default algorithm suite for message-level security  <wsHttpBinding> <binding name="wsHttp"> <security mode="Message"> <message clientCredentialType="UserName” algorithmSuite="TripleDes" /> </security> </binding> </wsHttpBinding>
  • 25. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester25 Secure Session  Another feature of message security is the ability to establish a secure session to reduce the overhead of key exchange and validation.  A token is generated through an initial exchange between caller and service. This token is used to authorize and secure subsequent message exchanges.  <wsHttpBinding> <binding name="wsHttp"> <security mode="Message"> <message clientCredentialType="UserName" establishSecurityContext="false" /> </security> </binding> </wsHttpBinding>
  • 26. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester26 Authorisation  <system.web> <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15"> <providers> <clear /> <add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="SqlConn" applicationName="MembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" passwordFormat="Hashed" /> </providers> </membership> <!-- Other configuration code not shown.--></system.web>  <behaviors>  <behavior name="ServiceBehaviour">  <serviceAuthorization principalPermissionMode ="UseAspNetRoles"  roleProviderName ="SqlProvider" />  </behavior>  <!-- Other configuration code not shown. -->  </behaviors>
  • 27. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester27  Imperatively  public string AdminsOnly() { // unprotected code PrincipalPermission p = new PrincipalPermission(null, "Administrators"); p.Demand(); // protected code }  Or declaratively  [PrincipalPermission(SecurityAction.Demand, Role = "Administrators")] public string AdminsOnly() { // protected code }
  • 28. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester28 Impersonation  When Windows credentials are used, the service can be configured to impersonate callers so that the request thread operates under the impersonated Windows token.  This makes it possible for services to access protected Windows resources under the identity of the caller, instead of the process identity of the service-for that request.  This can be dangerous and I consider it bad practice.
  • 29. 22 May, 2009 Windows Communication Foundation Security, by Tom Pester29  Using the OperationBehaviorAttribute you can apply impersonation rules per operation by setting the Impersonation property to one of the following:  ImpersonationOption.NotAllowed. The caller will not be impersonated.  ImpersonationOption.Allowed. The caller will be impersonated if a Windows credential is provided.  ImpersonationOption.Required. The caller will be impersonated and a Windows credential must be provided to support this.  This behavior is applied to service operations. [OperationBehavior(Impersonation = ImpersonationOption.Allowed)] public string DoSomething() { ... }
  • 30. www.orbitone.com 30 Windows Communication Foundation Security, by Tom Pester 22 May, 2009