SlideShare uma empresa Scribd logo
1 de 4
Baixar para ler offline
Reviewing SQL Server Permissions | TechRepublic



   ZDNet Asia    SmartPlanet    TechRepublic                                                                                    Log In    Join TechRepublic     FAQ     Go Pro!




                                                   Blogs     Downloads       Newsletters        Galleries     Q&A    Discussions         News
                                               Research Library


     IT Management             Development         IT Support        Data Center         Networks         Security




     Home / Blogs / The Enterprise Cloud                                                  Follow this blog:

     The Enterprise Cloud


     Reviewing SQL Server
     Permissions
     By Tim Chapman
     November 3, 2008, 10:19 AM PST

     Takeaway: SQL Server consultant Tim Chapman looks at the importance of database
     permissions and how you can use internal SQL Server system views to easily which users have
     access on your system.

       Permissions on data are one of the most critical aspects of database administration. If you’re too
     strict as a database administrator then your users will not be able to do their jobs. If you’re not
     lenient, then data can be compromised or even leaked. It is a very fine balance to control. The
     ability to determine these permissions on your database systems is absolutely paramount.
                                                                                                                           Btrieve 6.15 Forever
     Who has access to my SQL Server?                                                                                      Still using Btrieve? So are we! Get the Ultimate
                                                                                                                           Btrieve Patch
     First things first, you need to know which users are able to login into your SQL Server instance.                     pervasivedb.com/btrieve
     Logins come in two flavors; Windows authentication and SQL Server Logins. Windows logins are                          Google Docs For Business
     tied to Windows accounts while SQL Server logins are housed in SQL Server internally. Whether                         Start with 5 GB of Included Storage Get
     the login is Windows based or is an internal SQL account, you can access login information by                         Additional 20 GB Just $4/month!
     querying internal SQL Server views. To find the login information, the sys.server_principals system                   www.google.com/apps
     view can be used. The following script queries this view and returns login information along with                     re-lion Builder
     the type of associated login.                                                                                         Leading in easy to use terrain database
                                                                                                                           generation tools
     SELECT name, type_desc, is_disabled                                                                                   www.re-lion.com

     FROM sys.server_principals

     To test this query, run the following script followed by the script above. The new login TestLogin
     should appear in the result-set.                                                                                 Keep Up with TechRepublic
     CREATE LOGIN TestLogin WITH Password = ‘asdevex33′, CHECK_POLICY = OFF

     Who has access to my Databases?
     Once a login is able to gain entry into the server, they then need access to databases. Before a
                                                                                                                       
                                                                                                                            Five Apps
     login is able to access a database, a user must be mapped to that login inside the database. The                  
                                                                                                                            Google in the Enterprise
     following script queries the sys.database_principals system view, which holds user related
     information for the current database. Note that this information will likely differ for each database                 Subscribe Today
     you run it in. Users are database-level, so different users will have different access in different
     databases.
                                                                                                                      Follow us however you choose!
     SELECT




http://www.techrepublic.com/blog/datacenter/reviewing-sql-server-permissions/466[08/29/2012 3:46:21 PM]
Reviewing SQL Server Permissions | TechRepublic



     UserName = dp.name, UserType = dp.type_desc, LoginName = sp.name, LoginType =
     sp.type_desc

     FROM sys.database_principals dp

     JOIN sys.server_principals sp ON dp.principal_id = sp.principal_id                                    Media Gallery
     To test the above view, run the following script followed by the script immediately above. The new
     user TestUser (which is now mapped to the login TestLogin) should appear in the result-set.

     CREATE USER TestUser FOR LOGIN TestLogin

     Server Roles                                                                                                PHOTO GALLERY (1 of 15)
                                                                                                                 Curiosity's autonomous
     Now that I have covered server logins and database users, I need to cover the different server and          'seven minutes of...
     database roles on the system. A login can be a member of a server role, which gives the login
     elevated permissions for the SQL Server instance. The following query can be used to view which                   More Galleries »
     logins are tied to which server roles.

     select p.name, p.type_desc, pp.name, pp.type_desc

     from sys.server_role_members roles

     join sys.server_principals p on roles.member_principal_id = p.principal_id
                                                                                                                 VIDEO (1 of 13)
                                                                                                                 Cracking Open: HTC Titan II
     join sys.server_principals pp on roles.role_principal_id = pp.principal_id
                                                                                                                        More Videos »
     The following script adds the TestLogin I created above to the dbcreator server role. Once this
     script is ran, rerun the immediate script above. The new login role will be included in the result-
     set.
                                                                                                           Hot Questions                     View All
     EXECUTE sp_addsrvrolemember
                                                                                                            3     SSL redirection
     @loginame = ‘TestLogin’,

     @rolename = ‘dbcreator’
                                                                                                            3     Switching from a Job to a career in
     Database Roles                                                                                               the IT field: Need an IT pro's
                                                                                                                  advice
     The previous query illustrated which users had specific permissions inside of your database.
     However, when you’re a member of a database role, you’re given permissions that are not                      windows 7 won't shutdown and
                                                                                                            2
     contained in the sys.database_permissions view, but are absolutely vital for knowing which users             keeps switching on
     have permissions inside your database. You can use the following query to determine which
     users are assigned to database roles.
                                                                                                            2     can anyone suggest if any such
                                                                                                                  software exist with similar
     SELECT
                                                                                                                  functionality?
     p.name, p.type_desc, pp.name, pp.type_desc, pp.is_fixed_role
                                                                                                           Ask a Question
     FROM sys.database_role_members roles

     JOIN sys.database_principals p ON roles.member_principal_id = p.principal_id
                                                                                                           Hot Discussions                   View All
     JOIN sys.database_principals pp ON roles.role_principal_id = pp.principal_id

     The following script adds the TestUser to the db_datareader database role. Once this script has       221    Should developers be sued for
     been executed, run the previous script to see the new entry in the sys.database_role_members                 security holes?
     system view.
                                                                                                            79    The sitting duck that is open
                                                                                                                  source

     EXECUTE sp_addrolemember
                                                                                                            27    Five fast Windows desktop search
     @rolename = ‘db_datareader’,                                                                                 utilities

     @membername = ‘TestUser’                                                                                     Is the death knell sounding for
                                                                                                            30
                                                                                                                  traditional antivirus?
     What can these users do?

http://www.techrepublic.com/blog/datacenter/reviewing-sql-server-permissions/466[08/29/2012 3:46:21 PM]
Reviewing SQL Server Permissions | TechRepublic



     The following query uses the sys.database_permissions system view to indicate which users had
                                                                                                                    Start a Discussion
     specific permissions inside the current database.

     SELECT
                                                                                                                    Blog Archive
         dp.class_desc, dp.permission_name, dp.state_desc,

     ObjectName = OBJECT_NAME(major_id), GranteeName = grantee.name, GrantorName =                                    August 2012        December 2011
     grantor.name                                                                                                     July 2012          November 2011
                                                                                                                      June 2012          October 2011
     FROM sys.database_permissions dp
                                                                                                                      May 2012           September 2011
     JOIN sys.database_principals grantee on dp.grantee_principal_id = grantee.principal_id                           April 2012         August 2011
                                                                                                                      March 2012         July 2011
     JOIN sys.database_principals grantor on dp.grantor_principal_id = grantor.principal_id
                                                                                                                      February 2012      June 2011
     Conclusion                                                                                                       January 2012

     Today I looked at some system views included in SQL Server 2005 and SQL Server 2008 which
     can be used to view permissions on your SQL Server instance. The more you know about the
     permissions on your SQL Server system, the more prepared you’ll be if problems arise.


     Get IT Tips, news, and reviews delivered directly to your inbox by subscribing to TechRepublic’s free
     newsletters.




                    About Tim Chapman
                        Full Bio    Contact




                   EMC AX4 - A failover update                   Use the Print Management
                                                                 console for Windows Server
                                                                 2008 print server




         5            Join the conversation!                                              Add Your Opinion
      Comments        Follow via:



      Staff Picks      Top Rated      Most Recent      My Contacts                               See All Comments




                       Very useful                                                                        0
                       ckmutunga 24th Aug 2011                                                       Votes



             It is exactly what I was looking for.


                 View in thread




                       Who has access to my Databases?                                                  0
                       JeffNguyen 10th Jun 2011                                                      Votes


             I think for the part Who has access to my Databases?, the SQL should be. Please
             correct me if I'm wrong SELECT UserName = dp.name, UserType = dp.type_desc,
             LoginName = sp.name, LoginType =... Read Whole Comment +



http://www.techrepublic.com/blog/datacenter/reviewing-sql-server-permissions/466[08/29/2012 3:46:21 PM]
Reviewing SQL Server Permissions | TechRepublic



               View in thread




                      minor correction?                                                                   0
                      Malkie 27th Jan 2011                                                           Votes



            Permissions on data are one of the most critical aspects of database administration.
            If you???re too strict as a database administrator then your users will not be able to
            do their jobs. If you???re... Read Whole Comment +


               View in thread




                                                  See all comments



     Join the TechRepublic Community and join the conversation! Signing-up is
     free and quick, Do it now, we want to hear your opinion.

      Join       Login




http://www.techrepublic.com/blog/datacenter/reviewing-sql-server-permissions/466[08/29/2012 3:46:21 PM]

Mais conteúdo relacionado

Mais procurados

Role based access control
Role based access controlRole based access control
Role based access controlPeter Edwards
 
Ms Sql Server Black Book
Ms Sql Server Black BookMs Sql Server Black Book
Ms Sql Server Black BookLiquidHub
 
The Java EE 7 Platform: Productivity++ & Embracing HTML5
The Java EE 7 Platform: Productivity++ & Embracing HTML5The Java EE 7 Platform: Productivity++ & Embracing HTML5
The Java EE 7 Platform: Productivity++ & Embracing HTML5Arun Gupta
 
Ved du, hvor dine data er - og hvem, der har adgang til dem? Ron Ben Natan, I...
Ved du, hvor dine data er - og hvem, der har adgang til dem? Ron Ben Natan, I...Ved du, hvor dine data er - og hvem, der har adgang til dem? Ron Ben Natan, I...
Ved du, hvor dine data er - og hvem, der har adgang til dem? Ron Ben Natan, I...IBM Danmark
 
TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...
TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...
TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...Michael Noel
 
Safety LAMP: data security & agile languages
Safety LAMP: data security & agile languagesSafety LAMP: data security & agile languages
Safety LAMP: data security & agile languagesPostgreSQL Experts, Inc.
 
