John Lam 1997 — 2026

Improving Web Application Security: Threats and Countermeasures rocks!

As part of my recent spelunking into writing secure ASP.NET subsystems, I have been on the lookout for more information on Code Access Security. Like many other people, I have tried to live a Win32-esque lifestyle where I only care about security principals and not about the identity of my callers. Full-trust was my friend.

However as I get older and more paranoid, I want to build systems where even if an attacker is able to compromise the service account that my code runs under, that my secure subsystems will remain secure. I need to use Code Access Security.

Like many other people, I own a copy of .NET Framework Security, which is one of the very few authoritative books on the subject. Unfortunately, it falls short on the side of telling an interesting story (typical of a “Frankenstein book” written by 5 authors) and loses the reader rather quickly.

A while ago, Scott Densmore shipped me a printed copy of Improving Web Application Security: Threats and Countermeasures (thanks, Scott!) A hectic travel schedule among other things left me little time to look over it closely until yesterday.

Wow. This free downloadable book from Microsoft contains an absolute treasure-trove of information. In particular, read Chapters 9 (Using Code Access Security with ASP.NET) where they talk about creating sandboxed assemblies, and Chapter 11 (Building Secure Serviced Components) where they talk about securing your Enterprise Services components using the same set of techniques that I recently blogged about.