Groups | Blog | Home
all groups > iis security > june 2004 >

iis security : MS Access on IIS 5.0


Robin
6/14/2004 10:12:51 AM
I have 3 MS Access databases running on IIS 5.0.

1 Is for internal use only while the other 2 are used to
display postings and have users submit information via
PHP pages.

What is the best way to restrict access to these
databases? Either within MS Access, IIS or NTFS file and
folder permissions?

Any help would be greatly appreciated. My manager is
threatening to migrate everthing to Apache and MySQL!

We've already had a hacker download 1 of the databases
and with that was able to access restricted areas of the
site. Can we disable the ability to download an access
mdb database?

Thanks,
Phil Frisbie, Jr.
6/14/2004 1:18:38 PM
[quoted text, click to view]

The best way is not to have the database within the web directory tree. ASP does
not need the database to be within the web directory tree, and this is a very
common novice mistake.

[quoted text, click to view]

I will refrain from making any Microsoft (in)security remarks ;) However...

You should always keep an open mind to use the best tool for the job. I would
never recommend (and neither does Microsoft) using Access on a web server, other
than a VERY low volume site. Access is designed for single user or a small work
group, and not for a website that might have hundreds of requests pending at
once. If you want to stick with Microsoft products then you should seriously
consider using MS SQL Server, or at least you can use MySQL with IIS just fine
without switching to Apache.

[quoted text, click to view]

As I said above, if it is not within the web directory tree the is no way for it
to be downloaded.

[quoted text, click to view]

--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com
Robin
6/14/2004 7:48:00 PM
Phil and Jeff.... Thank you so much for responding!
Let me see if I got this straight.
The site I inherited is using PHP pages to reference back
to the databases which are currently within the web
directory. Does this mean all I have to do is the
following:
1) Move the databases out of the web directory and create
a new folder one of the server's disk then,
2) Restrict access to this folder and databases using
NTFS permissions/authentication. But what permissions do
I use? Keep in mind some clients are just submitting
names and phone numbers and not internal staff.
3) Create new links within the PHP pages to point to the
databases and their new location outside the web
directory?

[quoted text, click to view]

It is a very low volume server but we were in talks to
deploy MySQL but with the recent attack my manager wanted
to make changes immediately.

jeff.nospam NO[at]SPAM zina.com
6/14/2004 8:24:45 PM
On Mon, 14 Jun 2004 10:12:51 -0700, "Robin"
[quoted text, click to view]

Place them outside the web folder heiarchy, use NTFS permissions and
authentication.

[quoted text, click to view]

Put it outside the web heirarchy.

Paul Lynch
6/15/2004 11:05:56 AM
On Mon, 14 Jun 2004 10:12:51 -0700, "Robin"
[quoted text, click to view]

Robin,

Refer to these articles which you may find helpful :

How do I protect my Access database (MDB file)?
http://www.aspfaq.com/show.asp?id=2454

What are the limitations of MS Access?
http://www.aspfaq.com/show.asp?id=2195


Regards,

Paul Lynch
jeff.nospam NO[at]SPAM zina.com
6/15/2004 6:38:11 PM
On Mon, 14 Jun 2004 19:48:00 -0700, "Robin"
[quoted text, click to view]

Normally a designer would use an include file for the database
connections, but some code this into every page and unfortunately
you'd need to change those pages individually. As for permissions,
usually just the system account needs access, but if the folder is
outside that defined in IIS it can't be accessed by a HTTP request to
download it, no matter what security the folder/file has. Also use
URLScan if you're on IIS5 to defeat parent paths or directory
traversing, and make sure the server has current security patches.

Jeff

[quoted text, click to view]
Robin
6/16/2004 2:56:21 AM
I do in fact have an include file which will save me from
having to modify each page. I know this is another
problem which I have to fix but I think I can manage this
myself *fingers crossed*

I moved the databases to another folder but now I can't
get the site to pull the info out of them or post into
it. Page simply displays blank fields where the data
should populate!?!?!

What code do I need in the include file? I'd like to
avoid configuring any DSN.
Currently the code looks something like this:
<% Session("databasepath")
= "D:\Inetpub\wwwroot\sitename\data\databasename.mdb" %>
Do I leave it this way or change it? If I leave it how
do I get the database's to work now that I've moved them!

Thanks again for your help!!!
Very appreciative!


[quoted text, click to view]
Robin
6/16/2004 3:05:08 AM
Thanks for the feedback Paul.
Articles were very interesting.
I've read the articles however, I'm confused about one
thing. "The Access interface itself has no issues saving
or opening an MDB file with any other extension." Does
this mean that I need to have some server settings like
an ODBC DSN pointing to the database in the first place?
If not what server side settings is this referring to?
I'm currently using an include file to point to the
physical location of the databases (see my reply's to
Jeff).

Thanks for your help as well!


[quoted text, click to view]
Paul Lynch
6/16/2004 12:21:44 PM
On Wed, 16 Jun 2004 03:05:08 -0700, "Robin"
[quoted text, click to view]

I think what the author means is that Access will allow a file to be
saved as filename.bbc for example instead of filenename.mdb

You don't *need* a DSN, you can code a DSN-less connection instead.
See this article for details :

What should my connection string look like?
http://www.aspfaq.com/show.asp?id=2126

Check the permissions on the folder where you have placed your db file
as well as per this article :

http://www.aspfaq.com/show.asp?id=2062


Regards,

Paul Lynch
jeff.nospam NO[at]SPAM zina.com
6/16/2004 1:43:03 PM
On Wed, 16 Jun 2004 02:56:21 -0700, "Robin"
[quoted text, click to view]

When you move the file, you need to change the connection string to
match the new location.

[quoted text, click to view]

Change this path to wherever you moved the file. If it's moved to
D:\Databases\Sitename\Database.mdb for example, replace the path in
your code with the correct path.

Jeff

[quoted text, click to view]
jeff.nospam NO[at]SPAM zina.com
6/16/2004 1:44:02 PM
One other point on moving database files, the Access database requires
that the user account accessing it have MODIFY or better permissions
for the folder the database is in.

Jeff


On Wed, 16 Jun 2004 02:56:21 -0700, "Robin"
[quoted text, click to view]
Robin
6/17/2004 9:00:28 AM
Its working like a charm!

Thanks again for all your help!

[quoted text, click to view]
Robin
6/17/2004 9:01:08 AM
Its working great.

Thanks for all your help and advice! It really helped me
out.


[quoted text, click to view]
Paul Lynch
6/17/2004 8:14:39 PM
On Thu, 17 Jun 2004 09:01:08 -0700, "Robin"
[quoted text, click to view]

That's great ! Remember to keep your server up to date with security
patches as and when they are released. As always check here and
consider signing up for security bulletin notifications :

http://www.microsoft.com/security/default.mspx


Regards,

Paul Lynch
AddThis Social Bookmark Button