Get database properties using power shell in sql server 2008 techrepublic
Get database properties using power shell in sql server 2008   techrepublicGet database properties using power shell in sql server 2008   techrepublic
Get database properties using power shell in sql server 2008 techrepublicKaing Menglieng
 
Optimize sql server queries with these advanced tuning techniques tech repu
Optimize sql server queries with these advanced tuning techniques   tech repuOptimize sql server queries with these advanced tuning techniques   tech repu
Optimize sql server queries with these advanced tuning techniques tech repuKaing Menglieng
 
Sever-based Password Synchronization: Managing Multiple Passwords
Sever-based Password Synchronization: Managing Multiple PasswordsSever-based Password Synchronization: Managing Multiple Passwords
Sever-based Password Synchronization: Managing Multiple PasswordsPortalGuard
 
Windows Server 2008 Active Directory Components
Windows Server 2008 Active Directory ComponentsWindows Server 2008 Active Directory Components
Windows Server 2008 Active Directory ComponentsTũi Wichets
 
Peoplesoft Query Overview
Peoplesoft Query OverviewPeoplesoft Query Overview
Peoplesoft Query OverviewRockon0017i5
 
12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4uzzal basak
 
08 qmds2005 session11
08 qmds2005 session1108 qmds2005 session11
08 qmds2005 session11Niit Care
 
Performance tuningtoolkitintroduction
Performance tuningtoolkitintroductionPerformance tuningtoolkitintroduction
Performance tuningtoolkitintroductionRohit Kelapure
 

Mais procurados (20)

2) security
2) security2) security
2) security
 
Role based access control
Role based access controlRole based access control
Role based access control
 
Ms Sql Server Black Book
Ms Sql Server Black BookMs Sql Server Black Book
Ms Sql Server Black Book
 
DB2 LUW Auditing
DB2 LUW AuditingDB2 LUW Auditing
DB2 LUW Auditing
 
W3 analyzer.ppt
W3 analyzer.pptW3 analyzer.ppt
W3 analyzer.ppt
 
The Java EE 7 Platform: Productivity++ & Embracing HTML5
The Java EE 7 Platform: Productivity++ & Embracing HTML5The Java EE 7 Platform: Productivity++ & Embracing HTML5
The Java EE 7 Platform: Productivity++ & Embracing HTML5
 
Ved du, hvor dine data er - og hvem, der har adgang til dem? Ron Ben Natan, I...
Ved du, hvor dine data er - og hvem, der har adgang til dem? Ron Ben Natan, I...Ved du, hvor dine data er - og hvem, der har adgang til dem? Ron Ben Natan, I...
Ved du, hvor dine data er - og hvem, der har adgang til dem? Ron Ben Natan, I...
 
TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...
TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...
TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...
 
Safety LAMP: data security & agile languages
Safety LAMP: data security & agile languagesSafety LAMP: data security & agile languages
Safety LAMP: data security & agile languages
 
Get database properties using power shell in sql server 2008 techrepublic
Get database properties using power shell in sql server 2008   techrepublicGet database properties using power shell in sql server 2008   techrepublic
Get database properties using power shell in sql server 2008 techrepublic
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
Optimize sql server queries with these advanced tuning techniques tech repu
Optimize sql server queries with these advanced tuning techniques   tech repuOptimize sql server queries with these advanced tuning techniques   tech repu
Optimize sql server queries with these advanced tuning techniques tech repu
 
Sever-based Password Synchronization: Managing Multiple Passwords
Sever-based Password Synchronization: Managing Multiple PasswordsSever-based Password Synchronization: Managing Multiple Passwords
Sever-based Password Synchronization: Managing Multiple Passwords
 
Windows Server 2008 Active Directory Components
Windows Server 2008 Active Directory ComponentsWindows Server 2008 Active Directory Components
Windows Server 2008 Active Directory Components
 
Sql Server Security Best Practices
Sql Server Security Best PracticesSql Server Security Best Practices
Sql Server Security Best Practices
 
Peoplesoft Query Overview
Peoplesoft Query OverviewPeoplesoft Query Overview
Peoplesoft Query Overview
 
12c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.412c db upgrade from 11.2.0.4
12c db upgrade from 11.2.0.4
 
08 qmds2005 session11
08 qmds2005 session1108 qmds2005 session11
08 qmds2005 session11
 
Performance tuningtoolkitintroduction
Performance tuningtoolkitintroductionPerformance tuningtoolkitintroduction
Performance tuningtoolkitintroduction
 
Active Directory
Active DirectoryActive Directory
Active Directory
 

Destaque

A+스타일 sbl로 배우는 한국사
A+스타일   sbl로 배우는 한국사A+스타일   sbl로 배우는 한국사
A+스타일 sbl로 배우는 한국사Lally Jung
 
103 Iokfg Bk Bite Size Welcome To Kfg 2012
103 Iokfg Bk Bite Size Welcome To Kfg 2012103 Iokfg Bk Bite Size Welcome To Kfg 2012
103 Iokfg Bk Bite Size Welcome To Kfg 2012Andrew Stotter-Brooks
 
Business & Branding - Era of Broadcast Reversal
Business & Branding - Era of Broadcast ReversalBusiness & Branding - Era of Broadcast Reversal
Business & Branding - Era of Broadcast ReversalHubert Grealish
 
Linked data in the digital humanities skills workshop for realising the oppo...
Linked data in the digital humanities  skills workshop for realising the oppo...Linked data in the digital humanities  skills workshop for realising the oppo...
Linked data in the digital humanities skills workshop for realising the oppo...jodischneider
 
