views:

389

answers:

5

One of our clients has requested that we include the 'db_owner' role on the database login that their website uses, so that they can upload a script (an ASP page) to run some database changes. Normally the logins for the databases hosted on our server only include 'db_reader' and 'db_writer'. Is this ok, or should I request that they forward us the sql script to run on their behalf?

Or am I being too protective? Thanks

+5  A: 

I would suggest that you act as a filter between them and anything they might want to do to the database such as uploading and running those scripts. If they get db_owner and hose it all up, it will still probably be your head on the chopping block for letting them have it to begin with.

TheTXI
Yeah, that's what I was thinking, thanks.
Nick
One thing to note. This is still a VERY hard sell, because every client (every coder for that matter) THINKS they are doing good. The client won't MEAN to bollocks the db, (it runs his app after all), so you want to go after the security aspect.
I think it's a mistake and poor customer service to have a blanket policy that requires all changes to filter through the provider. I prefer a cooperative arrangement that allows me to do what I need to get done. If I'm able to do the task and willing to absorb the risk, why not let me?
tvanfosson
It may not be the best customer service to have a blanket policy of acting as a filter, but as a general standard, the less people you have with access to the database, the less people can potentially screw it up. If more people request it, then rethink and consider a more rounded policy.
TheTXI
Acting as a filter is necessary, even within companies. Everyone here has experienced a snowball bug fix. Some small change that fixes your one problem could have catastrophic results. The only way to ensure that the proper testing procedures are in place is to control access to prod environments.
@devinb: You are assuming that the DBA knows the application/schema better than the developer. At least here, that's not always the case. That's why I prefer working cooperatively - talk about what needs to be done, make sure that you're not missing anything, but let the developer do it if he can.
tvanfosson
@tvanfosson - I agree, the customer can accept responsability for their changes but it's the website database login they want changing, so if the site gets hacked, it's 'goodbye database'. Then it becomes 'my fault'..
Nick
If it's the website's DB login they want changed, there is absolutely no reason why they can't/shouldn't come to you as the DBA first.
TheTXI
@tvanfosson You are completely correct, the developers know the app and the db much better. Cooperation is necessary, but anything that needs to be done should be scripted and "rollback scripted". If you give someone privilege to edit tables, there are no records of what they did.
A: 

What kind of scripts are they running?

Rather then providing them direct access you could provide some kind of interface as TheTXI suggested. I would be very concerned about giving db_owner access unnecessarily.

That might be you, or a team member, or depending on the type of scripts you may be able to provide them some kind of web interface (thus allowing you to at least wrap some validation around the script).

But if they directly run something on the system that you don't want to it will most likely be on you (whether that be just managing a restore or something more serious)

Chris
A: 

You can get more granualar with your permissions to let them only do what you want. It would depend on how often they want to make changes and how responsible you are for their data. I would not want to grant dbo to someone unless there was a really good reason.

Make sure that they are the owner of the database not just in the dbo role. If dbchaining is on in another database with the same owner they could turn it on in their database and have dbo permissions in that other database.

Ryan
A: 

Or, make them sign an agreement that says "Any damage you cause to the data or the database schema caused by you or anyone logged in under said db account is not of your fault and no blame can be put on you, etc etc" At least if they balls something up, that way you're covered and the client stays happy. Though you might want to give them a separate login for this, so that they can't blame incorrect changes on the website code.

Sekhat
Unfortunately, if the website or application goes down, they can still blame you and say that your failover system sucks and blah blah blah. Even if they signed something, they can then argue that they were using the database in a supported way, and the architecture broke the website/app.
+2  A: 

I think that I would want to have a service level agreement that is acceptable to everyone before I would give out that much control over the database. For example, you could specify that if the client damages their databases in a way that they can't fix, your response would be limited to restoring it to a backup point of their choosing within a certain timeframe. You might also require them to maintain a specific technical contact for database issues who will be the first contact for their developers, etc. The SLA should spell out the various risks, including loss of data, inherit in having this level of capability.

In general, I'm in favor of giving more control, rather than less, if the client is willing to accept the responsibility. As a person who uses such services, I know that it can definitely improve productivity if I'm allowed to make the changes that need to be made without having to jump through hoops. I'm also willing to accept the risks involved, but I clearly know what the implications are.

tvanfosson
Good point, I'll check the content of the SLA's we use
Nick
As part of SLA I would have a hefty $$$... rate for fixing anything that they induced
Kristen