SQL Server must protect against a user falsely repudiating by ensuring databases are not in a trust relationship.

From MS SQL Server 2016 Database Security Technical Implementation Guide

Part of SRG-APP-000080-DB-000063

Associated with: CCI-000166

SV-93777r1_rule SQL Server must protect against a user falsely repudiating by ensuring databases are not in a trust relationship.

Vulnerability discussion

Non-repudiation of actions taken is required in order to maintain data integrity. Examples of particular actions taken by individuals include creating information, sending a message, approving information (e.g., indicating concurrence or signing a contract), and receiving a message. Non-repudiation protects against later claims by a user of not having created, modified, or deleted a particular data item or collection of data in the database.SQL Server provides the ability for high privileged accounts to impersonate users in a database using the TRUSTWORTHY feature. This will allow members of the fixed database role to impersonate any user within the database. 

Check content

Determine if the trustworthy property is set on the database. SELECT name as DatabaseName, SUSER_SNAME(owner_sid) AS DatabaseOwner, is_trustworthy_on FROM sys.databases WHERE name = DB_NAME() If trustworthy is not enabled, this is not a finding. If the database is MSDB, trustworthy is required to be enabled and therefore, this is not a finding. If trustworthy is enabled, determine if the database owner is a privileged account. DECLARE @databaseOwner AS nvarchar(50) SET @databaseOwner = 'sa' SELECT member.name AS Login, role.name AS Role FROM sys.server_principals member INNER JOIN sys.server_role_members rm ON member.principal_id = rm.member_principal_id INNER JOIN sys.server_principals role ON rm.role_principal_id = role.principal_id WHERE member.name = @databaseOwner AND role.name IN ('sysadmin','securityadmin') SELECT login.name, permission.permission_name FROM sys.server_principals login INNER JOIN sys.server_permissions permission ON login.principal_id = permission.grantee_principal_id WHERE login.name = @databaseOwner AND permission.permission_name IN ('CONTROL SERVER') If the database owner is a privileged account, this is a finding. If the database owner is not a privileged account, review the system documentation to determine if the trustworthy property is required and authorized. If this is not documented, this is a finding.

Fix text

Disable trustworthy on the database. ALTER DATABASE [] SET TRUSTWORTHY OFF

Pro Tips

Lavender hyperlinks in small type off to the right (of CSS class id, if you view the page source) point to globally unique URIs for each document and item. Copy the link location and paste anywhere you need to talk unambiguously about these things.

You can obtain data about documents and items in other formats. Simply provide an HTTP header Accept: text/turtle or Accept: application/rdf+xml.

Powered by sagemincer