Global domination for your social and mobile games - Stephen Lee - 6waves
Global domination for your social and mobile games - Stephen Lee - 6waves Global domination for your social and mobile games - Stephen Lee - 6waves
Global domination for your social and mobile games - Stephen Lee - 6waves Sociality Rocks!
 
Badania w gamedevie - WGK 2012
Badania w gamedevie - WGK 2012Badania w gamedevie - WGK 2012
Badania w gamedevie - WGK 2012Stan Just
 
Mobile computing
Mobile computing Mobile computing
Mobile computing oni3z
 
Com fer un bloc power point
Com fer un bloc power pointCom fer un bloc power point
Com fer un bloc power pointlaiaroviraniubo
 
ARNOLD -UNFPA South Sudan Situation report1-Small
ARNOLD -UNFPA South Sudan Situation report1-SmallARNOLD -UNFPA South Sudan Situation report1-Small
ARNOLD -UNFPA South Sudan Situation report1-Smalldefault default
 
Module chapter 1 indo
Module chapter 1 indoModule chapter 1 indo
Module chapter 1 indoevijuniati
 
Bahasa indonesia
Bahasa indonesiaBahasa indonesia
Bahasa indonesiaPuspa Sari
 
Epigenetic modulators - review - BMCL digest
Epigenetic modulators - review - BMCL digestEpigenetic modulators - review - BMCL digest
Epigenetic modulators - review - BMCL digestBoobalan Pachaiyappan
 
Task 2 briefs
Task 2   briefsTask 2   briefs
Task 2 briefsCrashin
 
The science of stress and resilience handout
The science of stress and resilience handoutThe science of stress and resilience handout
The science of stress and resilience handoutPeter Gowers
 

Destaque (19)

A+스타일 sbl로 배우는 한국사
A+스타일   sbl로 배우는 한국사A+스타일   sbl로 배우는 한국사
A+스타일 sbl로 배우는 한국사
 
103 Iokfg Bk Bite Size Welcome To Kfg 2012
103 Iokfg Bk Bite Size Welcome To Kfg 2012103 Iokfg Bk Bite Size Welcome To Kfg 2012
103 Iokfg Bk Bite Size Welcome To Kfg 2012
 
Business & Branding - Era of Broadcast Reversal
Business & Branding - Era of Broadcast ReversalBusiness & Branding - Era of Broadcast Reversal
Business & Branding - Era of Broadcast Reversal
 
Linked data in the digital humanities skills workshop for realising the oppo...
Linked data in the digital humanities  skills workshop for realising the oppo...Linked data in the digital humanities  skills workshop for realising the oppo...
Linked data in the digital humanities skills workshop for realising the oppo...
 
Global domination for your social and mobile games - Stephen Lee - 6waves
Global domination for your social and mobile games - Stephen Lee - 6waves Global domination for your social and mobile games - Stephen Lee - 6waves
Global domination for your social and mobile games - Stephen Lee - 6waves
 
Biżuteria z modeliny
Biżuteria  z  modelinyBiżuteria  z  modeliny
Biżuteria z modeliny
 
Badania w gamedevie - WGK 2012
Badania w gamedevie - WGK 2012Badania w gamedevie - WGK 2012
Badania w gamedevie - WGK 2012
 
ροδια
ροδιαροδια
ροδια
 
Mobile computing
Mobile computing Mobile computing
Mobile computing
 
Mobile
MobileMobile
Mobile
 
Com fer un bloc power point
Com fer un bloc power pointCom fer un bloc power point
Com fer un bloc power point
 
Salvador dalí
Salvador dalíSalvador dalí
Salvador dalí
 
ARNOLD -UNFPA South Sudan Situation report1-Small
ARNOLD -UNFPA South Sudan Situation report1-SmallARNOLD -UNFPA South Sudan Situation report1-Small
ARNOLD -UNFPA South Sudan Situation report1-Small
 
Esquema 1
Esquema 1Esquema 1
Esquema 1
 
Module chapter 1 indo
Module chapter 1 indoModule chapter 1 indo
Module chapter 1 indo
 
Bahasa indonesia
Bahasa indonesiaBahasa indonesia
Bahasa indonesia
 
Epigenetic modulators - review - BMCL digest
Epigenetic modulators - review - BMCL digestEpigenetic modulators - review - BMCL digest
Epigenetic modulators - review - BMCL digest
 
Task 2 briefs
Task 2   briefsTask 2   briefs
Task 2 briefs
 
The science of stress and resilience handout
The science of stress and resilience handoutThe science of stress and resilience handout
The science of stress and resilience handout
 

Semelhante a Reviewing sql server permissions tech republic

Geek Sync | SQL Security Principals and Permissions 101
Geek Sync | SQL Security Principals and Permissions 101Geek Sync | SQL Security Principals and Permissions 101
Geek Sync | SQL Security Principals and Permissions 101IDERA Software
 
Administrators manual
Administrators manualAdministrators manual
Administrators manualScrumDesk
 
SharePoint Security in an Insecure World - AUSPC 2012
SharePoint Security in an Insecure World - AUSPC 2012SharePoint Security in an Insecure World - AUSPC 2012
SharePoint Security in an Insecure World - AUSPC 2012Michael Noel
 
