New-age Transactional Systems - Not Your Grandpa's OLTP
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
The content has been bookmarked!
There was an error bookmarking this content! Please retry.
Posted by Abel Avram on Jan 26, 2010
Starting with .NET Framework 1.0 Microsoft introduced Code Access Security (CAS), an instrument for assigning and controlling managed code's capabilities. .NET Framework 4.0 Beta 2 deprecates CAS, turning it off by default, and introduces Security Transparency Level 2.
Once considered a great feature that would help .NET gain ground against Java, CAS became unpopular among .NET developers because of its complexity and the potential of actually creating security holes if not used properly. Besides, native applications or unmanaged code have continued to run at full trust, making CAS less useful.
.NET Framework 4.0 comes with CAS turned off which means that all applications started via Windows Explorer or the command prompt run at full-trust. Hosted .NET applications, those running inside Internet Explorer or ASP.NET, will run at the trust level granted by their host, being partially trusted.
Because of this change, code currently in development may generate warnings or runtime exceptions:
As a result of these security policy changes, you may encounter compilation warnings and runtime exceptions if you call the obsolete CAS policy types and members either explicitly or implicitly (through other types and members). For a list of obsolete types and members and their replacements, see Code Access Security Policy Compatibility and Migration.
You can avoid the warnings and errors by using the <NetFx40_LegacySecurityPolicy> configuration element in the runtime settings schema to opt into the legacy CAS policy behavior. However, specifying the use of legacy security policy does not include any custom CAS policy for that version unless it is migrated to .NET Framework 4 Beta 2.
.NET 4.0 Beta 2 extends an earlier feature called Security Transparency which was introduced in .NET 2.0 and is used internally by Microsoft. Managed code running in a sandbox is considered transparent because it can execute only operations granted by its host and, consequently, is considered secure. Security Transparency Level 2 introduces new elements:
In the .NET Framework 4 Beta 2, transparency is an enforcement mechanism that separates code that runs as part of the application from code that runs as part of the infrastructure. Transparency draws a barrier between code that can do privileged things (critical code), such as calling native code, and code that cannot (transparent code). Transparent code can execute commands within the bounds of the permission set it is operating within, but cannot execute, call, derive from, or contain critical code.
The primary goal of transparency enforcement is to provide a simple, effective mechanism for isolating different groups of code based on privilege. In the sandboxing model, these privilege groups are either fully trusted (that is, not restricted) or partially trusted (that is, restricted to the permission set granted to the sandbox).
Desktop applications run as fully trusted; therefore, they are not affected by the transparency model.
There are three types of code in .NET 4.0: transparent code, security-safe-critical code, and security-critical code:
Transparent code, including code that is running as full trust, can call other transparent code or security-safe-critical code only. It can only perform actions allowed by the domain’s partial trust permission set (if one exists). Transparent code cannot do the following:
Perform an Assert or elevation of privilege.
Contain unsafe or unverifiable code.
Directly call critical code.
Call native code or code with the SuppressUnmanagedCodeSecurityAttribute attribute.
Call a member that is protected by a LinkDemand.
Inherit from critical types.
In addition, transparent methods cannot override critical virtual methods or implement critical interface methods.
Safe-critical code is fully trusted but is callable by transparent code. It exposes a limited surface area of full-trust code; correctness and security verifications happen in safe-critical code.
Security-critical code can call any code and is fully trusted, but it cannot be called by transparent code.
Developers can still use CAS if they target their application to an earlier .NET Framework version, but they won’t be able to use the latest features available in 4.0 Beta 2 and later. They are encouraged to use Windows Software Restriction Policies (SRP) instead, which provides a simpler security mechanism that applies both to managed code and native applications.
Federated Identity Management and Single Sign On
Using Drools? See what you're missing! Get the Power of Drools with the Assurance of Red Hat
Complimentary Gartner (Hype Cycle for Cloud Security) Report
According to MSDN(msdn.microsoft.com/en-us/library/ee191568(VS.100).aspx), only the CAS policy portion has been obsoleted, not the whole CAS.
Han is correct in stating that only the policy aspect of Code Access Security has been made obsolete – though that’s the part people often think of when they hear “Code Access Security/CAS.” The other aspects of CAS – such as permissions and stack walks (demands, asserts), are still useful and still fully supported in the framework.
With that clarification, though, this article is spot on – the new Transparency model is .NET Framework 4’s primary security enforcement mechanism.
Thank you,
Andrew Dai
Program Manager
Microsoft Common Language Runtime - Security
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.
Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.
Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).
Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.
Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.
One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.
InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.
2 comments
Watch Thread Reply