NCover.Console requires admin privileges

Security Briefs

Syndication

In my quest to get unit testing and code coverage, I was disappointed to find that NCover requires administrative privileges to run. I posted on their forum about this, and was informed that the authors "haven't had a good enough reason" to fix the problem.

So right now, if you want to use NCover in your CruiseControl implementation, you're going to need to run the CruiseControl service under a user account with admin privileges. That's just wrong. I offered my help - I hope they will take me up on it.

I'm a bit surprised that I didn't see more of an outcry about this. I spent a bit of time searching and found some posts by NCover guys saying that NCover.Console requires admin privileges to run, but I didn't find anyone questioning that.

Wow. Are people regularly running CruiseControl with admin privileges? Or is nobody using NCover? Inquiring minds want to know...


Posted Jan 21 2008, 09:11 AM by keith-brown
Filed under: , ,

Comments

Brad Wilson wrote re: NCover.Console requires admin privileges
on 01-21-2008 10:12 AM
I don't do automated code coverage, because I don't believe in failing a build based on an arbitrary coverage measurement.

I can test my coverage any time I want from within Visual Studio using TD.NET, which is all I care about.
Peter Waldschmidt wrote re: NCover.Console requires admin privileges
on 01-21-2008 11:37 AM
Hey Keith. I'm glad to hear that you are trying NCover. We have many customers who use NCover with CruiseControl, and we do all that we can to support it.

Unfortunately, the employee who responded to your forum post used an phrase that isn't entirely accurate. The issue isn't so much that we "haven't had a good reason." There are some very complex issues brought about by the new Windows Vista security paradigm that drove the decision to require administrative privileges.

NCover uses shared memory (for a variety of reasons) to share coverage data between the profiled process and NCover.Console. There are privileges required when opening memory mappings between different sessions on Windows that require elevated privileges.

When releasing the last major version of NCover we had some internal debates about whether to require administrative access or not. In our opinion the trade-offs were unacceptable. We may reconsider the decision for newer versions (and in fact we are rehashing the decisions now after receiving your feedback), but I wanted to assure you that it's much more than simply not having a reason to do the work. NCover is similar to a debugger in its operation and when you step into that realm, avoiding the need for admin privileges is dicey.
Keith Brown wrote re: NCover.Console requires admin privileges
on 01-21-2008 12:14 PM
Brad: thanks for the tip - that's a good point you make.

Peter: Thanks for the quick response.

I can't claim to have written a debugger, or even know much about how they work. But from what I do know, you've got all the permissions you need to debug in user mode as long as you're debugging processes in the same logon session as yourself. You have permission to read and write the process's memory, duplicate handles into and out of the process, etc. Visual Studio is an example of a debugger that works fine under a limited user account as long as you're debugging processes in the same logon session as the debugger itself.

When you start having to cross logon session boundaries it gets tricky (for example, debugging ASP.NET apps or Windows services). With NCover.Console I don't see that happening, but perhaps I'm missing something.

Once again, I'd be glad to help out any way I can. So if and when you decide to revisit this, shoot me an email!
Peter Waldschmidt wrote re: NCover.Console requires admin privileges
on 01-21-2008 1:58 PM
You're right, Keith. In the case where we are profiling a process in the same session, we could probably do what we need to do without requiring elevated permissions. The engineering issue is whether we have several different modes of operation and can intelligently switch between modes in order run at a lower privilege in the cases where it is possible.
Sergey Pashin wrote re: NCover.Console requires admin privileges
on 01-21-2008 10:51 PM
Keith,

Take a look at our Parabuild. Is supports NCover out of the box.

Sergey

Add a Comment

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