SPS Belgium 2012 - End to End Security for SharePoint Farms - Michael Noel
SPS Belgium 2012 - End to End Security for SharePoint Farms - Michael NoelSPS Belgium 2012 - End to End Security for SharePoint Farms - Michael Noel
SPS Belgium 2012 - End to End Security for SharePoint Farms - Michael NoelMichael Noel
 
SEASPC 2011 - SharePoint Security in an Insecure World: Understanding the Fiv...
SEASPC 2011 - SharePoint Security in an Insecure World: Understanding the Fiv...SEASPC 2011 - SharePoint Security in an Insecure World: Understanding the Fiv...
SEASPC 2011 - SharePoint Security in an Insecure World: Understanding the Fiv...Michael Noel
 
SPTechCon SFO 2012 - Understanding the Five Layers of SharePoint Security
SPTechCon SFO 2012 - Understanding the Five Layers of SharePoint SecuritySPTechCon SFO 2012 - Understanding the Five Layers of SharePoint Security
SPTechCon SFO 2012 - Understanding the Five Layers of SharePoint SecurityMichael Noel
 
Security for SharePoint in an Insecure World - SharePoint Connections Amsterd...
Security for SharePoint in an Insecure World - SharePoint Connections Amsterd...Security for SharePoint in an Insecure World - SharePoint Connections Amsterd...
Security for SharePoint in an Insecure World - SharePoint Connections Amsterd...Michael Noel
 
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universityCis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universitylhkslkdh89009
 
Be05 introduction to sql azure
Be05   introduction to sql azureBe05   introduction to sql azure
Be05 introduction to sql azureDotNetCampus
 
Security features In MySQL 8.0
Security features In MySQL 8.0Security features In MySQL 8.0
Security features In MySQL 8.0Mydbops
 
Asp.net membership anduserroles_ppt
Asp.net membership anduserroles_pptAsp.net membership anduserroles_ppt
Asp.net membership anduserroles_pptShivanand Arur
 
TROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
TROOPERS 20 - SQL Server Hacking Tips for Active Directory EnvironmentsTROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
TROOPERS 20 - SQL Server Hacking Tips for Active Directory EnvironmentsScott Sutherland
 
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)Scott Sutherland
 
Brief introduction into SQL injection attack scenarios
Brief introduction into SQL injection attack scenariosBrief introduction into SQL injection attack scenarios
Brief introduction into SQL injection attack scenariosPayampardaz
 
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...SpanishPASSVC
 

Semelhante a Reviewing sql server permissions tech republic (20)

Geek Sync | SQL Security Principals and Permissions 101
Geek Sync | SQL Security Principals and Permissions 101Geek Sync | SQL Security Principals and Permissions 101
Geek Sync | SQL Security Principals and Permissions 101
 
Administrators manual
Administrators manualAdministrators manual
Administrators manual
 
Where should I be encrypting my data?
Where should I be encrypting my data? Where should I be encrypting my data?
Where should I be encrypting my data?
 
SharePoint Security in an Insecure World - AUSPC 2012
SharePoint Security in an Insecure World - AUSPC 2012SharePoint Security in an Insecure World - AUSPC 2012
SharePoint Security in an Insecure World - AUSPC 2012
 
SPS Belgium 2012 - End to End Security for SharePoint Farms - Michael Noel
SPS Belgium 2012 - End to End Security for SharePoint Farms - Michael NoelSPS Belgium 2012 - End to End Security for SharePoint Farms - Michael Noel
SPS Belgium 2012 - End to End Security for SharePoint Farms - Michael Noel
 
SEASPC 2011 - SharePoint Security in an Insecure World: Understanding the Fiv...
SEASPC 2011 - SharePoint Security in an Insecure World: Understanding the Fiv...SEASPC 2011 - SharePoint Security in an Insecure World: Understanding the Fiv...
SEASPC 2011 - SharePoint Security in an Insecure World: Understanding the Fiv...
 
SPTechCon SFO 2012 - Understanding the Five Layers of SharePoint Security
SPTechCon SFO 2012 - Understanding the Five Layers of SharePoint SecuritySPTechCon SFO 2012 - Understanding the Five Layers of SharePoint Security
SPTechCon SFO 2012 - Understanding the Five Layers of SharePoint Security
 
Fortress SQL Server
Fortress SQL ServerFortress SQL Server
Fortress SQL Server
 
Security for SharePoint in an Insecure World - SharePoint Connections Amsterd...
Security for SharePoint in an Insecure World - SharePoint Connections Amsterd...Security for SharePoint in an Insecure World - SharePoint Connections Amsterd...
Security for SharePoint in an Insecure World - SharePoint Connections Amsterd...
 
Partially Contained Databases
Partially Contained DatabasesPartially Contained Databases
Partially Contained Databases
 
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universityCis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry university
 
Be05 introduction to sql azure
Be05   introduction to sql azureBe05   introduction to sql azure
Be05 introduction to sql azure
 
Security features In MySQL 8.0
Security features In MySQL 8.0Security features In MySQL 8.0
Security features In MySQL 8.0
 
Day2
Day2Day2
Day2
 
Asp.net membership anduserroles_ppt
Asp.net membership anduserroles_pptAsp.net membership anduserroles_ppt
Asp.net membership anduserroles_ppt
 
TROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
TROOPERS 20 - SQL Server Hacking Tips for Active Directory EnvironmentsTROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
TROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
 
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
2016 aRcTicCON - Hacking SQL Server on Scale with PowerShell (Slide Updates)
 
