Actions

セキュリティに関するヒント

From LimeSurvey Manual

Revision as of 00:06, 23 July 2018 by Bravehorse (talk | contribs) (Created page with "Windowsサーバーを使用している場合は、管理者フォルダでウェブサーバープロセスの所有者がディレクトリーにファイルを書き込む...")

概要

LimeSurveyはデフォルトで有効になっている独自のセキュリティに依存しています。このソフトウェアの開発者は、このソフトウェアの妥当性またはセキュリティレベルに関して、一切の責任を負いません。しかし、我々はセキュリティ問題を非常に真剣に受け止め、迅速に対応します。したがって、LimeSurveyにセキュリティ上の問題がある場合は、info@limesurvey.orgに電子メールを送信するか、バグトラッカーでバグレポートを提出してください(プライベートとしてマークしてください)。

Linuxのファイル権限

Linuxサーバーを使用している場合は、LimeSureyのインストールを保護するため、ファイルのアクセス権を設定する必要があります。

Linux/*nixにおけるファイル権限の基本

Linux/*nixオペレーティングシステムはマルチユーザーです。これは、あなたの個人アカウントとは別に、システム上に他のユーザーアカウントが存在する可能性があることを意味し、他のユーザーにどのようなアクセス許可を与えるかを管理する必要があります。

ヒント: パスワードのような重要なデータを保持している設定ファイルを安全に保つには、ファイルアクセス権を設定することが特に重要です。

'root'アカウントはスーパー管理ユーザーであるため、ファイルにアクセスするためのアクセス権が常に与えられます(設定したファイルアクセス権に関係なく)。

LimeSurveyを実行しているWebサーバーも特定のID(ユーザー)で実行されています。Linuxでは通常、'www'、'www-data'(Debian / Ubuntu上)、'apache'または'nobody'というユーザーです。しかし、ホスティング業者によっては、あなたの個人ユーザーでLimeSurveyスクリプトを実行できるシステム(suexecなど)を使用しているものもあります。もちろん、ウェブサーバーユーザーは、LimeSurveyファイルに対する読み取り権限が必要です。ただし、LimeSurveyサブディレクトリーのごく一部は、ウェブサーバーユーザーによって書き込み可能である必要があります。

ヒント: ウェブサーバーユーザーの書き込み権限が必要ないLimeSurveyのサブディレクトリーでは、その権限を取り消すことが非常に重要です。仮にLimeSurveyの脆弱性が発見されても、ファイルシステムのアクセス権限によって、メインファイルが不正に変更されることがなくなります、

自己管理型Linuxシステムでのファイルアクセス権の設定

ウェブサーバーとオペレーティングシステムの構成を管理している(物理サーバーの所有者であるか、ルートアクセス権を持つ仮想サーバーを借りている)場合は、以下の推奨事項を検討してください。

最初に、LimeSurveyファイルの所有者とグループを設定して、ファイルのアクセス権限設定を簡略化することができます。例えば、LimeSurveyファイルの所有者を個人のユーザー名に設定し、LimeSurveyファイルのグループをウェブサーバーグループに設定します。通常、このウェブサーバーグループには、ウェブサーバーアカウント(および、場合によって別のウェブマスターアカウント)のみが含まれます。例えば、あなたのユーザー名が'myaccount'で、ウェブサーバーユーザーが'apache'グループの'apache'であれば、シェルアクセスから次のコマンドを使います。$ chown -R myaccount:apache limesurvey/。その後、ファイルとサブディレクトリーのアクセス権限を設定します。

スクリプトが正常に動作するためには、いくつかのディレクトリーへの書き込み権限が必要です。

  • /limesurvey/application/configディレクトリーには、アプリケーションの構成設定を保存するための読み書きの権限が必要です。
  • /limesurvey/tmpディレクトリーとそのサブディレクトリーはインポート/アップロードに使用され、ウェブサーバーが読み書きの権限を持つ必要があります。
  • upload/directoryとそのすべてのサブディレクトリーについても、画像とメディアファイルをアップロードできるようにするため、読み書き権限設定する必要があります。
  • その他のディレクトリーとファイルはすべて読み取り専用に設定します。
ヒント: 所有者/グループについて、上記の推奨事項に従った場合、設定は次のコマンドによって適用できます。

$ chmod -R o-r-w-x limesurvey/

$ chmod -R -w limesurvey/

$ chmod -R 770 limesurvey/application/config

$ chmod -R 770 limesurvey/tmp

$ chmod -R 770 limesurvey/upload

ホストされているウェブサーバーでのファイルアクセス権の設定

ホストされた環境でウェブアプリケーションを保護するための標準的な手順は、ホストされた環境がさまざまな点で異なるため、非常に難しい問題です。

管理されているサーバーの場合、スクリプトが正常に動作するためにはいくつかのディレクトリーへの書き込み権限が必要です。

  • /limesurvey/tmpディレクトリーはインポート/アップロードに使用するため、ウェブサーバーに読み書き権限を設定する必要があります。
  • upload/directoryとそのすべてのサブディレクトリーにも画像/メディアファイルのアップロードを有効にするため、ウェブサーバーに読み書き権限を設定する必要があります。
  • その他のディレクトリーとファイルはすべて読み取り専用に設定します。
ヒント:
  • ウェブサーバーの設定によっては、ウェブサーバーが書き込みを行うフォルダーの権限を755または777に変更する必要があります。最初に755を試してください。動作しない場合は、777にしてください。
  • config.phpへのアクセス権を750にすることにより、他のユーザーのアクセスを制限することができますが、動作しない場合は755と設定します。

Windowsのファイル権限

Windowsサーバーを使用している場合は、管理者フォルダでウェブサーバープロセスの所有者がディレクトリーにファイルを書き込むことができるようにする必要があります。残りのファイルは読み取り専用に設定して実行できます。

Other security issues

The following are recommendations only. LimeSurvey in general is very safe without these additional measures. If you however collect extremely sensitive data, a little additional security can help:

SSL usage

We generally recommend the usage of SSL for sensitive survey data. You usually enable SSL by configuring your web server correctly and using a SSQL certificate. If you have enabled SSL, you should enforce SSL all the time from the global settings of LimeSurvey. Additionally, you could only set to use 'secure' cookies by editing the respective option in config.php.

The access to the config.php file

  You must update application/config/config.php only after the first installation is done and it works.


The /application/config/config.php file contains a user name and password for your database server. This poses certain security issues, particularly if you are using a login that has high level administrative access to your database. In the event of some error returning the content of this PHP file to a user's browser, your database password and other details could be compromised (however, this is a very unlikely scenario). The best way to minimize risk is to set up a specific login that has specific rights only to your LimeSurvey database.

Another way to secure this information can be to put the information from the /application/config/config.php file in a non-web directory, i.e. for Apache users this is the directory above the htdocs (also known as public_html or www) folder. Basically, you will use config.php, but have one line in it - a line that includes the file with ACTUAL configuration information (ex: <?php return include("/home/hostfolder/safedata/configreal.php"); ?>). Remove all actual configuration information from /application/config/config.php and paste it into the other file (configreal.php) that is mentioned in the /application/config/config.php file. This other file should be located in a non-web directory. Then, /application/config/config.php will not contain database passwords etc. - just the name of the file that DOES contain the database info.

This avoids having to change all the other files that include /application/config/config.php, since config.php 're-directs them' towards the configuration file that is located in a non-web directory which includes all the real configuration information. However, you will need to edit configreal.php and change the follow parameters to use absolute directory paths to work properly:

'basePath' => dirname(dirname('''FILE''')),
'runtimePath' => dirname(dirname(dirname('''FILE'''))).DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.'runtime',
[...]

'urlManager' => array(
   [...]
   'rules' => require('routes.php'),
   [...]
);

例:

'basePath' => '/var/www/htdocs/limesurvey',
'runtimePath' => '/var/www/htdocs/limesurvey/tmp/runtime',
[...]

'urlManager' => array(
   [...]
   'rules' => require('/var/www/htdocs/limesurvey/config/routes.php'),
   [...]
);

Also, don't use "admin" as the default user. Go to your MySQL database (or the one in which you installed LimeSurvey) and change default user name "admin" to whatever you prefer (e.g. "admin_xyz"). It will now be much harder to guess the administrator's new user name. Remember, this is one of the two variables intruders can use to gain access. The admin password is the other variable. So choose both of them with extreme caution.