Cannot encrypt custom section in web.config

Discussion in 'ASP .Net Security' started by mnowosad, Dec 8, 2006.

  1. mnowosad

    mnowosad Guest

    This problem has become a "show-stopper" for us.
    I have defined a custom section for my web application that contains
    sensitive data. Because of that, I want to have it encrypted in the same way
    I encrypt the "connectionStrings" section using the ASPNET_REGIIS tool.

    The problem is that I get an error saying that the ASPNET_REGIIS tool can't
    find the assembly file that contains my custom section.

    My custom section is coded like that:

    public class MyCustomSection : ConfigurationSection
    {
    }

    And declared like that in the web.config:

    <configSections>
    <section
    name="myCustomSection"
    type=" MyNamespace.MyCustomSection, MyAssembly"
    allowLocation="false"
    allowDefinition="MachineToApplication"/>
    </configSections>

    <myCustomSection>
    <-- My elements with sensitive data comes here -->
    </myCustomSection>

    My questions are:

    1) Why ASPNET_REGIIS cannot encrypt my custom section?

    2) Why ASPNET_REGIIS is probing for the assembly where MyCustomSection was
    declared? Isn't the tool just supposed to encrypt the text inside the custom
    section?

    3) If it needs the assembly where MyCustomSection was declared, how can I
    make it find it? Installing the assembly into the GAC is not an option we
    can do in our project.

    Thanks for the help,
    Marcos
     
    mnowosad, Dec 8, 2006
    #1
    1. Advertising

  2. mnowosad

    Guest

    I'm also facing the same issue. Did u get any reply on this or have u come across a solution to this problem. I'm really stuck on this problem.
    ---
    Posted via DotNetSlackers.com
     
    , Dec 18, 2006
    #2
    1. Advertising

  3. in which assembly is your custom section?

    app_code?
    /bin
    or GAC ?


    -----
    Dominick Baier (http://www.leastprivilege.com)

    > This problem has become a "show-stopper" for us.
    > I have defined a custom section for my web application that contains
    > sensitive data. Because of that, I want to have it encrypted in the
    > same way
    > I encrypt the "connectionStrings" section using the ASPNET_REGIIS
    > tool.
    > The problem is that I get an error saying that the ASPNET_REGIIS tool
    > can't find the assembly file that contains my custom section.
    >
    > My custom section is coded like that:
    >
    > public class MyCustomSection : ConfigurationSection
    > {
    > }
    > And declared like that in the web.config:
    >
    > <configSections>
    > <section
    > name="myCustomSection"
    > type=" MyNamespace.MyCustomSection, MyAssembly"
    > allowLocation="false"
    > allowDefinition="MachineToApplication"/>
    > </configSections>
    > <myCustomSection>
    > <-- My elements with sensitive data comes here -->
    > </myCustomSection>
    > My questions are:
    >
    > 1) Why ASPNET_REGIIS cannot encrypt my custom section?
    >
    > 2) Why ASPNET_REGIIS is probing for the assembly where MyCustomSection
    > was declared? Isn't the tool just supposed to encrypt the text inside
    > the custom section?
    >
    > 3) If it needs the assembly where MyCustomSection was declared, how
    > can I make it find it? Installing the assembly into the GAC is not an
    > option we can do in our project.
    >
    > Thanks for the help,
    > Marcos
     
    Dominick Baier, Dec 18, 2006
    #3
  4. mnowosad

    mnowosad Guest

    The custom section class is defined in an assembly that is in the /bin
    folder.
    Putting our libraries in the GAC is not an allowed option for this
    particular project, due to the policy of the web hosting company we are using.

    Marcos

    "Dominick Baier" wrote:

    > in which assembly is your custom section?
    >
    > app_code?
    > /bin
    > or GAC ?
    >
    >
    > -----
    > Dominick Baier (http://www.leastprivilege.com)
    >
    > > This problem has become a "show-stopper" for us.
    > > I have defined a custom section for my web application that contains
    > > sensitive data. Because of that, I want to have it encrypted in the
    > > same way
    > > I encrypt the "connectionStrings" section using the ASPNET_REGIIS
    > > tool.
    > > The problem is that I get an error saying that the ASPNET_REGIIS tool
    > > can't find the assembly file that contains my custom section.
    > >
    > > My custom section is coded like that:
    > >
    > > public class MyCustomSection : ConfigurationSection
    > > {
    > > }
    > > And declared like that in the web.config:
    > >
    > > <configSections>
    > > <section
    > > name="myCustomSection"
    > > type=" MyNamespace.MyCustomSection, MyAssembly"
    > > allowLocation="false"
    > > allowDefinition="MachineToApplication"/>
    > > </configSections>
    > > <myCustomSection>
    > > <-- My elements with sensitive data comes here -->
    > > </myCustomSection>
    > > My questions are:
    > >
    > > 1) Why ASPNET_REGIIS cannot encrypt my custom section?
    > >
    > > 2) Why ASPNET_REGIIS is probing for the assembly where MyCustomSection
    > > was declared? Isn't the tool just supposed to encrypt the text inside
    > > the custom section?
    > >
    > > 3) If it needs the assembly where MyCustomSection was declared, how
    > > can I make it find it? Installing the assembly into the GAC is not an
    > > option we can do in our project.
    > >
    > > Thanks for the help,
    > > Marcos

    >
    >
    >
     
    mnowosad, Dec 19, 2006
    #4
    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. =?Utf-8?B?bW5vd29zYWQ=?=

    Cannot encrypt a custom section in the configuration file

    =?Utf-8?B?bW5vd29zYWQ=?=, Dec 8, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    366
    =?Utf-8?B?bW5vd29zYWQ=?=
    Dec 8, 2006
  2. =?Utf-8?B?VGVycnkgSG9sbGFuZA==?=

    encrypt smpt section of web config

    =?Utf-8?B?VGVycnkgSG9sbGFuZA==?=, Oct 1, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    447
    =?Utf-8?B?VGVycnkgSG9sbGFuZA==?=
    Oct 1, 2007
  3. MichaelS
    Replies:
    0
    Views:
    430
    MichaelS
    Nov 22, 2006
  4. Anil G
    Replies:
    1
    Views:
    122
    Randy Webb
    Jan 20, 2007
  5. kampy
    Replies:
    9
    Views:
    351
    Steven D'Aprano
    Oct 19, 2012
Loading...

Share This Page