10: Remoting Securing System.Runtime.Remoting

Slides:



Advertisements
Similar presentations
.NET Remoting in Delphi and C# Alain “Lino” Tadros President & CEO Falafel Software Inc. ComponentScience Inc. BORCON 2004.
Advertisements

XML Web Services in Visual Studio ®.NET NameTitleCompany.
Chapter 7 HARDENING SERVERS.
K. Salah 1 Chapter 31 Security in the Internet. K. Salah 2 Figure 31.5 Position of TLS Transport Layer Security (TLS) was designed to provide security.
Implementing Native Mode and Internet Based Client Management.
Distributed Systems Tutorial 2 -.NET Remoting. 2 What is Remoting?  Remoting allows you to pass objects or values across servers in different domains.
© 2007 Charteris plc20 June Extending Web Service Security with WS-* Presented by Chris Seary MVP Charteris plc, Bartholomew Close, London.
.NET Deployment Matt Smouse CSE775 – Distributed Objects Spring 2003.
Using Internet Information Server And Microsoft ® Internet Explorer To Implement Security On The Intranet HTTP.
Internet Information Server (IIS)
Jonas Thomsen, Ph.d. student Computer Science University of Aarhus Best Practices and Techniques for Building Secure Microsoft.
Course 201 – Administration, Content Inspection and SSL VPN
Internet Information Server 6.0. Overview  What’s New in IIS 6.0?  Built-in Accounts and IIS 6.0  IIS Pass-Through Authentication  Securing Web Traffic.
1 Infrastructure Hardening. 2 Objectives Why hardening infrastructure is important? Hardening Operating Systems, Network and Applications.
Session 11: Security with ASP.NET
MCSE Guide to Microsoft Exchange Server 2003 Administration Chapter Four Configuring Outlook and Outlook Web Access.
The Windows NT ® 5.0 Public Key Infrastructure Charlie Chase Program Manager Windows NT Security Microsoft Corporation.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Securing a Microsoft ASP.NET Web Application.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
1 Web services and security ---discuss different ways to enforce security Presenter: Han, Xue.
.NET Framework Danish Sami UG Lead.NetFoundry
Module 5 Configuring Authentication. Module Overview Lesson 1: Understanding Classic SharePoint Authentication Providers Lesson 2: Understanding Federated.
Dr. Mustafa Cem Kasapbaşı Security in ASP.NET. Determining Security Requirements Restricted File Types.
Grid Chemistry System Architecture Overview Akylbek Zhumabayev.
The.NET Runtime and IIS Presented by Chris Dickey – cdickey.net consulting
Developing Web Services Using ASP.NET and WSE That Interoperate with the Windows Communications Foundation ("Indigo") Mark Fussell COM432 Lead Program.
Hands-On Microsoft Windows Server Implementing Microsoft Internet Information Services Microsoft Internet Information Services (IIS) –Software included.
Reset and Recycle IIS Reset Application Pool Management Error Codes New HTTP Sub-status codes Custom/Detailed Errors Tracing in IIS7 and.
CHAPTER 9 Sniffing.
This is the main tracing and diagnostics presentation. Very important that this be practical and useful information. IT Pro audience is very.
Web Access. Overview  Purpose  Prerequisites  Install Components  Enable Virtual Directories  IIS Configuration & Security  Troubleshooting.
IIS and.Net security -Vasudha Bhat. What is IIS? Why do we need IIS? Internet Information Services (IIS) is a Web server, its primary job is to accept.
Pertemuan #10 Secure HTTP (HTTPS) Kuliah Pengaman Jaringan.
Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts How to host WCF services.
Security E-Learning Chapter 08. Security Control access to your web site –3 Techinques for Identifying users Giving users access to your site Securing.
Migrating ASP to ASP.NET Matt Gibbs ASP.NET Development Manager.
Configuring and Deploying Web Applications Lesson 7.
Modern Development Technologies in SharePoint SHAREPOINT SATURDAY OMAHA APRIL, 2016.
Lecture 10 Page 1 CS 236 Online SSL and TLS SSL – Secure Socket Layer TLS – Transport Layer Security The common standards for securing network applications.
APACHE Apache is generally recognized as the world's most popular Web server (HTTP server). Originally designed for Unix servers, the Apache Web server.
Lecture 9 Page 1 CS 236 Online Firewalls What is a firewall? A machine to protect a network from malicious external attacks Typically a machine that sits.
Windows Communication Foundation and Web Services
DataPower Security Details: Crypto Objects and AAA
SharePoint Authentication and Authorization
Jim Fawcett CSE775 – Distributed Objects Spring 2003
Presented by: Ramaswamy Krishnan-Chittur
Stop Those Prying Eyes Getting to Your Data
Stress Free Deployments with Octopus Deploy
11: COM+ Securing System.EnterpriseServices
Configuring and Troubleshooting Routing and Remote Access
Jim Fawcett CSE686 – Internet Programming Summer 2005
Presentation 23 .NET Remoting Introduced
Module 8: Securing Network Traffic by Using IPSec and Certificates
Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek
Matt Smouse CSE775 – Distributed Objects Spring 2003
Presented by: Ramaswamy Krishnan-Chittur
Introduction to Networking
Microsoft .NET Remoting Essentials
IIS v7.0 Martin Parry Developer & Platform Group Microsoft Limited
Module 8: Securing Network Traffic by Using IPSec and Certificates
Student: Popa Andrei-Sebastian
APACHE WEB SERVER.
Designing IIS Security (IIS – Internet Information Service)
Matt Smouse CSE775 – Distributed Objects Spring 2003
Jim Fawcett Core Technologies Spring 2005
Jim Fawcett CSE791 – Distributed Objects Spring 2002
Web Services Enhancements 2.0
Securing web applications Externally
Matt Smouse CSE775 – Distributed Objects Spring 2003
Security - Forms Authentication
Presentation transcript:

