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 ««12

Stored Procedure Security Expand / Collapse
Author
Message
Posted Monday, July 6, 2009 3:23 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Thursday, July 24, 2014 9:07 AM
Points: 11,157, Visits: 12,899
You might want to look at signing your procedure.

I have played around with EXECUTE AS trying to get access to the view and function you are interested in and can't get it to work so signing might be the best way. I have not tried that yet.




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #748118
Posted Wednesday, October 7, 2009 7:45 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Thursday, July 24, 2014 9:07 AM
Points: 11,157, Visits: 12,899
I realize I am back in this thread long after the original problem was solved, but I'm wondering what the solution was and also wanted to offer some more information. You might be interested in this article on SQLTeam



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #799669
Posted Wednesday, October 7, 2009 11:44 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, June 8, 2012 12:30 AM
Points: 150, Visits: 3,892
What I was able to discover is that the solution I was seeking wasn't available via SQL Server 2005. I ended up implementing user based security rather than the sproc based security I hoped was available.

I checked out that link, but didn't see the relevance of Dynamic Management Views to my security implementation dilemma.

Thanks,
Carleton

(This was the model I hoped existed):

I was very much hoping that security could be managed within the context of a stored procedure (through the EXECUTE AS or other method) for the following reason:

If you could give a sproc all the access it needs without giving the same level of access to the user/login executing it, it would drastically reduce the abilities a user/login needs to the system. If you could limit the world's access to only running specific stored procedures, this would be a tighter ship and potentially a simpler security model to administer.

For example, instead of giving update access to table TABLE1 to login LOGIN1, you would give update access to the sproc updating TABLE1. That way you know that LOGIN1 will not be able to perform updates not intended--they can only execute the relevant procedure. If I understand the available security options, LOGIN1 must have update access to TABLE1 in order to execute any procedure they call which updates TABLE1--and there are no ways around this? (outside of using the service broker...not an option for calling every sproc)
Post #799712
Posted Thursday, October 8, 2009 5:08 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Thursday, July 24, 2014 9:07 AM
Points: 11,157, Visits: 12,899
I had pointed to the link on DMV's because the objects you were trying to access were DMV's and in the article it mentioned that a user needs VIEW SERVER STATE permissions for server based DMV's and VIEW DATABASE STATE permissions for database level DMV's I thought it might help to know that.



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #799869
Posted Thursday, October 8, 2009 2:27 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, October 5, 2011 1:07 AM
Points: 3, Visits: 61
After struggling with user-based security we've transitioned to proc-based security. This works well when the schema of the proc and tables are the same -- except in cases of dynamic sql, and for that we've been using "execute as owner".

To simplify matters we have also switched to keeping everything in the dbo schema.
Post #800356
Posted Thursday, October 8, 2009 2:39 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Thursday, July 24, 2014 9:07 AM
Points: 11,157, Visits: 12,899
You don't necessarily have to have everything in the dbo schema as long as all the schemas are owned by dbo. Then ownership chaining will still work. I have blog post about ownership chaining, http://wiseman-wiseguy.blogspot.com/2009/03/whats-ownership-chaining.html



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #800371
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse