Re: Writing to an Access database file

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Jeff Cochran (jcochran.nospam_at_naplesgov.com)
Date: 03/25/04


Date: Thu, 25 Mar 2004 13:06:12 GMT

Okay, you have a lot of detail, and most is irrelevant, but here's the
basics:

1) The IUSR account has to have full control of the MDB file *and* the
folder it resides in for the anonymous user to use an Access database
in ASP.

2) The best method for eliminating unauthorized access to the MDB
file is to place it in a folder outside the web root heirarchy (the
\InetPub structure). Use your connection string to point to the
correct database file, files outside the web structure cannot be
browsed or accessed directly by a browser.

Jeff

On Thu, 25 Mar 2004 12:39:58 -0000, "Fran Tirimo" <fween@gmx.co.uk>
wrote:

>I am developing a small website using ASP scripts to format data retrieved
>from an Access database. It will run on a Windows 2003 server supporting
>FrontPage extensions 2002 hosted by the company 1&1 with only limited server
>configuration via a web based control panel.
>
>My query relates to the ASP security model and how it relates to FrontPage
>options for setting file access on a database file. If you know of any
>online documentation covering the following issues I would be grateful for
>links to it.
>
>For various reasons (session logging, synchronising data with a master
>database etc) I need to be able to write data to the database file.
>Essentially the problem is this: how do I make this possible without giving
>public access to the database file?
>
>The 1&1 control panel allows me to set Read/Write/Execute/Delete permissions
>for "IUSR" (I assume to mean annoymous unauthenticated users) and "NETWORK"
>users (I am not sure what this refers to yet).
>
>So far the only way I have managed to write to the database file from an ASP
>script is by using the control panel to set the following IUSR permissions
>on the database file:
>
> Read = true (cannot alter this)
> Write = true
> Execute = true
> Delete = false
>
>I understand that when as ASP script executes, it takes on a "security
>context" corresponding to the user requesting the page. In my case, when an
>annonymous user makes a request that needs to be logged to the database for
>example, the script that performs the logging has annonymous user
>privelages. Therefore for the write to the database to be successful, IUSR
>write permissions must be allowed.
>
>Of course, these permission settings have some undesireable side effects:
>
> 1 - With "Read = true" on the database file for annonymous users means
>that anyone can download the database file.
> 2 - With "Write = true" annonymous users could in theory directly alter
>the database file eg using telnet or some similar method.
>
>I am not sure if this this second point is true...
> - What exactly do annonymous write permissions on a file/directory allow
>to occur?
> - I am not yet sure if the server is set up to ONLY accept HTTP GET and
>POST commands from annonymous users but have contacted the hosting company
>about this.
>
>I may have found a solution to the above issues. As I am using FrontPage to
>publish the site I may be able to take advantage of FP's file permission
>settings by disallowing browsing by annonymous users for the directory
>containg the database file.
>
>What I need to know is whether my suggested solution to the problem really
>prevents anonymous users from downloading/modifying my database file and how
>would I test this?
>
>I assume that I still have to allow IUSR read/write access to the database
>file, given the ASP security issues mentioned above. (Are FP permissions
>considered by the web server instead of or in conjunction with Windows file
>permissions when deciding if access to a resource is to be allowed?)
>
>To check my understanding of FP folder permissions...
>
> - Allow files to be browsed - does this prevent downloading of files in
>the folder as well as preventing folder contents from being viewed from ANY
>HTTP client?
> - Allow scripts to be run - does this refer to annonymous users being
>allowed to view pages generated by scripts within the folder? Or does it
>refer to scripts in other folders access files/data in the said folder?
> - Allow prrograms to be run - this is probably not relevant to me and I
>should probably disallow this option.
>
>Also, I have read that you can create a "hidden" folder in FP just by giving
>it a name beginning with an underscore. Would such a folder allow a script
>to access/write to a dataqbase file? My tests seem to show that the _private
>directory created by default in new FP webs does NOT allow scripts to write
>to files.
>
>Finally, is there any way within an ASP script to assume a more privileged
>security context? For example, would using Sever.Execute to call another
>script containg the code to modify the database use a more privileged
>security context?
>
>Thanks for your help
>
>Francesco Tirimo
>fween@gmx.co.uk
>



Relevant Pages

  • Re: would a GPO have been better?
    ... >> file to all machines on the network with varying levels of success. ... >> interested in finding out how Active Directory GPO's can do it. ... The login script is a WSH ... then opens the database file on the server to compare the ...
    (microsoft.public.win2000.group_policy)
  • Re: a powerful text editor in fmp8.5
    ... choose a database file, choose the ... In FMP 6 Windows, could you script this? ... I guess one should then use a plugin such as 'PDF Manipulator', ...
    (comp.databases.filemaker)
  • Update
    ... I made the Sqlite3 database file using SQLite SPY ( ... the CGI script executes? ... Directory and database file have been chmoded 777. ...
    (perl.beginners)
  • Re: error in attaching database
    ... but I suspect that the database file is corrupt or the ... Can you post your script? ... Jim ... > When we run our attachment script through osql we ...
    (microsoft.public.sqlserver.msde)
  • Re: Synching email on 2 different computers with 1 internet connection?
    ... Only 1 of the computers has an internet ... Right click the Database file (inside the main identity folder) ... Start Entourage and make sure that Office notifications is turned off ...
    (microsoft.public.mac.office.entourage)