Actions

Installation security hints/ja: Difference between revisions

From LimeSurvey Manual

(Created page with "Linuxサーバーを使用している場合は、LimeSureyのインストールを保護するため、ファイルのアクセス権を設定する必要があります。")
No edit summary
 
(39 intermediate revisions by 3 users not shown)
Line 5: Line 5:


LimeSurveyはデフォルトで有効になっている独自のセキュリティに依存しています。このソフトウェアの開発者は、このソフトウェアの妥当性またはセキュリティレベルに関して、一切の責任を負いません。しかし、我々はセキュリティ問題を非常に真剣に受け止め、迅速に対応します。したがって、LimeSurveyにセキュリティ上の問題がある場合は、[mailto:info@limesurvey.org info@limesurvey.org]に電子メールを送信するか、[http://bugs.limesurvey.org バグトラッカー]でバグレポートを提出してください(プライベートとしてマークしてください)。
LimeSurveyはデフォルトで有効になっている独自のセキュリティに依存しています。このソフトウェアの開発者は、このソフトウェアの妥当性またはセキュリティレベルに関して、一切の責任を負いません。しかし、我々はセキュリティ問題を非常に真剣に受け止め、迅速に対応します。したがって、LimeSurveyにセキュリティ上の問題がある場合は、[mailto:info@limesurvey.org info@limesurvey.org]に電子メールを送信するか、[http://bugs.limesurvey.org バグトラッカー]でバグレポートを提出してください(プライベートとしてマークしてください)。
==Webサーバーの制限==
Apacheを使用する場合、LimeSurverは制限のために別のhtaccessファイルを使用します。<code>AllowOverride</code>によってhtaccessが使用できるようになっているか確認してください。
他のウェブサーバーまたは<code>AllowOverride None</code>を使用したい場合は、以下のようにすべきです。
* (任意)application、protected、framework、themes/*/viewsにあるすべてのアクセスを不可にする
* ユーザーによる /upload/surveys/.*/fu_[a-z0-9] へのアップロードを不可にする
* (任意)uploadディレクトリーの実行可能ファイルへのアクセスを不可にする
nginxのサンプルは[[General_FAQ/ja#nginx_webserver.E3.81.AE.E4.BD.BF.E7.94.A8|よくある質問]]にあります。


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


===Basic facts about Linux/*nix file permissions===
===Linux/*nixにおけるファイル権限の基本===


A Linux/*nix operating system is multi-user. This means that, apart from your personal account, other user accounts may exist on the system and you should take care of what permissions you give to other users.
Linux/*nixオペレーティングシステムはマルチユーザーです。これは、あなたの個人アカウントとは別に、システム上に他のユーザーアカウントが存在する可能性があることを意味し、他のユーザーにどのようなアクセス許可を与えるかを管理する必要があります。


<div class="simplebox">[[File:help.png]] '''Hint:''' setting file permissions is especially important in order to secure configuration files holding critical data such as passwords.</div>
<div class="simplebox">[[File:help.png]] '''ヒント:''' パスワードのような重要なデータを保持している設定ファイルを安全に保つには、ファイルアクセス権を設定することが特に重要です。</div>


'''Bear in mind that the 'root' account will always be granted permission to access your files (no matter what file permissions you set) as it is the super-admin user.'''
''''root'アカウントはスーパー管理ユーザーであるため、ファイルにアクセスするためのアクセス権が常に与えられます(設定したファイルアクセス権に関係なく)。'''


The web server (which runs LimeSurvey) is also running under a given identity (user). On Linux, this is usually the 'www', 'www-data' (on Debian/Ubuntu), 'apache' or 'nobody' user. However, some hosting companies use systems (such as suexec) that make it possible to run LimeSurvey scripts with your personal user. Of course, the web server user must have the right to read LimeSurvey files. However, only a small subset of LimeSurvey sub-directories must be writable by the web server user.
LimeSurveyを実行しているWebサーバーも特定のID(ユーザー)で実行されています。Linuxでは通常、'www''www-data'(Debian / Ubuntu上)、'apache'または'nobody'というユーザーです。しかし、ホスティング業者によっては、あなたの個人ユーザーでLimeSurveyスクリプトを実行できるシステム(suexecなど)を使用しているものもあります。もちろん、ウェブサーバーユーザーは、LimeSurveyファイルに対する読み取り権限が必要です。ただし、LimeSurveyサブディレクトリーのごく一部は、ウェブサーバーユーザーによって書き込み可能である必要があります。


<div class="simplebox">[[File:help.png]] '''Hint''': it is very valuable to revoke write permission for the web server user to these LimeSurvey sub-directories that do not require it. Indeed, even if a LimeSurvey vulnerability might be discovered, the main files will still be protected from an illicit modification thanks to the file system permissions.</div>
<div class="simplebox">[[File:help.png]] '''ヒント''': ウェブサーバーユーザーの書き込み権限が必要ないLimeSurveyのサブディレクトリーでは、その権限を取り消すことが非常に重要です。仮にLimeSurveyの脆弱性が発見されても、ファイルシステムのアクセス権限によって、メインファイルが不正に変更されることがなくなります、</div>


===Setting file permissions on a self-managed Linux system===
===自己管理型Linuxシステムでのファイルアクセス権の設定===


If you're managing your web server and operating system configuration (you are the owner of the physical server or are renting a virtual server on which you have root access), you may consider the following recommendations from below.
ウェブサーバーとオペレーティングシステムの構成を管理している(物理サーバーの所有者であるか、ルートアクセス権を持つ仮想サーバーを借りている)場合は、以下の推奨事項を検討してください。


You can first set the owner and group of your LimeSurvey files so that it will ease the file permissions setup. A possible strategy is to set the owner of the LimeSurvey files to your personal username, and the group of the LimeSurvey files to the web server group. Usually, this web server group only contains the web server account (and possibly another webmaster account). For instance, if your username is 'myaccount' and the webserver user is 'apache' in the 'apache' group, then, from a shell access, you can use the following command: <code>$ chown -R myaccount:apache limesurvey/</code>. Subsequently, set the file and sub-directories permissions.
最初に、LimeSurveyファイルの所有者とグループを設定して、ファイルのアクセス権限設定を簡略化することができます。例えば、LimeSurveyファイルの所有者を個人のユーザー名に設定し、LimeSurveyファイルのグループをウェブサーバーグループに設定します。通常、このウェブサーバーグループには、ウェブサーバーアカウント(および、場合によって別のウェブマスターアカウント)のみが含まれます。例えば、あなたのユーザー名が'myaccount'で、ウェブサーバーユーザーが'apache'グループの'apache'であれば、シェルアクセスから次のコマンドを使います。<code>$ chown -R myaccount:apache limesurvey/</code>。その後、ファイルとサブディレクトリーのアクセス権限を設定します。


For the script to work properly, the write access to some directories is needed:
スクリプトが正常に動作するためには、いくつかのディレクトリーへの書き込み権限が必要です。
*The /limesurvey/application/config directory requires ''Read & Write'' for saving the application configuration settings
*/limesurvey/application/configディレクトリーには、アプリケーションの構成設定を保存するための''読み書き''の権限が必要です。
*The /limesurvey/tmp directory and its sub-directories are used for imports/uploads and should be set to ''Read & Write'' for your web server
*/limesurvey/tmpディレクトリーとそのサブディレクトリーはインポート/アップロードに使用され、ウェブサーバーが''読み書き''の権限を持つ必要があります。
*The upload/directory and all its sub-directories must also have set ''Read & Write'' permissions in order to enable pictures and media files upload
*upload/directoryとそのすべてのサブディレクトリーについても、画像とメディアファイルをアップロードできるようにするため、''読み書き''権限設定する必要があります。
* All other directories and files can be set to ''Read Only''
* その他のディレクトリーとファイルはすべて''読み取り専用''に設定します。


<div class="simplebox">[[File:help.png]] '''Hint:''' supposing you've followed the recommendations above on owner/group, these settings can be applied by the following commands:
<div class="simplebox">[[File:help.png]] '''ヒント:''' 所有者/グループについて、上記の推奨事項に従った場合、設定は次のコマンドによって適用できます。


<code>$ chmod -R o-r-w-x limesurvey/</code>
<code>$ chmod -R o-r-w-x limesurvey/</code>
Line 48: Line 60:
</div>
</div>


===Setting file permissions on a hosted web server===
===ホストされているウェブサーバーでのファイルアクセス権の設定===


Giving the difficulty of a standard procedure to secure a web application on a hosted environment, it is rather difficult because hosted environments differ in many ways.
ホストされた環境でウェブアプリケーションを保護するための標準的な手順は、ホストされた環境がさまざまな点で異なるため、非常に難しい問題です。


In the managed server case, the server needs write access to some directories in order for the script to work properly:
管理されているサーバーの場合、スクリプトが正常に動作するためにはいくつかのディレクトリーへの書き込み権限が必要です。
*The /limesurvey/tmp directory is used for imports/uploads and should be set to ''Read & Write'' for your web server
*/limesurvey/tmpディレクトリーはインポート/アップロードに使用するため、ウェブサーバーに''読み書き''権限を設定する必要があります。
*The upload/directory and all its sub-directories must also have ''Read & Write'' for your web server in order to enable pictures and media files upload
*upload/directoryとそのすべてのサブディレクトリーにも画像/メディアファイルのアップロードを有効にするため、ウェブサーバーに''読み書き''権限を設定する必要があります。
* The other directories and files should be set to ''Read Only''
* その他のディレクトリーとファイルはすべて''読み取り専用''に設定します。


<div class="simplebox">[[File:help.png]] '''Hint:'''
<div class="simplebox">[[File:help.png]] '''ヒント:'''
* Depending on your web server configuration, you will have to chmod the rights on the writable folders to 755 or 777 to make it writable for the web server. Try 755 first, if it does not work, 'upgrade' to 777
* ウェブサーバーの設定によっては、ウェブサーバーが書き込みを行うフォルダーの権限を755または777に変更する必要があります。最初に755を試してください。動作しない場合は、777にしてください。
* You can also try to remove other users' read access to config.php by setting this file's permissions to 750 - if it does not work, 'upgrade' to 755</div>
* config.phpへのアクセス権を750にすることにより、他のユーザーのアクセスを制限することができますが、動作しない場合は755と設定します。</div>


==Windows file permissions==
===Windowsのファイル権限===


If you are using a Windows server, your should ensure that the admin folder allows the owner of the web server process to write files to this directory, The rest of the files can be set to read-only and execute.
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:
以下は推奨事項です。LimeSurveyは一般的に、これらの追加の対策がなくても非常に安全です。ただし、非常に機密性の高いデータを収集する場合は、セキュリティーを強化するとよいでしょう。


===SSL usage===
===SSLの使用===
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|global settings]] of LimeSurvey. Additionally, you could only set to use 'secure' cookies by editing the [[Optional_settings|respective option]] in config.php.
機密性の高いアンケートデータにはSSLの使用を推奨します。通常は、ウェブサーバーを正しく構成し、SSQL証明書を使用してSSLを有効にします。SSLを有効にしている場合は、LimeSurveyの[[Global_settings/ja|全体設定]]で常にSSLを適用するよう設定します。さらに、config.phpの[[Optional_settings/ja|それぞれのオプション]]を編集することにより、 '安全な'cookieを使用するように設定することもできます。


=== The access to the config.php file ===
=== config.phpファイルへのアクセス ===


{{Alert| You must update application/config/'''config.php''' only after the first installation is done and it works.}}  
{{Alert| 最初のインストールが完了し、それが動作した後にのみapplication/config/'''config.php'''を更新してください。}}  


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.
/application/config/config.phpファイルには、データベースサーバーのユーザー名とパスワードが含まれています。特に、データベースに管理アクセスレベルが高いユーザーでログインしている場合は、セキュリティ上の問題が発生します。何らかのエラーが発生し、このPHPファイルの内容がユーザーのブラウザに表示された場合、データベースのパスワードやその他の詳細情報が漏洩する可能性があります(ただし、これはまれなシナリオです)。リスクを最小限に抑えるには、LimeSurveyデータベースに特定の権限しか持たない特定のログインユーザーを設定することです。


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: <code><?php return include("/home/hostfolder/safedata/configreal.php"); ?></code>). 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.
この情報を保護するもう1つの方法は、/application/config/config.phpファイルの情報をウェブディレクトリー以外のディレクトリーに入れることです。つまり、Apacheユーザーの場合、これはhtdocs(public_htmlまたはwwwの場合もある)フォルダよりも上のディレクトリーです。基本的にはconfig.phpを使用しますが、その中には実際の設定情報を含むファイルを含む行を1行加えます(例:<code><?php return include("/home/hostfolder/safedata/configreal.php"); ?></code>)。/application/config/config.phpから実際の設定情報をすべて削除し、/application/config/config.phpファイルに記述されている別のファイル(configreal.php)に貼り付けます。このファイルは、ウェブ以外のディレクトリーに配置する必要があります。これにより、/application/config/config.phpにはデータベースのパスワードなどがなくなり、データベースの情報を含むファイルの名前だけが書かれていることになります。


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:
これにより、/application/config/config.phpを含む他のすべてのファイルを変更する必要がなくなります。これは、config.phpがウェブ以外のディレクトリーにある本物の設定情報を含む設定ファイルに向けて'リダイレクト'するためです。ただし、configreal.phpを編集して、絶対パスを使用するようにパラメータを変更する必要があります。


<syntaxhighlight lang="php" enclose="div">
<syntaxhighlight lang="php">


'basePath' => dirname(dirname('''FILE''')),
'basePath' => dirname(dirname('''FILE''')),
Line 97: Line 109:
例:
例:


<syntaxhighlight lang="php" enclose="div">
<syntaxhighlight lang="php">
'basePath' => '/var/www/htdocs/limesurvey',
'basePath' => '/var/www/htdocs/limesurvey',
'runtimePath' => '/var/www/htdocs/limesurvey/tmp/runtime',
'runtimePath' => '/var/www/htdocs/limesurvey/tmp/runtime',
Line 109: Line 121:
</syntaxhighlight>
</syntaxhighlight>


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.
また、'''既定のユーザーとして "admin"を使用しないでください'''。MySQLデータベース(またはLimeSurveyをインストールしたデータベース)で、既定のユーザー名"admin"を好きなもの(例えば "admin_xyz")に変更してください。これにより、管理者の新しいユーザー名を推測するのがずっと難しくなります。ユーザー名は、侵入者がアクセスするために使用する2つの変数の1つです。もう一つは管理者パスワードです。とりわけ注意を払ってそれぞれを設定してください。
 
 
===コンテンツセキュリティポリシー(CSP)===
 
'''免責事項 - ここに掲載されているCSPはあくまでも例であり、そのまま使用することを意図していません。これはあくまでも出発点であり、ニーズに合わせて徹底的に試験する必要があります。'''
<nowiki><IfModule mod_headers.c>
        Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; base-uri 'none'; form-action 'self'; frame-ancestors 'self'; upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i"
</IfModule></nowiki>

Latest revision as of 02:28, 19 February 2022

概要

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

Webサーバーの制限

Apacheを使用する場合、LimeSurverは制限のために別のhtaccessファイルを使用します。AllowOverrideによってhtaccessが使用できるようになっているか確認してください。

他のウェブサーバーまたはAllowOverride Noneを使用したい場合は、以下のようにすべきです。

  • (任意)application、protected、framework、themes/*/viewsにあるすべてのアクセスを不可にする
  • ユーザーによる /upload/surveys/.*/fu_[a-z0-9] へのアップロードを不可にする
  • (任意)uploadディレクトリーの実行可能ファイルへのアクセスを不可にする

nginxのサンプルはよくある質問にあります。

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

その他のセキュリティ問題

以下は推奨事項です。LimeSurveyは一般的に、これらの追加の対策がなくても非常に安全です。ただし、非常に機密性の高いデータを収集する場合は、セキュリティーを強化するとよいでしょう。

SSLの使用

機密性の高いアンケートデータにはSSLの使用を推奨します。通常は、ウェブサーバーを正しく構成し、SSQL証明書を使用してSSLを有効にします。SSLを有効にしている場合は、LimeSurveyの全体設定で常にSSLを適用するよう設定します。さらに、config.phpのそれぞれのオプションを編集することにより、 '安全な'cookieを使用するように設定することもできます。

config.phpファイルへのアクセス

  最初のインストールが完了し、それが動作した後にのみapplication/config/config.phpを更新してください。


/application/config/config.phpファイルには、データベースサーバーのユーザー名とパスワードが含まれています。特に、データベースに管理アクセスレベルが高いユーザーでログインしている場合は、セキュリティ上の問題が発生します。何らかのエラーが発生し、このPHPファイルの内容がユーザーのブラウザに表示された場合、データベースのパスワードやその他の詳細情報が漏洩する可能性があります(ただし、これはまれなシナリオです)。リスクを最小限に抑えるには、LimeSurveyデータベースに特定の権限しか持たない特定のログインユーザーを設定することです。

この情報を保護するもう1つの方法は、/application/config/config.phpファイルの情報をウェブディレクトリー以外のディレクトリーに入れることです。つまり、Apacheユーザーの場合、これはhtdocs(public_htmlまたはwwwの場合もある)フォルダよりも上のディレクトリーです。基本的にはconfig.phpを使用しますが、その中には実際の設定情報を含むファイルを含む行を1行加えます(例:<?php return include("/home/hostfolder/safedata/configreal.php"); ?>)。/application/config/config.phpから実際の設定情報をすべて削除し、/application/config/config.phpファイルに記述されている別のファイル(configreal.php)に貼り付けます。このファイルは、ウェブ以外のディレクトリーに配置する必要があります。これにより、/application/config/config.phpにはデータベースのパスワードなどがなくなり、データベースの情報を含むファイルの名前だけが書かれていることになります。

これにより、/application/config/config.phpを含む他のすべてのファイルを変更する必要がなくなります。これは、config.phpがウェブ以外のディレクトリーにある本物の設定情報を含む設定ファイルに向けて'リダイレクト'するためです。ただし、configreal.phpを編集して、絶対パスを使用するようにパラメータを変更する必要があります。

'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'),
   [...]
);

また、既定のユーザーとして "admin"を使用しないでください。MySQLデータベース(またはLimeSurveyをインストールしたデータベース)で、既定のユーザー名"admin"を好きなもの(例えば "admin_xyz")に変更してください。これにより、管理者の新しいユーザー名を推測するのがずっと難しくなります。ユーザー名は、侵入者がアクセスするために使用する2つの変数の1つです。もう一つは管理者パスワードです。とりわけ注意を払ってそれぞれを設定してください。


コンテンツセキュリティポリシー(CSP)

免責事項 - ここに掲載されているCSPはあくまでも例であり、そのまま使用することを意図していません。これはあくまでも出発点であり、ニーズに合わせて徹底的に試験する必要があります。

<IfModule mod_headers.c>
        Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; base-uri 'none'; form-action 'self'; frame-ancestors 'self'; upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i"
</IfModule>