Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
ちょっと間が空いてしまいましたが、再開します。
今回は xml ファイルになっているコンフィグレーションを暗号化する方法について触れましょう。ApplicationHost.config を例に行くと、例えば <connectionStrings> を追加します。今まで書いている <system.webServer> 外の指定になります。
あくまでもサンプルですが、こんな感じの記述を追加するとします。
<connectionStrings>
<add name="RemoteSqlServer" connectionString="data source=127.0.0.1;Integrated Security=SSPI;Initial Catalog=aspnetdb" providerName="System.Data.SqlClient" />
<add name="AccessFileName" connectionString="~\App_Data\ASPNetDB.mdb" providerName="System.Data.OleDb" />
</connectionStrings>
.NETフレームワークのフォルダへ行きます。
%windir% \Microsoft.NET\Framework\version
aspnet_regiis –pe connectionStrings –app /app
/appの仮想ディレクトリにある web.config のセクション暗号化を行う指定がこれになります。
<protectedData>
<protectedDataSections>
<add name="connectionStrings" provider="DataProtectionConfigurationProvider" inheritedByChildren="false" />
</protectedDataSections>
</protectedData>
<connectionStrings>
<EncryptedData>
<CipherData>
<CipherValue>AQAAANN.......CMD/Cl+sBdA</CipherValue>
</CipherData>
</EncryptedData>
</connectionStrings>
という具合に protectedData セクションに書かれるとともにCipherValueということで暗号化されるという仕組みになってます。ツールは以上のように aspnet_regiis を使用します。
暗号化する仕組みも用意されているというご紹介でした。もう少し細かい単位での話しはまた改めて書こうかなと思います。
Comments
- Anonymous
January 01, 2003
MSのエバンジェリストの奥主さんがIIS7の設定についてBlogで情報をだされています。
【IIS7】 コンフィグレーションシステム Part I【IIS7】 コンフィグレーションシステム Part... - Anonymous
February 28, 2006
ええっと。訂正。
流れを読んでいくとなんか変ですよね。そうこの例はApplicationHost.configではなく、/app にあるweb.config にセクションを追加するストーリーです。謹んで訂正です。