InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What Is The New Security Features Added In Sql Server 2016? |
|
Answer» Always Encrypted:
Row Level Security:
Dynamic Data Masking:
For example: I have a columns called “CredNo” to store customer creditcard NUMBER. If I mask this column then it will be viewed as 22XXXXXXXXXX56. But as I said data is not modified only this logic applied and data is masked based on the user/role. A SYSADMIN or db_owner can VIEW the actual data. We can use 4 different types of functions to mask data: Email, Partial, Default, Random Always Encrypted: Row Level Security: Dynamic Data Masking: For example: I have a columns called “CredNo” to store customer creditcard number. If I mask this column then it will be viewed as 22XXXXXXXXXX56. But as I said data is not modified only this logic applied and data is masked based on the user/role. A SYSADMIN or db_owner can view the actual data. We can use 4 different types of functions to mask data: Email, Partial, Default, Random |
|
| 2. |
What Is The New Security Features Added In Sql Server 2014? |
|
Answer» Functionality Enhancement for TDE: In 2014 Transparent DATA Encryption takes the normal backup and then APPLIES the Encryption before writing it to the disk. It allows backup compression is useful when TDE enabled. TDE applies on COMPRESSED backup. CONNECT ANY DATABASE: This is a new server level permission which can allow a login to connect all existing and future databases in the instance. This can be helpful when we need to give permissions for audit purpose. IMPERSONATE ANY LOGIN: This is a new server level permission which gives us more control in giving/denying impersonate access to logins. SELECT ALL USER SECURABLES: A new server level permission. When granted, a login such as an auditor can view data in all databases that the user can connect to. Functionality Enhancement for TDE: In 2014 Transparent Data Encryption takes the normal backup and then applies the Encryption before writing it to the disk. It allows backup compression is useful when TDE enabled. TDE applies on compressed backup. CONNECT ANY DATABASE: This is a new server level permission which can allow a login to connect all existing and future databases in the instance. This can be helpful when we need to give permissions for audit purpose. IMPERSONATE ANY LOGIN: This is a new server level permission which gives us more control in giving/denying impersonate access to logins. SELECT ALL USER SECURABLES: A new server level permission. When granted, a login such as an auditor can view data in all databases that the user can connect to. |
|
| 3. |
What Are The New Security Features Added In Sql Server 2012? |
|
Answer» Default Schema for Windows Group Logins: Let’s say we have a Windows account [MyDomain WinAdmin]. If someone from this group logged in [MyDomainUser1] and tried to create an object then there will be a new schema created like [MyDomainUser1].Table. This issue got FIXED in 2012. In 2012 we can assign a default schema for the Windows Group accounts. User Defined Server ROLES: Till 2008 R2 we have user defined roles at database level, 2012 allows us to create a Server level user defined roles which gives us more control in handling security. Contained Database: Easier database migrations as it contains user and login information on same database instead of in Master. Data Protection: Supporting Hash Algorithm-256 (SHA-256) and SHA-512. Auditing: Native support/feature for auditing the database environment by creating the Audit specifications. We can also create user defined audits. Ex: We can create an Audit specification to TRACE all events for a SPECIFIC login and write all these event details into Audit Log. We can also filter the events. Default Schema for Windows Group Logins: Let’s say we have a Windows account [MyDomain WinAdmin]. If someone from this group logged in [MyDomainUser1] and tried to create an object then there will be a new schema created like [MyDomainUser1].Table. This issue got fixed in 2012. In 2012 we can assign a default schema for the Windows Group accounts. User Defined Server Roles: Till 2008 R2 we have user defined roles at database level, 2012 allows us to create a Server level user defined roles which gives us more control in handling security. Contained Database: Easier database migrations as it contains user and login information on same database instead of in Master. Data Protection: Supporting Hash Algorithm-256 (SHA-256) and SHA-512. Auditing: Native support/feature for auditing the database environment by creating the Audit specifications. We can also create user defined audits. Ex: We can create an Audit specification to trace all events for a specific login and write all these event details into Audit Log. We can also filter the events. |
|
| 4. |
What Is Application Role In Sql Server Database Security? |
|
Answer» Application roles are DATABASE level roles like database roles. We can create them and assign permissions to them just like regular database roles but we can’t map users with them. Instead, we PROVIDE a password to unlock access to the database. Here it is how it works:
Application roles are database level roles like database roles. We can create them and assign permissions to them just like regular database roles but we can’t map users with them. Instead, we provide a password to unlock access to the database. Here it is how it works: |
|
| 5. |
You Are Delegating Permissions On Your Sql Server To Other Administrators. You Have Local, Single Server Jobs On One Server That You Would Like To Allow Another Administer To Start, Stop, And View The History For, But Not Delete History. This Administrator Will Own The Jobs. Which Role Should You Assign? |
|
Answer» SQLAgentUserRole: SQL Server PROVIDES 3 fixed roles for the agent service that limit privileges for ADMINISTRATORS. The SQLAgentUserRole is designed for local jobs (not multiserver) that allow the member to work with their OWNED jobs (EDIT, start, stop, view history) without deleting the history of any job. SQLAgentUserRole: SQL Server provides 3 fixed roles for the agent service that limit privileges for administrators. The SQLAgentUserRole is designed for local jobs (not multiserver) that allow the member to work with their owned jobs (edit, start, stop, view history) without deleting the history of any job. |
|
| 6. |
How To Enforce Security In Sql Server? |
|
Answer» By providing strong Passwords, Limited the access to make sure right people have access to the right data, Creating Customized database roles, server roles and assign privileges and by choosing the correct authentication mode etc. A DBA should be careful in providing security…..General precautions includes:
We have plenty of FEATURES in SQL SERVER to enforce the security. The major features include:
In addition to these features we have some more added in SQL SERVER 2008, like Policy Based Management, Security Audit, Improved Encryption, Backup Security etc. When we talk about the security we have to consider the below:
By providing strong Passwords, Limited the access to make sure right people have access to the right data, Creating Customized database roles, server roles and assign privileges and by choosing the correct authentication mode etc. A DBA should be careful in providing security…..General precautions includes: We have plenty of features in SQL SERVER to enforce the security. The major features include: In addition to these features we have some more added in SQL SERVER 2008, like Policy Based Management, Security Audit, Improved Encryption, Backup Security etc. When we talk about the security we have to consider the below: |
|
| 7. |
How To Recover From Sql Injection? |
|
Answer» If for some reason the resolution IMPLEMENTED does not resolve the PROBLEM and the SQL Injection attack occurs again, the quickest path may be to do the following:
If for some reason the resolution implemented does not resolve the problem and the SQL Injection attack occurs again, the quickest path may be to do the following: |
|
| 8. |
How Can Sql Injection Be Stopped? |
|
Answer» DevelopmentDBA:
DevelopmentDBA: |
|
| 9. |
What Is Sql Injection And Why Is It A Problem? |
|
Answer» SQL Injection is an exploit where unhandledunexpected SQL commands are passed to SQL SERVER in a MALICIOUS manner. It is a problem because unknowingly data can be stolen, DELETED, updated, inserted or corrupted. SQL Injection is an exploit where unhandledunexpected SQL commands are passed to SQL Server in a malicious manner. It is a problem because unknowingly data can be stolen, deleted, updated, inserted or corrupted. |
|
| 10. |
What Are Some Of The Pros And Cons Of Not Dropping The Sql Server Builtinadministrators Group? |
|
Answer» Pros:
Cons: Any Windows login is by default a SQL Server system administrator, which MAY not be a desired situation Pros: Cons: Any Windows login is by default a SQL Server system administrator, which may not be a desired situation |
|
| 11. |
Is Profiler The Only Tool That Has The Ability To Audit And Identify Ddl Events? |
|
Answer» No. In SQL Server 2005 DDL triggers were introduced to audit CREATE, ALTER and DROP EVENTS for relational (stored procedures, functions, views, etc.) and security (certificates, LOGINS, server, etc.) objects. No. In SQL Server 2005 DDL triggers were introduced to audit CREATE, ALTER and DROP events for relational (stored procedures, functions, views, etc.) and security (certificates, logins, server, etc.) objects. |
|
| 12. |
How Can Sql Server Instances Be Hidden? |
|
Answer» To hide a SQL Server INSTANCE, we need to make a change in SQL Server Configuration Manager. To do this launch SQL Server Configuration Manager and do the FOLLOWING: select the instance of SQL Server, right click and select Properties. After SELECTING properties you will just set Hide Instance to “Yes” and click OK or Apply. After the change is made, you need to restart the instance of SQL Server to not EXPOSE the name of the instance. To hide a SQL Server instance, we need to make a change in SQL Server Configuration Manager. To do this launch SQL Server Configuration Manager and do the following: select the instance of SQL Server, right click and select Properties. After selecting properties you will just set Hide Instance to “Yes” and click OK or Apply. After the change is made, you need to restart the instance of SQL Server to not expose the name of the instance. |
|
| 13. |
Name 3 Of The Features That The Sql Server Built-in Function Loginproperty Performs On Standard Logins? |
|
Answer» Date when the password was set
Date when the password was set |
|
| 14. |
How To Perform Backup For Certificates In Sql Server? |
Answer»
|
|
| 15. |
What Options Are Available To Audit Login Activity? |
|
Answer» Custom solution with your application to log all logins into a centralized table
Custom solution with your application to log all logins into a centralized table |
|
| 16. |
Name Three Of The Features Managed By The Surface Area Configuration Tool? |
|
Answer» Ad-hoc REMOTE queries
Ad-hoc remote queries |
|
| 17. |
What Objects Does The Fn_my_permissions Function Reports On? |
Answer»
SELECT * FROM fn_my_permissions(NULL, ‘SERVER’); SELECT * FROM fn_my_permissions(‘AdventureWorks’, ‘DATABASE’); SELECT * FROM fn_my_permissions(‘Employee’, ‘OBJECT’) SELECT * FROM fn_my_permissions(NULL, ‘SERVER’); SELECT * FROM fn_my_permissions(‘AdventureWorks’, ‘DATABASE’); SELECT * FROM fn_my_permissions(‘Employee’, ‘OBJECT’) |
|
| 18. |
If You Lose Rights To Your Sql Server Instance What Are The Options To Connect To Sql Server Instance? |
|
Answer» OPTION1: Use the DEDICATED Administrator CONNECTION OPTION2: Use BUILTINAdministrators GROUP Option3: Change Registry Values Option1: Use the Dedicated Administrator Connection Option2: Use BUILTINAdministrators Group Option3: Change Registry Values |
|
| 19. |
What Are The Extra Roles Available In Msdb? |
|
Answer» db_ssisadmin: Equals to sysadmin db_ssisoperator: Import/Delete/Change Role of own packages db_ssisltduser: Only can view and execute the packages dc_admin: Can administrate and USE the data collector dc_operator: Can administrate and use the data collector dc_proxy : Can administrate and use the data collector PolicyAdministratorRole: can perform all CONFIGURATION and maintenance activities on Policy-Based Management POLICIES and conditions. ServerGroupAdministratorRole : Can administrate the registered server group ServerGroupReaderRole: Can view and the registered server group dbm_monitor: Created in the msdb database when the first database is registered in Database Mirroring MONITOR db_ssisadmin: Equals to sysadmin db_ssisoperator: Import/Delete/Change Role of own packages db_ssisltduser: Only can view and execute the packages dc_admin: Can administrate and use the data collector dc_operator: Can administrate and use the data collector dc_proxy : Can administrate and use the data collector PolicyAdministratorRole: can perform all configuration and maintenance activities on Policy-Based Management policies and conditions. ServerGroupAdministratorRole : Can administrate the registered server group ServerGroupReaderRole: Can view and the registered server group dbm_monitor: Created in the msdb database when the first database is registered in Database Mirroring Monitor |
|
| 20. |
What Are The Security Related Catalog Views? |
Answer»
DATABASE Level:
Server Level: Database Level: |
|
| 21. |
What Are The Database Roles? |
Answer»
Note: Fixed database roles are not equivalent to their database-level permission. For example, the db_owner fixed database role has the CONTROL DATABASE permission. But granting the CONTROL DATABASE permission does not make a user a member of the db_owner fixed database role. Note: Fixed database roles are not equivalent to their database-level permission. For example, the db_owner fixed database role has the CONTROL DATABASE permission. But granting the CONTROL DATABASE permission does not make a user a member of the db_owner fixed database role. |
|
| 22. |
What Are The Fixed Server Level Roles? |
|
Answer» SysAdmin – Can perform any activity ServerAdmin – Can change server configuration, restart, shutdown server SecurityAdmin – Can manage server level logins, also can manage db level if they have permission on db Granted: ALTER ANY LOGIN ProcessAdmin – Can kill a process on an INSTANCE Granted: ALTER ANY CONNECTION, ALTER SERVER STATE DiskAdmin – Can manage the disk files Granted: ALTER RESOURCES BulkAdmin – Can perform BULK INSERT Granted: ADMINISTER BULK OPERATIONS SetupAdmin – Can add and REMOVE linked servers Granted: ALTER ANY LINKED SERVER Dbcreator – Can create, alter, DROP and restore any database on the instance Granted: CREATE ANY DATABASE Public – Default role for newly created login sp_helpsrvrolemember : LIST out the members mapped with the server roles SysAdmin – Can perform any activity ServerAdmin – Can change server configuration, restart, shutdown server SecurityAdmin – Can manage server level logins, also can manage db level if they have permission on db Granted: ALTER ANY LOGIN ProcessAdmin – Can kill a process on an instance Granted: ALTER ANY CONNECTION, ALTER SERVER STATE DiskAdmin – Can manage the disk files Granted: ALTER RESOURCES BulkAdmin – Can perform BULK INSERT Granted: ADMINISTER BULK OPERATIONS SetupAdmin – Can add and remove linked servers Granted: ALTER ANY LINKED SERVER Dbcreator – Can create, alter, drop and restore any database on the instance Granted: CREATE ANY DATABASE Public – Default role for newly created login sp_helpsrvrolemember : List out the members mapped with the server roles |
|
| 23. |
How To Resolve The Orphan Use Problem? |
|
Answer»
USE <database_name>; GO; sp_change_users_login @Action='Report'; GO; To resolve the orphan USER PROBLEM: 10USE <database_name>; GO sp_change_users_login @Action='update_one', @UserNamePattern='<database_user>', @LoginName='<login_name>'; GO To find out the orphan users: USE <database_name>; GO; sp_change_users_login @Action='Report'; GO; To resolve the orphan user problem: 10USE <database_name>; GO sp_change_users_login @Action='update_one', @UserNamePattern='<database_user>', @LoginName='<login_name>'; GO |
|
| 24. |
We Have A List Of 3 Sql Server Logins Which Are Dedicated To A Critical Application. We Have Given All Required Rights To Those Logins. Now My Question Is We Have To Restrict The Access Only To These Three Logins. Means There Are Two Conditions: A) No Other User Should Be Able To Access The Database Except Those Three Logins B) Even For Those Three Logins They Should Be Able To Run Their Queries Only Through The Application. If Someone Login Through Ssms And Trying To Run A Query Should Result Into A Failure. Finally There Should Be Only Way To Running A Query Is From Their Application Using One Of Those Three Logins, There Should Be No Other Way To Run Queries On That Database. How Do You Restrict? |
|
Answer» Do not GIVE access to any other login on that database except for those 3 app LOGINS. Create a trigger that test each and every query like below IF app_name() in(‘SQL Query ANALYZER’,’Microsoft SQL Server Management Studio’) raiserror (…..) Return Do not give access to any other login on that database except for those 3 app logins. Create a trigger that test each and every query like below IF app_name() in(‘SQL Query Analyzer’,’Microsoft SQL Server Management Studio’) raiserror (…..) Return |
|
| 25. |
What Is The Use Of Builtinadministrators Group In Sql Server? |
|
Answer» Any Windows login in BUILTINAdministrators GROUP is by default a SQL Server system administrator. This single group can be USED to manage administrators from a Windows and SQL Server PERSPECTIVE Any Windows login in BUILTINAdministrators group is by default a SQL Server system administrator. This single group can be used to manage administrators from a Windows and SQL Server perspective |
|
| 26. |
What Is The Guest User Account In Sql Server? What Login Is It Mapped To It? |
|
Answer» The Guest user account is created by default in all databases and is used when EXPLICIT permissions are not granted to access an object. It is not mapped directly to any LOGIN, but can be used by any login. Depending on your SECURITY needs, it may MAKE sense to drop the Guest user account, in all databases except Master and TEMPDB The Guest user account is created by default in all databases and is used when explicit permissions are not granted to access an object. It is not mapped directly to any login, but can be used by any login. Depending on your security needs, it may make sense to drop the Guest user account, in all databases except Master and TempDB |
|