Brief introduction into SQL injection attack scenarios
Brief introduction into SQL injection attack scenariosBrief introduction into SQL injection attack scenarios
Brief introduction into SQL injection attack scenarios
 
Moodle + Adobe Connect
Moodle + Adobe Connect Moodle + Adobe Connect
Moodle + Adobe Connect
 
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
24 HOP edición Español -Diferentes técnicas de administración de logins y usu...
 

Mais de Kaing Menglieng

What is your sql server backup strategy tech_republic
What is your sql server backup strategy    tech_republicWhat is your sql server backup strategy    tech_republic
What is your sql server backup strategy tech_republicKaing Menglieng
 
Using sql server 2008's merge statement tech republic
Using sql server 2008's merge statement   tech republicUsing sql server 2008's merge statement   tech republic
Using sql server 2008's merge statement tech republicKaing Menglieng
 
Using object dependencies in sql server 2008 tech republic
Using object dependencies in sql server 2008   tech republicUsing object dependencies in sql server 2008   tech republic
Using object dependencies in sql server 2008 tech republicKaing Menglieng
 
Using hash fields in sql server tech republic
Using hash fields in sql server   tech republicUsing hash fields in sql server   tech republic
Using hash fields in sql server tech republicKaing Menglieng
 
Using grouping sets in sql server 2008 tech republic
Using grouping sets in sql server 2008   tech republicUsing grouping sets in sql server 2008   tech republic
Using grouping sets in sql server 2008 tech republicKaing Menglieng
 
Understand when to use user defined functions in sql server tech-republic
Understand when to use user defined functions in sql server   tech-republicUnderstand when to use user defined functions in sql server   tech-republic
Understand when to use user defined functions in sql server tech-republicKaing Menglieng
 
Sql server indexed views speed up your select queries part 1 - code-projec
Sql server indexed views   speed up your select queries  part 1 - code-projecSql server indexed views   speed up your select queries  part 1 - code-projec
Sql server indexed views speed up your select queries part 1 - code-projecKaing Menglieng
 
Sql server – query optimization – remove bookmark lookup – remove rid lookup
Sql server – query optimization – remove bookmark lookup – remove rid lookupSql server – query optimization – remove bookmark lookup – remove rid lookup
Sql server – query optimization – remove bookmark lookup – remove rid lookupKaing Menglieng
 
Sql server common interview questions and answers
Sql server   common interview questions and answersSql server   common interview questions and answers
Sql server common interview questions and answersKaing Menglieng
 
Sql server common interview questions and answers page 6
Sql server   common interview questions and answers page 6Sql server   common interview questions and answers page 6
Sql server common interview questions and answers page 6Kaing Menglieng
 
Sql server common interview questions and answers page 5
Sql server   common interview questions and answers page 5Sql server   common interview questions and answers page 5
Sql server common interview questions and answers page 5Kaing Menglieng
 
Sql server common interview questions and answers page 4
Sql server   common interview questions and answers page 4Sql server   common interview questions and answers page 4
Sql server common interview questions and answers page 4Kaing Menglieng
 
Sql server common interview questions and answers page 2
Sql server   common interview questions and answers page 2Sql server   common interview questions and answers page 2
Sql server common interview questions and answers page 2Kaing Menglieng
 
Sql server – 2008 – hardware and software requirements for installing sql se
Sql server – 2008 – hardware and software requirements for installing sql seSql server – 2008 – hardware and software requirements for installing sql se
Sql server – 2008 – hardware and software requirements for installing sql seKaing Menglieng
 
Speeding up queries with semi joins and anti-joins
Speeding up queries with semi joins and anti-joinsSpeeding up queries with semi joins and anti-joins
Speeding up queries with semi joins and anti-joinsKaing Menglieng
 
Speed up sql server apps - visual studio magazine
Speed up sql server apps  - visual studio magazineSpeed up sql server apps  - visual studio magazine
Speed up sql server apps - visual studio magazineKaing Menglieng
 
See sql server graphical execution plans in action tech republic
See sql server graphical execution plans in action   tech republicSee sql server graphical execution plans in action   tech republic
See sql server graphical execution plans in action tech republicKaing Menglieng
 
Query optimization how to search millions of record in sql table faster -
Query optimization   how to search millions of record in sql table faster  -Query optimization   how to search millions of record in sql table faster  -
Query optimization how to search millions of record in sql table faster -Kaing Menglieng
 
New date datatypes in sql server 2008 tech republic
New date datatypes in sql server 2008   tech republicNew date datatypes in sql server 2008   tech republic
New date datatypes in sql server 2008 tech republicKaing Menglieng
 

Mais de Kaing Menglieng (20)

What is your sql server backup strategy tech_republic
What is your sql server backup strategy    tech_republicWhat is your sql server backup strategy    tech_republic
What is your sql server backup strategy tech_republic
 
Using sql server 2008's merge statement tech republic
Using sql server 2008's merge statement   tech republicUsing sql server 2008's merge statement   tech republic
Using sql server 2008's merge statement tech republic
 
Using object dependencies in sql server 2008 tech republic
Using object dependencies in sql server 2008   tech republicUsing object dependencies in sql server 2008   tech republic
Using object dependencies in sql server 2008 tech republic
 
