Should I run stuff as network service in production?

Security Briefs

Syndication

A reader asked me this question today (specifically in regards to SQL Server and IIS). He said that he found some advice in the patterns & practices guidelines (How To: Create a Service Account for an ASP.NET 2.0 Application) that seemed to indicate that it would be OK to use the Network Service account in production Here was my response to him - I thought other readers might be interested in this, and I'm sure some of you may have comments to expand on this:

It is easier to use network service, because it can use the SPN of the machine, which is already set up. There are some drawbacks, of course.

One is that the more stuff you run as Network Service (NS), the more privilege it starts to gain. For example, if one of the OS services that runs as NS is compromised by a remote attacker, the attacker now has credentials to read your SQL Server database (if that's also running as NS).

The principal of least privilege would dictate that each service have its own account, to isolate the resources that the service needs so that other services can't use those resources without explicitly being granted access.

Another drawback is that on the network, NS is represented using the machine account SID. This SID changes anytime you repave the machine (perhaps there's a way to reset it back, but I've not explored this). So while adding machines to groups is possible for authorization purposes, it can get messy if the machine SID changes (you'll need to update all of those group memberships). This problem doesn't exist for a user account.


Posted Aug 16 2007, 08:14 AM by keith-brown

Comments

Dan wrote re: Should I run stuff as network service in production?
on 08-16-2007 12:54 PM
The SQL Books Online specifically recommends *not* using the network service account to run SQL Server.

There is a SQL Server security best practices white paper at http://www.microsoft.com/technet/prodtechnol/sql/2005/sql2005secbestpract.mspx that, among other things, describes the best practices for SQL Server service accounts.
dom wrote re: Should I run stuff as network service in production?
on 08-16-2007 5:30 PM
Enter Service SIDs (at leat on Vista/2008)
Mike Smith-Lonergan wrote re: Should I run stuff as network service in production?
on 08-27-2007 2:34 PM
Keith, isn't it possible to "recapture" an existing Computer account when reinstalling Windows? I could've sworn I'd done this a few times in my lifetime, where the Computer account was preserved (and thus the SID as well).

I don't recall it was a perfectly error/warning-free experience, but I'd bet it happens pretty much anytime (a) the user joining the computer to the domain is the same as the one who originally created the Computer account, and (b) the current Computer CN (hostname) is the same as the existing Computer account.
Dominic Cronin wrote re: Should I run stuff as network service in production?
on 09-21-2007 1:29 PM
Sysinternals have a tool for resetting the machine SID. I've never used it in the way hinted at here but there's no obvious reason why that wouldn't work:


http://www.microsoft.com/technet/sysinternals/Security/NewSid.mspx

Add a Comment

(required)  
(optional)
(required)  
Remember Me?