Re: How does username without login work with certificate
- From: Brian Ho <BrianHo@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 7 Jan 2007 22:25:03 -0800
Thank you for your response.
In our case, it seems like the username without login is inappropriate do
the job. What do you recommend if we just want to let some users to decrypt
the data?
Brian
"Bob Beauchemin" wrote:
Hi Brian,.
To answer your first question, anyone with SSMS must have impersonate
permission on user::username for the "execute as" to work.
Whether or not you should use a password to protect a certificate rather
than the database master key depends on what you want to accomplish. With
the setup you have, you cannot keep the data away from someone who knows the
user name, has impersonate privilege on the user, and has the password for
the certificate.
Cheers,
Bob Beauchemin
SQLskills
"Brian Ho" <BrianHo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F9BBE8C2-C220-4906-8C68-1EAC1E88D3D9@xxxxxxxxxxxxxxxx
We used a username without login feature to give CONTROL access to
certificate so that application can use this user account to decrypt
sensistive column. The set up is fine and we were able to decrypt the
column
with this username. This bring up an issue if someone who knows this
username and certificate password, they can see the decrypted information
too. Anyone with SQL analyzer can enter EXECUTE AS USER = 'username' to
grant access to the sensistive column. How can we prevent this or the way
we
set up this username is inappropriated?
Below is a sample code that we used to allow this username to decrypt
column
for your reference.
USE DEMO
GO
CREATE USER username without login
grant CONTROL on certificate :: CertKey to username
grant VIEW DEFINITION on symmetric key::SSN_Sym_Key to username
GRANT SELECT ON CUSTOMER TO username
GO
-- To decrypt SSN column
EXECUTE AS USER = 'USERNAME'
GO
Open symmetric key SSN_Sym_Key decryption by certificate CertKey with
password = 'certpwd'
go
Select CONVERT(varchar, DecryptByKey(SSN)) as 'Decrypted SSN'
from CUSTOMER
Where [LAST NAME] = 'Johonson'
GO
Is there a way to store the certificate password instead of hard code it
into the open symmetric key command?
- Follow-Ups:
- Re: How does username without login work with certificate
- From: Bob Beauchemin
- Re: How does username without login work with certificate
- References:
- Re: How does username without login work with certificate
- From: Bob Beauchemin
- Re: How does username without login work with certificate
- Prev by Date: RE: IIS (ASP) -> SQLServer Authentication Issue
- Next by Date: Re: How does username without login work with certificate
- Previous by thread: Re: How does username without login work with certificate
- Next by thread: Re: How does username without login work with certificate
- Index(es):
Relevant Pages
|