Chris Eargle

Life Student of the Kodefu Arts

C# 3.0 Presentation

by chris 25. April 2008 02:08

The examples I showed in my C# 3.0 presentation were based on the examples provided in the Visual Studio 2008 Training Kit. The source code for the new features in C# 3.0 are located, by default, in C:\VS2008TrainingKit\Labs\WhatsNewC#. There are other great labs in this kit as well.

  • Building Web Apps
  • Building WPF Apps
  • CardSpace
  • Client Application Services
  • Dynamic Sites
  • Intro to ASP.NET Ajax
  • JSON
  • LINQ to SQL
  • Silverlight Monster Factory
  • LINQ in VB9
  • VSTO (Excel, Outlook, SharePoint, Word)
  • Windows Communication Foundation
  • Windows Workflow Foundation
  • What's New in VB9
  • Workflow Services
  • WPF Data Binding

That's an exhausting list of material to learn!

Of course, code alone doesn't give you a lot of information. Here are the topics I touched upon with links to MSDN.

C# 2.0

·         Partial Types

·         Aliases

·         Static Classes

·         Property Access Modifiers

·         Generics

·         Nullable Types

·         Null coalescing operator

·         yield

·         Delegates

o   Inference

o   Covariance/Contravariance

o   Anonymous methods

 

C# 3.0

·         Auto-Implemented Properties

·         Object and Collection Initializers

·         Implicitly typed variables

·         Anonymous types

·         Extension Methods

·         Lambda Expressions

·         Expression Trees

·         LINQ

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

linq, lamdba

Presentation

E-mail | Kick it! | DZone it! | del.icio.us
Permalink | Comments (1) | Post RSSRSS comment feed

Augusta Meeting Tonight

by chris 24. April 2008 07:58

I am presenting on new language features in C# 3.0 at the inaugral meeting of the Augusta Developers Guild tonight. It will be nearly devoid of slides, as I've decided the words on the screen will be more of a distraction than anything. So, let's code, lambda!

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

E-mail | Kick it! | DZone it! | del.icio.us
Permalink | Comments (0) | Post RSSRSS comment feed

WCF 3.5 Security Guidelines

by chris 17. April 2008 08:16

The patterns & practices WCF Security Guidance project has released the the WCF 3.5 Security Guidelines. This is useful if you're trying to follow the best practices for securing your services.

Here are the categories and topics for the initial release of the guidelines. For more in depth information, go to the site.  

Categories

  • Auditing and Logging
  • Authentication
  • Authorization
  • Binding
  • Configuration Management
  • Exception Management
  • Hosting
  • Impersonation and Delegation
  • Input/Data Validation
  • Proxy Considerations
  • Deployment considerations 

Auditing and Logging

  • Use WCF auditing to audit your service
  • If non-repudiation is important, consider setting SuppressAuditFailure property to false
  • Use message logging to log operations on your service
  • Instrument for user management events
  • Instrument for significant business operations
  • Protect log files from unauthorized access
  • Do not log sensitive information

Authentication

  • Know your authentication options
  • Use Windows Authentication when you can
  • If you support non-WCF clients using windows authentication and message security, consider using the Kerberos direct option
  • If your users are in AD, but you can’t use windows authentication, consider using username authentication
  • If your clients have certificates, consider using client certificate authentication
  • If you need to streamline certificate distribution to your clients for message encryption, consider using the negotiate credentials option
  • If your users are in a custom store, consider using username authentication with a custom validator
  • If your users are in a SQL membership store, use the SQL Membership Provider
  • If your partner applications need to be authenticated when calling WCF services, use client certificate authentication.
  • If you are using username authentication, use SQL Server Membership Provider instead of custom authentication
  • If you need to support intermediaries and a variety of transports between client and service, use message security to protect credentials
  • If you are using username authentication, validate user login information
  • Do not store passwords directly in the user store
  • Enforce strong passwords
  • Protect access to your credential store
  • If you are using Windows Forms to connect to WCF, do not cache credentials

Authorization

  • If you use ASP.NET roles, use the ASP.NET Role Provider
  • If you use windows groups for authorization, use ASP.NET Role Provider with AspNetWindowsTokenRoleProvider
  • If you store role information in SQL, consider using the SQL Server Role Provider for roles authorization
  • If you store role information in Windows Groups, consider using the WCF PrincipalPermissionAttribute class for roles authorization
  • If you need to authorize access to WCF operations, use declarative authorization
  • If you need to perform fine-grained authorization based on business logic, use imperative authorization

Binding

  • If you need to support clients over the internet, consider using wsHttpBinding.
  • If you need to expose your WCF service to legacy clients as an ASMX web service, use basicHttpBinding
  • If you need to support remote WCF clients within an intranet, consider using netTcpBinding.
  • If you need to support local WCF clients, consider using netNamedPipeBinding.
  • If you need to support disconnected queued calls, use netMsmqBinding.
  • If you need to support bidirectional communication between WCF Client and WCF service, use wsDualHttpBinding.

Configuration Management

  • Use Replay detection to protect against message replay attacks
  • If you host your service in a Windows service, expose a metadata exchange (mex) binding
  • If you don’t want to expose your WSDL, turn off HttpGetEnabled and metadata exchange (mex)
  • Manage bindings and endpoints in config not code
  • Associate names with the service configuration when you create service behavior, endpoint behavior, and binding configuration
  • Encrypt configuration sections that contain sensitive data

Exception Management

  • Use structured exception handling
  • Do not divulge exception details to clients in production
  • Use a fault contract to return error information to clients
  • Use a global exception handler to catch unhandled exceptions

Hosting

  • If you are hosting your service in a Windows Service, use a least privileged custom domain account
  • If you are hosting your service in IIS, use a least privileged service account
  • Use IIS to host your service unless you need to use a transport that IIS does not support

Impersonation and Delegation

  • Know the impersonation options
  • If you have to flow the original caller, use constrained delegation
  • Consider LogonUser when you need to impersonate but you don’t have trusted delegation
  • Consider S4U when you need a Windows token and you don’t have the original caller’s credentials
  • Use programmatic impersonation to impersonate based on business logic
  • When impersonating programmatically be sure to revert to original context
  • Only impersonate on operations that require it
  • Use OperationBehavior to impersonate declaratively

Input/Data Validation

  • If you need to validate parameters, use parameter inspectors
  • If your service has operations that accept message or data contracts, use schemas to validate your messages
  • If you need to do schema validation, use message inspectors
  • Validate operation parameters for length, range, format and type
  • Validate parameter input on the server
  • Validate service responses on the client
  • Do not rely on client-side validation
  • Avoid user-supplied file name and path input
  • Do not echo untrusted input

Proxy Considerations

  • Publish your metadata over HTTPS to protect your clients from proxy spoofing
  • If you turn off mutual authentication, be aware of service spoofing

Deployment considerations

  • Do not use temporary certificates in production
  • If you are using a custom domain account in the identity pool for your WCF application, create an SPN for Kerberos to authenticate the client.
  • If you are using a custom service account and need to use trusted for delegation, create an SPN
  • If you are hosting your service in a Windows Service, using a custom domain identity, and ASP.NET needs to use constrained trusted for delegation when calling the service, create an SPN
  • Use IIS to host your service unless you need to use a transport that IIS does not support
  • Use a least privileged account to run your WCF service
  • Protect sensitive data in your configuration files

My Related Posts

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

wcf, security, guidelines

Training

E-mail | Kick it! | DZone it! | del.icio.us
Permalink | Comments (0) | Post RSSRSS comment feed

.NET 3.5 Enhancements Training Kit

by chris 16. April 2008 08:59

Microsoft has released a training kit for .NET Framework 3.5 Enhancements. It includes labs, demos, and Power Point files for the following technologies:

  • ASP.NET MVC
  • ASP.NET Dynamic Data
  • ASP.NET AJAX History
  • ASP.NET Silverlight controls
  • ADO.NET Data Services
  • ADO.NET Entity Framework

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

download, mvc, ajax, entity, silverlight

