all groups > inetserver asp db > march 2004 >
You're in the

inetserver asp db

group:

Securing documents - SQL Server or FileSystem


Securing documents - SQL Server or FileSystem Marlow
3/31/2004 5:36:07 PM
inetserver asp db: I am writing a .NET web application that provides secure access t
images and files. Basically files/images will be uploaded to th
website (storage method to be determined) by a given user and the
access to the file will be restriced to other specific users base
upon some permissions that are stored in join tables against the fil
meta data records

Currently I am storing the files in the file system with a pointer t
the folder the files reside in. Each folder has a unique hashed name

The problem is that the files are all accessible to anyone if a use
is able to "guess" or otherwise determine the appropriate URL t
retrieve the file. Obviously this is not appropriate for informatio
that must be secure

To resolve this problem I have thought of two methods
1) Store the files in the SQL Database, and have an aspx page th
retrieves the files and checks certain security credentials and th
binarywrites the file to response, o
2) Move the files out of the accessible web published folders, t
another area of the file system, then write a page that checks th
security credentials opens a filestream to the file and writes it int
the Response object (if this is even feasible?)

There are potentially very large files to be uploaded and upwards o
30,000 files. I am aware of the data paging in storing files large
than 8K in SQL. Also there will be several different instances of th
application and database running for different clients but on the sam
servers

Alot of the files will be images that are referenced through
provided DHTML control, many of which will appear on a public websit
and will be accessed very frequently. Which of the above methods woul
provide (in your opinion of course!) the best combination of Securit
and Performance

An example would be that a given file is available from a specifi
online date, until a specific offline date. It must be such that afte
that date the file can no longer be accessed even if the user has th
URL directly through to the specific file. (Currently the HTML conten
that links to the files is taken offline, but not the file
themselves.

Any input appreciated, thanks in advance
Re: Securing documents - SQL Server or FileSystem Aaron Bertrand [MVP]
3/31/2004 8:54:56 PM
I'd go with #2. See http://www.aspfaq.com/2149 for pros and cons of the
options, and http://www.aspfaq.com/2276 for information about using
ADODB.Stream to present images that are not in the web folders.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/





[quoted text, click to view]

Re: Securing documents - SQL Server or FileSystem Aaron Bertrand [MVP]
3/31/2004 8:55:37 PM
Note that your application is only as secure as the filesystem. If a user
can get to the filesystem, then they can access the code that retrieves
images in option 1, or the files themselves in option 2.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/

AddThis Social Bookmark Button