views:

64

answers:

1

I have a python application designed to run as a service on Linux, and I've been asked to install it on a Windows XP box in an office where there are no Linux machines (for me, this makes it a bizarre and confusing place as I have virtually no experience developing for Windows).

On Linux the application has its own user, and the application and database credential file reside in an encrypted folder accessible only by that user. (I'd like to state that I am not a cryptologist, and that if there are already glaring security errors in this set up I'm very happy to have them pointed out to me!)

How can I achieve an equivalent level of security by similar or different means on a Windows XP machine? That is to say, how can I prevent those who have access to the computer or the disk altering the program or reading the credentials?

A little background: the host windows box is a workstation used every day by users with non-administrative privileges. The secure assets are personal data roughly as sensitive as, for example, a school report. The application is intended to be used by about 10 people who authenticate to the application with individual passwords (stored salted and hashed in the database).

There is a very similar question that received the answer:

on Windows you would store the credentials in the registry in a location protected by an ACL

However, it doesn't touch on the aspect of protecting the program files, and further it seems to assume a higher level of Windows experience than I currently enjoy :) I have no idea how to protect registry items with an ACL, nor how I would then be able to access the protected keys from my program. Simple instructions for a developer in an unfamiliar environment would be greatly appreciated!

+1  A: 

Your question is unclear about what your application does and what your security requirements are. I'm going to make some assumptions, and provide an answer based on them. If these assumptions are incorrect, please clarify in a comment and I'll update.

I'm assuming you have an application that:

  • stores sensitive data in a database stored in a DBMS installed on the workstation
  • is installed on a shared workstation
  • each user has their own login (non-admin)
  • allows different users to log on and interract with their data
  • user runs applicaiton which connects to a service
  • service connects with database, delivers data to users
  • service runs under its own user account

If this is correct, then you shouldn't have much issue.

The service can run under any account, but it would be easy enough to have it run under one of the standards (Local Machine or Network Service). Configure the database so that only this account can access it. In Sql Server, I'd only grant that user account (and admins on the box) login and access rights to the database.

This is the only security you need, if the users aren't admins. Now, when the frontend connects to the service, the user can provide the username/password and the service can authenticate against salted and hashed passwords stored in the database. All this is secure as long as 1) each user has their own login 2) communications are secure (using named pipes or SSL) and 3) no virii or keyloggers are running under an admin's credentials.


You can configure your service as to what account it runs under by running services.msc (or right-clicking on MyComputer and selecting Manage or clicking on Services under the Admin tools menu in Control Panel or probably in a number of different ways).

Bring up the list of services, right click on your app and hit Properties. From there, make it look like this: alt text

Will
All your assumptions correct until "service runs under its own user account" and only then because I had no idea whether services could be run as specific users. Do you know how I can specify which user a service is run as? Really helpful answer, thank you!
Ian Mackinnon
Yes, you can easily configure a windows service to run under any user account. Added a snappy for that. Can't seem to find the friggen docs anywhere online!
Will