Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««123»»

SQLServerCentral Runs sp_Blitz - Security Expand / Collapse
Author
Message
Posted Thursday, January 10, 2013 12:59 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: 2 days ago @ 7:40 AM
Points: 68, Visits: 415
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.



Post #1405617
Posted Thursday, January 10, 2013 3:39 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 7:24 AM
Points: 3,462, Visits: 1,786
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
Post #1405685
Posted Monday, February 18, 2013 5:29 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 4:41 AM
Points: 2,319, Visits: 868
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!

qh


SQL 2K acts like a spoilt child - you need to coax it round with lollipops.
Post #1421151
Posted Monday, February 18, 2013 5:39 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: 2 days ago @ 7:40 AM
Points: 68, Visits: 415
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!



Post #1421158
Posted Monday, February 18, 2013 5:47 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 4:41 AM
Points: 2,319, Visits: 868
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.

qh


SQL 2K acts like a spoilt child - you need to coax it round with lollipops.
Post #1421163
Posted Monday, February 18, 2013 5:49 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: 2 days ago @ 7:40 AM
Points: 68, Visits: 415
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.


Post #1421165
Posted Monday, February 18, 2013 6:00 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 4:41 AM
Points: 2,319, Visits: 868
I guess I was thinking a bit too far out of the box!

qh


SQL 2K acts like a spoilt child - you need to coax it round with lollipops.
Post #1421169
Posted Monday, February 18, 2013 6:03 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: 2 days ago @ 7:40 AM
Points: 68, Visits: 415
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.


Post #1421171
Posted Monday, February 18, 2013 12:52 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 7:24 AM
Points: 3,462, Visits: 1,786
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
Post #1421331
Posted Monday, February 18, 2013 12:54 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: 2 days ago @ 7:40 AM
Points: 68, Visits: 415
I'd love to see someone else do it, but I'm not aware of how to enumerate the list of instances that way.


Post #1421332
« Prev Topic | Next Topic »

Add to briefcase ««123»»

Permissions Expand / Collapse