SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Andere mochten auch

Mbc Consulting Group
Mbc Consulting GroupMbc Consulting Group
Mbc Consulting Group
Kevin Cook
 
Кризис роста в ИТ-компании Иоря Ашманова
Кризис роста в ИТ-компании Иоря АшмановаКризис роста в ИТ-компании Иоря Ашманова
Кризис роста в ИТ-компании Иоря Ашманова
Ingria. Technopark St. Petersburg
 
L1. intro to ethics
L1. intro to ethicsL1. intro to ethics
L1. intro to ethics
t0nywilliams
 
Контроль вашего сердца [Web Ready 2010]
Контроль вашего сердца [Web Ready 2010]Контроль вашего сердца [Web Ready 2010]
Контроль вашего сердца [Web Ready 2010]
Ingria. Technopark St. Petersburg
 
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
guestff1b67
 

Andere mochten auch (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
 

Ähnlich wie WCF security

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
 
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
 
Security issues in cloud
Security issues in cloudSecurity issues in cloud
Security issues in cloud
Wipro
 
Session 1: The SOAP Story
Session 1: The SOAP StorySession 1: The SOAP Story
Session 1: The SOAP Story
ukdpe
 
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
 

Ähnlich wie 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)
 

Mehr von Orbit One - We create coherence

Mehr von 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
 

Kürzlich hochgeladen

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
Safe Software
 
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
panagenda
 

Kürzlich hochgeladen (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 

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