10: Remoting Securing System.Runtime.Remoting Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

Why bother securing .NET remoting? .NET remoting will mainly be used on a corporate intranet the corporate intranet is protected by firewalls so aren’t we safe from external attacks? Firewalls can slow down external attacks, but they aren’t a silver bullet the best defenses are layered ones insider attacks can be much more devastating ignore security on the intranet at your own peril Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

Solution one: hosting in IIS 10: Remoting Solution one: hosting in IIS ASP.NET comes with a special handler for remoting HttpRemotingHandlerFactory Reads server remoting configuration from web.config Passes HTTP requests through to remoting channel requires that you use Http channel you can use any formatter you like (binary, soap, custom) Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

HttpRemotingHandlerFactory class foo : MarshalByRefObject 10: Remoting Hosting in IIS http://acme.com/myApp/foo.soap ASP.NET Pipeline modules HttpRemotingHandlerFactory class foo : MarshalByRefObject worker process Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

How to host in IIS Set up a virtual directory in IIS 10: Remoting How to host in IIS Set up a virtual directory in IIS Build server object into a library assembly (.DLL) drop this assembly into “bin” directory under vroot, or install in GAC Create a web.config file and wire it all up must use http channel when hosting in IIS prefer binary formatter for efficiency server URI must end with “.soap” or “.rem” to map to .NET remoting handler in ASP.NET pipeline Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

