How to read (non-event log) registry keys as ASP .NET process

Discussion in 'ASP .Net Security' started by rhenders, Oct 7, 2005.

  1. rhenders

    rhenders Guest

    Can someone please outline the required steps to allow the ASPNET user to
    read selected registry keys? Here is what I've tried so far:

    I've created (copied) the DPAPI implementation from MSDN into an assembly
    called DataProtection. This works fine as long as the ASPNET process runs as
    SYSTEM.

    I've created a strong-name for DataProtection.dll and registered it in the
    GAC.

    I've created a key in HKLM\Software using Regedit(32) and granted the ASPNET
    user access to it.

    Regardless, I'm getting the following error:

    System.Security.SecurityException: Requested registry access is not allowed.
    at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
    at ...

    Thanks in advance.
    rhenders, Oct 7, 2005
    #1
    1. Advertising

  2. rhenders

    rhenders Guest

    PS - just in case it's not obvious, I'm looking for a best practice and not a
    solution that exposes ASPNET more than necessary.

    "rhenders" wrote:

    > Can someone please outline the required steps to allow the ASPNET user to
    > read selected registry keys? Here is what I've tried so far:
    >
    > I've created (copied) the DPAPI implementation from MSDN into an assembly
    > called DataProtection. This works fine as long as the ASPNET process runs as
    > SYSTEM.
    >
    > I've created a strong-name for DataProtection.dll and registered it in the
    > GAC.
    >
    > I've created a key in HKLM\Software using Regedit(32) and granted the ASPNET
    > user access to it.
    >
    > Regardless, I'm getting the following error:
    >
    > System.Security.SecurityException: Requested registry access is not allowed.
    > at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
    > at ...
    >
    > Thanks in advance.
    rhenders, Oct 7, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Henrik_the_boss
    Replies:
    0
    Views:
    2,647
    Henrik_the_boss
    Nov 5, 2003
  2. Replies:
    0
    Views:
    748
  3. Leny
    Replies:
    3
    Views:
    16,923
    Daniel
    Feb 1, 2005
  4. Vlatko Duvnjak

    read registry keys

    Vlatko Duvnjak, Apr 7, 2006, in forum: C++
    Replies:
    2
    Views:
    567
    Tomás
    Apr 8, 2006
  5. Tom Wingert
    Replies:
    0
    Views:
    330
    Tom Wingert
    Jan 12, 2006
Loading...

Share This Page