3.13 Ensure membership in admin roles in MSDB database is limited

Information

Based on Microsoft design an account with DB_OWNER can elevate permissions to SYSADMIN

MSDB must be configured with the TRUSTWORTHY flag ON to work properly. If the TRUSTWORTHY setting is set to ON and if the owner of the database is a member of a group that has administrative credentials, such as the sysadmin group (for example the default sa login), the database owner can then be able to create and run unsafe assemblies that can compromise the instance of the SQL Server, as well as run code to elevate his privileges to SYSADMIN

Solution

USE [msdb]
GO

ALTER ROLE [db_owner] DROP MEMBER <username>;

See Also

https://workbench.cisecurity.org/benchmarks/14058