V-213907
SV-213907r1167464_rule
CAT II
SQL Server must limit privileges to change software modules, to include stored procedures, functions, and triggers, and links to software external to SQL Server.
From: MS SQL Server 2016 Database Security Technical Implementation Guide (V3R5)
Description
<VulnDiscussion>If the system were to allow any user to make changes to software libraries, then those changes might be implemented without undergoing the appropriate testing and approvals that are part of a robust change management process.
Accordingly, only qualified and authorized individuals shall be allowed to obtain access to information system components for purposes of initiating changes, including upgrades and modifications.
Unmanaged changes that occur to the database software libraries or configuration can lead to unauthorized or compromised installations.</VulnDiscussion><FalsePositives></FalsePositives><FalseNegatives></FalseNegatives><Documentable>false</Documentable><Mitigations></Mitigations><SeverityOverrideGuidance></SeverityOverrideGuidance><PotentialImpacts></PotentialImpacts><ThirdPartyTools></ThirdPartyTools><MitigationControl></MitigationControl><Responsibility></Responsibility><IAControls></IAControls>
Check Procedure
Obtain a listing of schema ownership from the server documentation.
Execute the following query to obtain a current listing of schema ownership.
SELECT s.name AS schema_name, p.name AS owning_principal
FROM sys.schemas s
JOIN sys.database_principals p ON s.principal_id = p.principal_id
WHERE p.name != 'dbo'
AND (s.name != p.name
or p.name not in
( 'db_accessadmin'
, 'db_backupoperator'
, 'db_datareader'
, 'db_datawriter'
, 'db_ddladmin'
, 'db_denydatareader'
, 'db_denydatawriter'
, 'db_owner'
, 'db_securityadmin'
, 'guest'
, 'INFORMATION_SCHEMA'
, 'sys'
, 'TargetServersRole'
, 'SQLAgentUserRole'
, 'SQLAgentReaderRole'
, 'SQLAgentOperatorRole'
, 'DatabaseMailUserRole'
, 'db_ssisadmin'
, 'db_ssisltduser'
, 'db_ssisoperator'
, 'replmonitor'
, '##MS_SSISServerCleanupJobLogin##'
)
)
ORDER BY schema_name
If any schema is owned by an unauthorized database principal, this is a finding.
Fix Text
Transfer ownership of database schemas to authorized database principals.
ALTER AUTHORIZATION ON SCHEMA::[<Schema Name>] TO [<Principal Name>]
CCI Reference
CCI-001499- Created
- 2026-02-12 15:25:32
- Last Updated
- 2026-04-07 20:09:49