14
Website Security ASP.NET is compiled to managed code before executing, so web pages can utilize the same role-based features as other .NET applications. Web.config can define built-in ASP.NET security providers such as “Forms”, “Windows” or set event handlers for custom providers. Web.config is an “application” level security policy file. Settings in higher level policy files take precedent, so administrators of shared web servers can breath.

SynapseIndia dotnet website security development

Embed Size (px)

Citation preview

Page 1: SynapseIndia  dotnet website security development

Website SecurityASP.NET is compiled to managed code before

executing, so web pages can utilize the same role-based features as other .NET applications.

Web.config can define built-in ASP.NET security providers such as “Forms”, “Windows” or set event handlers for custom providers.

Web.config is an “application” level security policy file. Settings in higher level policy files take precedent, so administrators of shared web servers can breath.

Page 2: SynapseIndia  dotnet website security development

Security & Managed Code

Evidence-based security means that there is no guarantee your code has sufficient permission to run when the user executes it!

.NET classes are free-threaded.

Page 3: SynapseIndia  dotnet website security development

ASP.NET

Programming model can handle client-side events on the server as if they happened on the server.

Design-time provides GUI configuration of controls on the page. Microsoft provides controls that are fast and scalable for .NET (vs. VS6).

Compiled code means 2-5 times faster execution.

Session State is now fast and scalable.

Page 4: SynapseIndia  dotnet website security development

ASP.NET Change Management• Version code just like any other .NET application!• Debug Using Trace! (instead of Response.Write)• Automated Unit Testing!• Deploy Assemblies Without Source Code!

– Protect your Intellectual Property!• Publish web applications with simple XCopy!

– Goodbye FrontPage Extensions!• Dynamic Code Replacement - Without Rebooting!• Concurrently Run Different Versions of Business

Objects Side-By-Side!• Script Builds from Source Control

Page 5: SynapseIndia  dotnet website security development

ASP.NET Cool FeaturesOutput Caching is automatic, but configurable by

user, query, time or underlying data source AND at either the page or control level.

ASP and ASP.NET can run in the same directory but do not share state.

Use any .NET language. Use structured exception handling as implemented in the language.

Debug from web pages down into business objects.

Page 6: SynapseIndia  dotnet website security development

Writing XML Web ServicesUse the WebService directive in .ASMX pages. Code behind

uses the WebMethod attribute and inherits from System.Web.Services.WebService.

.NET will use reflection to automatically generate a WSDL and a simple human-readable testing and documentation page.

Also, you can publish any COM+ object or .NET assembly by registering it in COM+ and checking a box. COM+ can use .NET remoting instead of HTTP for .NET to .NET calls.

SQL and Exchange 2000 both provide XML Web Services access methods to their data.

Page 7: SynapseIndia  dotnet website security development

Web ServicesImports System.Web.Services

<WebService(Namespace := "http://tempuri.org/")> _Public Class Service1 Inherits System.Web.Services.WebService

<WebMethod()> Public Function HelloPerson(ByVal YourName As String) As String

HelloPerson = "Hello, " & YourName & "." End Function

End Class

Page 8: SynapseIndia  dotnet website security development

Consuming XML Web ServicesAll Web Services are late-binding.

Static bindings are Web References. Use them just like a referenced assembly. IntelliSense works!

Dynamically bind to services at run-time by using UDDI and/or Disco.

If necessary, configure proxy server and credentials in machine.config.

Consume .NET Web Services from any platform.

Page 9: SynapseIndia  dotnet website security development

Consuming Web Services

Page 10: SynapseIndia  dotnet website security development

ASP.NET Web Form

Page 11: SynapseIndia  dotnet website security development

Web Services

Private Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button.Click

Dim ws As New HelloService.Service1()

Results.Text &= ws.HelloPerson(strName.Text) & "<br>"

End Sub

Page 12: SynapseIndia  dotnet website security development

Touchless Desktop Deployment

DEMO

Page 13: SynapseIndia  dotnet website security development

Issues

Only Windows 2000 and XP as servers. Windows 98 or better as clients. CE support is in beta and will be a subset.

Transparency of Source Code – MSIL is relatively easy to reverse engineer to source code. Obfuscators and encryption will solve this in the future.

Security of .NET is still questioned based on past experience with Microsoft.

Page 14: SynapseIndia  dotnet website security development

.NET MythsMyth: Passport is required for authentication in .NET. BizTalk

is required for XML Web Services. Windows CALs are required for access to “authenticated” IIS applications.

Myth: J# is another Microsoft attempt to corrupt Java.

Myth: The Microsoft .NET Pet Store benchmark proves ASP.NET is 15-28 times faster, requires ¼ the CPU, ¼ the code and supports 6-8x as many users as J2EE.

Related Myth: Oracle’s latest Java Pet Store proves J2EE on Oracle is faster than .NET

Myth: .NET is a huge mental leap for VB developers.