April 8, 2005 at 1:42 pm
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/jreade/selectingawebhostforyourwebsitepart2of2.asp
Jon
April 20, 2005 at 7:04 am
RE: SQL Security in a hosted environment.
As this excellent article points out, in some (most) hosted environments you can see other peoples databases in Enterprise Manager, Query Analyser or even DTS. Sometimes you can see the table names and structure and stored procedure text. I believe this relates to databases having a guest account enabled.
However, at least one hoster I know of has solved this problem very nicely. If you get a trial account at http://europe.webmatrixhosting.net and register your database in Enterprise Manager, you only see your own database! Likewise in Query Analyser. DTS shows them all.
My question, and perhaps I should post this more generally, is: How do they do this? My main hosting partner doesn't know how its done and I can't figure it out.
Ideas anyone?
April 20, 2005 at 8:52 am
Thanks for the compliment TSG. Not sure how they can do this, as the dynamic SQL that SQL Server 2000 Enterprise Manager kicks off to get the database details is as follows:
select name,
DATABASEPROPERTY(name, N'IsDetached'),
(case when DATABASEPROPERTY(name, N'IsShutdown') is null then -1 else DATABASEPROPERTY(name, N'IsShutdown') end),
DATABASEPROPERTY(name, N'IsSuspect'),
DATABASEPROPERTY(name, N'IsOffline'),
DATABASEPROPERTY(name, N'IsInLoad'),
(case when DATABASEPROPERTY(name, N'IsInRecovery') is null then -1 else DATABASEPROPERTY(name, N'IsInRecovery') end),
(case when DATABASEPROPERTY(name, N'IsNotRecovered') is null then -1 else DATABASEPROPERTY(name, N'IsNotRecovered') end),
DATABASEPROPERTY(name, N'IsEmergencyMode'),
DATABASEPROPERTY(name, N'IsInStandBy'), has_dbaccess(name),
status,
category,
status2
from master.dbo.sysdatabases
I'd be very interested to know how they could restrict the information that is brought back to just those rows which the currently connected user is entitled to see. Great idea though, would be very useful in locking down the environment further, will try to find out if anything like this has been included in SQL Server 2005.
Jon
April 20, 2005 at 10:07 am
Hopefully this will help. Following the steps in this KB article should make it so only databases you have access to show up in EM, QA, and even DTS. My web host (Maximum ASP) applied these changes recently and it works great! It also really speeds initial response time in EM if the server has a lot of databases that you don't have access to, which is usually the case in a shared hosting environment.
April 22, 2005 at 2:31 am
Thanks Andy.
This works a charm. I tried it myself first and then forwarded it to my hoster.
Well done.
TSG
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply