Trusted IP addresses
Every server, should be configured to only allow
trusted IP addresses. You don't allow just anyone
to come into your house and talk to your children.
In the same respect you should know exactly who
should be allowed to "talk" to your database server.
If it's
a back end for a web server., then only that web
server's address should be allowed to access that
database server. If the database server is supplying
information to a homegrown application that is
running on the internal network, then it should
only answer to addresses from within the internal
network.
Also please none of this cheap mentality of hosting
your web databases on the same server that houses
internal database information. Why would you have
internal information out in the DMZ, its not called
the DMZ for nothing.
Database
Connections
These days with the number of Dynamic Applications
it becomes tempting to allow immediate unauthenticated
updates to a database. I say, "Ney!" to such laziness.
If you are going to allow users to make updates
to a database via a web page, ensure that you
validate all updates to ensure that all updates
are warranted and safe. For example ensure that
you are removing any possible SQL code from a
user supplied input. If a normal user should never
be inputting it don't allow the data to ever be
submitted.
If you are one of those
administrators that feels the need to use ODBC
connections ensure that every connection uses
it's own unique user to access the shared data.
It personally makes my skin crawl when I see the
user account "sa" used for every connection and
data source on the server. Does every employee
in your company have keys to every room in the
building? I'll let you address that problem quietly
if they do.
Table Access
Control
Table access control is probably one of the most
overlooked forms of database security because
of the inherent difficult in applying it. Properly
using Table access control will require the collaboration
of both system administrator and database developer,
and we all know that "collaboration" is a foreign
word in the IT industry.
An example would be
allowing read access to user imputed information
to the public. If a user just imputed the information
whey would they have to look at it within the
same session. Or, if a table is just used for
system reference why should it have any other
permissions beside read available?
Unfortunately table structure and proper relational
database structure and development is a little
out of the scope of this article. But, keep a
look out for it in my upcoming articles.
Restricting
Database Access
Now being that we have completed a basic overview
of database security I want to dive a little further
into the specifics of server security. Mainly
into the network access of the system. Specifically
targeting Internet based databases, since they
have been the most recent targets of attacks.
All web-enabled applications have ports that they
listen to ( I know this is pretty basic to most
of you but, it needs to be said for the beginners!).
Most cyber criminals
( I always refrain from the media sensationalized
term "Hackers" or "Crackers") are going to do
a simple "port scan" to look for ports that are
open that popular database systems use by default.
Now I say by default, because you can change the
ports a service listens on, which I personally
feel is a great way to throw off a criminal.
First they will attempt
to determine if a machine is even at a specific
address. They will do this by pinging the system.
(If you don't know what ping is quietly close
this article, you need to do some studying first!)
This is done by simply opening up a command line
and typing "ping".
C:\ ping
127.0.0.1
or
root@localhost:
~$: ping 127.0.0.1
The response
should look like this:
Pinging
127.0.0.1 with 32 bytes of data:
Reply from
127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Reply from 127.0.0.1: bytes=32 time<10ms TTL=128
Ping statistics
for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0%
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms |