Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

How to combine web.config section encryption and the usage of WebConfigModification

$
0
0

Hi,

I have a question about encrypting web.config section that are shared across solutions which might use WebConfigModifications to change the SharePoint web.config.

Currently, I've embedded custom assemblies in my SharePoint solution. These assemblies read configuration items from the web.config so we need elements in the SharePoint web.config. We added those using the WebConfigModification class. No problem so far.

Additionally, we want to encrypt specific sections, because they contain sensitive information. I tested this and encrypted the specific section. SharePoint still worked and my solution still worked. Still no problem so far.

However, when I deactivate features that need to remove entries from that specific encrypted configuration section, the entries are not removed. Also, when I activate features that need to add entries to that specific encrypted configuration section, the entries are added within the section, but besides the encrypted content in that section. In the last case, SharePoint crashes complaining about invalid configuration. Makes sense, since entries exist twice (once encrypted, once unencrypted).

Now we can tackle this issue when it's about sections are specifically created for our application/assemblies, but what if this is about section that are also used by other assemblies/solutions, say "connectionStrings" or "appSettings". Other SharePoint solutions might want to make changes to these sections as well using the WebConfigModification class. Those assemblies might not be able to deal with encrypted sections.

Is there a way to deal with this issue, to be able to encrypt these 'shared' sections without other solutions generating a bunch of errors and crashing?

Thanks in advance for any replies!

Cheers,
Ruud Hunnekens.


Viewing all articles
Browse latest Browse all 11571

Trending Articles