CLR Enabled


Job details

Name: CLR Enabled
Platform: Sqlserver
Category: Security
Premium package: Security and compliance package
Description: Checks if the assemblies can be run by SQL Server.
Long description: Checks if the assemblies can be run by SQL Server. Enabling use of CLR assemblies widens the attack surface of SQL Server and puts it at risk from both inadvertent and malicious assemblies.
Version: 1.2
Default schedule: 4 1 1 *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & databasetype=‘sqlserver’]/instance[maj_version > ‘2005′ & hasengine=‘YES’ & eng_inst_priv = 0 & (engine_edition = ‘Microsoft SQL Server’ engine_edition = ‘Azure SQL Managed Instance’)]

Parameters

Name Default value Description
return status 1 Return status value (ALARM – 2, WARNING – 1, or OK – 0) when the “clr enabled” parameter is enabled.
disable CLR user code execution NO If set to “YES“ the alert will disable “clr enabled” (if it is enabled) by running sp_configure stored procedure.
history threshold 365 The maximum number of days to keep statistics for in the historic tables.

Job Summary

SELECT value_in_use FROM sys.configurations WHERE name = 'clr enabled'

Technical Details
The monitoring job involves several key components to ensure comprehensive and effective oversight:

Dependency Management
The job also manages dependencies effectively to ensure clean and consistent execution. Each component like stored procedures and tables are checked and cleaned if the job execution fails, preventing leftover or corrupt configurations.

Implementation and Output
The implementation code provided outlines the SQL for setting up necessary tables, checking and updating the CLR configuration, and handling condition-based configurations. The job output is mainly used for monitoring and alert purposes but can be configured to automatically alter system settings for security purposes based on the pre-set conditions.

Scheduling and Monitoring

Reporting and Compliance
The dbWatch job configuration comes equipped with a framework for reporting, which includes:

These components serve both operational monitoring and compliance auditing purposes, giving a comprehensive view of the CLR management on the SQL Server platform.