SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQLServerCentral Runs sp_Blitz - Security


SQLServerCentral Runs sp_Blitz - Security

Author
Message
Brent Ozar
Brent Ozar
SSC-Enthusiastic
SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)

Group: General Forum Members
Points: 188 Visits: 500
GSquared (1/10/2013)
Can I call this proc recursive? Under the headings of Performance, it shows some problems coming up from proc sp_Blitz. :-)

[master].[dbo].[sp_Blitz] has WITH RECOMPILE in the stored procedure code, which may cause increased CPU usage due to constant recompiles of the code.


Hahaha, yeah, we've got that fixed in v17 coming out this month. I facepalmed big time when I saw that.



Kenneth.Fisher
Kenneth.Fisher
SSCarpal Tunnel
SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)

Group: General Forum Members
Points: 4276 Visits: 2033
Excellent tool and one I've been looking at myself.

Just to add to the comments about using SA as the database owner. There is a somewhat obscure potential security hole that can be exploited. It's actually one I've used myself to bypass some permissions issues. If your database is set to trustworthy and is owned by any sysadmin then you are effectively giving a free pass to anyone with IMPERSONATE on dbo in that database. You can easily create a stored procedure in the dbo schema with the EXECUTE AS OWNER clause that can perform any task that a sysadmin on the server can.

Now, not a common situation, but if you don't know it's coming it would be very easy to create an unintended security hole.

Just as a note you can set the owner of the database to a login with just CONNECT permissions. I've never done it mind you except in testing, so I don't know what implications it might have.

Kenneth Fisher
I strive to live in a world where a chicken can cross the road without being questioned about its motives.
--------------------------------------------------------------------------------
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Link to my Blog Post --> www.SQLStudies.com
quackhandle1975
quackhandle1975
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3227 Visits: 1240
Another +1 for sp_Blitz from me. I am currently providing some SQL consultancy to an SME with < 20 SQL instances and sp_Blitz has been perfect for me to diagnose quickly and effectively as to what SQL is doing (or is not doing!) and how it was installed, tweaked etc. Obviously I need to check other aspects of each instance, but it's an excellent tool for any prod DBA.

Just a question for a possible upgrade, have a Server here with 8 sql instances installed (yes on a prod server, I know, I know!) , maybe a future version of blitz could pick this up?

Thanks Brent! Satisfied

qh

Who looks outside, dreams; who looks inside, awakes. – Carl Jung.
Brent Ozar
Brent Ozar
SSC-Enthusiastic
SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)

Group: General Forum Members
Points: 188 Visits: 500
quackhandle1975 (2/18/2013)
Just a question for a possible upgrade, have a Server here with 8 sql instances installed (yes on a prod server, I know, I know!) , maybe a future version of blitz could pick this up?


HAHAHA, wow, I bet that was a fun surprise. 8 instances! I've never seen that many outside of a cluster (and of course all of the instances weren't on the same node unless there had been a complete disaster).

I loooove this idea. Now I gotta figure out how to detect it from inside T-SQL. I can't use sys.dm_server_services because that only returns the current instance's related services. I did some quick Googling and there's an interesting solution involving xp_cmdshell, but that's not usually enabled:

http://stackoverflow.com/questions/714413/how-to-detect-all-sql-server-instances-from-studio

I've heard from a lot of people who've worked on their own PowerShell equivalent of sp_Blitz™, and it'd be easier to detect there. Dang!



quackhandle1975
quackhandle1975
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3227 Visits: 1240
No problem, glad I can help improve sp_Blitz in some way. Could you simply get a list of named instances and do a count, say more than 2 and it gets flagged up?

Granted as a prod DBA, my dev skills aren't as strong as some. Unsure

qh

Who looks outside, dreams; who looks inside, awakes. – Carl Jung.
Brent Ozar
Brent Ozar
SSC-Enthusiastic
SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)

Group: General Forum Members
Points: 188 Visits: 500
The question is - how do you get a list of named instances inside T-SQL? I'm not aware of a way to do that.



quackhandle1975
quackhandle1975
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3227 Visits: 1240
I guess I was thinking a bit too far out of the box! Crazy

qh

Who looks outside, dreams; who looks inside, awakes. – Carl Jung.
Brent Ozar
Brent Ozar
SSC-Enthusiastic
SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)

Group: General Forum Members
Points: 188 Visits: 500
Hahaha, yeah. There's a few similar things I'd like to be able to detect (partition alignment, driver versions, etc) but there's only so far I can go in T-SQL. I've heard so many people saying they'd like to build a PowerShell equivalent to do similar health assessments, and I'm really surprised I haven't seen one by now.



Kenneth.Fisher
Kenneth.Fisher
SSCarpal Tunnel
SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)SSCarpal Tunnel (4.3K reputation)

Group: General Forum Members
Points: 4276 Visits: 2033
Could you use xp_regread or something similar?

Kenneth Fisher
I strive to live in a world where a chicken can cross the road without being questioned about its motives.
--------------------------------------------------------------------------------
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Link to my Blog Post --> www.SQLStudies.com
Brent Ozar
Brent Ozar
SSC-Enthusiastic
SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)

Group: General Forum Members
Points: 188 Visits: 500
I'd love to see someone else do it, but I'm not aware of how to enumerate the list of instances that way.



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search