Training

E-mail | Kick it! | DZone it! | del.icio.us
Permalink | Comments (0) | Post RSSRSS comment feed

Powered by BlogEngine.NET 1.3.1.0
Theme by Mads Kristensen

About the author

Chris Eargle Chris Eargle
Enterprise .NET developer in Columbia, SC.

E-mail me Send mail

Pages

  • Presentations

Twitter Updates

    Recent comments

    • Dev InTENsity (3)
      Chris Eargle wrote: Thanks for attending my presentations, Seth! In… [More]
    • Set Operations in MSBuild (1)
      FreeToDev wrote: Very nice post. Makes me wonder why I wrote tasks … [More]
    • Dev InTENsity (3)
      Seth Richards wrote: I saw both your C# 3.0 (I came up with the 'why ex… [More]
    • Dev InTENsity (3)
      Scott Ames wrote: I went to your presentation in Walthan for Code Ca… [More]
    • Generics Don't Make Me Sad (1)
      Matt Sheppard wrote: Cheers, I can't remember if I was aware of either… [More]
    • C# 3.0 Presentation (1)
      vijay wrote: Good post Thanks, Vijay [More]
    • Format Solution (4)
      Joe wrote: I added a couple of lines to FormatProjectItem() t… [More]
    • Sessions Galore (1)
      Lou wrote: I'll have to get you down here soon - I'll e-mail … [More]
    • Redeemed (3)
      Fred Beiderbecke wrote: It wasn't you, it was some of the others in the ro… [More]
    • South Florida Code Camp (1)
      Jason Meridth wrote: You've mentioned the only latest difference betwee… [More]

    Archive

    • 2008
      • November (3)
      • October (7)
      • September (8)
      • August (5)
      • July (1)
      • June (1)
      • April (4)
      • March (1)
      • February (4)
      • January (5)
    • 2007
      • December (5)
      • November (1)
      • October (6)
      • September (3)
      • August (1)
      • June (1)

    Tags

    • activex
    • addin
    • ado.net data services
    • ajax
    • architecture
    • astoria
    • azure
    • beta
    • bug
    • c#
    • code camp
    • com
    • consolas
    • continuous integration
    • conversion
    • ctp
    • database
    • deployment
    • design
    • design principles
    • download
    • ebook
    • entity
    • entlib
    • environment variables
    • expression blend
    • fail
    • font
    • framework
    • gadget
    • generics
    • grid
    • guidelines
    • icon
    • interfaces
    • jacksonville
    • lamdba
    • linq
    • linqtosql
    • list
    • live mesh
    • macro
    • mobile
    • msbuild
    • msdn
    • msi
    • mvc
    • powertoy
    • preview
    • properties
    • ray ozzie
    • refactoring
    • regasm
    • russ fustino
    • security
    • serialization
    • silverlight
    • snippet
    • source code
    • sql server
    • sqlmetal
    • starter kit
    • stream
    • string
    • trial
    • usability
    • ux
    • vbscript
    • vista
    • visual studio
    • vs2008
    • wcf
    • web
    • winforms
    • wpf
    • xml

    Categories

    • RSS feed for Bleeding EdgeBleeding Edge (5)
    • RSS feed for CEDGCEDG (2)
    • RSS feed for GeneralGeneral (1)
    • RSS feed for KodefuKodefu (19)
    • RSS feed for Path NotesPath Notes (7)
    • RSS feed for PresentationPresentation (5)
    • RSS feed for TechniquesTechniques (2)
    • RSS feed for TrainingTraining (5)
    • RSS feed for WeaponsWeapons (4)
    • RSS feed for ZenZen (5)

    Archive

    Blogroll

    • RSS feed for Structure Too BigStructure Too Big
      • Should you buy an exten...
      • WorldMaps Update
      • MSDN Roadshow -- coming...
    • RSS feed for Chris CraftChris Craft
      • Raleigh Code Camp Fall...
      • [PDANUG] Event Reminder...
      • MSDN Southern Fried Roa...
    Download OPML file OPML

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Sign in