web.config example <configuration> 10: Remoting web.config example <configuration> <system.runtime.remoting> <application> <channels> <channel ref='http'> <serverProviders> <formatter ref='binary'/> </serverProviders> </channel> </channels> <service> <wellknown mode='Singleton' type='Calc, server' objectUri='calc.soap'/> </service> </application> </system.runtime.remoting> </configuration> This should look familiar to anyone who has written a normal .NET remoting configuration file (which is normally processed via RemotingConfiguration.Configure(filename). Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

Client configuration <configuration> 10: Remoting Client configuration <configuration> <system.runtime.remoting> <application> <channels> <channel ref='http' useDefaultCredentials='true'> <serverProviders> <formatter ref='binary'/> </serverProviders> </channel> </channels> <service> <wellknown mode='Singleton' type='Calc, server' objectUri='calc.soap'/> </service> </application> </system.runtime.remoting> </configuration> This should look familiar to anyone who has written a normal .NET remoting configuration file (which is normally processed via RemotingConfiguration.Configure(filename). Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

Security goals Authentication Message Integrity 10: Remoting Security goals Authentication Message Integrity Message Confidentiality Authorization Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

Security when hosting in IIS 10: Remoting Security when hosting in IIS IIS has many options for authentication basic digest integrated (Kerberos) SSL (optionally with client certs) SSL is required if you want message integrity message confidentiality mutual authentication Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

Typical configurations: SSL + Basic Authentication 10: Remoting Typical configurations: SSL + Basic Authentication Benefits: works well with firewalls & proxies passwords easy to work with for clients provides mutual authentication, integrity, confidentiality Drawbacks: doesn’t leverage single sign on (client must provide cleartext password) server code has access to client’s cleartext password Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

Typical configurations: Integrated Authentication (Kerberos) 10: Remoting Typical configurations: Integrated Authentication (Kerberos) Benefits: leverages single sign on great for Intranet clients Drawbacks: generally does not work with firewalls or proxies must add SSL into the mix to achieve mutual authentication message integrity message confidentiality Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

Typical configurations: SSL with client certificates 10: Remoting Typical configurations: SSL with client certificates Benefits: works well with firewalls & proxies provides mutual authentication, integrity, confidentiality Drawbacks: human clients have trouble managing personal certificates certificates aren’t as mobile as passwords smart cards can help here Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

Authorization When hosting in IIS, your server code runs under ASP.NET 10: Remoting Authorization When hosting in IIS, your server code runs under ASP.NET To get access to the client principal, be sure to set authentication mode to “Windows” this is the default setting in machine.config anyway Use normal ASP.NET techniques for authorization Thread.CurrentPrincipal.IsInRole() PrincipalPermission PrincipalPermissionAttribute Uncaught exceptions will propagate back to client this is bad (includes a server-side stack trace) trap, log, and rethrow exception at top level of call to avoid giving away too much information consider using a remoting sink to automate this Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

IIS hosting and callbacks 10: Remoting IIS hosting and callbacks Callbacks will be completely unsecured No authentication No message integrity protection No message confidentiality protection We really need a built-in solution Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

Solution two: the SSPI remoting sink In August, 2002, Microsoft published two unsupported samples for the .NET Framework SSPI wrapper[1] Remoting security channel sinks[2] To use, must install both on client and server Uses SSPI to add security (e.g., Kerberos) to the channel authentication message integrity message confidentiality [1] http://msdn.microsoft.com/library/en-us/dndotnet/html/remsspi.asp [2] http://msdn.microsoft.com/library/en-us/dndotnet/html/remsec.asp Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

The SSPI remoting sink Does not require IIS Does not require SSL Doesn’t fall down in the face of callbacks Will eventually be built in (but not in Everett) Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

Using the SSPI remoting sink Wire the sink into the channel via configuration file must do this on both client and server Use remoting like you normally would current sample autoimpersonates client this is broken, watch for fix in future Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

client.exe.config <configuration> 10: Remoting client.exe.config <configuration> <system.runtime.remoting> <application> <channels> <channel ref='http'> <clientProviders> <formatter ref='binary'/> <provider ref='sspi' securityPackage='kerberos' impersonationLevel='impersonate' authenticationLevel='packetPrivacy'/> </clientProviders> </channel> </channels> </application> </system.runtime.remoting> </configuration> Note that order is important – the sspi provider must come *after* the formatter on the client side. Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

server.exe.config impersonationLevel='impersonate' 10: Remoting server.exe.config <configuration> <system.runtime.remoting> <application> <channels> <channel ref='http' port='4243'> <serverProviders> <provider ref='sspi' securityPackage='kerberos' impersonationLevel='impersonate' authenticationLevel='packetPrivacy'/> <formatter ref='binary'/> </serverProviders> </channel> </channels> <service> <wellknown type='Bob, server' mode='Singleton' objectUri='bob'/> </service> </application> </system.runtime.remoting> </configuration> Note that order is important, on the server side the provider must come *before* formatter. This is the opposite order from the client. Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

10: Remoting machine.config The preceding example config files made use of ref='sspi' adjust machine.config as follows to make this work <system.runtime.remoting> <!-- other stuff omitted for brevity --> <channelSinkProviders> <clientProviders> <formatter id="soap" ... /> <formatter id="binary" ... /> <provider id="sspi" type="see notes"/> </clientProviders> <serverProviders> </serverProviders> </channelSinkProviders> </system.runtime.remoting> The type attribute should be set to something that looks like this: "Microsoft.Samples.Runtime.Remoting.Security.SecurityClientChannelSinkProvider, Microsoft.Samples.Runtime.Remoting.Security, Version=1.0.9.0, Culture=neutral, PublicKeyToken=9f0928b6ea506bde" Since the version and public key may change over time, the safest way to get the assembly name part of this string is to run the following command: gacutil -l Microsoft.Samples.Runtime.Remoting.Security This will show you the full strong names of all versions of the remoting sample assembly. Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003

Summary .NET remoting has no built in, supported, security model Can layer security on by hosting in IIS Can layer security on using an unsupported sample from MS Expect improvement in the future (not Everett, though ) Essential .NET Security © 2003 DevelopMentor, Inc. 11/3/2003