Securing documents - SQL Server or FileSystem

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Securing documents - SQL Server or FileSystem

    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

    Marlow Guest

  2. Similar Questions and Discussions

    1. Indexing Documents on Server
      The content pages on our website are located in a database. The documents referenced in this pages are located on a disk. We have a directory that...
    2. OT: Securing a MySQL Server on Windows
      Greetings, MySQL Developer zone has published an excellent article on Securing a MySQL Server on Windows: <...
    3. Coverting Indesign 2.0 documents to Microsoft Word xp documents
      How would you go about converting indesign documents to microsoft word documents? Is there a way to convert them? Thanks for any help that you can...
    4. Securing a Unix Server
      A new document about Unix security can be downloaded from http://www.edu.physics.uoc.gr/Docs/manuals/info/Securing_a_Unix_Server.ps (add .gz for...
    5. Securing a Debian server
      Hi there We're thinking about starting to use Debian instead of RH on our Linux boxes and I have a question concerning this. RH offers to check...
  3. #2

    Default Re: Securing documents - SQL Server or FileSystem

    I'd go with #2. See [url]http://www.aspfaq.com/2149[/url] for pros and cons of the
    options, and [url]http://www.aspfaq.com/2276[/url] for information about using
    ADODB.Stream to present images that are not in the web folders.

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





    "Marlow" <anonymous@discussions.microsoft.com> wrote in message
    news:0538D328-ABC3-4099-AFA1-07F79374B944@microsoft.com...
    >I am writing a .NET web application that provides secure access to
    > images and files. Basically files/images will be uploaded to the
    > website (storage method to be determined) by a given user and then
    > access to the file will be restriced to other specific users based
    > upon some permissions that are stored in join tables against the file
    > meta data records.
    >
    > Currently I am storing the files in the file system with a pointer to
    > 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 user
    > is able to "guess" or otherwise determine the appropriate URL to
    > retrieve the file. Obviously this is not appropriate for information
    > 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 the
    > retrieves the files and checks certain security credentials and the
    > binarywrites the file to response, or
    > 2) Move the files out of the accessible web published folders, to
    > another area of the file system, then write a page that checks the
    > security credentials opens a filestream to the file and writes it into
    > the Response object (if this is even feasible?).
    >
    > There are potentially very large files to be uploaded and upwards of
    > 30,000 files. I am aware of the data paging in storing files larger
    > than 8K in SQL. Also there will be several different instances of the
    > application and database running for different clients but on the same
    > servers.
    >
    > Alot of the files will be images that are referenced through a
    > provided DHTML control, many of which will appear on a public website
    > and will be accessed very frequently. Which of the above methods would
    > provide (in your opinion of course!) the best combination of Security
    > and Performance?
    >
    > An example would be that a given file is available from a specific
    > online date, until a specific offline date. It must be such that after
    > that date the file can no longer be accessed even if the user has the
    > URL directly through to the specific file. (Currently the HTML content
    > that links to the files is taken offline, but not the files
    > themselves.)
    >
    > Any input appreciated, thanks in advance.
    >

    Aaron Bertrand [MVP] Guest

  4. #3

    Default Re: Securing documents - SQL Server or FileSystem

    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
    [url]http://www.aspfaq.com/[/url]


    Aaron Bertrand [MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139