<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="sv">
	<id>https://docs.moodle.org/4x/sv/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Michaelh2</id>
	<title>MoodleDocs - Användarbidrag [sv]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/4x/sv/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Michaelh2"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/4x/sv/Special:Bidrag/Michaelh2"/>
	<updated>2026-05-16T13:31:01Z</updated>
	<subtitle>Användarbidrag</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/4x/sv/index.php?title=report/security/report_security_check_preventexecpath&amp;diff=141570</id>
		<title>report/security/report security check preventexecpath</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/4x/sv/index.php?title=report/security/report_security_check_preventexecpath&amp;diff=141570"/>
		<updated>2021-08-25T03:09:56Z</updated>

		<summary type="html">&lt;p&gt;Michaelh2: Small layout tweak.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Security overview report}}Some administration options allow setting the path to executable files on the web server such as du, aspell, ghostscript and others. This can potentially cause a security risk. You can prevent administrators from changing these paths by adding the following setting to your config.php file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;preventexecpath = true;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should also explicitly set the relevant paths in your config.php file such as:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;pathtodu = &#039;PATH&#039;;&lt;br /&gt;
$CFG-&amp;gt;pathtounoconv = &#039;PATH&#039;;&lt;br /&gt;
$CFG-&amp;gt;aspellpath = &#039;PATH&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:report/security/report security check preventexecpath]]&lt;/div&gt;</summary>
		<author><name>Michaelh2</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/4x/sv/index.php?title=Site_security_settings&amp;diff=140554</id>
		<title>Site security settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/4x/sv/index.php?title=Site_security_settings&amp;diff=140554"/>
		<updated>2021-06-02T06:12:02Z</updated>

		<summary type="html">&lt;p&gt;Michaelh2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;.&lt;br /&gt;
{{Security}}&lt;br /&gt;
===Protect usernames===&lt;br /&gt;
&lt;br /&gt;
If enabled, when a user attempts to reset their password and enters a username or email address, the following message is displayed: &amp;quot;If you supplied a correct username or email address then an email should have been sent to you.&amp;quot; This is to prevent a malicious party from using the interface to determine which usernames and email addresses are in use in valid accounts.&lt;br /&gt;
&lt;br /&gt;
If the protect usernames setting is disabled, when a user attempts to reset their password they are provided with feedback regarding whether an account exists with the username or email address supplied. For example, the message &amp;quot;The email address was not found in the database&amp;quot; may be displayed.&lt;br /&gt;
&lt;br /&gt;
===Force users to login===&lt;br /&gt;
&lt;br /&gt;
If you turn this setting on, all users must login before they even see the [[Front Page]] of the site. Note however that this does not prevent guest access to courses, if you have autologin guests enabled in [[User policies]].&lt;br /&gt;
&lt;br /&gt;
===Force users to login for profiles===&lt;br /&gt;
&lt;br /&gt;
Leave this set to Yes to keep anonymous visitors away from user profiles. &lt;br /&gt;
&lt;br /&gt;
===Force users to login to view user pictures===&lt;br /&gt;
&lt;br /&gt;
If enabled, users must login in order to view user profile pictures and the default user picture will be used in all notification emails.&lt;br /&gt;
&lt;br /&gt;
===Open to search engines===&lt;br /&gt;
&lt;br /&gt;
Enabling this setting allows search engines crawlers guest access to your site. Any part of the site that allows guest access will then be searchable on search engines. In addition, people coming in to your site via a search engine search will automatically be logged in as a guest.&lt;br /&gt;
&lt;br /&gt;
=== Referrer policy ===&lt;br /&gt;
&lt;br /&gt;
A referrer policy can be set, various parts of moodle rely on the referrer being set so it&#039;s generally best to only remove or reduce the referrer for external links. So a policy of origin-when-cross-origin is probably the best balance. &lt;br /&gt;
See the MDN docs for more details:&lt;br /&gt;
&lt;br /&gt;
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy&lt;br /&gt;
&lt;br /&gt;
===Allow indexing by search engines===&lt;br /&gt;
This determines whether to allow search engines to index your site. The default is Everywhere except login and signup pages.&lt;br /&gt;
&lt;br /&gt;
===Profile visible roles===&lt;br /&gt;
Any role which is checked/ticked here will be visible on  user profiles and the Participation screen.&lt;br /&gt;
&lt;br /&gt;
===Maximum uploaded file size===&lt;br /&gt;
&lt;br /&gt;
Probably the most frequently asked question in the Moodle.org Using Moodle forums is &amp;quot;How do I increase the upload file size limit?&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Upload file sizes are restricted in a number of ways - each one in this list restricts the following ones:&lt;br /&gt;
&lt;br /&gt;
1. The Apache server setting LimitRequestBody ... default in Apache 2.x or greater is set to 0 or an unlimited upload size&lt;br /&gt;
&lt;br /&gt;
2. The PHP site settings post_max_size and upload_max_filesize in php.ini : &#039;&#039;&#039;modify php.ini in web server directories&#039;&#039;&#039; ( apache2.x.x/bin/php.ini ) not in php directories :&lt;br /&gt;
 &lt;br /&gt;
 post_max_size = 128M;  to increase limit to 128 Megabytes;&lt;br /&gt;
 upload_max_filesize = 128M;  to increase limit to 128 Megabytes;&lt;br /&gt;
 max_execution_time = 600 ; Maximum execution time of each script, in seconds;&lt;br /&gt;
