Re: Planning security strategy in sql server
- From: "Dan Guzman" <guzmanda@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 7 Sep 2007 07:32:30 -0500
It would be something like "assigning a fixed database role to an
application role"...
You can add an application role to fixed database role. For example:
EXEC sp_addrolemember 'db_datareader', 'MyApplicationRole'
Also, if I'm accessing to a database object that references data from
another database trough views / stored procedures and so on by means of
ownership chaining, it would work?
Yes, but there is some additional configuration and considerations:
1) Once an application role is activated, all other databases can only be accessed only as the guest user so you'll need to enable the guest user in the referenced database. No permissions need to be granted, though.
2) You'll need to enable the 'db chaining' database option in both databases. You should do this only if you fully trust users that have CREATE permissions in those databases because ownership chaining will extend to both databases.
3) To maintain an unbroken chain for dbo-owned objects, both databases need to be owned by the same login. You can change with sp_changedbowner, if needed. Note that if the databases are owned by 'sa', ensure that only sysadmin role members can create objects in those databases because ownership chaining will extend to master as well.
I'm starting to think this is not the right way to manage security... maybe
it would be better to store a strong encoded HASH for the administrator's
password IN another table to retrieve it for accessing ALL THE DATABASES
without having to apply permissions to tables etc trough all our databases.
There are issues with application roles and connection pooling so using an application SQL login instead of an application role isn't a bad idea. However, I suggest minimal privileges rather than admin since that is the Best Practice. If all of your data access is via stored procedures, just grant execute permissions on the procs. Personally, I'd use separate logins per application to provide more granularity.
It's definitely a good idea to encrypt the password rather than storing in clear text. However, you can use a one-way hash for SQL passwords because you'll need the decrypted version to connect.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Roger Tranchez" <run1789@xxxxxxxxxxxxxxxx> wrote in message news:0CED4C32-E969-4DE1-834F-3B3FC5662E11@xxxxxxxxxxxxxxxx
Hello,
I'm planning (maybe) to use sql server 2000 application roles in order to
prevent unauthorized access to the database.
To achieve this, I want to login to sql server with authenticated mode using
a domain account that belongs to a group in the domain that has only public
access to the database.
Next I will activate the application role.
For the database users, you can assign the database role "db_datawriter" and
"db_datareader" to assign those permissions in a single step, to all the user
objects in the database BUT, I would like to do it in a single step for my
application role.
It would be something like "assigning a fixed database role to an
application role"...
Also, if I'm accessing to a database object that references data from
another database trough views / stored procedures and so on by means of
ownership chaining, it would work?
I'm starting to think this is not the right way to manage security... maybe
it would be better to store a strong encoded HASH for the administrator's
password IN another table to retrieve it for accessing ALL THE DATABASES
without having to apply permissions to tables etc trough all our databases.
As security is not a very fundamental issue in our company, maybe using this
HASH approach to store the database wood be enough secure... As after all,
the access to different parts of the databases will be controlled by the
windows or web applications through its own user/password table, this seems a
reasonable way to work...
I know everybody RECOMMENDS eeeverywhere not storing passwords, not to let
them travel trough the network and so on, but I would store the HASH... We
are not working at the CIA!
What do you think?
Thanks in advance
--
Roger Tranchez
MCTS
.NET 2005 and DB developer
.
- Prev by Date: limiting symmetric key access
- Next by Date: Re: Cannot Drop Users
- Previous by thread: limiting symmetric key access
- Next by thread: Re: Cannot Drop Users
- Index(es):
Relevant Pages
|