Web Host Chat
Bringing Hosts & Customers together since 2001
Home QLinks Members Your Profile Register FAQ's Hosts Only Area SMS Alerts Advertising
User Information
»REGISTER NOW!

Go Back   Web Host Chat > Web Hosting Chat > Hosting Software and additional add-on products
Reply
 
LinkBack Thread Tools
Old 30th May 2007   #1 (permalink)
Trusted User (495)
Platinum User
Join Date: Jun 2006
Location: UK
Age: 34
Posts: 486
LeaUK is on a distinguished road
Plesk 8.1.1 - Access databases and security

Nows here's something...

I need to run an Access database, but where does it go? It requires IUSR_xxxx (Internet priveldges both read + write) and I note that web hosts recommend placing the mdb beneath httpdocs (the root). No way surely not!!

After some carefull experimentation (Google wasn't a friend today) and applying some common sense I created a folder beneath 'Private' (no IUSR_xxx access) and granted IUSR_ xxxx r+w (without either r or w the database would fail.)

I used Plesk to create a DSN and test the connection - albeit Plesk doesn't impersonate a IUSR_xxx so a little bit superfluous. Then used some asp script to trial (see below). All OK.

Now onto security:

Can a web browser (I_SR_xxx) actually navigate above the root httpdocs folder and manage to download the mdb file? I can't see how but hey I'm a nuub.

Any thoughts? My stagegy seems common sense and appeared to work but are there any shorcomings?


Thanks for any pointers
Lea

Oh, the asp script was simply:

Code:
<%
set conn=Server.CreateObject("ADODB.Connection") 
conn.Open "private"
%>
saved in the web root.
__________________
Registered User
LeaUK is offline   Reply With Quote
Old 30th May 2007   #2 (permalink)
I am Staff at
Naglotech
About My Company!


Basic Host
andyb28's Avatar
Join Date: Dec 2004
Location: Essex
Age: 35
Posts: 1,180
andyb28 is on a distinguished road
THIS USER HAS BEEN GAGGED BY THE FORUM HOSTS FOR SPAM OR BREAKING THE RULES...
User will be ungaged in around 78 hours from this post.

__________________
Andy Booth

Naglotech Ltd Webhosting, Colocation, Consultancy
Cybernetic-Servers Game Servers, Dedicated Servers

Company No : 5326296
AS35327
__________________
Web Host - VIP Member

Last edited by andyb28 : 30th May 2007 at 03:59 PM. Reason: Added more info.
andyb28 is offline   Reply With Quote
Old 30th May 2007   #3 (permalink)
Trusted User (495)
Platinum User
Join Date: Jun 2006
Location: UK
Age: 34
Posts: 486
LeaUK is on a distinguished road
Hi Andy

Thanks for your info re FP. However for the asp script to run I definately need IUSR_xxx r+w access even if the ODBC is configured or not. Without this (i.e simply placing the file in 'private' above the web root) the script cannot access the mdb and an error is thrown.

However there is some sense in what you've mentioned. ODBC should allow the mdb to sit anywhere but I have read over several websites (inc MS) and proved that IUSR_xxx/IIS_ access is required on the mdb.

Granting IUSR_xxx access to files above the root shouldn't be an issue but I just wanted to check. The Plesk FAQ/Knowlegbase is as useful as ever!

Using Plesk, try it for yourself, create an mdb and place it in 'private'
Setup the ODBC link to the mdb and hit the Test button - all OK.
Now add the code in my original post to a file called databasecheck.asp and upload to httpdocs.
Call the asp script and it will fail.
Now add IUSR_xxxx r+w to the mdb and call the asp file again - it works!

???
Lea
__________________
Registered User

Last edited by LeaUK : 30th May 2007 at 06:36 PM.
LeaUK is offline   Reply With Quote
Old 30th May 2007   #4 (permalink)
I am Staff at
Naglotech
About My Company!


Basic Host
andyb28's Avatar
Join Date: Dec 2004
Location: Essex
Age: 35
Posts: 1,180
andyb28 is on a distinguished road
THIS USER HAS BEEN GAGGED BY THE FORUM HOSTS FOR SPAM OR BREAKING THE RULES...
User will be ungaged in around 78 hours from this post.

__________________
Andy Booth

Naglotech Ltd Webhosting, Colocation, Consultancy
Cybernetic-Servers Game Servers, Dedicated Servers

Company No : 5326296
AS35327
__________________
Web Host - VIP Member
andyb28 is offline   Reply With Quote
Old 30th May 2007   #5 (permalink)
I am Staff at
eHosting Limited
About My Company!

Certified Host
Join Date: Oct 2004
Location: Manchester, UK
Posts: 183
PaulC is on a distinguished road
The easiest way is to create a folder such as "data" within the "httpdocs" folder, uploading the Access DB into there.

From Plesk you can then set up "/data" as a protected directory meaning you need a user name/password to access the contents of the folder.

Paul
__________________
Paul Carter
eHosting Limited
__________________
Web Host - Certified Member
PaulC is offline   Reply With Quote
Old 30th May 2007   #6 (permalink)
Trusted User (495)
Platinum User
Join Date: Jun 2006
Location: UK
Age: 34
Posts: 486
LeaUK is on a distinguished road
I don't think the asp requires a connection string to talk to a DSN. the mdb has no inbuilt security credentials (user/password) associated.

I've taken a look at how the fpdb folder is structured and by using FP to place the mdb into this folder the permissions are granted automatically. FP sets the appropriate permissions for the folder - and of course it can as it's running on the server.

Files within the folder fpdb inherit IUSR_xxxx with change permissions only, not read, thus a browser cannot download it even though it maybe placed beneath the root (not sure where FP places fpdb?).

I have read this which was posted from another host:

Quote:
"Your access database needs to be placed inside a folder which has write permissions enabled and HTTP read access removed to prevent users from download your *.mdb files."
and this seems to make some sense. What's 'HTTP read access'? Does this simply mean the folder should be out of the control of IIS, ie above the Home directory (web root) in which IIS points to? If so my folder 'private' is fine as it's above the Home directory, but just has to have IUSR_xxx r+w granted.

??
Lea
__________________
Registered User
LeaUK is offline   Reply With Quote
Old 30th May 2007   #7 (permalink)
Trusted User (495)
Platinum User
Join Date: Jun 2006
Location: UK
Age: 34
Posts: 486
LeaUK is on a distinguished road
Paul

My understanding is that IUSR_xxx requires r+w access to the mdb such that as the asp script is called the browser can interact with the database. If the folder was password protected ,then surely the user (IUSR_xxx would have to keep entering passwords when the asp code requests access??

Doesn't sound quite right to me...? Or have I missed something..??

Lea
__________________
Registered User
LeaUK is offline   Reply With Quote
Old 30th May 2007   #8 (permalink)
I am Staff at
eHosting Limited
About My Company!

Certified Host
Join Date: Oct 2004
Location: Manchester, UK
Posts: 183
PaulC is on a distinguished road
Lea,

If you plan on the scripts writing to the MDB file you will need to give the folder write permissions to the IUSR_xxx user. If this isnt set then lock files cant be created, and the file cant be updated which causes problems.

Password Protecting the directory protects this against web access, ie. through a browser. A script is accessing it directly in terms of a connection to a file, and so will access this fine.

Dont forget if its a .net script you will need to set the permissions for the IWPD_xxx user!

Paul
__________________
Paul Carter
eHosting Limited
__________________
Web Host - Certified Member
PaulC is offline   Reply With Quote
Old 30th May 2007   #9 (permalink)
Trusted User (495)
Platinum User
Join Date: Jun 2006
Location: UK
Age: 34
Posts: 486
LeaUK is on a distinguished road
Hi Paul

as my previous post, I need to assign both r + w - discovered that whilst doing some serious Googling.. chhers though and thanks for the tip re asp.net

An interesting alternative to use the URL protection feature and it works - I've just tested it. The script runs fine without asking for passwords, and when using a browser to attempt access to the 'database' folder the authorisation box is presented as one would expect.

However I don't understand something:

Quote:
A script is accessing it directly in terms of a connection to a file, and so will access this fine.
so if the script accesses it 'directly' why does the mdb file clearly need IUSR_xxx read access???

I still prefere to place the mdb in a folder above the Home folder - I just get the feeling that's why Plesk placed 'private' there...??

Lea
__________________
Registered User

Last edited by LeaUK : 30th May 2007 at 07:28 PM.
LeaUK is offline   Reply With Quote
Old 30th May 2007   #10 (permalink)
Trusted User (495)
Platinum User
Join Date: Jun 2006
Location: UK
Age: 34
Posts: 486
LeaUK is on a distinguished road
I wanted to find out what Plesk actually did to IIS when URL protection is used, originally I assumed it simply disabled Annonomous Authentication, but then I remembered the nightmare I had a year or so ago with that and ended up using a ISAPI plugin called IISPassword, which worked well.

It seems like PLesk have gone the same route with there own IIS plugin to handle URL protection as I could not find any changes to the protected URL/folder in permissions or anywhere in IIS.

So in summary, there are two methods of protecting mdb files from browser download:

1. Place the mdb in a folder above the Home directory (web root) and allow IUSR_xxx read + write.

or

2. Add a folder beneath the web root and add url protection.

Which is the most secure? Which to choose?

Lea
__________________
Registered User
LeaUK is offline   Reply With Quote
Old 30th May 2007   #11 (permalink)
I am Staff at
eHosting Limited
About My Company!

Certified Host
Join Date: Oct 2004
Location: Manchester, UK
Posts: 183
PaulC is on a distinguished road
Lea,

In terms of your question about the permissions, the ASP script runs as the user IUSR_xxx and so this user requires the NTFS privileges for the user to read/write to the file. I am not sure on the function of the private folder, it should be used for databases however it seems the IUSR user does not have access by default and so it seems to be usable by only the FTP user.

SWsoft have written their own ISAPI to take care of the password protection, site preview functions, etc.

In terms of security it is better to place it above the httpdocs folder, but that means manually adding permissions for IUSR each and every time. The password protection I would say is secure enough, of course if there is a vulnerability in the SWsoft ISAPI it may remove the security. Also, don't forget that if your script isn't secure it could be compromised to display the data if it was in either location.

Paul
__________________
Paul Carter
eHosting Limited
__________________
Web Host - Certified Member
PaulC is offline   Reply With Quote
Old 30th May 2007   #12 (permalink)
Trusted User (495)
Platinum User
Join Date: Jun 2006
Location: UK
Age: 34
Posts: 486
LeaUK is on a distinguished road
Hi Paul

Quote:
In terms of security it is better to place it above the httpdocs folder
My thoughts exactly, I feel more comfortable now.

Re the folder 'private' -

Quote:
IUSR user does not have access by default and so it seems to be usable by only the FTP user.
Maybe I will configure the default domain structure to include a folder where Access databases can be placed and grant IUSR_xxx permissions automatically. That will save admins/resellers the hassle and therefore reduce my support time also

Again, thanks Paul.

Just one more thing, many a time does the support here beat the Official Plesk forum and several others....cheers all

Lea
__________________
Registered User
LeaUK is offline   Reply With Quote
Old 31st May 2007   #13 (permalink)
I am Staff at
Naglotech
About My Company!


Basic Host
andyb28's Avatar
Join Date: Dec 2004
Location: Essex
Age: 35
Posts: 1,180
andyb28 is on a distinguished road
THIS USER HAS BEEN GAGGED BY THE FORUM HOSTS FOR SPAM OR BREAKING THE RULES...
User will be ungaged in around 78 hours from this post.

__________________
Andy Booth

Naglotech Ltd Webhosting, Colocation, Consultancy
Cybernetic-Servers Game Servers, Dedicated Servers

Company No : 5326296
AS35327
__________________
Web Host - VIP Member
andyb28 is offline   Reply With Quote
Old 31st May 2007   #14 (permalink)
Trusted User (569)
Platinum User
Join Date: Mar 2004
Age: 24
Posts: 544
Cameron Gray is on a distinguished road
In actual fact, when using the DSN-less (code as show above) connections Windows actually creates a volitile DSN in the registry which then gets reaped when not used for x hours. It stil uses ODBC drivers underneath the ADODB objectset.

In a highly DAO oriented site, a pooling driver combined with a DSN is the most efficient classic ASP method.
__________________
Cameron Gray

[Any views expressed on this forum are my own, and may not represent the views of any employer or organisation that I am connected with.]
__________________
Registered User
Cameron Gray is offline   Reply With Quote
Old 31st May 2007   #15 (permalink)
I am Staff at
Naglotech
About My Company!


Basic Host
andyb28's Avatar
Join Date: Dec 2004
Location: Essex
Age: 35
Posts: 1,180
andyb28 is on a distinguished road
THIS USER HAS BEEN GAGGED BY THE FORUM HOSTS FOR SPAM OR BREAKING THE RULES...
User will be ungaged in around 78 hours from this post.

__________________
Andy Booth

Naglotech Ltd Webhosting, Colocation, Consultancy
Cybernetic-Servers Game Servers, Dedicated Servers

Company No : 5326296
AS35327
__________________
Web Host - VIP Member
andyb28 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
HostClub Europe: Value Server with Plesk + all Plesk features StarGate Web Hosting and Related Offers 1 23rd April 2007 12:47 AM
[NEWS] Info Security Product Guide Selects Comodo For 2006 ?Hot Company ... - Help Net Security [NEWS] Hosting and Tech News 0 2nd February 2006 01:06 AM
Databases neilrbowen Business and Technical Advice 24 11th August 2005 06:37 PM


Some great companies!


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0