squid のデフォルトではエラーページの表示の際に、ホスト名とバージョン情報を表示してしまう。
この動作はセキュリティ上好ましくない。
できれば隠蔽したい。
squid でホスト名を隠蔽する方法はこちらを参照。
バージョン情報を隠蔽する方法は次の通り。
ちなみに、squid-2.6.STABLE21-6.el5 で動作確認しました。
/etc/squid/squid.conf にて以下を追記する。
設定例
# TAG: httpd_suppress_version_string on|off # Suppress Squid version string info in HTTP headers and HTML error pages. # #Default: # httpd_suppress_version_string off httpd_suppress_version_string on
最後に squid のプロセスを再起動して変更を反映。
/etc/init.d/squid restart
この設定により、アクセス制限でリクエストが拒否された時の エラーページが次のようになりました。
変更前
ERROR The requested URL could not be retrieved -------------------------------------------------------------------------------- While trying to retrieve the URL: http://192.168.1.100/ The following error was encountered: Access Denied. Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect. Your cache administrator is root. -------------------------------------------------------------------------------- Generated Tue, 21 Apr 2009 09:51:19 GMT by squid.example.net (squid/2.5.STABLE14)
↓
変更後
ERROR The requested URL could not be retrieved -------------------------------------------------------------------------------- While trying to retrieve the URL: http://192.168.1.100/ The following error was encountered: Access Denied. Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect. Your cache administrator is root. -------------------------------------------------------------------------------- Generated Tue, 21 Apr 2009 09:52:48 GMT by squid.example.net (squid)