Slashdot Mirror


Developing Securely In Windows

FrazzledDad writes "No, really. Please pick yourself up off the floor and stop laughing. Yes, there are good books on developing Windows software in a secure fashion. Keith Brown's The .NET Developer's Guide to Windows Security is right alongside Howard and LeBlanc's Writing Secure Code as examples of good Windows security works. Brown's book should be on any .NET Developer's bookshelf and will be of use to developers who work in other development platforms on Windows." Read on for the rest of the review. The .NET Developer's Guide to Windows Security author Keith Brown pages 408 publisher Addison-Wesley rating 9 reviewer Jim Holmes ISBN 0321228359 summary Terrific coverage of how to go about securely developing .NET software

I know the entire topic of Windows security may kick off a "slightly" enthusiastic debate among Slashdotters. I'd really prefer not to get wrapped up in a fray, so let me just say that a professional software developer needs to well understand the security issues in the environment and platform they're working on. This book's an important aid in that understanding. Great Fundamentals

Brown's book is broken into six parts, ranging from "The Big Picture", an overview of security on Windows, to "Access Control" and a wrap-up "Miscellaneous." Each part is made up of numerous "items," one topic which Brown elaborates on.

Brown covers a lot of very basic, important fundamentals such as "What is Authentication?", "What is a Luring Attack?", and "What is Kerberos?" He gives concise, clear overviews of each topic, then gets into the weeds where necessary.

For example, one of Brown's first emphatic points is that development on Windows platform shouldn't be done using an account with Administrator privileges. He covers the "why" in several early items, then spends 11 pages in Item 9 showing the approaches, tools, and issues involved in developing under a non-Admin account. This particular item needs to be stapled to far too many developers' foreheads because they don't understand, or care about, the ramifications of development as an Admin. Great Details

Brown also goes into great detail on many Items. His discussion of IPSEC is a good example. He spends Item 68 on the fundamentals of IPSEC such as key exchange and authentication, then goes on in Item 69 to discuss the details of implementing IPSEC via policies in a domain. He covers client and server configurations, then gives rationale for selecting various options. He also talks about why it's not the best solution, or even a complete solution, but does point out where IPSEC makes sense.

COM programming gets an entire section/part to itself, and Brown does a great job explaining the complex issues surrounding securing COM(+) communication. He discusses Authentication, Impersonation, and what calls you need to make in your Main method to properly invoke various COM security aspects.

Threat Modeling gets its own Item, but isn't covered in great depth. Brown lays out Microsoft's STRIDE system (Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, and Elevation of privilege) as a guideline for threat modeling. He also talks a bit about attack trees. Neither topic gets substantial treatment; however, Brown makes it clear he's only introducing these topics and points readers to several other resources such as Swiderski and Snyder's Threat Modeling. Great List of Cons and Problems

Part of good software engineering is understanding the ramifications of choices you make. Brown's very good about laying out the "Why" for his items, plus he's also clear where hard choices have to be made.

For example, in his discussion of IPSEC he asks "Where is IPSEC useful? When you don't have any better alternatives." He goes on to show how IPSEC can be used to help COM servers talk securely, or in .NET Remoting under the 1.1 Framework which stupidly doesn't provide secure communication channels.

Another example might be the erasability of a secret under .NET. Managed environments such as .NET and Java don't make it easy to ensure secrets (passwords, keys, etc.) can be erased out of the managed memory heap or at least overwritten immediately after their purpose is fulfilled. Not only can the object's memory be left unerased, but what about controlling whether it's written out to a swapfile? Brown points out these sorts of issues and tries to point out how to deal with them. What the Book Doesn't Cover

Brown's book isn't so much about specific coding techniques, although there are a fair number of those within. You won't find specifics on .NET's code access security, or issues around cross-site scripting. You'll need to look to Howard and LeBlanc's Writing Secure Code for code specifics.

Rather, the book is more about approaches to secure development on Windows. Brown's book also isn't about security and threat analysis, but again, he's forthright about that and points readers to other sources.

Bill Wagner, author of Effective C#, points out on his blog that Brown's book would be more usable if "titles [were] organized around the tasks I need to perform." I think that's a good criticism - a cookbook format would be a great improvement for a second edition. Summary

The book's very well written with a good index and a terrific Bibliography which serves as a great reading list for furthering one's knowledge of security on the Windows platform.

I've found the book very educational and useful. It's an important addition to my bookshelf and has already helped me with a couple of important topics. I think any professional, contentious developer working in the Windows environment would find this a vital addition to their bookshelf as well."

You can purchase The .NET Developer's Guide to Windows Security from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

