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.
今回は 「じゃあ具体的に管理者が applicationHost.config に制限をかけたい場合にどのような方法になるのか」 をご案内したいと思います。今回も含め、かなり具体的なエリアに踏み込んでいくのでもちろん製品版とは微妙な記述や仕様変更がある可能性がある点はご容赦、という前提で続けていきます。。。
まずはじめに、.config ファイル内のルールとして <___location></___location> というセクションを書くことができる点から行きましょう。 <___location> は.configファイル階層上のどこのパスの設定かを指定した上でコンフィグレーションを記述指定するセクションです。
例えば ルートのIIS Serverの設定を記述したい場合、元々の<system.webServer> の設定を変更するのではなく、<___location></___location>で囲った範囲に指定したい内容を.configファイルの最後の方に書くような方法が想定されています。つまり、applicationHost.config 内でこんな感じになるという意味です。
<system.webServer>
・・・色々な設定
</system.webServer>
・・・その他コンフィグレーション設定
<___location path="." allowOverride="false">
<system.webServer>
<security>
<authentication>
<windowsAuthentication>
<providers>
<add value="Negotiate" />
<add value="NTLM" />
</providers>
</windowsAuthentication>
</authentication>
</security>
</system.webServer>
</___location>
この記載はつまり、ルートに対して allowOverride を false にすることによって Windows認証のプロバイダー設定を下位の階層で上書きできないようにすることを指定しています。___location + allowOverride 以外にも下記のようなものもあります。こちらは ___locationを使わず、基本的に applicationHost.config の各セクションに直接書くことを想定しています。
●lockAttributes
<windowsAuthentication enabled="true" lockAttributes="enabled" >
ご覧の通り、直前の enabled をロックします。
●lockElements
<windowsAuthentication enabled="true" lockElements="providers" >
<providers>
<add value="Negotiate" />
<add value="NTLM" />
</providers>
</windowsAuthentication>
ご覧の通り、 <providers> の element をロックします。
●lockItem
<windowsAuthentication enabled="true" lockItem="true" >
これは windowsAuthentication そのものをロックします。
●lockAllElementsExcept
<windowsAuthentication enabled="true" lockAllElementsExcept="providers">
これは文字通り”providers だけロックしない”という指定ですね。
ご覧いただいた通り、.config ファイルの各所にロックをかけられるということになります。これで管理者は変更されたくない箇所については鍵をかけておけます。ただ、見れば見るほど、各サーバーの applicationHost.config は開発プロジェクトなり、組織なりで標準を作っておかないとまたまたアプリ移植性(あるサーバーからあるサーバーへのアプリ移植を指してます。)が悪い環境ができてしまう可能性がありますね。
ということで、実際にIIS7をお使いになることが決定したら構成の共通標準を作る方向で考えましょう。今回はこんな感じで終了。
Comments
- Anonymous
January 01, 2003
MSのエバンジェリストの奥主さんがIIS7の設定についてBlogで情報をだされています。
【IIS7】 コンフィグレーションシステム Part I【IIS7】 コンフィグレーションシステム Part...