「セキュリティ推奨」の版間の差分

提供:MoodleDocs
移動先:案内検索
編集の要約なし
(done.)
 
(同じ利用者による、間の203版が非表示)
1行目: 1行目:
{{セキュリティ}}
{{セキュリティ}}


作成中です - [[利用者:Mitsuhiro Yoshida|Mitsuhiro Yoshida]] ([[利用者・トーク:Mitsuhiro Yoshida|トーク]])
すべてのウェブアプリケーションは非常に複雑なものであり、すべてのアプリケーションには時々発見されるセキュリティ問題が存在します。通常、それはプログラマが予期しない入力の組み合わせに起因します。Moodleプロジェクトはセキュリティを深刻に捉えています。そして、私たちが発見したセキュリティホールを閉じるよう、継続的にMoodleを改良しています。


All web application software is highly complex, and every application has security issues that are found from time to time, usually involving some combination of input that the programmers did not anticipate. The Moodle project takes security seriously, and is continuously improving Moodle to close such holes as we find them.
==イントロダクション (Introduction)==


==イントロダクション==
*このページでは、あなたのMoodleインストレーションに関する重要なセキュリティ対策も含みます。
*This page contains important security measures for your Moodle installation.
*開発者が確認することができ、登録Moodleサイトに早急に対応されるよう知らせるため、あなたはセキュリティ問題を[http://tracker.moodle.org/secure/CreateIssue!default.jspa  Moodle tracker]に報告 (およびセキュリティ問題であるとマーク) する必要があります。
*You should report security problems to the [http://tracker.moodle.org/secure/CreateIssue!default.jspa  Moodle tracker] (and mark it as a security issue!) so that developers can see it and inform  registered Moodle sites about fixes as soon as possible.
*まだアップグレードされていないMoodle管理者を保護するため、あなたは実際のセキュリティ上の弱点をウェブ上のフォーラムまたは他の場所に投稿すべきではありません。
*You should not post actual exploits in the forums or elsewhere on the web (to protect Moodle admins who have not upgraded yet).


==簡易セキュリティ対策 (Simple security measures)==
==簡易セキュリティ対策 (Simple security measures)==
*The best security strategy is a good backup! But you don't have a good backup unless you are able to restore it. Test your restoration procedures!
 
*Load only software or services you will use
*最善のセキュリティ戦略は適切なバックアップです! しかし、リストアできない限り、あなたは良いバックアップをしているとは言えません! あなたのリストア手順を確認してください!  
*Perform regular updates
*あなたが使用するソフトウェアおよびサービスのみをロードしてください。
*Model your security after the layers of clothing you wear on a cold winter day
*定期的な更新を実行してください。
*寒い冬の日の重ね着の考えをもとにして、あなたのセキュリティモデルを作成してください。


==基本推奨 (Basic recommendations)==
==基本推奨 (Basic recommendations)==
*Update Moodle regularly on each release
:Published security holes draw crackers attention after release. The older the version, the more vulnerabilities it is likely to contain.
*Register globals '''MUST''' be disabled!
:This will help prevent against possible XSS problems in third-party scripts.
*Use strong passwords for admin and teachers
:Choosing "difficult" passwords is a basic security practice to protect against "brute force" cracking of accounts.
*Only give teacher accounts to trusted users. Avoid creating public sandboxes with free teacher accounts on production servers.
:Teacher accounts have much freer permissions and it is easier to create situations where data can be abused or stolen.
*Separate your systems as much as possible
:Another basic security technique is to use different passwords on different systems, use different machines for different services and so on.  This will prevent damage being widespread even if one account or one server is compromised.


==Run regular updates==
*それぞれのバージョンのリリース時、定期的にMoodleをアップデートしてください。
*Use auto update systems
:公開されたセキュリティホールはリリース後にクラッカーの注意を引くことになります。古いバージョンほど、脆弱性を含んでいる可能性があります。
*Windows Update
*「register_globals」を無効にしてください!
:これはサードパーティスクリプトのXSS (cross site scripting - クロスサイトスクリプティング ) 問題を防ぐための助けとなります。
*管理者および教師に強いパスワードを使用してください。
:「難しい」パスワードを選択することは「強引な (brute force) 」アカウントのクラッキングに対する基本的なセキュリティの実践です。
*信頼できるユーザにのみ教師アカウントを与えてください。実運用サーバ上にフリーの教師アカウントが利用できる公開サンドボックスの作成を避けるためです。
:教師アカウントには極めて自由なパーミッションがあるため、データを悪用および盗用できる状況を簡単に作ることができてしまいます。
 
*あなたのシステムを可能な限り分けてください。
:もうひとつの基本的なセキュリティテクニックは異なるシステムで異なるパスワードを使用すること、異なるサービスごとに異なるマシンを使用すること等です。これにより、1つのアカウントが不正使用または1つのサーバに侵入にされたとしても、ダメージが広範囲に広がることを防ぎます。
 
==通常更新を実行する (Run regular updates)==
*自動更新システムを使用します。
*Windowsアップデート
*Linux: up2date, yum, apt-get
*Linux: up2date, yum, apt-get
:Consider automating updates with a script scheduled via cron
:cronのスケジュールスクリプトによる自動更新を考慮してください。
*Mac OSX update system
*Mac OSX更新システム
*Stay current with php, apache, and moodle
*php、apacheおよびmoodleを最新版にします。


==Use mailing lists to stay updated==
==最新状態にするため、メーリングリストを使用する (Use mailing lists to stay updated)==
*CERT - http://www.us-cert.gov/cas/signup.html
*CERT - http://www.us-cert.gov/cas/signup.html
*PHP - http://www.php.net/mailing-lists.php - sign up for Announcements list
*PHP - http://www.php.net/mailing-lists.php - アナウンスメントリストにサインアップします。
*MySQL - http://lists.mysql.com - sign up for MySQL Announcements
*MySQL - http://lists.mysql.com - MySQLアナウンスメントにサインアップします。
 
==ファイアウォール (Firewalls)==


==Firewalls==
*セキュリティ専門家は2重のファイアーウォールを推奨しています。
*Security experts recommend a dual firewall
:ハードウェア/ソフトウェアの組み合わせを別にします。
:Differing hardware/software combinations
*多くの場合、未使用のサービスを無効にすることはファイアーウォールと同じく効果的です。
*Disabling unused services is often as effective as a firewall
:開いているネットワークポートを確認するには、netstat -a コマンドを使用してください。
:Use netstat -a to review open network ports
*セキュリティ保護の保証があるわけではありません。
*Not a guarantee of protection
*許可されるポート
*Allow ports
:80, 443(ssl), 9111 (チャット用)  
:80, 443(ssl), and 9111 (for chat),
リモート管理: ssh 22またはrdp 3389
:Remote admin: ssh 22, or rdp 3389


==Password policy==
==パスワードポリシー (Password policy)==


A password policy may be set up in ''Settings > Site administration > Security > [[Site policies]]''.
パスワードポリシーは「設定 > サイト管理 > セキュリティ > [[サイトポリシー]]」で設定することができます。


There is a check box to determine if password complexity should be enforced or not, the option to set the minimum length of the password, the minimum number of digits, the minimum number of lowercase characters, the minimum number of uppercase characters and the minimum number of non alphanumeric characters.
パスワードの複雑さを強制するチェックボックスがあります。オプションは次のとおりです: パスワード長、数字、小文字、大文字、非英数字、連続した同一文字


If a user enters a password that does not meet those requirements, they are given an error message indicating the nature of the problem with the entered password.
これらの条件に合致しないパスワードをユーザが入力した場合、入力されたパスワードに関する問題を示したエラーメッセージが表示されます。


Enforcing password complexity along with requiring users to change their initial password go a long way in helping ensure that users choose and are in fact using "good passwords".
初期パスワードの変更とともに複雑なパスワードの使用を強制することにより、ユーザが「良いパスワード」を選択する役に立ちます。


However, making the check too onerous just results in them writing it down so be realistic.
しかし、チェックを面倒にすることにより、結果としてユーザがパスワードを書きとめることになりますので、現実的になる必要もあります。


==Be prepared for the worst==
==最悪の事態に備える (Be prepared for the worst)==
*Have backups ready
 
*Practice recovery procedures ahead of time
*バックアップを準備してください。
*Use a rootkit detector on a regular basis
*事前にリカバリ処理を練習してください。
*定期的にルートキット検出ツールを使用してください。
**Linux/MacOSX - http://www.chkrootkit.org/  
**Linux/MacOSX - http://www.chkrootkit.org/  
**Windows - http://technet.microsoft.com/en-en/sysinternals/bb897445.aspx and http://technet.microsoft.com/de-de/sysinternals/bb897445.aspx
**Windows - http://technet.microsoft.com/en-en/sysinternals/bb897445.aspx および http://technet.microsoft.com/de-de/sysinternals/bb897445.aspx
 
==Moodleセキュリティ警告 (Moodle security alerts) ==


==Moodle security alerts==
*あなたのサイトをmoodle.orgに登録してください。
*Register your site with Moodle.org
:登録ユーザにはメールアラートが送信されます。
:Registered users receive email alerts
*セキュリティアラートは下記オンラインにも掲載されます:
*Security alerts also posted online
*ウェブ - http://moodle.org/security
*Web - http://moodle.org/security
*RSSフィード - http://moodle.org/rss/file.php/1/1/forum/996/rss.xml
*RSS feed - http://moodle.org/rss/file.php/1/1/forum/996/rss.xml


==Miscellaneous considerations==
==様々な検討事項 (Miscellaneous considerations)==
These are all things you might consider that impact your overall security:
*Use the secure forms setting
*Always set a mysql root user password
*Turn off mysql network access
*Use SSL, httpslogins=yes
*Use good passwords - set up a password policy in ''Settings > Site administration > Security > [[Site policies]]''
*Do not enable the ''opentogoogle'' setting (in ''Settings > Site administration > Security > [[Site policies]]'')
*Disable guest access
*Place enrollment keys on all courses or set Course Enrollable = No for all courses
*Ensure the enrolment key hint is disabled (which it is by default) in ''Administration > Site administration > Plugins > Enrolment > Self enrolment.''


以下、あなたのセキュリティ全体に関して影響のある考慮すべき内容です:
*セキュアフォーム設定を使用してください。
*常にMySQLのrootパスワードを設定してください。
*MySQLネットワークアクセスを無効にしてください。
*SSLを使用してください (httpslogins=yes)。
*良いパスワードを使用してください - 「設定 > サイト管理 > セキュリティ > [[サイトポリシー]]」のパスワードポリシーを設定してください。
* 「設定 > サイト管理 > セキュリティ > [[サイトポリシー]]」の「opentogoogle」設定を有効にしないでください。
*ゲストアクセスを無効にしてください。
*すべてのコースに登録キーを設定するか、すべてのコースにおいて「コース登録可能 = No」に設定してください。
*「管理 > サイト管理 > プラグイン > 受講登録 > 自己登録」で登録キーヒント (「ヒントを表示する」) が無効にされていることを確認してください。


==Most secure/paranoid file permissions==
==最も安全なファイルパーミッション (Most secure/paranoid file permissions)==


'''Note''': <u>The following information applies to Linux/Unix based installations only, as MS Windows permission system is quite different</u>.
'''注意''': <u>MS Windowsのパーミッションシステムとは全く異なるため、以下の情報はLinux/Unixベースのインストーレーションのみに適用してください。</u>


Depending on your server set-up there are two different scenarios:
あなたのサーバのセットアップに応じて、以下2つの異なるシナリオがあります:
# You are running Moodle on your own dedicated server.
# あなたは独自の専用サーバでMoodleを運用しています。
# You are running Moodle on a shared hosting environment.
# あなたは共有ホスティング環境でMoodleを運用しています。


In the sections below, you are required to use the web service user account and group to set the permissions, so you need to know them. This can vary quite a bit from server to server but if this feature has not been disabled in your server, you can go to http://your.moodle.site/admin/phpinfo.php (logging in as admin), and then search for the line that reads 'User/Group', inside the 'apache' table. For example, I get 'www-data' for the user account and 'www-data' for the group too.
以下のセクションでは、あなたにパーミッションを設定するためにウェブサービスユーザアカウントおよびグループが必要であることに留意してください。これはサーバによって異なりますが、この機能が無効にされていない場合、あなたは管理者としてログインした上で http://your.moodle.site/admin/phpinfo.php にアクセスして、「apache」テーブル内にある「User/Group」の行を探してください。例えば、私はユーザアカウントに「www-data」、グループアカウントにも「www-data」を見つけることができました。


=== Running Moodle on a dedicated server ===
=== 専用サーバでMoodleを運用する (Running Moodle on a dedicated server) ===
Assuming you are running Moodle on a sealed server (i.e. no user logins allowed on the machine) and that root takes care of the modifications to both moodle code and moodle config (config.php), then this are the most tight permissions I can think of:
あなたは密閉されたサーバでMoodleを運用しています。そして、MoodleコードおよびMoodle設定 (config.php) の両方を管理者 (root) が管理していると仮定します。以下、私が考える最も厳重なパーミッションです:


1. moodledata directory and all of its contents (and subdirectories, includes sessions):
1. moodledataディレクトリおよびすべてのコンテンツ (およびsessionsを含むサブディレクトリ):
  owner: apache user (apache, httpd, www-data, whatever; see above)
  owner: apache user (apache, httpd, www-data, whatever; see above)
  group: apache group (apache, httpd, www-data, whatever; see above)
  group: apache group (apache, httpd, www-data, whatever; see above)
  permissions: 700 on directories, 600 on files
  permissions: 700 on directories, 600 on files


2. moodle directory and all of its contents and subdirectories (including config.php):
2. moodleディレクトリおよびすべてのコンテンツ (およびconfig.phpを含むサブディレクトリ):
  owner: root
  owner: root
  group: root
  group: root
  permissions: 755 on directories, 644 on files.
  permissions: 755 on directories, 644 on files.


If you allow local logins for regular users, then 2. should be:
あなたが通常ユーザとしてログインできる場合、2. は下記のようになります:
  owner: root
  owner: root
  group: apache group (apache, httpd, www-data, whatever; see above)
  group: apache group (apache, httpd, www-data, whatever; see above)
  permissions: 750 on directories, 640 on files.
  permissions: 750 on directories, 640 on files.


Think of these permissions as the most paranoid ones. You can be secure enough with less tighter permissions, both in moodledata and moodle directories (and subdirectories).
これらのパーミッションは考え過ぎのパーミッションであることをご理解ください。moodledataおよびmoodleディレクトリ (およびサブディレクトリ) のパーミッションの厳しさを緩くしたとしても、あなたは十分セキュアであることができます。


=== Running Moodle on a shared hosting environment ===
=== 共有ホスティング環境でMoodleを運用する (Running Moodle on a shared hosting environment) ===
If you are running Moodle on a shared hosting environment, then above permissions are probably wrong. If you set 700 as the permission for directories (and 600 for files), you are probably denying the web service user account access to your directories and files.
あなたが共有ホスティング環境でMoodleを運用している場合、恐らく、上記のパーミッションは正しくありません。ディレクトリに700 (およびファイルに600) のパーミッションを設定した場合、恐らく、あなたのディレクトリおよびファイルにウェブサービスユーザアカウントがアクセスできないようになります。


If you want to tighten your permissions as much as possible, you will need to know:
可能な限りパーミッションを厳しくしたい場合、あなたは以下の内容を把握する必要があります:


# the user account and the group the web service is running under (see above).
# ユーザアカウントおよびグループの下でウェブサービスが動作している (上記をご覧ください)
# the owner of the directories/files of both moodledata and the moodle directory (this should normally be your client user account), and the group of the directories/files. You can usually get this information from the file manager of your hosting control panel. Go to the moodle folder and pick any directory or file and try to view/change the permissions, owner and group of that file. That would normally show the current permissions, owner and group. Do the same for the moodledata directory.
# moodledataおよびmoodleディレクトリ両方のオーナー (通常、あなたのクライアントユーザアカウント) およびグループ。通常、あなたはこれらの情報をホスティングのコントロールパネルのマネージャから取得することができます。moodleフォルダに移動して、ディレクトリまたはファイルを選択した後、そのファイルのパーミッション、オーナーおよびグループを確認または変更してください。通常、これは現在のパーミッション、オーナーおよびグループを表示します。同じことをmoodledataディレクトリに対しても実施してください。


Then, depending on the following scenarios you should use a different set of permissions (listed from more secure to less secure) for your moodledata directory:
そして、下記シナリオに応じて、あなたのmoodledataディレクトリに対して、異なるパーミッションを設定することができます (安全性の高いものから低いものへと一覧表示されています):


# if the web service account and the owner of the directories/files is the same, you should use 700 for directories and 600 for files.
# ウェブサービスアカウントおよびディレクトリ/ファイルのオーナーが同一である場合、あなたはディレクトリのパーミッションを700、ファイルのパーミッションを600にすべきです。
# if the web service group and the group of the directories/files is the same, you should use 770 for directories and 660 for the files.
# ウェブサービスグループおよびディレクトリ/ファイルのグループが同一である場合、あなたはディレクトリのパーミッションを770、ファイルのパーミッションを660にすべきです。
# if none of the above, you will need to use 777 for directories and 666 for files, which is less secure but it is your only option. 707 and 606 would be more secure, but it might or might not work, depending on your particular setup.
# 上記のどれにも当てはまらない場合、あなたはディレクトリのパーミッションを777、ファイルのパーミッションを666にする必要があります。これは安全性が低くなりますが、あなたが選択し得る唯一のオプションです。707および606はさらに安全になりますが、動作の可否はあなたの設定に依存します。


In fact, you just need to set moodledata the permissions specified above, as all the directories and files inside are created by the web service itself, and will have the right permissions.
ウェブサービス自体によって、ディレクトリおよびファイルが作成され、適切なパーミッションが適用されるため、実際のところ、あなたが必要なことは上記で指定されたパーミッションをmoodledataに設定するのみです。


Regarding the moodle directory, as long as the web service user account can read the files plus read and execute the directories, that should be enough. There is no need to grant write permission to the web service account/group on any of the files or subdirectories. The only drawback is that you will need to create the config.php by hand during the installation process, as Moodle will not be able to create it. But that should not be a big problem.
Moodleディレクトリに関して、ウェブサービスユーザアカウントがファイルを読むこと、ディレクトリを読むことおよび実行することができる限り、これで十分です。ファイルまたはサブディレクトリに対して、ウェブサービスアカウント/グループに書き込み権を与える必要はありません。唯一の難点はインストール処理中、Moodleがconfig.phpを作成できないため、あなたがconfig.phpを手動で作成する必要がある点です。しかし、これは大きな問題ではありません。


==関連情報==
==関連情報==


*[[Security FAQ]]
*[[セキュリティFAQ]]
Using Moodle forum discussions:
Using Moodleフォーラムディスカッション
*[http://moodle.org/mod/forum/discuss.php?d=39404 Guide to Securing your Moodle Server]
*[http://moodle.org/mod/forum/discuss.php?d=39404 あなたのMoodleサーバを安全にするためのガイド (Guide to Securing your Moodle Server) - 英語]
*[http://moodle.org/mod/forum/discuss.php?d=93561 How to secure Moodle website from hacking] including recommendations on emergency recovery
*[http://moodle.org/mod/forum/discuss.php?d=93561Moodle サイトをハッキングから安全にする方法 (How to secure Moodle website from hacking)] 推奨緊急リカバリ方法を含む - 英語


[[en:Security_recommendations]]
[[en:Security_recommendations]]

2015年2月19日 (木) 03:44時点における最新版


すべてのウェブアプリケーションは非常に複雑なものであり、すべてのアプリケーションには時々発見されるセキュリティ問題が存在します。通常、それはプログラマが予期しない入力の組み合わせに起因します。Moodleプロジェクトはセキュリティを深刻に捉えています。そして、私たちが発見したセキュリティホールを閉じるよう、継続的にMoodleを改良しています。

イントロダクション (Introduction)

  • このページでは、あなたのMoodleインストレーションに関する重要なセキュリティ対策も含みます。
  • 開発者が確認することができ、登録Moodleサイトに早急に対応されるよう知らせるため、あなたはセキュリティ問題をMoodle trackerに報告 (およびセキュリティ問題であるとマーク) する必要があります。
  • まだアップグレードされていないMoodle管理者を保護するため、あなたは実際のセキュリティ上の弱点をウェブ上のフォーラムまたは他の場所に投稿すべきではありません。

簡易セキュリティ対策 (Simple security measures)

  • 最善のセキュリティ戦略は適切なバックアップです! しかし、リストアできない限り、あなたは良いバックアップをしているとは言えません! あなたのリストア手順を確認してください!
  • あなたが使用するソフトウェアおよびサービスのみをロードしてください。
  • 定期的な更新を実行してください。
  • 寒い冬の日の重ね着の考えをもとにして、あなたのセキュリティモデルを作成してください。

基本推奨 (Basic recommendations)

  • それぞれのバージョンのリリース時、定期的にMoodleをアップデートしてください。
公開されたセキュリティホールはリリース後にクラッカーの注意を引くことになります。古いバージョンほど、脆弱性を含んでいる可能性があります。
  • 「register_globals」を無効にしてください!
これはサードパーティスクリプトのXSS (cross site scripting - クロスサイトスクリプティング ) 問題を防ぐための助けとなります。
  • 管理者および教師に強いパスワードを使用してください。
「難しい」パスワードを選択することは「強引な (brute force) 」アカウントのクラッキングに対する基本的なセキュリティの実践です。
  • 信頼できるユーザにのみ教師アカウントを与えてください。実運用サーバ上にフリーの教師アカウントが利用できる公開サンドボックスの作成を避けるためです。
教師アカウントには極めて自由なパーミッションがあるため、データを悪用および盗用できる状況を簡単に作ることができてしまいます。
  • あなたのシステムを可能な限り分けてください。
もうひとつの基本的なセキュリティテクニックは異なるシステムで異なるパスワードを使用すること、異なるサービスごとに異なるマシンを使用すること等です。これにより、1つのアカウントが不正使用または1つのサーバに侵入にされたとしても、ダメージが広範囲に広がることを防ぎます。

通常更新を実行する (Run regular updates)

  • 自動更新システムを使用します。
  • Windowsアップデート
  • Linux: up2date, yum, apt-get
cronのスケジュールスクリプトによる自動更新を考慮してください。
  • Mac OSX更新システム
  • php、apacheおよびmoodleを最新版にします。

最新状態にするため、メーリングリストを使用する (Use mailing lists to stay updated)

ファイアウォール (Firewalls)

  • セキュリティ専門家は2重のファイアーウォールを推奨しています。
ハードウェア/ソフトウェアの組み合わせを別にします。
  • 多くの場合、未使用のサービスを無効にすることはファイアーウォールと同じく効果的です。
開いているネットワークポートを確認するには、netstat -a コマンドを使用してください。
  • セキュリティ保護の保証があるわけではありません。
  • 許可されるポート
80, 443(ssl), 9111 (チャット用)

リモート管理: ssh 22またはrdp 3389

パスワードポリシー (Password policy)

パスワードポリシーは「設定 > サイト管理 > セキュリティ > サイトポリシー」で設定することができます。

パスワードの複雑さを強制するチェックボックスがあります。オプションは次のとおりです: パスワード長、数字、小文字、大文字、非英数字、連続した同一文字

これらの条件に合致しないパスワードをユーザが入力した場合、入力されたパスワードに関する問題を示したエラーメッセージが表示されます。

初期パスワードの変更とともに複雑なパスワードの使用を強制することにより、ユーザが「良いパスワード」を選択する役に立ちます。

しかし、チェックを面倒にすることにより、結果としてユーザがパスワードを書きとめることになりますので、現実的になる必要もあります。

最悪の事態に備える (Be prepared for the worst)

Moodleセキュリティ警告 (Moodle security alerts)

  • あなたのサイトをmoodle.orgに登録してください。
登録ユーザにはメールアラートが送信されます。

様々な検討事項 (Miscellaneous considerations)

以下、あなたのセキュリティ全体に関して影響のある考慮すべき内容です:

  • セキュアフォーム設定を使用してください。
  • 常にMySQLのrootパスワードを設定してください。
  • MySQLネットワークアクセスを無効にしてください。
  • SSLを使用してください (httpslogins=yes)。
  • 良いパスワードを使用してください - 「設定 > サイト管理 > セキュリティ > サイトポリシー」のパスワードポリシーを設定してください。
  • 「設定 > サイト管理 > セキュリティ > サイトポリシー」の「opentogoogle」設定を有効にしないでください。
  • ゲストアクセスを無効にしてください。
  • すべてのコースに登録キーを設定するか、すべてのコースにおいて「コース登録可能 = No」に設定してください。
  • 「管理 > サイト管理 > プラグイン > 受講登録 > 自己登録」で登録キーヒント (「ヒントを表示する」) が無効にされていることを確認してください。

最も安全なファイルパーミッション (Most secure/paranoid file permissions)

注意: MS Windowsのパーミッションシステムとは全く異なるため、以下の情報はLinux/Unixベースのインストーレーションのみに適用してください。

あなたのサーバのセットアップに応じて、以下2つの異なるシナリオがあります:

  1. あなたは独自の専用サーバでMoodleを運用しています。
  2. あなたは共有ホスティング環境でMoodleを運用しています。

以下のセクションでは、あなたにパーミッションを設定するためにウェブサービスユーザアカウントおよびグループが必要であることに留意してください。これはサーバによって異なりますが、この機能が無効にされていない場合、あなたは管理者としてログインした上で http://your.moodle.site/admin/phpinfo.php にアクセスして、「apache」テーブル内にある「User/Group」の行を探してください。例えば、私はユーザアカウントに「www-data」、グループアカウントにも「www-data」を見つけることができました。

専用サーバでMoodleを運用する (Running Moodle on a dedicated server)

あなたは密閉されたサーバでMoodleを運用しています。そして、MoodleコードおよびMoodle設定 (config.php) の両方を管理者 (root) が管理していると仮定します。以下、私が考える最も厳重なパーミッションです:

1. moodledataディレクトリおよびすべてのコンテンツ (およびsessionsを含むサブディレクトリ):

owner: apache user (apache, httpd, www-data, whatever; see above)
group: apache group (apache, httpd, www-data, whatever; see above)
permissions: 700 on directories, 600 on files

2. moodleディレクトリおよびすべてのコンテンツ (およびconfig.phpを含むサブディレクトリ):

owner: root
group: root
permissions: 755 on directories, 644 on files.

あなたが通常ユーザとしてログインできる場合、2. は下記のようになります:

owner: root
group: apache group (apache, httpd, www-data, whatever; see above)
permissions: 750 on directories, 640 on files.

これらのパーミッションは考え過ぎのパーミッションであることをご理解ください。moodledataおよびmoodleディレクトリ (およびサブディレクトリ) のパーミッションの厳しさを緩くしたとしても、あなたは十分セキュアであることができます。

共有ホスティング環境でMoodleを運用する (Running Moodle on a shared hosting environment)

あなたが共有ホスティング環境でMoodleを運用している場合、恐らく、上記のパーミッションは正しくありません。ディレクトリに700 (およびファイルに600) のパーミッションを設定した場合、恐らく、あなたのディレクトリおよびファイルにウェブサービスユーザアカウントがアクセスできないようになります。

可能な限りパーミッションを厳しくしたい場合、あなたは以下の内容を把握する必要があります:

  1. ユーザアカウントおよびグループの下でウェブサービスが動作している (上記をご覧ください)。
  2. moodledataおよびmoodleディレクトリ両方のオーナー (通常、あなたのクライアントユーザアカウント) およびグループ。通常、あなたはこれらの情報をホスティングのコントロールパネルのマネージャから取得することができます。moodleフォルダに移動して、ディレクトリまたはファイルを選択した後、そのファイルのパーミッション、オーナーおよびグループを確認または変更してください。通常、これは現在のパーミッション、オーナーおよびグループを表示します。同じことをmoodledataディレクトリに対しても実施してください。

そして、下記シナリオに応じて、あなたのmoodledataディレクトリに対して、異なるパーミッションを設定することができます (安全性の高いものから低いものへと一覧表示されています):

  1. ウェブサービスアカウントおよびディレクトリ/ファイルのオーナーが同一である場合、あなたはディレクトリのパーミッションを700、ファイルのパーミッションを600にすべきです。
  2. ウェブサービスグループおよびディレクトリ/ファイルのグループが同一である場合、あなたはディレクトリのパーミッションを770、ファイルのパーミッションを660にすべきです。
  3. 上記のどれにも当てはまらない場合、あなたはディレクトリのパーミッションを777、ファイルのパーミッションを666にする必要があります。これは安全性が低くなりますが、あなたが選択し得る唯一のオプションです。707および606はさらに安全になりますが、動作の可否はあなたの設定に依存します。

ウェブサービス自体によって、ディレクトリおよびファイルが作成され、適切なパーミッションが適用されるため、実際のところ、あなたが必要なことは上記で指定されたパーミッションをmoodledataに設定するのみです。

Moodleディレクトリに関して、ウェブサービスユーザアカウントがファイルを読むこと、ディレクトリを読むことおよび実行することができる限り、これで十分です。ファイルまたはサブディレクトリに対して、ウェブサービスアカウント/グループに書き込み権を与える必要はありません。唯一の難点はインストール処理中、Moodleがconfig.phpを作成できないため、あなたがconfig.phpを手動で作成する必要がある点です。しかし、これは大きな問題ではありません。

関連情報

Using Moodleフォーラムディスカッション