Forms-Based Authentiction and NON ASP.NET Assets

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

  1. #1

    Default Forms-Based Authentiction and NON ASP.NET Assets

    I have a feeling you're gonna say no but, is there any way, with ASP.NET
    Forms-Based Authentication, to protect access to NON ASP.NET objects? For
    example, if I have a directory that has .ASPX files AND, say, JPEG files
    (.jpg), it would appear that if the user has the URL to one of the JPEGs, he
    can still come back any time and download it without being sent to the Login
    page. I assume this is because, for a JPEG file, ASP.NET is not involved at
    all in the whole IIS loop.

    Right?

    Alex
    Alex Maghen Guest

  2. Similar Questions and Discussions

    1. Can a css file be used in a forms based datagrid?
      If so how, that'd be really cool if I could create different color schemes in the css file and have the ability to change them on the fly. Any...
    2. Forms Authentication based on roles.
      HI, I have the following problem. I am making a portal of DJs. The djs must have a Menu, the administrator another menu. I created 2 directories...
    3. Forms based security
      Hi there, In forms based security do I have to arrange pages into subdirectories in order to secure them? I want the public to access my home page...
    4. Forms-based Authentication
      HI I'm using Forms-based Authentication and trying out the example from the book: "ASP.NET Professional Secrets" after downloading the c# code...
    5. Role based opinion needed - Not for app but for assets...
      I have gone through newsgroups and several websites and have a pretty good handle on the role based security and dynamically displaying pages on our...
  3. #2

    Default Re: Forms-Based Authentiction and NON ASP.NET Assets

    Alex,

    you are correct....

    .......5 minutes later

    I found the following, see snippet below, at
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/THCMGlance.asp[/url]

    I have not tested it yet, but it might be possible to add a new verb like:
    <add verb="*" path="*.jpeg" type="System.Web.HttpForbiddenHandler" />

    As I said, not sure if this will work, migth be worth a try.

    If it does not work, you're still correct Alex

    --

    Best regards,
    Geir Aamodt
    geir.aamodt(AT)bekk.no

    ----------------Snippet start----------------
    Map Protected Resources to HttpForbiddenHandler
    HTTP handlers are located in Machine.config beneath the <httpHandlers>
    element. HTTP handlers are responsible for processing Web requests for
    specific file extensions. Remoting should not be enabled on front-end Web
    servers; enable Remoting only on middle-tier application servers that are
    isolated from the Internet.

    a.. The following file extensions are mapped in Machine.config to HTTP
    handlers:
    b.. .aspx is used for ASP.NET pages.
    c.. .rem and .soap are used for Remoting.
    d.. .asmx is used for Web Services.
    e.. .asax, .ascx, .config, .cs, .csproj, .vb, .vbproj, .webinfo, .asp,
    ..licx, .resx, and .resources are protected resources and are mapped to
    System.Web.HttpForbiddenHandler.
    For .NET Framework resources, if you do not use a file extension, then map
    the extension to System.Web.HttpForbiddenHandler in Machine.config, as shown
    in the following example:

    <add verb="*" path="*.vbproj" type="System.Web.HttpForbiddenHandler" />
    In this case, the .vbproj file extension is mapped to
    System.Web.HttpForbiddenHandler. If a client requests a path that ends with
    ..vbproj, then ASP.NET returns a message that states "This type of page is
    not served."

    The following guidelines apply to handling .NET Framework file extensions:

    a.. Map extensions you do not use to HttpForbiddenHandler. If you do not
    serve ASP.NET pages, then map .aspx to HttpForbiddenHandler. If you do not
    use Web Services, then map .asmx to HttpForbiddenHandler.
    b.. Disable Remoting on Internet-facing Web servers. Map remoting
    extensions (.soap and .rem) on Internet-facing Web servers to
    HttpForbiddenHandler.
    ----------------Snippet end----------------



    "Alex Maghen" <AlexMaghen@discussions.microsoft.com> wrote in message
    news:CEF1ED71-DA8E-4A9F-B70F-3FA4E537FBBE@microsoft.com...
    >I have a feeling you're gonna say no but, is there any way, with ASP.NET
    > Forms-Based Authentication, to protect access to NON ASP.NET objects? For
    > example, if I have a directory that has .ASPX files AND, say, JPEG files
    > (.jpg), it would appear that if the user has the URL to one of the JPEGs,
    > he
    > can still come back any time and download it without being sent to the
    > Login
    > page. I assume this is because, for a JPEG file, ASP.NET is not involved
    > at
    > all in the whole IIS loop.
    >
    > Right?
    >
    > Alex

    Geir Aamodt Guest

  4. #3

    Default Re: Forms-Based Authentiction and NON ASP.NET Assets

    On 20 Feb 2005, "=?Utf-8?B?QWxleCBNYWdoZW4=?="
    <AlexMaghen@discussions.microsoft.com> postulated in news:CEF1ED71-
    [email]DA8E-4A9F-B70F-3FA4E537FBBE@microsoft.com[/email]:
    > I have a feeling you're gonna say no but, is there any way, with
    ASP.NET
    > Forms-Based Authentication, to protect access to NON ASP.NET objects?
    For
    > example, if I have a directory that has .ASPX files AND, say, JPEG
    files
    > (.jpg), it would appear that if the user has the URL to one of the
    JPEGs, he
    > can still come back any time and download it without being sent to
    the Login
    > page. I assume this is because, for a JPEG file, ASP.NET is not
    involved at
    > all in the whole IIS loop.
    >
    > Right?
    >
    > Alex
    It's an interesting problem that I may have to solve myself for access
    to other types of files, like PDFs, in a pay-for-access document
    control system I need to design for a client.

    IIS and Windows ACLS determine who gets access to a website folder.

    You'd have to investigate impersonation in ASP.NET, but I can imagine a
    design where the default IIS account doesn't have access to JPG files
    in a certain folder, but the entity impersonated by your ASP.NET app
    does.

    Another approach might be through ISAPI filters, though these are
    different with IIS6.0 and IIS5.1 and I'd have to solve the problem on
    two different platforms.

    Is this a real problem you're trying to solve, or are you just what-if-
    ing.

    -- ipgrunt
    IPGrunt Guest

  5. #4

    Default Re: Forms-Based Authentiction and NON ASP.NET Assets

    If these objects/files are sensitive, the safest way to store them is
    "database" in the form of "image". I do this for documents and images. They
    work OK.

    John

    "Alex Maghen" <AlexMaghen@discussions.microsoft.com> wrote in message
    news:CEF1ED71-DA8E-4A9F-B70F-3FA4E537FBBE@microsoft.com...
    >I have a feeling you're gonna say no but, is there any way, with ASP.NET
    > Forms-Based Authentication, to protect access to NON ASP.NET objects? For
    > example, if I have a directory that has .ASPX files AND, say, JPEG files
    > (.jpg), it would appear that if the user has the URL to one of the JPEGs,
    > he
    > can still come back any time and download it without being sent to the
    > Login
    > page. I assume this is because, for a JPEG file, ASP.NET is not involved
    > at
    > all in the whole IIS loop.
    >
    > Right?
    >
    > Alex

    WJ Guest

  6. #5

    Default Re: Forms-Based Authentiction and NON ASP.NET Assets

    Hi,

    You can use Forms Authentication and deny access to PDF and for that matter
    any static files that are handled by IIS with a simple configuration of the
    IIS Configuration Manager settings.

    Please check
    [url]http://aspnet_harish.blogspot.com/2004/07/securing-pdfs-docs-in-forms.html[/url]

    Thanks.

    "IPGrunt" wrote:
    > On 20 Feb 2005, "=?Utf-8?B?QWxleCBNYWdoZW4=?="
    > <AlexMaghen@discussions.microsoft.com> postulated in news:CEF1ED71-
    > [email]DA8E-4A9F-B70F-3FA4E537FBBE@microsoft.com[/email]:
    >
    > > I have a feeling you're gonna say no but, is there any way, with
    > ASP.NET
    > > Forms-Based Authentication, to protect access to NON ASP.NET objects?
    > For
    > > example, if I have a directory that has .ASPX files AND, say, JPEG
    > files
    > > (.jpg), it would appear that if the user has the URL to one of the
    > JPEGs, he
    > > can still come back any time and download it without being sent to
    > the Login
    > > page. I assume this is because, for a JPEG file, ASP.NET is not
    > involved at
    > > all in the whole IIS loop.
    > >
    > > Right?
    > >
    > > Alex
    >
    > It's an interesting problem that I may have to solve myself for access
    > to other types of files, like PDFs, in a pay-for-access document
    > control system I need to design for a client.
    >
    > IIS and Windows ACLS determine who gets access to a website folder.
    >
    > You'd have to investigate impersonation in ASP.NET, but I can imagine a
    > design where the default IIS account doesn't have access to JPG files
    > in a certain folder, but the entity impersonated by your ASP.NET app
    > does.
    >
    > Another approach might be through ISAPI filters, though these are
    > different with IIS6.0 and IIS5.1 and I'd have to solve the problem on
    > two different platforms.
    >
    > Is this a real problem you're trying to solve, or are you just what-if-
    > ing.
    >
    > -- ipgrunt
    >
    ranganh 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