Using hash fields in sql server tech republic
Using hash fields in sql server   tech republicUsing hash fields in sql server   tech republic
Using hash fields in sql server tech republic
 
Using grouping sets in sql server 2008 tech republic
Using grouping sets in sql server 2008   tech republicUsing grouping sets in sql server 2008   tech republic
Using grouping sets in sql server 2008 tech republic
 
Understand when to use user defined functions in sql server tech-republic
Understand when to use user defined functions in sql server   tech-republicUnderstand when to use user defined functions in sql server   tech-republic
Understand when to use user defined functions in sql server tech-republic
 
Sql server indexed views speed up your select queries part 1 - code-projec
Sql server indexed views   speed up your select queries  part 1 - code-projecSql server indexed views   speed up your select queries  part 1 - code-projec
Sql server indexed views speed up your select queries part 1 - code-projec
 
Sql server – query optimization – remove bookmark lookup – remove rid lookup
Sql server – query optimization – remove bookmark lookup – remove rid lookupSql server – query optimization – remove bookmark lookup – remove rid lookup
Sql server – query optimization – remove bookmark lookup – remove rid lookup
 
Sql server common interview questions and answers
Sql server   common interview questions and answersSql server   common interview questions and answers
Sql server common interview questions and answers
 
Sql server common interview questions and answers page 6
Sql server   common interview questions and answers page 6Sql server   common interview questions and answers page 6
Sql server common interview questions and answers page 6
 
Sql server common interview questions and answers page 5
Sql server   common interview questions and answers page 5Sql server   common interview questions and answers page 5
Sql server common interview questions and answers page 5
 
Sql server common interview questions and answers page 4
Sql server   common interview questions and answers page 4Sql server   common interview questions and answers page 4
Sql server common interview questions and answers page 4
 
Sql server common interview questions and answers page 2
Sql server   common interview questions and answers page 2Sql server   common interview questions and answers page 2
Sql server common interview questions and answers page 2
 
Sql server – 2008 – hardware and software requirements for installing sql se
Sql server – 2008 – hardware and software requirements for installing sql seSql server – 2008 – hardware and software requirements for installing sql se
Sql server – 2008 – hardware and software requirements for installing sql se
 
Speeding up queries with semi joins and anti-joins
Speeding up queries with semi joins and anti-joinsSpeeding up queries with semi joins and anti-joins
Speeding up queries with semi joins and anti-joins
 
Speed up sql
Speed up sqlSpeed up sql
Speed up sql
 
Speed up sql server apps - visual studio magazine
Speed up sql server apps  - visual studio magazineSpeed up sql server apps  - visual studio magazine
Speed up sql server apps - visual studio magazine
 
See sql server graphical execution plans in action tech republic
See sql server graphical execution plans in action   tech republicSee sql server graphical execution plans in action   tech republic
See sql server graphical execution plans in action tech republic
 
Query optimization how to search millions of record in sql table faster -
Query optimization   how to search millions of record in sql table faster  -Query optimization   how to search millions of record in sql table faster  -
Query optimization how to search millions of record in sql table faster -
 
New date datatypes in sql server 2008 tech republic
New date datatypes in sql server 2008   tech republicNew date datatypes in sql server 2008   tech republic
New date datatypes in sql server 2008 tech republic
 

