Write access to web.config

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

  1. #1

    Default Write access to web.config

    What are the security risks to grant ASP.NET user write access to web.config?
    I am working on a project in which I am required to update web.config at the
    runtime, basically modifying access to different directories.

    Any suggestion will be greatly appreciated.

    Thanks
    Asim Guest

  2. Similar Questions and Discussions

    1. Can you re-write SQL for Access
      I need the following code to work for MS Access. It is writen for a SQL database. Does anybody know how to make it work. I am stumped? Specifically...
    2. Please help with iis/asp.net config for anonymous access.
      Is this a virtual directory on a network share? Have you supplied the correct crendentials when setting up the virtual directory? If this is not on...
    3. web.config access problem
      I'm trying to set up an application so that on first run/install it writes to the web.config various values. I have loaded the web.config into an...
    4. Write Access to Access DataBase
      I'm trying to update a Access Database from information gained from a ASPX page. The database will not update. I'm sure it is in some security...
    5. Access to config file
      I'm writing C# ASP.NET application. For different parts of application I wrote different config files. When I was transferred files from my office...
  3. #2

    Default Write access to web.config

    in short : don't do it

    or..

    it is not a good choice to modify web.config because

    - your opening up to all kind of other security issues if your worker process has write access to web.config (thats a defense in depth measure) - then you have to be VERY shure that the rest of your app is based on rock-solid code

    - your asp.net app will restart everytime you modify web.config

    if you really want to modify web.config - refactor out that code - package it in a serviced component (com+) and give this component a seperate identity which is allowed to modify web.config -

    but my suggestion would be :

    there is an event in the http pipeline of asp.net that's specifically made for this purpose - AuthorizeRequest - there you can plug in your code to programmatically decide who is authorized or not (from an alternate data store like an xml file or db)

    don't mess with web.config (and its dacls) !



    ---
    Dominick Baier - DevelopMentor
    [url]http://www.leastprivilege.com[/url]

    nntp://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.security/<0DFAA11D-A929-4BD0-9548-0EDEF6805E84@microsoft.com>

    What are the security risks to grant ASP.NET user write access to web.config?
    I am working on a project in which I am required to update web.config at the
    runtime, basically modifying access to different directories.

    Any suggestion will be greatly appreciated.

    Thanks

    [microsoft.public.dotnet.framework.aspnet.security]
    Dominick Baier Guest

  4. #3

    Default Re: Write access to web.config

    Hi Asim,

    There are certainly serious security risks in doing this. You might want to
    consider storing the configuration information in some other place like a
    database rather than the web.config.

    I'd also worry about performance problems because whenever you change the
    web.config, the Web application resets and will want to recompile.

    Ken

    "Asim" <Asim@discussions.microsoft.com> wrote in message
    news:0DFAA11D-A929-4BD0-9548-0EDEF6805E84@microsoft.com...
    > What are the security risks to grant ASP.NET user write access to
    > web.config?
    > I am working on a project in which I am required to update web.config at
    > the
    > runtime, basically modifying access to different directories.
    >
    > Any suggestion will be greatly appreciated.
    >
    > Thanks
    Ken Cox [Microsoft MVP] Guest

  5. #4

    Default Re: Write access to web.config

    Asim..
    I don't advice updating or modifying web.config files at anytime UNLESS
    u need to do so..
    GDLUCK
    Patrick



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Olurotimi Ige 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