Again: Protecting ConnectionString in web.config

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

  1. #1

    Default Again: Protecting ConnectionString in web.config

    Hi,

    Today, i met a problem from my boss: how to protect the connection
    string in web.config
    if there's a cracker gain full control of the win server that IIS
    located?

    At first, he said plaintext is unacceptable. After some searching, i
    reported some
    solution:

    I said store it in registry, my boss ask: he can read it though
    regedit

    I said the encrypt/decrypt connection string method that widely found
    from
    Internet, he ask: if cracker trace the program, he can property
    decrypt it programmetcialy. The same, hardcode the string in a dll is
    also
    banned.

    I said window auth of sqlserver 2000, he ask: if cracker gain full
    control,
    this is useless.

    After that, i counter: if a cracker gain full control of the server,
    any protection
    is already useless.

    He said: IIS is easily being attack, so we must think of such a
    situration.

    At last, i want to ask: why you choose ASP.NET that must bind on IIS
    even you
    have such concern????? but i had not.

    I m not trying to talk about the vulnerablily of IIS, but this is real
    talking
    from my boss.... anyway, any solution or comment on this silly
    conversation
    are welcome.


    Thank you very much
    bigMAC Guest

  2. Similar Questions and Discussions

    1. connectionstring in MX7?
      Hi, It seams that the connectionstring attribute of CFQUERY has been removed in MX7. Is this correct. What does I do instead when I want to...
    2. Error loading XML file c:\windows\microsoft.net\framework\v1.0.3705\Config\machine.config
      I had many ASP.NET web applications that I created before I had to rebuild my machine. After a fresh install of XP Pro, VS.NET 2003, etc, I now...
    3. HELP Generating ConnectionString Property from the Designer
      This functionality is implemented in the SQLConnection control in the connectionstring property. I am Building a custom control from an inherited...
    4. config file: a) what Module ? b) conditionals in config (for multiple hosts)
      Hi, a) I am looking for a module to handle config files. There are a number of these modules, like AppCconig. Any consensus about The Right...
    5. [RCR] Include CONFIG::Config['rubydocdir'] in rbconfig.rb
      Hi folks, I apologise if people have read this RCR and are not interested, but this is what I consider to be an important RCR, not a merely...
  3. #2

    Default Re: Again: Protecting ConnectionString in web.config

    The most secure way is to use Windows authentication, so you don't have a
    connection string.

    If you must use SQL Authentication, then look into the command line utility
    aspnet_setreg, which will encrypt and store in the registry (using strong
    ACLs) the connection string.

    The bottom line: the aspnet_wp process must be able to decrypt the
    connection string if it intends to pass it. If your box is compromised to
    the point where the attacker can do anything the aspnet_wp process can do,
    then they can read it, but that goes without saying. The only way to prevent
    an attacker who has compromised a system to that level is to not have
    anything valuable stored at all. So, you can mitigate the damages by having
    that connection string provide you with only the access that you need for
    that one application to run. Denydatareader and denydatawriter, and give
    execute permissions on only those stored procedures that you need to access
    to make the application run, so the attacker can do nothing more than make
    the application do what it would be doing anyway.

    --
    Chris Jackson
    Software Engineer
    Microsoft MVP - Windows Client
    Windows XP Associate Expert
    --
    More people read the newsgroups than read my email.
    Reply to the newsgroup for a faster response.
    (Control-G using Outlook Express)
    --

    "bigMAC" <tylun_guy@hotmail.com> wrote in message
    news:ca8ae5c3.0312011823.5e9212d@posting.google.co m...
    > Hi,
    >
    > Today, i met a problem from my boss: how to protect the connection
    > string in web.config
    > if there's a cracker gain full control of the win server that IIS
    > located?
    >
    > At first, he said plaintext is unacceptable. After some searching, i
    > reported some
    > solution:
    >
    > I said store it in registry, my boss ask: he can read it though
    > regedit
    >
    > I said the encrypt/decrypt connection string method that widely found
    > from
    > Internet, he ask: if cracker trace the program, he can property
    > decrypt it programmetcialy. The same, hardcode the string in a dll is
    > also
    > banned.
    >
    > I said window auth of sqlserver 2000, he ask: if cracker gain full
    > control,
    > this is useless.
    >
    > After that, i counter: if a cracker gain full control of the server,
    > any protection
    > is already useless.
    >
    > He said: IIS is easily being attack, so we must think of such a
    > situration.
    >
    > At last, i want to ask: why you choose ASP.NET that must bind on IIS
    > even you
    > have such concern????? but i had not.
    >
    > I m not trying to talk about the vulnerablily of IIS, but this is real
    > talking
    > from my boss.... anyway, any solution or comment on this silly
    > conversation
    > are welcome.
    >
    >
    > Thank you very much

    Chris Jackson Guest

  4. #3

    Default Re: Again: Protecting ConnectionString in web.config

    Check out the article "Safeguard Database Connection Strings and Other
    Sensitive Settings in Your Code" at
    [url]http://msdn.microsoft.com/msdnmag/issues/03/11/ProtectYourData/default.aspx[/url].
    It may give you some ideas.

    Alek

    "bigMAC" <tylun_guy@hotmail.com> wrote in message
    news:ca8ae5c3.0312011823.5e9212d@posting.google.co m...
    > Hi,
    >
    > Today, i met a problem from my boss: how to protect the connection
    > string in web.config
    > if there's a cracker gain full control of the win server that IIS
    > located?
    >
    > At first, he said plaintext is unacceptable. After some searching, i
    > reported some
    > solution:
    >
    > I said store it in registry, my boss ask: he can read it though
    > regedit
    >
    > I said the encrypt/decrypt connection string method that widely found
    > from
    > Internet, he ask: if cracker trace the program, he can property
    > decrypt it programmetcialy. The same, hardcode the string in a dll is
    > also
    > banned.
    >
    > I said window auth of sqlserver 2000, he ask: if cracker gain full
    > control,
    > this is useless.
    >
    > After that, i counter: if a cracker gain full control of the server,
    > any protection
    > is already useless.
    >
    > He said: IIS is easily being attack, so we must think of such a
    > situration.
    >
    > At last, i want to ask: why you choose ASP.NET that must bind on IIS
    > even you
    > have such concern????? but i had not.
    >
    > I m not trying to talk about the vulnerablily of IIS, but this is real
    > talking
    > from my boss.... anyway, any solution or comment on this silly
    > conversation
    > are welcome.
    >
    >
    > Thank you very much

    Alek Davis 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