&lt;br /&gt;
3. The Moodle site-wide maximum uploaded file size setting: &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Security &amp;gt; Site policies &amp;gt; Maximum uploaded file size&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
4. The Moodle course maximum uploaded file size setting in the course default  settings: &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Courses &amp;gt; Course default settings&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
5. The  file size settings in each individual course in &#039;&#039;Course Administration&amp;gt;Settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
5. Certain course activity module settings (for example, Assignment)&lt;br /&gt;
&lt;br /&gt;
* See [[File upload size]] for more details.&lt;br /&gt;
&lt;br /&gt;
===User quota===&lt;br /&gt;
&lt;br /&gt;
The maximum number of bytes that a user can store in their own [[Private files]] area.&lt;br /&gt;
&lt;br /&gt;
===Allow EMBED and OBJECT tags===&lt;br /&gt;
Allowing these presents a security risk but if you wish normal users such as students to be able to use them then check the box here.&lt;br /&gt;
&lt;br /&gt;
===Enable trusted content===&lt;br /&gt;
&lt;br /&gt;
By default Moodle will always thoroughly clean text that comes from users to remove any possible bad scripts, media etc that could be a security risk. The Trusted Content system is a way of giving particular users that you trust the ability to include these advanced features in their content without interference. To enable this system, you need to first enable this setting, and then grant the [[Capabilities/moodle/site:trustcontent|Trust submitted content]] capability to a specific Moodle role. Texts created or uploaded by such users will be marked as trusted and will not be cleaned before display.&lt;br /&gt;
&lt;br /&gt;
===Maximum time to edit posts===&lt;br /&gt;
&lt;br /&gt;
This sets the editing time for forum postings. The editing time is the amount of time users have to change forum postings before they are mailed to subscribers.&lt;br /&gt;
&lt;br /&gt;
Please refer to the forum discussions [http://moodle.org/mod/forum/discuss.php?d=28679 Editing a forum post after the 30 minutes deadline] and [http://moodle.org/mod/forum/discuss.php?d=5367 The philosophy underlying &amp;quot;no editing after 30 minutes&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
===Full name format===&lt;br /&gt;
&lt;br /&gt;
This setting has been moved in Moodle 2.6 onwards to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Users &amp;gt; Permissions &amp;gt; [[Roles settings|User policies]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
===Allow extended characters in usernames===&lt;br /&gt;
&lt;br /&gt;
The default here, unchecked = unenabled, can only contain alphabetical letters in lowercase, numbers, hypen &#039;-&#039;, underscore &#039;_&#039;, period &#039;.&#039;, or at sign &#039;@&#039;. If you enable this, it will be possible to have any characters for the username, but they must still be lowercase. This setting would allow you for example to have usernames with accents such as ö or ê and so on.&lt;br /&gt;
&lt;br /&gt;
Note: In Moodle 3.4.2 onwards, the Site policy URL and Site policy URL for guests settings have been moved to &#039;Policy settings&#039; in the Site administration.&lt;br /&gt;
&lt;br /&gt;
===Keep tag name casing===&lt;br /&gt;
&lt;br /&gt;
If checked, then tags like the following will be displayed: SOCCER, gUiTaR, MacDonalds, music&lt;br /&gt;
&lt;br /&gt;
If unchecked, then all tags will be displayed as follows: Soccer, Guitar, Macdonalds, Music&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tips&#039;&#039;:&lt;br /&gt;
:* For English, off is useful.&lt;br /&gt;
:* For Japanese, no changes are made either way.&lt;br /&gt;
:* For languages where this kind of capitalization changes the meaning, it is best to keep this option on.&lt;br /&gt;
&lt;br /&gt;
===Profiles for enrolled users only===&lt;br /&gt;
&lt;br /&gt;
To prevent misuse by spammers, profile descriptions of users who are not yet enrolled in any course are hidden. New users must enrol in at least one course before they can add a profile description.&lt;br /&gt;
&lt;br /&gt;
===Cron execution via command line only===&lt;br /&gt;
&lt;br /&gt;
[[Cron]] is an action that runs various administrative jobs on your Moodle such as sending out forum posts. Running the cron from a web browser can expose privileged information to anonymous users. Thus it is recommended to only run the cron from the command line or set a cron password for remote access.&lt;br /&gt;
&lt;br /&gt;
===Cron password for remote access===&lt;br /&gt;
&lt;br /&gt;
Setting a password will mean that users can only run cron from the browser if they know the password and add it like this:&lt;br /&gt;
www.YOURMOODLE.com/admin/cron.php/?password=THEPASSWORDYOUSET.&lt;br /&gt;
&lt;br /&gt;
===Account lockout===&lt;br /&gt;
&lt;br /&gt;
Account lockout may be enabled. &lt;br /&gt;
&lt;br /&gt;
Account lockout threshold: After a specified number of failed login attempts, a user&#039;s account is locked and they are sent an email containing a URL to unlock the account. Setting this to &#039;No&#039; means there is no threshold and an account attempting to log in can do so an unlimited number of times.&lt;br /&gt;
&lt;br /&gt;
Account lockout observation window: Observation time for lockout threshold, if there are no failed attempts the threshold counter is reset after this time. This is the counter for how long to watch for more failed attempts by an account trying to log in even after being locked out, the counter will reset at each attempt and last this long.&lt;br /&gt;
&lt;br /&gt;
Account lockout duration: Locked out account is automatically unlocked after this duration.&lt;br /&gt;
&lt;br /&gt;
The account may also be unlocked by an administrator in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Users &amp;gt; Accounts &amp;gt; Browse list of users&#039;&#039; or by waiting for the account lockout duration to elapse.&lt;br /&gt;
&lt;br /&gt;
===Password policy===&lt;br /&gt;
&lt;br /&gt;
It is highly recommended that a password policy is set to force users to use stronger passwords that are less susceptible to being cracked by a intruder.&lt;br /&gt;
[[Image:Password policy.png|thumb|Password policy]]&lt;br /&gt;
&lt;br /&gt;
The password policy includes option to set the minimum length of the password, the minimum number of digits, the minimum number of lower-case characters, the minimum number of upper-case characters and the minimum number of non alphanumeric characters.&lt;br /&gt;
&lt;br /&gt;
The password policy is enabled by default. Default (recommended) settings are:&lt;br /&gt;
* Password length - 8&lt;br /&gt;
* Digits - 1&lt;br /&gt;
* Lowercase letters - 1&lt;br /&gt;
* Uppercase letters - 1&lt;br /&gt;
* Non-alphanumeric characters - 1&lt;br /&gt;
&lt;br /&gt;
If a user enters a password that does not meet the requirements, they are given an error message indicating the nature of the problem with the entered password.&lt;br /&gt;
&lt;br /&gt;
Enabling the password policy does not affect existing users until they decide to or are required to change their password. An admin can force all users to change their password using the force password change option in [[Bulk user actions]].&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip&#039;&#039;: The password policy may also be applied to [[Enrolment key|enrolment keys]] by ticking the &#039;Use password policy&#039; checkbox in the [[Self enrolment]] settings.&lt;br /&gt;
&lt;br /&gt;
===Password rotation limit===&lt;br /&gt;
&lt;br /&gt;
Here you can specify how often a user must change their password before they can re-use a previous password. Note that this might not work with some external authentication plugins.&lt;br /&gt;
&lt;br /&gt;
===Log out after password change===&lt;br /&gt;
&lt;br /&gt;
By default, users can change their password and remain logged in. Enabling this setting will log them out of existing sessions except the one in which they specify their new password. This setting only applies to users manually changing their password, not to bulk password changes.&lt;br /&gt;
&lt;br /&gt;
===User created token duration===&lt;br /&gt;
&lt;br /&gt;
A new setting in Moodle 3.4 onwards enables the duration of a web services token created by a user (for example via the mobile app) to be set. (Previously the duration was 3 months and this value could not be changed.)&lt;br /&gt;
&lt;br /&gt;
===Group enrolment key policy===&lt;br /&gt;
If this is enabled then when a teacher sets a group enrolment key, they will have to set a key which follows the password policy set above. Note that the group enrolment key policy requires the password policy to be enabled.&lt;br /&gt;
&lt;br /&gt;
===Disable user profile images===&lt;br /&gt;
&lt;br /&gt;
Check/tick this box if you don&#039;t want your users to be able to change their [[User pictures|profile images]]. &lt;br /&gt;
&lt;br /&gt;
===Email change confirmation===&lt;br /&gt;
&lt;br /&gt;
A confirmation step is required for users to change their email address unless the &#039;&#039;emailchangeconfirmation&#039;&#039; box is unchecked.&lt;br /&gt;
&lt;br /&gt;
===Remember username===&lt;br /&gt;
If you want  usernames to be stored during login then set this to &amp;quot;yes&amp;quot;. This will store permanent cookies and in some countries may be considered a privacy issue if used without consent. From a UK point of view, see http://tracker.moodle.org/secure/attachment/24290/UK+Laws+Relating+to+Cookies-LUNS2011.pdf See also the Using Moodle forum discussion [http://moodle.org/mod/forum/discuss.php?d=201558 EU Cookie Law].&lt;br /&gt;
&lt;br /&gt;
===Strict validation of required fields===&lt;br /&gt;
If enabled, users are prevented from entering a space or line break only in required fields in forms. (note: add more info)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Policies plugin]] - The Policies plugin provides a new user sign-on process, with ability to define multiple policies (site, privacy, third party), track user consents, and manage updates and versioning of the policies&lt;br /&gt;
&lt;br /&gt;
[[es:Políticas del sitio]]&lt;br /&gt;
[[eu:Gunearen_politikak]]&lt;br /&gt;
[[fr:Règles site]]&lt;br /&gt;
[[ja:サイトポリシー]]&lt;br /&gt;
[[de:Sicherheitsregeln der Website]]&lt;/div&gt;</summary>
		<author><name>Michaelh2</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/4x/sv/index.php?title=Security_recommendations&amp;diff=140481</id>
		<title>Security recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/4x/sv/index.php?title=Security_recommendations&amp;diff=140481"/>
		<updated>2021-05-20T09:50:42Z</updated>

		<summary type="html">&lt;p&gt;Michaelh2: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Security}}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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