Reviewing sql server permissions tech republic

  • 1. Reviewing SQL Server Permissions | TechRepublic ZDNet Asia SmartPlanet TechRepublic Log In Join TechRepublic FAQ Go Pro! Blogs Downloads Newsletters Galleries Q&A Discussions News Research Library IT Management Development IT Support Data Center Networks Security Home / Blogs / The Enterprise Cloud Follow this blog: The Enterprise Cloud Reviewing SQL Server Permissions By Tim Chapman November 3, 2008, 10:19 AM PST Takeaway: SQL Server consultant Tim Chapman looks at the importance of database permissions and how you can use internal SQL Server system views to easily which users have access on your system. Permissions on data are one of the most critical aspects of database administration. If you’re too strict as a database administrator then your users will not be able to do their jobs. If you’re not lenient, then data can be compromised or even leaked. It is a very fine balance to control. The ability to determine these permissions on your database systems is absolutely paramount. Btrieve 6.15 Forever Who has access to my SQL Server? Still using Btrieve? So are we! Get the Ultimate Btrieve Patch First things first, you need to know which users are able to login into your SQL Server instance. pervasivedb.com/btrieve Logins come in two flavors; Windows authentication and SQL Server Logins. Windows logins are Google Docs For Business tied to Windows accounts while SQL Server logins are housed in SQL Server internally. Whether Start with 5 GB of Included Storage Get the login is Windows based or is an internal SQL account, you can access login information by Additional 20 GB Just $4/month! querying internal SQL Server views. To find the login information, the sys.server_principals system www.google.com/apps view can be used. The following script queries this view and returns login information along with re-lion Builder the type of associated login. Leading in easy to use terrain database generation tools SELECT name, type_desc, is_disabled www.re-lion.com FROM sys.server_principals To test this query, run the following script followed by the script above. The new login TestLogin should appear in the result-set. Keep Up with TechRepublic CREATE LOGIN TestLogin WITH Password = ‘asdevex33′, CHECK_POLICY = OFF Who has access to my Databases? Once a login is able to gain entry into the server, they then need access to databases. Before a Five Apps login is able to access a database, a user must be mapped to that login inside the database. The Google in the Enterprise following script queries the sys.database_principals system view, which holds user related information for the current database. Note that this information will likely differ for each database Subscribe Today you run it in. Users are database-level, so different users will have different access in different databases. Follow us however you choose! SELECT http://www.techrepublic.com/blog/datacenter/reviewing-sql-server-permissions/466[08/29/2012 3:46:21 PM]
  • 2. Reviewing SQL Server Permissions | TechRepublic UserName = dp.name, UserType = dp.type_desc, LoginName = sp.name, LoginType = sp.type_desc FROM sys.database_principals dp JOIN sys.server_principals sp ON dp.principal_id = sp.principal_id Media Gallery To test the above view, run the following script followed by the script immediately above. The new user TestUser (which is now mapped to the login TestLogin) should appear in the result-set. CREATE USER TestUser FOR LOGIN TestLogin Server Roles PHOTO GALLERY (1 of 15) Curiosity's autonomous Now that I have covered server logins and database users, I need to cover the different server and 'seven minutes of... database roles on the system. A login can be a member of a server role, which gives the login elevated permissions for the SQL Server instance. The following query can be used to view which More Galleries » logins are tied to which server roles. select p.name, p.type_desc, pp.name, pp.type_desc from sys.server_role_members roles join sys.server_principals p on roles.member_principal_id = p.principal_id VIDEO (1 of 13) Cracking Open: HTC Titan II join sys.server_principals pp on roles.role_principal_id = pp.principal_id More Videos » The following script adds the TestLogin I created above to the dbcreator server role. Once this script is ran, rerun the immediate script above. The new login role will be included in the result- set. Hot Questions View All EXECUTE sp_addsrvrolemember 3 SSL redirection @loginame = ‘TestLogin’, @rolename = ‘dbcreator’ 3 Switching from a Job to a career in Database Roles the IT field: Need an IT pro's advice The previous query illustrated which users had specific permissions inside of your database. However, when you’re a member of a database role, you’re given permissions that are not windows 7 won't shutdown and 2 contained in the sys.database_permissions view, but are absolutely vital for knowing which users keeps switching on have permissions inside your database. You can use the following query to determine which users are assigned to database roles. 2 can anyone suggest if any such software exist with similar SELECT functionality? p.name, p.type_desc, pp.name, pp.type_desc, pp.is_fixed_role Ask a Question FROM sys.database_role_members roles JOIN sys.database_principals p ON roles.member_principal_id = p.principal_id Hot Discussions View All JOIN sys.database_principals pp ON roles.role_principal_id = pp.principal_id The following script adds the TestUser to the db_datareader database role. Once this script has 221 Should developers be sued for been executed, run the previous script to see the new entry in the sys.database_role_members security holes? system view. 79 The sitting duck that is open source EXECUTE sp_addrolemember 27 Five fast Windows desktop search @rolename = ‘db_datareader’, utilities @membername = ‘TestUser’ Is the death knell sounding for 30 traditional antivirus? What can these users do? http://www.techrepublic.com/blog/datacenter/reviewing-sql-server-permissions/466[08/29/2012 3:46:21 PM]
  • 3. Reviewing SQL Server Permissions | TechRepublic The following query uses the sys.database_permissions system view to indicate which users had Start a Discussion specific permissions inside the current database. SELECT Blog Archive dp.class_desc, dp.permission_name, dp.state_desc, ObjectName = OBJECT_NAME(major_id), GranteeName = grantee.name, GrantorName = August 2012 December 2011 grantor.name July 2012 November 2011 June 2012 October 2011 FROM sys.database_permissions dp May 2012 September 2011 JOIN sys.database_principals grantee on dp.grantee_principal_id = grantee.principal_id April 2012 August 2011 March 2012 July 2011 JOIN sys.database_principals grantor on dp.grantor_principal_id = grantor.principal_id February 2012 June 2011 Conclusion January 2012 Today I looked at some system views included in SQL Server 2005 and SQL Server 2008 which can be used to view permissions on your SQL Server instance. The more you know about the permissions on your SQL Server system, the more prepared you’ll be if problems arise. Get IT Tips, news, and reviews delivered directly to your inbox by subscribing to TechRepublic’s free newsletters. About Tim Chapman Full Bio Contact EMC AX4 - A failover update Use the Print Management console for Windows Server 2008 print server 5 Join the conversation! Add Your Opinion Comments Follow via: Staff Picks Top Rated Most Recent My Contacts See All Comments Very useful 0 ckmutunga 24th Aug 2011 Votes It is exactly what I was looking for. View in thread Who has access to my Databases? 0 JeffNguyen 10th Jun 2011 Votes I think for the part Who has access to my Databases?, the SQL should be. Please correct me if I'm wrong SELECT UserName = dp.name, UserType = dp.type_desc, LoginName = sp.name, LoginType =... Read Whole Comment + http://www.techrepublic.com/blog/datacenter/reviewing-sql-server-permissions/466[08/29/2012 3:46:21 PM]
  • 4. Reviewing SQL Server Permissions | TechRepublic View in thread minor correction? 0 Malkie 27th Jan 2011 Votes Permissions on data are one of the most critical aspects of database administration. If you???re too strict as a database administrator then your users will not be able to do their jobs. If you???re... Read Whole Comment + View in thread See all comments Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion. Join Login http://www.techrepublic.com/blog/datacenter/reviewing-sql-server-permissions/466[08/29/2012 3:46:21 PM]