Port Blocking, SQL Server, and the Internet

  • Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/colu

  • I agree with Denny. Opening 1433 to the Internet is a bad idea. At least redirect it, but preferebly limit this to VPN access only.


  • I disagree with the last part about applications.  Perhaps I'm not the best programmer around, but I can't implement a custom binary protocol for our applications to use in twenty minutes as suggested by the author. 

    We have literally hundreds of privately owned companies that trade information back and forth through our SQL server using a custom application that we wrote.  Using MS's ADO components, we have a very efficient way for distributed users to update and retrieve information from inside our application.  We don't have to train each user to use VNC (which I love), or setup a VPN.  Each user has their own login and password that gets embedded in the application.  I wish the authentication was encrypted, and perhaps it will be in a future version of SQL and MDAC.  To advocate just closing off remote access to the SQL server from the outside doesn't seem reasonable to me.

    Student of SQL and Golf, Master of Neither

  • Bob:

    "So given that list of options, considering how many of them should take less than 20 minutes to implement (Like remote desktop or VNC) I have to ask why you would ever want to risk the valuable data and resources of that SQL server? "

    I did not say that *ALL* of the could be done in 20 minutes   just that several things like Remote Desktop are fast to setup and use.

    I sure would bow to any coder who could do a custom binary in even 20 hours !  I'd expect that to be more like 20 work days @ 8 hours a day depending on how complex it was.

    as for what you have I certainly don't think you can or will ditch it .... but perhaps it's time to think about a future upgrade where you use a WebService, it would for example give you WSE which can deal with the plain text user name and password. and you can also reduce the number of open connections and database hits to scale even better.

    an example:  asp.net and web services can cache a "Lookup Table" in local memory and return that in-place of a database connection.

    over the course of a day's work that could amount to huge numbers of requests filled with only a few hits on the sql server.

    how many tables like that do you have? that change seldom and are read often?




  • I agree with all the ideas in the original article but I do have a problem with actually implementing them because I work for an ISP and I admin a couple of servers which need to have shared access via Enterprise manager for their owner/client so they can update their tables etc. I know they could do this via code within an ASP page or the like being uploaded but most don't know how. If I could get around this I would be happy to close the port. regards from Paul Reynolds

  • well one method is to use terminal services ... so they vpn and or terminal to a server that has sql em on it, not the "real" sql server just an admin server that lets them login as a user that has rights to one database.

    or check out this:



    The Web Data Administrator is a utility program implemented in ASP.NET that enables you to easily manage your SQL Server data wherever you are. Using its built-in features, you can do the following from Internet Explorer or your favorite Web browser:

    • Create and edit databases in Microsoft SQL Server 2000 or Microsoft SQL Server 2000 Desktop Engine (MSDE)
    • Perform ad-hoc queries against databases and save them to your file system
    • Export and import database schema and data

    as I recall I tried it out and liked it.... I have my server local so I have not needed it.



  • I agee with the author in that SQL Server should not be exposed to the Internet, however, it is NOT the place of the ISP to block any traffic.  There should be absolutly no exceptions, the ISP has a duty to pass ALL traffic that can be routed to the destination.

    The control of what enters or leaves any network should be under the control of that network.  The ISP blocking ports will only cause a variety of evasion tactics that will cause much bigger problems down the road.  Just look at all of the overuse of port 80, now it is being used for just about everything.  We are now having to purchase/build new applications to filter the port 80 traffic and try to determine what is OK and what is not OK.


  • So what do other folks do when they want to share data from a SQL server amongst a large, geographically distributed group of customers?  We have hundreds of customers that trade data from inside an application written in VB6.  They use the ADO calls built into our application to access one central SQL server.  Obviously they are outside the firewall.  They have to update and read data that other customers post (generally through Stored Procedures).  What is the "better" way to do this than through a port open to the outside?

    It seems to me that each person posting on this topic is "assuming" that the only use for SQL server is for "internal" use, perhaps to drive content for a web server.  If that was the case, I'd say close the ports as well, just from the basic security concept that you never share what you don't need to.  But that assumption is not part of the basic article that started this thread!  Or maybe I'm missing something - which is what I'm trying to find out.


    Student of SQL and Golf, Master of Neither

  • I think that one of the things to do when setting up SQL Server as a security precaution is to change the default port to something else.  Someone internally at my company exposed themselves and got the CodeRed virus.  Every SQL Server in the company was infected accept for ours because we were not on port 1433.

    Will this stop every attack, of course not, but why open yourself to needless headaches when something simple can be done.  As for using ADO, our apps make extensive use of ADO and our connection strings all tell ADO to use this different port.  You add a comma and the port value to the server name.  "=ourSQLServer,1234".  Bingo - you're now connected using the other port.

    Our SQL Servers are not directly accessible from outside the company, unless you are using VPN, but if you did have to access them externally, then changing the port wouldn't hurt because it would just put one more layer of obfuscation in the hackers path.

    My two cents worth.


    "You have been told, O man what is good and what Yahweh asks of you, simply this: to act justly, love tenderly and walk humbly with your God." (Micah 6:8)

    Ad maiorem Dei gloriam

  • I agree with the statement that the port of sql server i.e. 1433 should be blocked by the ISP. But can anybody tell me the way how to pass the parameters to the asp file which I will have to call in another case (to implement security). As Most of the clients requires performance.

  • I tend to err on the side of caution - I'd never expose SQL directly to the net.  A VPN using the standard MS PPTP connections is very easily configured at both the server and client ends...  This is by far more secure and helps ensure that any future exploits for SQL don't find their way into your network.

    You could, if desired, make use of the features of your NAPT firewall to have SQL use 1433 internally and appear on a different port externally - security through obscurity   I do this for Terminal Services - rather than exposing 3389 for a single server to the net I'll map something like 4001, 4002, 4003 etc each being pointed at a different internal IP address for port 3389.  The less of your network that is exposed, the more secure you are (generally).

  • Wow this is still looked at... been a while since my bit on sql.


    for an outside client to get at the data my general plan is to use another server to manage the request.

    examples include web services / xml or an app server remoting the data

    any client on the "outside" of the corp. data center should never see the IP of the SQL db server.

    should never have direct access to it via SQL connection.

    and in many cases a middle server can cache some data thus reducing the work load and # of connections on the sql server.

    less vulnerable, more scalable, more managed.

    seems good to me.

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply