Creating Secure Applications

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Creating Secure Applications - Presentation Transcript

    1.  
    2. Creating Reliable And Robust Applications With Visual Studio 2005 And SQL Server 2005 Andrew Coates Developer Evangelist Microsoft Australia http://blogs.msdn.com/acoat
    3. Agenda
      • Introduction
      • Enhancements for secure application development with Visual Studio 2005
      • Security enhancements in SQL Server 2005
    4. Introduction: Security Today
      • More mission-critical systems
      • More IT assets exposed via the Internet
        • More ways to connect (more threat paths)
        • Everything is becoming connected
      • Increased complexity and functionality lead to increased vulnerabilities
      • Software must do more to protect on the security front
        • Major effort to enhance security capability and features in Visual Studio 2005 and SQL Server 2005
    5. Visual Studio 2005 and .NET 2.0 Enhancements
    6. Managed Code
      • Designed to run under less privileged accounts
      • Improved Code Access Security
      • Permissions Calculator
      • Debug in Zone
      • IntelliSense in Zone (Visual Basic .NET)
      • FxCop
    7. Develop Under Less Privileged Account
      • Developing under Least Privileged account is a good practice
        • User will not run your application as an administrator
        • When developing as admin you may be unaware that non-admin accounts don’t have access to resources that you may access
      • Visual Studio 2005 runs much better under non administrative account than previous versions
    8. Security Principles to Live By Practical Least Privilege
      • Elevate as necessary
        • RunAs
        • MakeMeAdmin (http://blogs.msdn.com/aaron_margosis)
        • Fast User Switching
        • Terminal Services / Remote Desktop
      • Vista/Longhorn LUA
        • http ://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnlong/html/leastprivlh.asp
      • Add Granular Permissions
      • SQL Server 2005
        • Granular permissions
        • Security execution context
        • DDL Triggers
      • Code Access Security easier with VS 2005
        • Permission Calculator
        • Code Access Security - IntelliSense in Zone, Debugging in Zone
    9. Code Access Security
      • Applies security to Assembly Identity
      • Allows restriction on the actions an assembly can perform
      • Predefined permission sets are available to sandbox low trust code
      • Visual Studio 2005 allows the developer to select a target permission set
    10. Code Access Security (CAS)
      • Code access security is a mechanism that helps limit the access code has to protected resources and operations; Has following functions
        • Defines permissions and permission sets that represent the right to access various system resources
        • Enables administrators to configure security policy
        • Enables code to request the permissions it requires in order to run, and specifies which permissions the code must never have
        • Grants permissions to each assembly that is loaded, based on the permissions requested and on the operations permitted by security policy
        • Enables code to demand that its callers have specific permissions
        • Enables code to demand that its callers possess a digital signature, thus allowing only callers from a particular organization or site to call the protected code
        • Enforces restrictions on code at run time by comparing the granted permissions of every caller on the call stack to the permissions that callers must have
    11. Code Access Security Evidence Policy + Permissions
    12. Stack Walk
      • Essential part of the security system
      • To protect unauthorized access to protected resources
      • Before allowing an assembly access the protected resource may demand a stack walk to verify that all functions in the call chain have permission to access the system resource
      • Functions can choose to modify the stack walk, and there are a few mechanisms to do this
        • LinkDemands
        • Assert
        • Deny
        • PermitOnly
    13. Stack Walk
    14. Stack Walk P .Demand() Stack walk for permission p Stack walk example Assembly A Assembly B Assembly C Assembly D PermissionSet PermissionSet PermissionSet PermissionSet
    15. Sandboxing
      • Application Domains can be created to sandbox assemblies
      • Process for creating a sandbox has been simplified under the 2.0 framework
      • API is exposed as a new overload of AppDomain.CreateDomain
      AppDomain.CreateDomain( string friendlyName,    Evidence securityInfo, AppDomainSetup info, PermissionSet grantSet, params StrongName[] fullTrustAssemblies );
    16. Application Domain Creation
    17. Security Transparent Code
      • Transparent code makes no asserts or demands
      • On a stack walk transparent code will have the lesser of its assigned permission set and the permission set of the caller
      • FxCop includes rules to ensure transparency is being correctly used
    18. Global Assembly Cache (GAC) Is Full-Trust
      • .NET 2.0 assemblies in the GAC get FullTrust no matter what the security policy says
      • The new GacMembershipCondition Class determines whether an assembly belongs to a code group by testing its global assembly cache membership
      • Rather than having to know about both the full-trust list and the GAC, a framework developer only has to install their framework in the GAC now.
    19. Increased Strong Name (SN) Key Size
      • SN to generate keys of different sizes; The -k flag takes a key size option as its first parameter
      • If the key size is not specified, it defaults to 1024 bits, the same as the v1.0 and v1.1 versions of SN produce; Not all key sizes are valid, for an RSA key 
      • Will result in
      sn -k 2708 invalidKey.snk sn -k 2048 largekey.snk Failed to generate a strong name key pair -- Invalid flags specified
    20. Permissions Calculator
      • PermCalc replaces the PermView utility
      • Looks into assemblies on which target has dependencies
      • Available as both a command line tool and integrated into Visual Studio
    21. PermCalc
    22. Debugging Enhancements
      • Debug in Zone – Visual Studio can create environment to match permissions for restricted environments
      • IntelliSense in Zone (Visual Basic)
    23. Debug In Zone
    24. Debug and IntelliSense In Zone
    25. FxCop
      • Integrated into Visual Studio
      • Identifies Design Issues and supplies information on how to fix them
      • Enforces Microsoft .Net Design Guidelines
      • Can be used as a part of the code check-in policy
    26. FxCop
    27. Other Managed Code Security Enhancements
      • Security cannot be turned of permanently
      • New classes
        • SecureString
          • Contents are kept encrypted
          • Modified until set to ReadOnly
          • Deleted from memory on demand
        • ProtectedMemory
          • Used to Encrypt data in Memory
          • Uses Data Protection API available in Windows XP and Later
    28. What Else Is New In .NET 2.0 Security
      • Enhanced SecurityException
      • Increased SN Key Size
      • Transparent Code
      • Managed ACLs
      • PKCS7 support
      • FIPS enforcement
      • RFC 2898 PBKDF 2
      • Test key signing
      • Enhanced X509 support (via X509Certificate2)
      • XML Encryption
      • AppDomainManager/HostSecurityManager
    29. Team Foundation Server Check In Policies
      • Code Analysis
      • Testing
      • Peer Review
    30. TFS Check In Policies
    31. Unmanaged Code
      • Application Verifier
      • Integrated Code Analysis Tools
      • Buffer Check Switch
      • Safe C Runtime Library
    32. SQL Server 2005 Enhancements
    33. SQL Server 2005 Enhancements
      • Secure by Default
      • Password Policy
      • Strengthened Authentication
      • User-Schema Separation
      • Granular Permissions
      • Execution Context
      • Encryption
      • Catalog Security
    34. Secure By Default
      • If SQL Server 2005 is installed and no options are changed, it is installed in a secure state
      • Access to many resources must now be explicitly granted or enabled before being used
      • Surface Area Configuration Tool
    35. Surface Area Configuration Tool
    36. Password Policy And Authentication
      • SQL Server 2005 can inherit the Password Policy when hosted on Windows 2003
      • Can be enabled or disabled on a per login basis
      • Logins can be enabled and disabled
      • Login protocol uses stronger channel
        • Uses SQL Server generated certificate
        • No SSL certificate loading is required
    37. User-Schema Separation
      • Objects are associated with a schema instead of a user
      • Object naming scheme and resolution have been changed
        • server.database.schema.object
      • Users can be assigned a default schema
    38. User-Schema Separation
    39. Granular Permissions
      • Permissions can be applied to three scopes: Server, database, and schema
      • Permissions can have one of three states: Granted, revoked, and denied
      • New Permissions Added
      • Securable – entities to be secured (tables, views, assemblies, servers, and others)
      • Grantee – Server level permission
      • Catalog Security
    40. Execution Context
      • EXECUTE AS CALLER (default)
      • EXECUTE AS ‘USER’
      • EXECUTE AS SELF
      • EXECUTE AS OWNER
    41. Execute AS
    42. Endpoint Security
      • An Endpoint is a point of entry into SQL Server
      • Endpoint Transports Include
        • Shared Memory
        • Named Pipes
        • TCP
        • Virtual Interface Adapter
        • HTTP (Windows 2003 and XP SP2 Only)
      • HTTP Transport is not created by default
      • HTTP Endpoints support 4 authentication types for web methods
      • Anonymous access is not allowed
      • Communications can be secured with SSL
    43. Encryption
      • SQL Server now has built in support for encryption and decryption
      • Keys can be secured within or external to SQL Server
      • Supports Symmetric encryption, Asymmetric encryption, Encryption by paraphrase and certificates
    44. Encryption
    45. Other Stuff (Canberra)
      • Event DVDs will be mailed to you in the next week or so.
      • Go to Code Camp www.codecampoz.com
    46. Some More Microsoft Resources
      • Security eForum site
        • http://www.microsoft.com/ australia/eforum
      • MSDN Security Development Centre
        • http:// msdn.microsoft.com /security/
      • Security Development Centre – Writing Secure Code
        • http:// msdn.microsoft.com/security/securecode/default.aspx
      • Patterns and Practices: Security Guidelines
        • http://msdn.microsoft.com/library/en-us/dnpag2/html/pagguidelines0003.asp
      • What’s new in Security for v2.0
        • http://blogs.msdn.com/shawnfa/archive/2005/08/24/455581.aspx
      • What’s new with Code Access Security in the .Net Framework 2.0
        • http://msdn.microsoft.com/msdnmag/issues/05/11/CodeAccessSecurity/default.aspx
      • Security Enhancements in Visual Studio 2005
        • http://msdn.microsoft.com/library/en-us/dnvs05/html/vs05security.asp
      • Repel Attacks on Your Code with Visual Studio 2005 Safe C and C++ Libraries
        • http://msdn.microsoft.com/msdnmag/issues/05/05/SafeCandC/
      • SQL Server 2005 Security
        • http://msdn.microsoft.com/sql/learning/security/default.aspx
      • Visual Studio 2005 and SQL Server 2005 Webcast
        • http://www.microsoft.com/events
    47.  
    48. © 2006 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

    + guest879f38guest879f38, 2 years ago

    custom

    202 views, 1 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 202
      • 202 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 10
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories