Re: SQL Server 2005 Stored Procedure security annoyances
- From: "Dan Guzman" <guzmanda@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 17 Sep 2006 09:59:33 -0500
Are there no way to set per database the rights to execute non-system
stored proecedure on a database wide level?
In SQL 2005, you can grant permissions at higher levels, like schema or
database. For example:
GRANT EXECUTE ON SCHEMA::MySchema TO MyRole
I mean it is unrealistic to have to manually set for each SP the rights
because
I am sure I will forget some SP's and probably forget to set the rights
when
I add new SP's in the future. Sure , I can run some wierd query to set
the
rights to all SP's, but that's a pain to lookup as well.
I mean it must be possible to set the SP security settings with minimal
time/effort,
otherwise I can just as well continiue using a account with to broad
rights. db_owner?
Personally, I would still create appropriate roles and grant individual proc
permissions because not all stored procedures are equal. Granting
permissions to all procs may be acceptable when all procedures are read-only
and you have no sensitive data or when granting to an admin role. However,
these are the exceptional cases.
Consider keeping stored procedure scripts files with permissions, preferably
in source control. I think you will soon find that scripts look naked
without GRANTs and you won't forget to assign permissions. Perhaps it's
time to graduate to the next 'maturity level'.
--
Hope this helps.
Dan Guzman
SQL Server MVP
<sune42@xxxxxxxxxxx> wrote in message
news:1158486740.616143.183250@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hi
I have came to the maturity level to stop using the sa account when I
run
my web-server.
So, I created a new account and added it to the DB_datareader/writer
role.
but I still can't execute my own stored procedures.
Are there no way to set per database the rights to execute non-system
stored proecedure on a database wide level?
I mean it is unrealistic to have to manually set for each SP the rights
because
I am sure I will forget some SP's and probably forget to set the rights
when
I add new SP's in the future. Sure , I can run some wierd query to set
the
rights to all SP's, but that's a pain to lookup as well.
I mean it must be possible to set the SP security settings with minimal
time/effort,
otherwise I can just as well continiue using a account with to broad
rights. db_owner?
We need a default DB_ExecuteSP role that each user can be associated
with!
any ideas?
/andy
.
- References:
- SQL Server 2005 Stored Procedure security annoyances
- From: sune42
- SQL Server 2005 Stored Procedure security annoyances
- Prev by Date: Re: SQL Server 2005 Stored Procedure security annoyances
- Next by Date: Re: encryption optimization
- Previous by thread: Re: SQL Server 2005 Stored Procedure security annoyances
- Next by thread: Re: encryption optimization
- Index(es):
Relevant Pages
|