How to secure files and directories in asp.net

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default How to secure files and directories in asp.net

    Hi,

    How can i secure files and directories in asp.net ..... i'm using form based
    authentication to secure my asp.net pages but when any user directly access
    (directly type url address in the webbrowser.) any other file like perl or
    any text file in my application directory it allows user to access that file
    .. how can i secure my directories and other files from being access.

    TIA

    atif


    Atif Iqbal Guest

  2. Similar Questions and Discussions

    1. Secure PDF's merged into 1 document from 2 different Secure Files, possible?
      I have multiple Secured PDF files that I have created. There is a possibility that my end user will need to merge multiple PDF files into 1 main PDF,...
    2. Upload files and directories
      I am in dire need of a script that will upload everything from one server to another one that I can cron. Right now I have to do it by hand and...
    3. including files in other directories
      I have some code running on windows on my local machine that uses the jpgraph image library. I include the jpgraph libs using include...
    4. how to rename 200 files in many sub-directories?
      Hello, I have over 200 zip files in about 100 sub-directories of say c:\docs. Each zip file contains one MS Word doc file. The name of the doc...
    5. Comparing directories and files
      I have directories with sub directories where the same files have been placed in both areas, with differing dates and updates. How can I "compare"...
  3. #2

    Default RE: How to secure files and directories in asp.net

    Atif,

    ASP.NET Forms authentication will only secure content that is processed by
    the aspnet_isapi.dll. If you need to replace other static file types (such
    as text files), you can do that by mapping them to the aspnet_isapi.dll,
    but you'll want to test that fully before deploying it to production apps.
    For perl files, you're out of luck because they have to be processed by the
    perl engine.

    You can also consider having an ASP.NET page that redirects to the URL that
    is passed to it. If the user is not authenticated via Forms auth, the
    request will be denied. If they are, it will be accepted and your ASP.NET
    page can redirect to the correct URL.

    There are many approaches to this problem.

    Jim Cheshire, MCSE, MCSD [MSFT]
    ASP.NET
    Developer Support
    [email]jamesche@online.microsoft.com[/email]

    This post is provided "AS-IS" with no warranties and confers no rights.

    --------------------
    >From: "Atif Iqbal" <iatif@hotmail.com>
    >Subject: How to secure files and directories in asp.net
    >Date: Thu, 1 Apr 2004 11:33:24 +0500
    >Lines: 13
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >Message-ID: <u2Z7DN7FEHA.1912@TK2MSFTNGP10.phx.gbl>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.security
    >NNTP-Posting-Host: lhr63.pie.net.pk 202.125.147.222
    >Path:
    cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTF EED01.phx.gbl!TK2MSFTNGP08
    ..phx.gbl!TK2MSFTNGP10.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl
    microsoft.public.dotnet.framework.aspnet.security: 9466
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.security
    >
    >Hi,
    >
    >How can i secure files and directories in asp.net ..... i'm using form
    based
    >authentication to secure my asp.net pages but when any user directly access
    >(directly type url address in the webbrowser.) any other file like perl or
    >any text file in my application directory it allows user to access that
    file
    >. how can i secure my directories and other files from being access.
    >
    >TIA
    >
    >atif
    >
    >
    >
    Jim Cheshire [MSFT] Guest

  4. #3

    Default Re: How to secure files and directories in asp.net

    Thanx for ur reply

    but there must be a way to secure directories in asp.net .
    can u plz guide me how to secure my directories so that no one can access my
    directories
    without an appropriate previliges. response.redirect is not the solution
    i've used server.transfer
    but it does not support perl files...

    TIA
    Atif



    "Jim Cheshire [MSFT]" <jamesche@online.microsoft.com> wrote in message
    news:GFkbWLCGEHA.1996@cpmsftngxa06.phx.gbl...
    > Atif,
    >
    > ASP.NET Forms authentication will only secure content that is processed by
    > the aspnet_isapi.dll. If you need to replace other static file types
    (such
    > as text files), you can do that by mapping them to the aspnet_isapi.dll,
    > but you'll want to test that fully before deploying it to production apps.
    > For perl files, you're out of luck because they have to be processed by
    the
    > perl engine.
    >
    > You can also consider having an ASP.NET page that redirects to the URL
    that
    > is passed to it. If the user is not authenticated via Forms auth, the
    > request will be denied. If they are, it will be accepted and your ASP.NET
    > page can redirect to the correct URL.
    >
    > There are many approaches to this problem.
    >
    > Jim Cheshire, MCSE, MCSD [MSFT]
    > ASP.NET
    > Developer Support
    > [email]jamesche@online.microsoft.com[/email]
    >
    > This post is provided "AS-IS" with no warranties and confers no rights.
    >
    > --------------------
    > >From: "Atif Iqbal" <iatif@hotmail.com>
    > >Subject: How to secure files and directories in asp.net
    > >Date: Thu, 1 Apr 2004 11:33:24 +0500
    > >Lines: 13
    > >X-Priority: 3
    > >X-MSMail-Priority: Normal
    > >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    > >Message-ID: <u2Z7DN7FEHA.1912@TK2MSFTNGP10.phx.gbl>
    > >Newsgroups: microsoft.public.dotnet.framework.aspnet.security
    > >NNTP-Posting-Host: lhr63.pie.net.pk 202.125.147.222
    > >Path:
    >
    cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTF EED01.phx.gbl!TK2MSFTNGP08
    > phx.gbl!TK2MSFTNGP10.phx.gbl
    > >Xref: cpmsftngxa06.phx.gbl
    > microsoft.public.dotnet.framework.aspnet.security: 9466
    > >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.security
    > >
    > >Hi,
    > >
    > >How can i secure files and directories in asp.net ..... i'm using form
    > based
    > >authentication to secure my asp.net pages but when any user directly
    access
    > >(directly type url address in the webbrowser.) any other file like perl
    or
    > >any text file in my application directory it allows user to access that
    > file
    > >. how can i secure my directories and other files from being access.
    > >
    > >TIA
    > >
    > >atif
    > >
    > >
    > >
    >

    Atif Iqbal Guest

  5. #4

    Default Re: How to secure files and directories in asp.net

    Atif,

    You have to remember that if you are trying to have an ASP.NET specific
    feature protect your content (a feature such as ASP.NET Forms
    authentication), it's only going to work for resources that are parsed
    through the ASP.NET ISAPI filter. If ASP.NET does not process the request,
    it cannot control access to the resource.

    Because of this, you are going to have to use NTFS permissions or some
    other authentication method that you devise to control access to your
    resources.

    Jim Cheshire, MCSE, MCSD [MSFT]
    ASP.NET
    Developer Support
    [email]jamesche@online.microsoft.com[/email]

    This post is provided "AS-IS" with no warranties and confers no rights.

    --------------------
    >From: "Atif Iqbal" <iatif@hotmail.com>
    >References: <u2Z7DN7FEHA.1912@TK2MSFTNGP10.phx.gbl>
    <GFkbWLCGEHA.1996@cpmsftngxa06.phx.gbl>
    >Subject: Re: How to secure files and directories in asp.net
    >Date: Fri, 2 Apr 2004 11:29:34 +0500
    >Lines: 83
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >Message-ID: <#wYyjvHGEHA.1240@TK2MSFTNGP10.phx.gbl>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.security
    >NNTP-Posting-Host: lhr63.pie.net.pk 202.125.147.222
    >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl
    microsoft.public.dotnet.framework.aspnet.security: 9485
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.security
    >
    >Thanx for ur reply
    >
    >but there must be a way to secure directories in asp.net .
    >can u plz guide me how to secure my directories so that no one can access
    my
    >directories
    >without an appropriate previliges. response.redirect is not the solution
    >i've used server.transfer
    >but it does not support perl files...
    >
    >TIA
    >Atif
    >
    >
    >
    >"Jim Cheshire [MSFT]" <jamesche@online.microsoft.com> wrote in message
    >news:GFkbWLCGEHA.1996@cpmsftngxa06.phx.gbl...
    >> Atif,
    >>
    >> ASP.NET Forms authentication will only secure content that is processed
    by
    >> the aspnet_isapi.dll. If you need to replace other static file types
    >(such
    >> as text files), you can do that by mapping them to the aspnet_isapi.dll,
    >> but you'll want to test that fully before deploying it to production
    apps.
    >> For perl files, you're out of luck because they have to be processed by
    >the
    >> perl engine.
    >>
    >> You can also consider having an ASP.NET page that redirects to the URL
    >that
    >> is passed to it. If the user is not authenticated via Forms auth, the
    >> request will be denied. If they are, it will be accepted and your
    ASP.NET
    >> page can redirect to the correct URL.
    >>
    >> There are many approaches to this problem.
    >>
    >> Jim Cheshire, MCSE, MCSD [MSFT]
    >> ASP.NET
    >> Developer Support
    >> [email]jamesche@online.microsoft.com[/email]
    >>
    >> This post is provided "AS-IS" with no warranties and confers no rights.
    >>
    >> --------------------
    >> >From: "Atif Iqbal" <iatif@hotmail.com>
    >> >Subject: How to secure files and directories in asp.net
    >> >Date: Thu, 1 Apr 2004 11:33:24 +0500
    >> >Lines: 13
    >> >X-Priority: 3
    >> >X-MSMail-Priority: Normal
    >> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >> >Message-ID: <u2Z7DN7FEHA.1912@TK2MSFTNGP10.phx.gbl>
    >> >Newsgroups: microsoft.public.dotnet.framework.aspnet.security
    >> >NNTP-Posting-Host: lhr63.pie.net.pk 202.125.147.222
    >> >Path:
    >>
    >cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFT FEED01.phx.gbl!TK2MSFTNGP0
    8
    >> phx.gbl!TK2MSFTNGP10.phx.gbl
    >> >Xref: cpmsftngxa06.phx.gbl
    >> microsoft.public.dotnet.framework.aspnet.security: 9466
    >> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.security
    >> >
    >> >Hi,
    >> >
    >> >How can i secure files and directories in asp.net ..... i'm using form
    >> based
    >> >authentication to secure my asp.net pages but when any user directly
    >access
    >> >(directly type url address in the webbrowser.) any other file like perl
    >or
    >> >any text file in my application directory it allows user to access that
    >> file
    >> >. how can i secure my directories and other files from being access.
    >> >
    >> >TIA
    >> >
    >> >atif
    >> >
    >> >
    >> >
    >>
    >
    >
    >
    Jim Cheshire [MSFT] 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