*This page contains important security measures for your Moodle installation.&lt;br /&gt;
*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.&lt;br /&gt;
*You should not post actual exploits in the forums or elsewhere on the web (to protect Moodle admins who have not upgraded yet).&lt;br /&gt;
&lt;br /&gt;
==Simple security measures==&lt;br /&gt;
*The best security strategy is a good backup! But you don&#039;t have a good backup unless you are able to restore it. Test your restoration procedures!&lt;br /&gt;
*Load only software or services you will use&lt;br /&gt;
*Perform regular updates&lt;br /&gt;
*Model your security after the layers of clothing you wear on a cold winter day&lt;br /&gt;
&lt;br /&gt;
==Basic recommendations==&lt;br /&gt;
&lt;br /&gt;
;Update Moodle regularly on each release&lt;br /&gt;
:Published security holes draw crackers&#039; attention after release. The older the version, the more vulnerabilities it is likely to contain.&lt;br /&gt;
; Use https to secure all pages (not just the login page)&lt;br /&gt;
:Protect all traffic from your Moodle instance and your users by making all pages accessible via https only. This not only protects passwords on login but also ensures the privacy of your users so that all user data cannot be intercepted or manipulated (&amp;quot;ad injections&amp;quot;) from third parties like WLAN providers for example. Free https certificates are available from https://letsencrypt.org/. In addition, set httpslogin=yes in your moodle config to add an extra layer of protection for submitting login credentials.&lt;br /&gt;
;[[admin/environment/custom check/php check register globals|Register globals &#039;&#039;&#039;MUST&#039;&#039;&#039; be disabled]]&lt;br /&gt;
:This will help prevent against possible XSS problems in third-party scripts.&lt;br /&gt;
;Run the [[Security_overview_report|Security Overview Report]]&lt;br /&gt;
:This identifies various configurations within your Moodle site that may pose a security risk, so any issues raised by that report should be investigated and action taken if necessary.&lt;br /&gt;
;Use strong passwords for admin and teachers&lt;br /&gt;
:Choosing &amp;quot;difficult&amp;quot; passwords is a basic security practice to protect against &amp;quot;brute force&amp;quot; cracking of accounts.&lt;br /&gt;
;Only give teacher accounts to trusted users. Avoid creating public sandboxes with free teacher accounts on production servers.&lt;br /&gt;
:Teacher accounts have much more liberal permissions and it is easier to create situations where data can be abused or stolen.&lt;br /&gt;
;Separate your systems as much as possible&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
==Run regular updates==&lt;br /&gt;
*Use auto update systems&lt;br /&gt;
*Windows Update &lt;br /&gt;
*Linux: up2date, yum, apt-get&lt;br /&gt;
:Consider automating updates with a script scheduled via cron &lt;br /&gt;
*Mac OSX update system&lt;br /&gt;
*Stay current with php, apache, and moodle&lt;br /&gt;
&lt;br /&gt;
==Use mailing lists to stay updated==&lt;br /&gt;
*CERT - http://www.us-cert.gov/cas/signup.html&lt;br /&gt;
*PHP - http://www.php.net/mailing-lists.php - sign up for Announcements list&lt;br /&gt;
*MySQL - http://lists.mysql.com - sign up for MySQL Announcements&lt;br /&gt;
&lt;br /&gt;
==Firewalls==&lt;br /&gt;
*Security experts recommend a dual firewall&lt;br /&gt;
:Differing hardware/software combinations &lt;br /&gt;
*Disabling unused services is often as effective as a firewall&lt;br /&gt;
:Use netstat -a to review open network ports&lt;br /&gt;
*Not a guarantee of protection&lt;br /&gt;
*Allow ports &lt;br /&gt;
:80, 443(ssl), and 9111 (for chat), &lt;br /&gt;
:Remote admin: ssh 22, or rdp 3389&lt;br /&gt;
&lt;br /&gt;
==Password policy==&lt;br /&gt;
&lt;br /&gt;
A password policy may be set up in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Security &amp;gt; [[Site policies]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;good passwords&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
However, making the check too onerous just results in them writing it down so be realistic.&lt;br /&gt;
&lt;br /&gt;
==Be prepared for the worst==&lt;br /&gt;
*Have backups ready &lt;br /&gt;
*Practice recovery procedures ahead of time &lt;br /&gt;
*Use a rootkit detector on a regular basis &lt;br /&gt;
**Linux/MacOSX - http://www.chkrootkit.org/ &lt;br /&gt;
**Windows - http://technet.microsoft.com/en-en/sysinternals/bb897445.aspx and http://technet.microsoft.com/de-de/sysinternals/bb897445.aspx&lt;br /&gt;
&lt;br /&gt;
==Moodle security alerts==&lt;br /&gt;
*Register your site with Moodle.org&lt;br /&gt;
:Registered users receive email alerts&lt;br /&gt;
*Security alerts also posted online&lt;br /&gt;
*Web - http://moodle.org/security&lt;br /&gt;
*RSS feed - http://moodle.org/rss/file.php/1/1/forum/996/rss.xml&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous considerations==&lt;br /&gt;
These are all things you might consider that impact your overall security:&lt;br /&gt;
*Use the secure forms setting&lt;br /&gt;
*Always set a mysql root user password&lt;br /&gt;
*Turn off mysql network access&lt;br /&gt;
*Use SSL, httpslogins=yes&lt;br /&gt;
*Use good passwords - set up a password policy in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Security &amp;gt; [[Site policies]]&#039;&#039;&lt;br /&gt;
*Do not enable the &#039;&#039;opentowebcrawlers&#039;&#039; setting (in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Security &amp;gt; [[Site policies]]&#039;&#039;)&lt;br /&gt;
*Disable guest access&lt;br /&gt;
*Place enrollment keys on all courses or set Course Enrollable = No for all courses&lt;br /&gt;
*Ensure the enrolment key hint is disabled (which it is by default) in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Enrolment &amp;gt; Self enrolment.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Most secure/paranoid file permissions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &amp;lt;u&amp;gt;The following information applies to Linux/Unix based installations only, as MS Windows permission system is quite different&amp;lt;/u&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Depending on your server set-up there are two different scenarios:&lt;br /&gt;
# You are running Moodle on your own dedicated server.&lt;br /&gt;
# You are running Moodle on a shared hosting environment.&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&amp;lt;nowiki&amp;gt;http://your.moodle.site/admin/phpinfo.php&amp;lt;/nowiki&amp;gt;&#039;&#039; (logging in as admin), and then search for the line that reads &#039;User/Group&#039;, inside the &#039;apache&#039; table. For example, I get &#039;www-data&#039; for the user account and &#039;www-data&#039; for the group too.&lt;br /&gt;
&lt;br /&gt;
=== Running Moodle on a dedicated server ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
1. moodledata directory and all of its contents (and subdirectories, includes sessions):&lt;br /&gt;
 owner: apache user (apache, httpd, www-data, whatever; see above)&lt;br /&gt;
 group: apache group (apache, httpd, www-data, whatever; see above)&lt;br /&gt;
 permissions: 700 on directories, 600 on files&lt;br /&gt;
&lt;br /&gt;
2. moodle directory and all of its contents and subdirectories (including config.php):&lt;br /&gt;
 owner: root&lt;br /&gt;
 group: root&lt;br /&gt;
 permissions: 755 on directories, 644 on files.&lt;br /&gt;
&lt;br /&gt;
If you allow local logins for regular users, then 2. should be:&lt;br /&gt;
 owner: root&lt;br /&gt;
 group: apache group (apache, httpd, www-data, whatever; see above)&lt;br /&gt;
 permissions: 750 on directories, 640 on files.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
=== Running Moodle on a shared hosting environment ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
If you want to tighten your permissions as much as possible, you will need to know:&lt;br /&gt;
&lt;br /&gt;
# the user account and the group the web service is running under (see above).&lt;br /&gt;
# 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.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Security FAQ]]&lt;br /&gt;
*[https://moodle.com/news/top-security-tips-for-moodle-administrators/ Top security tips for Moodle administrators article]&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=39404 Guide to Securing your Moodle Server]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=93561 How to secure Moodle website from hacking] including recommendations on emergency recovery&lt;br /&gt;
&lt;br /&gt;
[[es:Recomendaciones de Seguridad]]&lt;br /&gt;
[[fr:Sécurité]]&lt;/div&gt;</summary>
		<author><name>Michaelh2</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/4x/sv/index.php?title=Security_overview_report&amp;diff=140112</id>
		<title>Security overview report</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/4x/sv/index.php?title=Security_overview_report&amp;diff=140112"/>
		<updated>2021-04-13T10:06:19Z</updated>

		<summary type="html">&lt;p&gt;Michaelh2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Security}}&lt;br /&gt;
A security overview report is available via &#039;Security checks&#039; in the Site administration &amp;quot;Reports&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
Some of the checks included are as follows:&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check globals|Register globals]]&lt;br /&gt;
:register_globals is a PHP setting that must be disabled for Moodle to operate safely.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check unsecuredataroot|Insecure dataroot]]&lt;br /&gt;
:The dataroot is the directory where Moodle stores user files.  It should not be directly accessible via the web.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check displayerrors|Displaying of PHP errors]]&lt;br /&gt;
:If PHP is set to display errors, then anyone can enter a faulty URL causing PHP to give up valuable information about directory structures and so on.&lt;br /&gt;
&lt;br /&gt;
*[[Vendor directory security check|Vendor directory]]&lt;br /&gt;
:The vendor directory should not be present on public sites.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check noauth|No authentication]]&lt;br /&gt;
:Use of the &amp;quot;no authentication&amp;quot; plugin can be dangerous, allowing people to access the site without authenticating. &lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check embed|Allow EMBED and OBJECT]]&lt;br /&gt;
:Allowing ordinary users to embed Flash and other media in their texts (eg forum posts) can be a problem because those rich media objects can be used to steal admin or teacher access, even if the media object is on another server.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report_security_check_preventexecpath|Execuable paths]]&lt;br /&gt;
:Allowing executable paths to be set via the Admin GUI is a vector for privilege escalation. This can be prevented by setting the following config.php: &amp;lt;code php&amp;gt;$CFG-&amp;gt;preventexecpath = true;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check mediafilterswf‎|Enabled .swf media filter]]&lt;br /&gt;
:Even the flash media filter can be abused to include malicious flash files.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check openprofiles|Open user profiles]]&lt;br /&gt;
:User profiles should not be open to the web without authentication, both for privacy reasons and because spammers then have a platform to publish spam on your site.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check google|Open to Google]]&lt;br /&gt;
:Allowing Google to enter your site means that all the contents become available to the world.  Don&#039;t use this unless it&#039;s a really public site.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check passwordpolicy|Password policy]]&lt;br /&gt;
:Using a password policy will force your users to use stronger passwords that are less susceptible to being cracked by a intruder.&lt;br /&gt;
&lt;br /&gt;
*[[Password salting|Password salt]]&lt;br /&gt;
:Setting a password salt greatly reduces the risk of password theft.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check emailchangeconfirmation‎|Email change confirmation]]&lt;br /&gt;
:You should generally always force users to confirm email address changes via an extra step where a confirmation link is sent to the user.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check cookiesecure|Secure cookies]]&lt;br /&gt;
:It is recommended to use secure cookies only when serving over SSL.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check configrw|Writable config.php]]&lt;br /&gt;
:The config.php file must not be writeable by the web server process.  If it is, then it is possible for another vulnerability to allow attackers to rewrite the Moodle code and display whatever they want.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check riskxss|XSS trusted users]]&lt;br /&gt;
:Make sure that you trust all the people on this list:  they are the ones with permissions to potentially write XSS exploits in forums etc.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check riskadmin|Administrators]]&lt;br /&gt;
:Review your administrator accounts and make sure you only have what you need.&lt;br /&gt;
&lt;br /&gt;
*[[Backup of user data]]&lt;br /&gt;
:Make sure that only roles that need to backup user data can do so and that all users who have the capability are trusted.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check defaultuserrole‎ |Default role for all users]]&lt;br /&gt;
:This checks that the registered user role is defined with sane permissions.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check guestrole|Guest role]]&lt;br /&gt;
:This checks that the guest role is defined with sane permissions.&lt;br /&gt;
&lt;br /&gt;
*[[report/security/report security check frontpagerole‎|Frontpage role]]&lt;br /&gt;
:This checks that the frontpage user role is defined with sane permissions.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/view.php?id=7301 Security and Privacy forum] on moodle.org&lt;br /&gt;
&lt;br /&gt;
[[Category:Report]]&lt;br /&gt;
[[Category:Site administration]]&lt;br /&gt;
&lt;br /&gt;
[[de:Sicherheitsbericht]]&lt;br /&gt;
[[es:Reporte Vista general de Seguridad]]&lt;br /&gt;
[[eu:Seguratasunaren_ikuspegi_orokorra]]&lt;br /&gt;
[[fr:Panorama de sécurité]]&lt;br /&gt;
[[ja:セキュリティオーバービュー]]&lt;/div&gt;</summary>
		<author><name>Michaelh2</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/4x/sv/index.php?title=Security_recommendations&amp;diff=140111</id>
		<title>Security recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/4x/sv/index.php?title=Security_recommendations&amp;diff=140111"/>
		<updated>2021-04-13T09:59:11Z</updated>

		<summary type="html">&lt;p&gt;Michaelh2: /* Basic recommendations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Security}}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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
*This page contains important security measures for your Moodle installation.&lt;br /&gt;
*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.&lt;br /&gt;
*You should not post actual exploits in the forums or elsewhere on the web (to protect Moodle admins who have not upgraded yet).&lt;br /&gt;
&lt;br /&gt;
==Simple security measures==&lt;br /&gt;
*The best security strategy is a good backup! But you don&#039;t have a good backup unless you are able to restore it. Test your restoration procedures!&lt;br /&gt;
*Load only software or services you will use&lt;br /&gt;
*Perform regular updates&lt;br /&gt;
*Model your security after the layers of clothing you wear on a cold winter day&lt;br /&gt;
&lt;br /&gt;
==Basic recommendations==&lt;br /&gt;
&lt;br /&gt;
;Update Moodle regularly on each release&lt;br /&gt;
:Published security holes draw crackers&#039; attention after release. The older the version, the more vulnerabilities it is likely to contain.&lt;br /&gt;
; Use https to secure all pages (not just the login page)&lt;br /&gt;
:Protect all traffic from your Moodle instance and your users by making all pages accessible via https only. This not only protects passwords on login but also ensures the privacy of your users so that all user data cannot be intercepted or manipulated (&amp;quot;ad injections&amp;quot;) from third parties like WLAN providers for example. Free https certificates are available from https://letsencrypt.org/. In addition, set httpslogin=yes in your moodle config to add an extra layer of protection for submitting login credentials.&lt;br /&gt;
;[[admin/environment/custom check/php check register globals|Register globals &#039;&#039;&#039;MUST&#039;&#039;&#039; be disabled]]&lt;br /&gt;
:This will help prevent against possible XSS problems in third-party scripts.&lt;br /&gt;
;Run the [[Security_overview_report|Security Overview Report]]&lt;br /&gt;
:This identifies various configurations within your Moodle site that may pose a security risk, so any issues raised by that report should be investigated and action taken if necessary.&lt;br /&gt;
;Use strong passwords for admin and teachers&lt;br /&gt;
:Choosing &amp;quot;difficult&amp;quot; passwords is a basic security practice to protect against &amp;quot;brute force&amp;quot; cracking of accounts.&lt;br /&gt;
;Only give teacher accounts to trusted users. Avoid creating public sandboxes with free teacher accounts on production servers.&lt;br /&gt;
:Teacher accounts have much more liberal permissions and it is easier to create situations where data can be abused or stolen.&lt;br /&gt;
;Separate your systems as much as possible&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
==Run regular updates==&lt;br /&gt;
*Use auto update systems&lt;br /&gt;
*Windows Update &lt;br /&gt;
*Linux: up2date, yum, apt-get&lt;br /&gt;
:Consider automating updates with a script scheduled via cron &lt;br /&gt;
*Mac OSX update system&lt;br /&gt;
*Stay current with php, apache, and moodle&lt;br /&gt;
&lt;br /&gt;
==Use mailing lists to stay updated==&lt;br /&gt;
*CERT - http://www.us-cert.gov/cas/signup.html&lt;br /&gt;
*PHP - http://www.php.net/mailing-lists.php - sign up for Announcements list&lt;br /&gt;
*MySQL - http://lists.mysql.com - sign up for MySQL Announcements&lt;br /&gt;
&lt;br /&gt;
==Firewalls==&lt;br /&gt;
*Security experts recommend a dual firewall&lt;br /&gt;
:Differing hardware/software combinations &lt;br /&gt;
*Disabling unused services is often as effective as a firewall&lt;br /&gt;
:Use netstat -a to review open network ports&lt;br /&gt;
*Not a guarantee of protection&lt;br /&gt;
*Allow ports &lt;br /&gt;
:80, 443(ssl), and 9111 (for chat), &lt;br /&gt;
:Remote admin: ssh 22, or rdp 3389&lt;br /&gt;
&lt;br /&gt;
==Password policy==&lt;br /&gt;
&lt;br /&gt;
A password policy may be set up in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Security &amp;gt; [[Site policies]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;good passwords&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
However, making the check too onerous just results in them writing it down so be realistic.&lt;br /&gt;
&lt;br /&gt;
==Be prepared for the worst==&lt;br /&gt;
*Have backups ready &lt;br /&gt;
*Practice recovery procedures ahead of time &lt;br /&gt;
*Use a rootkit detector on a regular basis &lt;br /&gt;
**Linux/MacOSX - http://www.chkrootkit.org/ &lt;br /&gt;
**Windows - http://technet.microsoft.com/en-en/sysinternals/bb897445.aspx and http://technet.microsoft.com/de-de/sysinternals/bb897445.aspx&lt;br /&gt;
&lt;br /&gt;
==Moodle security alerts==&lt;br /&gt;
*Register your site with Moodle.org&lt;br /&gt;
:Registered users receive email alerts&lt;br /&gt;
*Security alerts also posted online&lt;br /&gt;
*Web - http://moodle.org/security&lt;br /&gt;
*RSS feed - http://moodle.org/rss/file.php/1/1/forum/996/rss.xml&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous considerations==&lt;br /&gt;
These are all things you might consider that impact your overall security:&lt;br /&gt;
*Use the secure forms setting&lt;br /&gt;
*Always set a mysql root user password&lt;br /&gt;
*Turn off mysql network access&lt;br /&gt;
*Use SSL, httpslogins=yes&lt;br /&gt;
*Use good passwords - set up a password policy in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Security &amp;gt; [[Site policies]]&#039;&#039;&lt;br /&gt;
*Do not enable the &#039;&#039;opentowebcrawlers&#039;&#039; setting (in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Security &amp;gt; [[Site policies]]&#039;&#039;)&lt;br /&gt;
*Disable guest access&lt;br /&gt;
*Place enrollment keys on all courses or set Course Enrollable = No for all courses&lt;br /&gt;
*Ensure the enrolment key hint is disabled (which it is by default) in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Enrolment &amp;gt; Self enrolment.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Most secure/paranoid file permissions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &amp;lt;u&amp;gt;The following information applies to Linux/Unix based installations only, as MS Windows permission system is quite different&amp;lt;/u&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Depending on your server set-up there are two different scenarios:&lt;br /&gt;
# You are running Moodle on your own dedicated server.&lt;br /&gt;
# You are running Moodle on a shared hosting environment.&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&amp;lt;nowiki&amp;gt;http://your.moodle.site/admin/phpinfo.php&amp;lt;/nowiki&amp;gt;&#039;&#039; (logging in as admin), and then search for the line that reads &#039;User/Group&#039;, inside the &#039;apache&#039; table. For example, I get &#039;www-data&#039; for the user account and &#039;www-data&#039; for the group too.&lt;br /&gt;
&lt;br /&gt;
=== Running Moodle on a dedicated server ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
1. moodledata directory and all of its contents (and subdirectories, includes sessions):&lt;br /&gt;
 owner: apache user (apache, httpd, www-data, whatever; see above)&lt;br /&gt;
 group: apache group (apache, httpd, www-data, whatever; see above)&lt;br /&gt;
 permissions: 700 on directories, 600 on files&lt;br /&gt;
&lt;br /&gt;
2. moodle directory and all of its contents and subdirectories (including config.php):&lt;br /&gt;
 owner: root&lt;br /&gt;
 group: root&lt;br /&gt;
 permissions: 755 on directories, 644 on files.&lt;br /&gt;
&lt;br /&gt;
If you allow local logins for regular users, then 2. should be:&lt;br /&gt;
 owner: root&lt;br /&gt;
 group: apache group (apache, httpd, www-data, whatever; see above)&lt;br /&gt;
 permissions: 750 on directories, 640 on files.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
=== Running Moodle on a shared hosting environment ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
If you want to tighten your permissions as much as possible, you will need to know:&lt;br /&gt;
&lt;br /&gt;
# the user account and the group the web service is running under (see above).&lt;br /&gt;
# 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.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Security FAQ]]&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=39404 Guide to Securing your Moodle Server]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=93561 How to secure Moodle website from hacking] including recommendations on emergency recovery&lt;br /&gt;
&lt;br /&gt;
[[es:Recomendaciones de Seguridad]]&lt;br /&gt;
[[fr:Sécurité]]&lt;/div&gt;</summary>
		<author><name>Michaelh2</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/4x/sv/index.php?title=Security_recommendations&amp;diff=140110</id>
		<title>Security recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/4x/sv/index.php?title=Security_recommendations&amp;diff=140110"/>
		<updated>2021-04-13T09:56:29Z</updated>

		<summary type="html">&lt;p&gt;Michaelh2: /* Basic recommendations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Security}}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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
*This page contains important security measures for your Moodle installation.&lt;br /&gt;
*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.&lt;br /&gt;
*You should not post actual exploits in the forums or elsewhere on the web (to protect Moodle admins who have not upgraded yet).&lt;br /&gt;
&lt;br /&gt;
==Simple security measures==&lt;br /&gt;
*The best security strategy is a good backup! But you don&#039;t have a good backup unless you are able to restore it. Test your restoration procedures!&lt;br /&gt;
*Load only software or services you will use&lt;br /&gt;
*Perform regular updates&lt;br /&gt;
*Model your security after the layers of clothing you wear on a cold winter day&lt;br /&gt;
&lt;br /&gt;
==Basic recommendations==&lt;br /&gt;
&lt;br /&gt;
;Update Moodle regularly on each release&lt;br /&gt;
:Published security holes draw crackers&#039; attention after release. The older the version, the more vulnerabilities it is likely to contain.&lt;br /&gt;
; Use https to secure all pages (not just the login page)&lt;br /&gt;
:Protect all traffic from your Moodle instance and your users by making all pages accessible via https only. This not only protects passwords on login but also ensures the privacy of your users so that all user data cannot be intercepted or manipulated (&amp;quot;ad injections&amp;quot;) from third parties like WLAN providers for example. Free https certificates are available from https://letsencrypt.org/. In addition, set httpslogin=yes in your moodle config to add an extra layer of protection for submitting login credentials.&lt;br /&gt;
;[[admin/environment/custom check/php check register globals|Register globals &#039;&#039;&#039;MUST&#039;&#039;&#039; be disabled]]&lt;br /&gt;
:This will help prevent against possible XSS problems in third-party scripts.&lt;br /&gt;
;Run the [[Security_overview_report|Security Overview Report]] and address any issues identified.&lt;br /&gt;
;Use strong passwords for admin and teachers&lt;br /&gt;
:Choosing &amp;quot;difficult&amp;quot; passwords is a basic security practice to protect against &amp;quot;brute force&amp;quot; cracking of accounts.&lt;br /&gt;
;Only give teacher accounts to trusted users. Avoid creating public sandboxes with free teacher accounts on production servers.&lt;br /&gt;
:Teacher accounts have much more liberal permissions and it is easier to create situations where data can be abused or stolen.&lt;br /&gt;
;Separate your systems as much as possible&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
==Run regular updates==&lt;br /&gt;
*Use auto update systems&lt;br /&gt;
*Windows Update &lt;br /&gt;
*Linux: up2date, yum, apt-get&lt;br /&gt;
:Consider automating updates with a script scheduled via cron &lt;br /&gt;
*Mac OSX update system&lt;br /&gt;
*Stay current with php, apache, and moodle&lt;br /&gt;
&lt;br /&gt;
==Use mailing lists to stay updated==&lt;br /&gt;
*CERT - http://www.us-cert.gov/cas/signup.html&lt;br /&gt;
*PHP - http://www.php.net/mailing-lists.php - sign up for Announcements list&lt;br /&gt;
*MySQL - http://lists.mysql.com - sign up for MySQL Announcements&lt;br /&gt;
&lt;br /&gt;
==Firewalls==&lt;br /&gt;
*Security experts recommend a dual firewall&lt;br /&gt;
:Differing hardware/software combinations &lt;br /&gt;
*Disabling unused services is often as effective as a firewall&lt;br /&gt;
:Use netstat -a to review open network ports&lt;br /&gt;
*Not a guarantee of protection&lt;br /&gt;
*Allow ports &lt;br /&gt;
:80, 443(ssl), and 9111 (for chat), &lt;br /&gt;
:Remote admin: ssh 22, or rdp 3389&lt;br /&gt;
&lt;br /&gt;
==Password policy==&lt;br /&gt;
&lt;br /&gt;
A password policy may be set up in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Security &amp;gt; [[Site policies]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;good passwords&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
However, making the check too onerous just results in them writing it down so be realistic.&lt;br /&gt;
&lt;br /&gt;
==Be prepared for the worst==&lt;br /&gt;
*Have backups ready &lt;br /&gt;
*Practice recovery procedures ahead of time &lt;br /&gt;
*Use a rootkit detector on a regular basis &lt;br /&gt;
**Linux/MacOSX - http://www.chkrootkit.org/ &lt;br /&gt;
**Windows - http://technet.microsoft.com/en-en/sysinternals/bb897445.aspx and http://technet.microsoft.com/de-de/sysinternals/bb897445.aspx&lt;br /&gt;
&lt;br /&gt;
==Moodle security alerts==&lt;br /&gt;
*Register your site with Moodle.org&lt;br /&gt;
:Registered users receive email alerts&lt;br /&gt;
*Security alerts also posted online&lt;br /&gt;
*Web - http://moodle.org/security&lt;br /&gt;
*RSS feed - http://moodle.org/rss/file.php/1/1/forum/996/rss.xml&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous considerations==&lt;br /&gt;
These are all things you might consider that impact your overall security:&lt;br /&gt;
*Use the secure forms setting&lt;br /&gt;
*Always set a mysql root user password&lt;br /&gt;
*Turn off mysql network access&lt;br /&gt;
*Use SSL, httpslogins=yes&lt;br /&gt;
*Use good passwords - set up a password policy in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Security &amp;gt; [[Site policies]]&#039;&#039;&lt;br /&gt;
*Do not enable the &#039;&#039;opentowebcrawlers&#039;&#039; setting (in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Security &amp;gt; [[Site policies]]&#039;&#039;)&lt;br /&gt;
*Disable guest access&lt;br /&gt;
*Place enrollment keys on all courses or set Course Enrollable = No for all courses&lt;br /&gt;
*Ensure the enrolment key hint is disabled (which it is by default) in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Enrolment &amp;gt; Self enrolment.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Most secure/paranoid file permissions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &amp;lt;u&amp;gt;The following information applies to Linux/Unix based installations only, as MS Windows permission system is quite different&amp;lt;/u&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Depending on your server set-up there are two different scenarios:&lt;br /&gt;
# You are running Moodle on your own dedicated server.&lt;br /&gt;
# You are running Moodle on a shared hosting environment.&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&amp;lt;nowiki&amp;gt;http://your.moodle.site/admin/phpinfo.php&amp;lt;/nowiki&amp;gt;&#039;&#039; (logging in as admin), and then search for the line that reads &#039;User/Group&#039;, inside the &#039;apache&#039; table. For example, I get &#039;www-data&#039; for the user account and &#039;www-data&#039; for the group too.&lt;br /&gt;
&lt;br /&gt;
=== Running Moodle on a dedicated server ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
1. moodledata directory and all of its contents (and subdirectories, includes sessions):&lt;br /&gt;
 owner: apache user (apache, httpd, www-data, whatever; see above)&lt;br /&gt;
 group: apache group (apache, httpd, www-data, whatever; see above)&lt;br /&gt;
 permissions: 700 on directories, 600 on files&lt;br /&gt;
&lt;br /&gt;
2. moodle directory and all of its contents and subdirectories (including config.php):&lt;br /&gt;
 owner: root&lt;br /&gt;
 group: root&lt;br /&gt;
 permissions: 755 on directories, 644 on files.&lt;br /&gt;
&lt;br /&gt;
If you allow local logins for regular users, then 2. should be:&lt;br /&gt;
 owner: root&lt;br /&gt;
 group: apache group (apache, httpd, www-data, whatever; see above)&lt;br /&gt;
 permissions: 750 on directories, 640 on files.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
=== Running Moodle on a shared hosting environment ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
If you want to tighten your permissions as much as possible, you will need to know:&lt;br /&gt;
&lt;br /&gt;
# the user account and the group the web service is running under (see above).&lt;br /&gt;
# 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.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Security FAQ]]&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=39404 Guide to Securing your Moodle Server]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=93561 How to secure Moodle website from hacking] including recommendations on emergency recovery&lt;br /&gt;
&lt;br /&gt;
[[es:Recomendaciones de Seguridad]]&lt;br /&gt;
[[fr:Sécurité]]&lt;/div&gt;</summary>
		<author><name>Michaelh2</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/4x/sv/index.php?title=HTTP_security&amp;diff=140109</id>
		<title>HTTP security</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/4x/sv/index.php?title=HTTP_security&amp;diff=140109"/>
		<updated>2021-04-13T06:01:04Z</updated>

		<summary type="html">&lt;p&gt;Michaelh2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Security}}&lt;br /&gt;
*In Moodle 3.4 onwards, the setting &#039;Use HTTPS for logins&#039; (loginhttps) has been removed.&lt;br /&gt;
* There is a [[HTTPS conversion tool]] for converting embedded content to HTTPS.&lt;br /&gt;
&lt;br /&gt;
==Secure cookies only==&lt;br /&gt;
&lt;br /&gt;
It is recommended to use secure cookies only when serving over [https://en.wikipedia.org/wiki/Transport_Layer_Security SSL]. When not serving over SSL, the setting is ignored. In Moodle 3.1.2 onwards, the &#039;Secure cookies only&#039; default setting is on.&lt;br /&gt;
&lt;br /&gt;
==cURL blocked hosts list==&lt;br /&gt;
&lt;br /&gt;
This allows you to block Moodle&#039;s cURL implementation from accessing the specified hosts, wherever it is used to fetch content (such as by the URL downloader in the file picker). Generally it is recommended that as a minimum this is configured to prevent access to any internal network resources. The following is an example list of hosts which can be configured, which prevents access to various versions of &amp;quot;localhost&amp;quot;, as well as an address commonly used by AWS and some other cloud providers to provide meta data about the server instance (169.254.169.254):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
127.0.0.1&lt;br /&gt;
192.168.0.0/16&lt;br /&gt;
10.0.0.0/8&lt;br /&gt;
172.16.0.0/12&lt;br /&gt;
0.0.0.0&lt;br /&gt;
localhost&lt;br /&gt;
169.254.169.254&lt;br /&gt;
0000::1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In future, some logical default values such as those above will be configured automatically for new Moodle sites. See MDL-56873 for more details.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; In addition to configuring this at the application level via this setting, it is also recommended that sufficient firewall/network security measures are in place, including restricting access to internal network endpoints to those users/services that require them.&lt;br /&gt;
&lt;br /&gt;
==cURL allowed ports list==&lt;br /&gt;
&lt;br /&gt;
This allows you to restrict Moodle&#039;s cURL implementation to only access the specified list of port numbers, wherever it is used to fetch content (such as by the URL downloader in the file picker). Generally it is recommended that this is configured to only allow standard web ports, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
80&lt;br /&gt;
443&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In future, some logical default values such as those above will be configured automatically for new Moodle sites. See MDL-56873 for more details.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; In addition to configuring this at the application level via this setting, it is also recommended that sufficient firewall/network security measures are in place, including restricting access to open ports on the internal network to those users/services that require them.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* MDL-55662 for removing the secure cookies only setting&lt;br /&gt;
&lt;br /&gt;
[[Category:Site administration]]&lt;br /&gt;
&lt;br /&gt;
[[de:HTTP-Sicherheit]]&lt;br /&gt;
[[es:Seguridad HTTP]]&lt;/div&gt;</summary>
		<author><name>Michaelh2</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/4x/sv/index.php?title=Security_recommendations&amp;diff=138921</id>
		<title>Security recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/4x/sv/index.php?title=Security_recommendations&amp;diff=138921"/>
		<updated>2020-11-12T08:56:42Z</updated>

		<summary type="html">&lt;p&gt;Michaelh2: /* Miscellaneous considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Security}}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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
*This page contains important security measures for your Moodle installation.&lt;br /&gt;
*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.&lt;br /&gt;
*You should not post actual exploits in the forums or elsewhere on the web (to protect Moodle admins who have not upgraded yet).&lt;br /&gt;
&lt;br /&gt;
==Simple security measures==&lt;br /&gt;
*The best security strategy is a good backup! But you don&#039;t have a good backup unless you are able to restore it. Test your restoration procedures!&lt;br /&gt;
*Load only software or services you will use&lt;br /&gt;
*Perform regular updates&lt;br /&gt;
*Model your security after the layers of clothing you wear on a cold winter day&lt;br /&gt;
&lt;br /&gt;
==Basic recommendations==&lt;br /&gt;
&lt;br /&gt;
;Update Moodle regularly on each release&lt;br /&gt;
:Published security holes draw crackers attention after release. The older the version, the more vulnerabilities it is likely to contain.&lt;br /&gt;
; Use https to secure all pages (not just the login page)&lt;br /&gt;
:Protect all traffic from your Moodle instance and your users by making all pages accessible via https only. This not only protects passwords on login but also ensures the privacy of your users so that all user data cannot be intercepted or manipulated (&amp;quot;ad injections&amp;quot;) from third parties like WLAN providers for example. Free https certificates are available from https://letsencrypt.org/. In addition, set httpslogin=yes in your moodle config to add an extra layer of protection for submitting login credentials.&lt;br /&gt;
;[[admin/environment/custom check/php check register globals|Register globals &#039;&#039;&#039;MUST&#039;&#039;&#039; be disabled]]&lt;br /&gt;
:This will help prevent against possible XSS problems in third-party scripts.&lt;br /&gt;
;Use strong passwords for admin and teachers&lt;br /&gt;
:Choosing &amp;quot;difficult&amp;quot; passwords is a basic security practice to protect against &amp;quot;brute force&amp;quot; cracking of accounts.&lt;br /&gt;
;Only give teacher accounts to trusted users. Avoid creating public sandboxes with free teacher accounts on production servers.&lt;br /&gt;
:Teacher accounts have much freer permissions and it is easier to create situations where data can be abused or stolen.&lt;br /&gt;
;Separate your systems as much as possible&lt;br /&gt;
: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.&lt;br /&gt;
&lt;br /&gt;
==Run regular updates==&lt;br /&gt;
*Use auto update systems&lt;br /&gt;
*Windows Update &lt;br /&gt;
*Linux: up2date, yum, apt-get&lt;br /&gt;
:Consider automating updates with a script scheduled via cron &lt;br /&gt;
*Mac OSX update system&lt;br /&gt;
*Stay current with php, apache, and moodle&lt;br /&gt;
&lt;br /&gt;
==Use mailing lists to stay updated==&lt;br /&gt;
*CERT - http://www.us-cert.gov/cas/signup.html&lt;br /&gt;
*PHP - http://www.php.net/mailing-lists.php - sign up for Announcements list&lt;br /&gt;
*MySQL - http://lists.mysql.com - sign up for MySQL Announcements&lt;br /&gt;
&lt;br /&gt;
==Firewalls==&lt;br /&gt;
*Security experts recommend a dual firewall&lt;br /&gt;
:Differing hardware/software combinations &lt;br /&gt;
*Disabling unused services is often as effective as a firewall&lt;br /&gt;
:Use netstat -a to review open network ports&lt;br /&gt;
*Not a guarantee of protection&lt;br /&gt;
*Allow ports &lt;br /&gt;
:80, 443(ssl), and 9111 (for chat), &lt;br /&gt;
:Remote admin: ssh 22, or rdp 3389&lt;br /&gt;
&lt;br /&gt;
==Password policy==&lt;br /&gt;
&lt;br /&gt;
A password policy may be set up in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Security &amp;gt; [[Site policies]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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 &amp;quot;good passwords&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
However, making the check too onerous just results in them writing it down so be realistic.&lt;br /&gt;
&lt;br /&gt;
==Be prepared for the worst==&lt;br /&gt;
*Have backups ready &lt;br /&gt;
*Practice recovery procedures ahead of time &lt;br /&gt;
*Use a rootkit detector on a regular basis &lt;br /&gt;
**Linux/MacOSX - http://www.chkrootkit.org/ &lt;br /&gt;
**Windows - http://technet.microsoft.com/en-en/sysinternals/bb897445.aspx and http://technet.microsoft.com/de-de/sysinternals/bb897445.aspx&lt;br /&gt;
&lt;br /&gt;
==Moodle security alerts==&lt;br /&gt;
*Register your site with Moodle.org&lt;br /&gt;
:Registered users receive email alerts&lt;br /&gt;
*Security alerts also posted online&lt;br /&gt;
*Web - http://moodle.org/security&lt;br /&gt;
*RSS feed - http://moodle.org/rss/file.php/1/1/forum/996/rss.xml&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous considerations==&lt;br /&gt;
These are all things you might consider that impact your overall security:&lt;br /&gt;
*Use the secure forms setting&lt;br /&gt;
*Always set a mysql root user password&lt;br /&gt;
*Turn off mysql network access&lt;br /&gt;
*Use SSL, httpslogins=yes&lt;br /&gt;
*Use good passwords - set up a password policy in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Security &amp;gt; [[Site policies]]&#039;&#039;&lt;br /&gt;
*Do not enable the &#039;&#039;opentowebcrawlers&#039;&#039; setting (in &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Security &amp;gt; [[Site policies]]&#039;&#039;)&lt;br /&gt;
*Disable guest access&lt;br /&gt;
*Place enrollment keys on all courses or set Course Enrollable = No for all courses&lt;br /&gt;
*Ensure the enrolment key hint is disabled (which it is by default) in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Enrolment &amp;gt; Self enrolment.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Most secure/paranoid file permissions==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: &amp;lt;u&amp;gt;The following information applies to Linux/Unix based installations only, as MS Windows permission system is quite different&amp;lt;/u&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Depending on your server set-up there are two different scenarios:&lt;br /&gt;
# You are running Moodle on your own dedicated server.&lt;br /&gt;
# You are running Moodle on a shared hosting environment.&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&amp;lt;nowiki&amp;gt;http://your.moodle.site/admin/phpinfo.php&amp;lt;/nowiki&amp;gt;&#039;&#039; (logging in as admin), and then search for the line that reads &#039;User/Group&#039;, inside the &#039;apache&#039; table. For example, I get &#039;www-data&#039; for the user account and &#039;www-data&#039; for the group too.&lt;br /&gt;
&lt;br /&gt;
=== Running Moodle on a dedicated server ===&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
1. moodledata directory and all of its contents (and subdirectories, includes sessions):&lt;br /&gt;
 owner: apache user (apache, httpd, www-data, whatever; see above)&lt;br /&gt;
 group: apache group (apache, httpd, www-data, whatever; see above)&lt;br /&gt;
 permissions: 700 on directories, 600 on files&lt;br /&gt;
&lt;br /&gt;
2. moodle directory and all of its contents and subdirectories (including config.php):&lt;br /&gt;
 owner: root&lt;br /&gt;
 group: root&lt;br /&gt;
 permissions: 755 on directories, 644 on files.&lt;br /&gt;
&lt;br /&gt;
If you allow local logins for regular users, then 2. should be:&lt;br /&gt;
 owner: root&lt;br /&gt;
 group: apache group (apache, httpd, www-data, whatever; see above)&lt;br /&gt;
 permissions: 750 on directories, 640 on files.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
=== Running Moodle on a shared hosting environment ===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
If you want to tighten your permissions as much as possible, you will need to know:&lt;br /&gt;
&lt;br /&gt;
# the user account and the group the web service is running under (see above).&lt;br /&gt;
# 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.&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Security FAQ]]&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=39404 Guide to Securing your Moodle Server]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=93561 How to secure Moodle website from hacking] including recommendations on emergency recovery&lt;br /&gt;
&lt;br /&gt;
[[es:Recomendaciones de Seguridad]]&lt;br /&gt;
[[fr:Sécurité]]&lt;/div&gt;</summary>
		<author><name>Michaelh2</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/4x/sv/index.php?title=OAuth_2_LinkedIn_service&amp;diff=134118</id>
		<title>OAuth 2 LinkedIn service</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/4x/sv/index.php?title=OAuth_2_LinkedIn_service&amp;diff=134118"/>
		<updated>2019-05-29T05:27:55Z</updated>

		<summary type="html">&lt;p&gt;Michaelh2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{OAuth2}}&lt;br /&gt;
&lt;br /&gt;
From 1 May 2019, LinkedIn no longer support their v1 API, which could previously be configured as an OAuth 2 authentication method in Moodle. According to LinkedIn&#039;s v2 API [https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq?context=linkedin/consumer/context migration documentation], the new API replaces the old basic user information endpoint with a &#039;lite&#039; endpoint, which does not include a user&#039;s email address (which must be retrieved from a separate endpoint).&lt;br /&gt;
&lt;br /&gt;
Since email address is a required field in Moodle, and our OAuth 2 implementation currently requires all user information to be retrieved from a single endpoint, the LinkedIn v2 API currently appears to be incompatible with Moodle&#039;s &amp;quot;Custom OAuth 2 Service&amp;quot; feature.&lt;br /&gt;
&lt;br /&gt;
We are continuing to investigate a workaround for the new API, and will update this documentation further when a solution can be found. In the meantime, if you have any information that may assist with this, please contribute to Tracker issue MDL-65637.&lt;br /&gt;
[[es:Servicio OAuth 2 Linkedln]]&lt;br /&gt;
[[de:OAuth2 LinkedIn Service]]&lt;/div&gt;</summary>
		<author><name>Michaelh2</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/4x/sv/index.php?title=report/security/report_security_check_google&amp;diff=133996</id>
		<title>report/security/report security check google</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/4x/sv/index.php?title=report/security/report_security_check_google&amp;diff=133996"/>
		<updated>2019-05-22T05:56:00Z</updated>

		<summary type="html">&lt;p&gt;Michaelh2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Security overview report}}Allowing search engines to enter your site means that all the contents become available to the world. Don&#039;t use this unless it&#039;s a really public site. &lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=7301 Security and Privacy forum]&lt;/div&gt;</summary>
		<author><name>Michaelh2</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/4x/sv/index.php?title=Security_FAQ&amp;diff=132942</id>
		<title>Security FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/4x/sv/index.php?title=Security_FAQ&amp;diff=132942"/>
		<updated>2019-01-10T07:42:09Z</updated>

		<summary type="html">&lt;p&gt;Michaelh2: /* Who is able to view security issues in the Tracker? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Security}}&lt;br /&gt;
==How do I report a security issue?==&lt;br /&gt;
&lt;br /&gt;
See [[:dev:Moodle security procedures|Moodle security procedures]] in the dev docs for details on how to report a security issue.&lt;br /&gt;
&lt;br /&gt;
Previously fixed security issues are listed in the [http://moodle.org/security/ Moodle.org Security news]. If you are unsure whether a problem has been fixed or not, it&#039;s best to report it anyway.&lt;br /&gt;
&lt;br /&gt;
==How can I keep my site secure?==&lt;br /&gt;
&lt;br /&gt;
It&#039;s good practice to always use the latest stable release of the version you are using. It is safe to upgrade to a more recent version on the branch you are using, say from Moodle 2.X.1 to the latest version on the 2.X branch. [[Git for Administrators|Downloading via Git]] makes it very easy way to do this.&lt;br /&gt;
&lt;br /&gt;
==How do I keep track of recent security issues?==&lt;br /&gt;
&lt;br /&gt;
* [[Site registration | Register your Moodle site with moodle.org]], making sure to enable the option of being notified about security issues and updates. After your registration is accepted, your email address will be automatically added to our low-volume security alerts mailing list.&lt;br /&gt;
&lt;br /&gt;
* Eventually, all important security issues are published to the general public via the [http://moodle.org/mod/forum/view.php?f=996 Moodle Security forum]. You can subscribe to the forum or [http://twitter.com/moodlesecurity follow moodlesecurity on Twitter].&lt;br /&gt;
&lt;br /&gt;
==Who is able to view security issues in the Tracker?==&lt;br /&gt;
&lt;br /&gt;
Depending upon the security level of a Tracker issue, access is restricted to developers, testers or members of the security team. Specific details are available in the [[dev:Tracker guide#When_creating_an_issue|Security Level field description in the Tracker guide]].&lt;br /&gt;
&lt;br /&gt;
==Which versions of Moodle are supported?==&lt;br /&gt;
&lt;br /&gt;
Currently supported versions are listed on [http://download.moodle.org/ download.moodle.org].&lt;br /&gt;
&lt;br /&gt;
==My site was hacked. What do I do?==&lt;br /&gt;
&lt;br /&gt;
See [[Hacked site recovery]].&lt;br /&gt;
&lt;br /&gt;
==How can I reduce spam in Moodle?==&lt;br /&gt;
&lt;br /&gt;
See [[Reducing spam in Moodle]].&lt;br /&gt;
&lt;br /&gt;
==How can I increase privacy in Moodle?==&lt;br /&gt;
&lt;br /&gt;
See [[Increasing privacy in Moodle]].&lt;br /&gt;
&lt;br /&gt;
==How do I enable reCAPTCHA?==&lt;br /&gt;
&lt;br /&gt;
To add spam protection to the [[Email-based self-registration]] new account form with a CAPTCHA element:&lt;br /&gt;
&lt;br /&gt;
#Obtain a reCAPTCHA key from http://recaptcha.net by [https://admin.recaptcha.net/accounts/signup/?next= signing up for an account] (free) then entering a domain.&lt;br /&gt;
#Copy and paste the public and private keys provided into the &#039;&#039;recaptchapublickey&#039;&#039; and &#039;&#039;recaptchaprivatekey&#039;&#039; fields in the manage authentication common settings in &#039;&#039;Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; [[Manage authentication]]&#039;&#039;.&lt;br /&gt;
#Click the &amp;quot;Save changes&amp;quot; button at the bottom of the page.&lt;br /&gt;
#Follow the settings link for email-based self-registration in &#039;&#039;Administration &amp;gt; Plugins &amp;gt; Authentication &amp;gt; Manage authentication&#039;&#039; and enable the reCAPTCHA element.&lt;br /&gt;
#Click the &amp;quot;Save changes&amp;quot; button at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
==How can I run the security overview report?==&lt;br /&gt;
&lt;br /&gt;
To run the [[Security overview|security overview report]], go to &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Reports &amp;gt; Security overview&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== I have discovered Cross Site Scripting (XSS) is possible with Moodle ==&lt;br /&gt;
&lt;br /&gt;
Some forms of rich content used by teachers to enhance their courses use the same technologies that malicious users can use for cross-site scripting attacks. If Moodle was solely concerned with security, it would not allow this. However, Moodle is also concerned with education and so a balance has to be struck between securing the system and supporting teachers with their needs.&lt;br /&gt;
&lt;br /&gt;
In order to strike a balance between authoring rich educational content and securing the system, access to post XSS-capable content is controlled by capabilites flagged with the &#039;XSS risk&#039; - see [[Risks]]. In general this means that admins and teachers can post XSS-capable content, but students can not - see [[XSS_trusted_users]].&lt;br /&gt;
&lt;br /&gt;
Occasionally security bugs are discovered in Moodle&#039;s handling of XSS capable content and we are greatful to the community for reporting these through [https://docs.moodle.org/dev/Moodle_security_procedures responsible disclosure].  Before reporting an XSS bug to Moodle, please ensure that the user posting the XSS content does not have capabilities flagged with the XSS risk.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=7301 Security and Privacy forum]&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[es:Seguridad FAQ]]&lt;/div&gt;</summary>
		<author><name>Michaelh2</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/4x/sv/index.php?title=Nolink_tags&amp;diff=132921</id>
		<title>Nolink tags</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/4x/sv/index.php?title=Nolink_tags&amp;diff=132921"/>
		<updated>2019-01-04T01:53:47Z</updated>

		<summary type="html">&lt;p&gt;Michaelh2: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{stub}}&lt;br /&gt;
At times it is useful to turn off HTML linking.  This can be done several ways. One is to use the [[HTML editor]]&#039;s no linking icon.  Another way is to toggle the source code and place a &amp;lt;nowiki&amp;gt;&amp;lt;nolink&amp;gt; &amp;lt;/nolink&amp;gt;&amp;lt;/nowiki&amp;gt; set of tags directly in the code. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;TIP:&#039;&#039; New users of Moodle should be careful when using any nolink feature for the first few times. See below. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Tips and Tricks==&lt;br /&gt;
Joseph Rézeau offered these observation in the Quiz forum:&lt;br /&gt;
&lt;br /&gt;
In the prehistory of Moodle we used to have the &amp;lt;nowiki&amp;gt;&amp;lt;nolink&amp;gt;&amp;lt;/nolink&amp;gt;&amp;lt;/nowiki&amp;gt; tag to enclose any portion of HTML which we did not want to be autolinked. This was not very WC3 compliant, so it was replaced (or rather complemented) by &amp;lt;nowiki&amp;gt;&amp;lt;span class=&amp;quot;nolink&amp;quot;&amp;gt;&amp;lt;/span&amp;lt;/nowiki&amp;gt;&amp;gt;. That was in my opinion an unfortunate decision; it should have been replaced with a &amp;lt;nowiki&amp;gt;&amp;lt;div class=&amp;quot;nolink&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/nowiki&amp;gt;, not a span tag. The reason is that a &amp;lt;span&amp;gt;&#039;s scope is too narrow and we often want to enclose a whole block of HTML within a nolink tag, so &amp;lt;div&amp;gt; should have been the best choice...&lt;br /&gt;
&lt;br /&gt;
So, like you, I keep using the old &amp;lt;nowiki&amp;gt;&amp;lt;nolink&amp;gt;&amp;lt;/nolink&amp;gt;&amp;lt;/nowiki&amp;gt; tag, which in fact still works, &#039;&#039;&#039;provided you do not come back to your HTML text and edit it&#039;&#039;&#039;. If you do, then you have to remove the &amp;lt;nowiki&amp;gt;&amp;lt;span class=&amp;quot;nolink&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;and replace it with &amp;lt;nowiki&amp;gt;&amp;lt;nolink&amp;gt;&amp;lt;/nolink&amp;gt;&amp;lt;/nowiki&amp;gt; (as you found out). I do it all the time and find it pretty irritating. The automatic replacing is due to the HTML editor being over-zealous in its tidying up of the HTML text.&lt;br /&gt;
&lt;br /&gt;
Another solution would be to hack the Moodle code and systematically replace all occurrences of &amp;lt;nowiki&amp;gt;&amp;lt;span class=&amp;quot;nolink&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt; with &amp;lt;nowiki&amp;gt;&amp;lt;div class=&amp;quot;nolink&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/nowiki&amp;gt;. I have done it on my local installation and it works OK.&lt;br /&gt;
&lt;br /&gt;
However, there is another problem. If you have typed some text in the HTML editor and formatted it (e.g. added a few bold or italics, etc. here and there) and then select that formatted text and click on the Prevent automatic linking button in the HTML editor toolbar, you find that all of your formatting is wiped away... You can, of course, re-format your text, but its a loss of time. If you decide that the whole of your text will have to be prevented from automatic linking (as is a frequent requirement in quiz questions), then you should immediately click on the Prevent automatic linking button, before typing anything. If the editor complains that &amp;quot;you must select some text first&amp;quot;, then clidk on the body tag at the bottom of the editor (see attached 1) before clicking the Prevent automatic linking button. Then start typing your text, formattting it, etc.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[HTML editor]]&amp;lt;br&amp;gt;&lt;br /&gt;
[[Media FAQ]]&lt;/div&gt;</summary>
		<author><name>Michaelh2</name></author>
	</entry>
</feed>