11 of 155 comments (clear)

  1. Here's a thought by sexyrexy · · Score: 5, Insightful

    Instead of bashing MS and Windows, prove that you're the better programmer by compensating for the sometimes flawed security. If you don't think users can trust their OS, at least you can take pride in the fact that they can trust your software running on it. A solid piece of software is just as impenetrable on Windows as it is on Linux or any other platform - it's all about understanding the environment. Looks like a great book, thanks for the review.

    --

    Rex is 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
    1. Re:Here's a thought by Penguinoflight · · Score: 2, Insightful

      Security isn't something you can just dump in to your program. It's a mindset you use to build a good program. Problem is if you build a brick wall on quicksand, your efforts are nearly useless. Compensation is not achievable.

      --
      "And we have seen and do testify that the Father sent the Son to be the Savior of the World"
      1 John 4:14
    2. Re:Here's a thought by aztracker1 · · Score: 5, Insightful

      Io be honest, I think that isn't entirely true, there are many different vectors of attack.. the best we (as developers) can do is make sure it isn't because of *our* software. We can check input before processing, we can use proper error handling to prevent a default error handler from exposing a dbms password. We cannot fix windows services, or software we rely on...

      However, I have to submit that most of the time security exploits in windows, are user initiated. Reduced privileges for default users would be a great improvement.. aside from that, we must bear personal responsibility for what we create.

      --
      Michael J. Ryan - tracker1.info
    3. Re:Here's a thought by ch-chuck · · Score: 2, Insightful

      Like someone said, writing a secure app for Windows is like putting a padlock on a paper bag. Aren't the biggest Windows Security risks IE and Outlook anyway? With their html enabled embedded shiny gewgaw features to bedazzle the clueless?

      --
      try { do() || do_not(); } catch (JediException err) { yoda(err); }
    4. Re:Here's a thought by bafarmer · · Score: 2, Insightful

      God, I hope some developers are reading the parent. I am a Windows Admin for a smallish group (~450 machines) and almost all of the problems we admins run into result from applications doing dumb things. We have finally gotten a policy through our business admins that allows us to nix software that won't run properly as a user in the Users group, and we have had only 2 security incidents since (and one of those was a machine we didn't know existed and thus wasn't being patched or getting AV updates). There is no reason the list of system requirements for an (end-user) application should ever contain "you must be logged in with administrative privileges on your computer."

      --
      I am Jack's sig. I reduce Jack's karma.
  2. It only works if you read it before hand... by RapidEye · · Score: 3, Insightful

    Brown's book should be on any .NET Developer's bookshelf

    Just putting it on the bookshelf won't help - ya need to read it before you put it there.

    On a related note, this pretty much rules out all the developers I work with - if you can't get it as a Book-On-iPod, they aren't interested these days =-)

    --
    "Murderer? Well, that's a harsh word. I prefer to think of myself as a Mortality Technician."
  3. Why should I be laughing? by Anonymous Coward · · Score: 5, Insightful

    Can you point me to any OS where security is automagic and the developer doesn't need to consider it? Windows may have its problems and more than enough shitty architecture, but security must be considered in the design of Mac and Unix/Linux programs as well.

  4. I think we're missing the point here... by Spy+der+Mann · · Score: 4, Insightful

    A chain is as strong as its weakest link.

    The point is making sure your app is NOT the weakest link here, i.e. allowing a virus to inject code thru a buffer overflow or something. And we're living in post-Sony times, it was bad enough with viruses - just wait till the rootkits start spreading.

  5. No, really by Junky191 · · Score: 4, Insightful

    "No, really. Please pick yourself up off the floor and stop laughing. Yes, there are good books on developing Windows software in a secure fashion." With snippets like that starting off an article, you start to see why people have trouble taking Slashdot seriously. This is getting ridiclous, almost FOXNEWSesque.

  6. Developing Secure Software by Daveznet · · Score: 2, Insightful

    Developing secure software should always be platform independent. But security for developing an application does not stop at the developer, it continues through to the system administrators and the users. We've all heard software is only as secure as the O/S its running on, well its also as secure as the administrators/users running it. Security should be practiced at all levels from development to roll out and installation and through its entire lifetime. No software is completely 100% secure, so if flaws pop up after development patches should be available ASAP.

    --
    GL HF!
  7. Re:No such thing .. by east+coast · · Score: 2, Insightful

    If the underlaying closed source API has bugs there's nothing much you can do about it.

    Does this mean that any system with bugs is not worth developing for? And if this is true does it mean that developers who code third party software should be absolved of any wrong doing? That's just nonsense to me. MS may not have a great product out there on the terms of security but the kind of retards at AOL who are coding weakly and creating a number of the exploits being used certainly are at fault.

    If we hold ourselves to only the highest acheivements of the worst developers we're all going to be in trouble.

    And what of those that have to use Windows? You may sit high and mighty and laugh about this but some of us are paid to code for Windows. Are we suppose to go find all those Linux jobs that I keep hearing of just because MS writes bad code? That's like quiting a company after finding that a CEO high up embezzeled (sp??) funds.

    --
    Dedicated Cthulhu Cultist since 4523 BC.