Default TCP Port

| 0 comments | 2,282 views
Categories:

VN:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)

This metric checks whether your SQL Server installation is using the default TCP port.
It’s widely known that SQL Server 2005 and 2008 listen on TCP port 1433. Keeping this default gives hackers a potential way of attacking your server.

This alert is raised when you are using the default port of 1433 which is a known security risk. You should consider modifying the port to a non-standard, non-default port in order to thoroughly secure your systems.

For information on how to change the TCP a server listens on, see MSDN.

Metric definition

Metric Name:
Default TCP Port
Description:
This metric checks whether your SQL Server installation is using the default TCP port. It’s widely known that SQL Server 2005 and 2008 listen on TCP port 1433. Keeping this default gives hackers a potential way of attacking your server. For information on how to change the TCP a server listens on, see MSDN http://msdn.microsoft.com/en-GB/library/ms177440(v=sql.90).aspx.
Enter the T-SQL query that will collect data:
DECLARE @KeyValue VarChar(500),
        @Data Varchar(255),
        @InstanceName VarChar(200)

SET @InstanceName = CONVERT(VarChar(200), ISNULL(SERVERPROPERTY('InstanceName'), 'MSSQLSERVER'))
SET @KeyValue = 'SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL'
EXEC xp_regread 'HKEY_LOCAL_MACHINE',
                @KeyValue,
                @InstanceName,
                @InstanceName OUTPUT

SET @Data = NULL
SET @KeyValue = 'SOFTWARE\Microsoft\Microsoft SQL Server\' + @InstanceName + '\MSSQLServer\SuperSocketNetLib\Tcp\IPAll\'
EXEC xp_regread 'HKEY_LOCAL_MACHINE',
                @KeyValue,
                'TcpPort',
                @Data OUTPUT

IF (COALESCE(@Data,1433) = 1433)
  SELECT 1 AS IsDefaultTCPPort
ELSE 
  SELECT 0 AS IsDefaultTCPPort
Select instances to collect from:
Select all
Choose databases to collect from:
Specify databases and type
master
Set collection frequency:
Collect data every day
Use collected or calculated values:
Leave the Use a calculated rate of change between collections check box turned off
Metric collection is:
Enabled

Alert definition

Alert name:
Default TCP Port Alert
Description:
This alert is raised when you are using the default port of 1433, which is a known security risk.
Raise an alert when the metric value goes:
Above the defined thresholds
Default threshold values:
Set the thresholds as follows:
High:0
Medium:
Low:
Raise an alert when the threshold is passed for:
Enter 1 collection
This alert is:
Enabled
VN:F [1.9.17_1161]
Rating: 0.0/5 (0 votes cast)