When does the SQL Server permission script used by Foglight grant the sysadmin
role to a login?
Why does this happen, when is it needed, and what you can be done to avoid it.
The script is designed to give a login all the permissions needed for Foglight to monitor SQL Server. These privileges are described in the Foglight for Databases deployment guide.
On older versions of SQL Server (before 2005), the only way to do this was to make the login a sysadmin
.
Even on newer versions, the script checks if the login already has the right permissions. If not, it may grant sysadmin,
but only if absolutely necessary.
The script uses this line to check the SQL Server version:
IF (REPLACE(CONVERT(VARCHAR(2), SERVERPROPERTY('ProductVersion')), '.', '') < 9)
This means: if the version is less than 9 (SQL Server 2000 or older), it uses the old method that requires sysadmin
.
sysadmin
.sysadmin
part and only grants specific permissions like:
VIEW SERVER STATE
VIEW ANY DEFINITION
EXECUTE
on certain stored proceduresSELECT
on monitoring tables
sysadmin
completely:sysadmin
account, but target a non-privileged login.sysadmin
was granted and you don’t want that, you can remove it manually in SSMS.If your organization has strict security rules, you can use a customized version of the script that never grants sysadmin
, and only applies the minimum permissions needed.
The grant privileges script provided is known to work successfully in supported environments; however, it has not been officially tested by Quest Quality Control.
Any modifications to the script, intentional or unintentional, are considered customizations. As such, they fall outside the scope of support provided by Quest Support and Development.
Customers who require assistance with customized versions of the script should contact Quest Professional Services for guidance and implementation support.
As a best practice, always back up your SQL Server environment before executing any script that modifies permissions or database objects.
Monitoring SQL Server 2000 instances is no longer supported by the Foglight for SQL Server cartridge.
As part of this change, Defect ID FOG-8384 was logged with R&D to remove legacy logic from the grant privileges script that conditionally assigns sysadmin
privileges for SQL Server versions earlier than 9.0 (SQL Server 2005).
This ensures the script aligns with current support policies and avoids unnecessary elevation of privileges on modern SQL Server environments.