Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Moodle Security
Moodle Security

Moodle Security: Learn how to install and configure Moodle in the most secure way possible

eBook
€8.99 €28.99
Paperback
€37.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Moodle Security

Chapter 2. Securing Your Server Linux

Linux has become a very important player as a mainstream operating system for servers. According to the Netcraft report of most reliable hosting company sites dating from February 2010, 6 out of 10 servers were running some brand of Linux. This indicates the strong position of this Operating System (OS) and the confidence it generates. Some of the reasons for this are:

  • Initial price: Linux is open source and therefore free for commercial use

  • Stability and Reliability: Linux is a highly stable and reliable platform with all of its elements well tested; any bug is usually quickly resolved by the community

  • Security: Linux is, by default, quite secure and is in fact in a much better position than Windows since it is at risk from much fewer viruses and Trojans

  • Better utilization of hardware resources

  • Availability of commercial support

Another reason for which we are starting with Linux is because Moodle is primarily developed on Linux using MySQL, Apache and...

Securing your Linux—the basics


We will try to explain the basic elements of Linux on which you should focus your attention during initial configuration.

Firewall

A Firewall is a part of a computer system designed to block or permit network communication based on set of predefined rules. The design and operation of the Internet is based on the Internet Protocol Suite, also commonly called Transfer Control Protocol / Internet Protocol (TCP/IP). In this system, hosts and host services are referenced using two components: an address and a port number. For example, HTTP—standard web protocol uses port 80 by default. In general, most services use a limited number of ports. A common technique for detecting running services on a public server is port scanning. It is used by administrators for verification of their security policies and by hackers for obtaining lists of potential targets for later attack. To prevent this and other types of misuse we should block access to all ports except the ones...

Apache configuration


Apache web server is one of the most popular implementations of web server on UNIX-like operating systems. As of February 2010, Apache served over 54 percent of all websites on the Internet. It is a stable and reliable software recommended for both high and small load websites. It is easily configurable and highly flexible because it features modular design which permits to use only parts of the functionality that we really need. This reduces memory footprint and makes server faster to operate and respond. We still must be sure that it is properly configured in terms of basic functionality and security.

Where to start

When attackers want to infiltrate a website they start first by probing for server information. If not properly configured, a web-server can expose sufficient information to the prying eye that can enable the attacker to find a security hole and access private data or services.

All communication between the web browser and web server is performed according...

MySQL configuration


Database is a crucial element of any LMS. In this way, Moodle is no different than all the other platforms. The recommended database for Moodle is MySQL. Most of the development is done using that RDBMS which makes it therefore less error prone and better tested than the other options. This, of course, does not imply that we can just sit back and enjoy the benefits of the default installation that comes with CentOS. Here is the checklist we should go over that improves our setup of MySQL:

  1. 1. Don't use MyISAM engine: CentOS 5.4 comes with MySQL 5.0.77. By default, this version uses the MyISAM engine for storing data. MyISAM is good as a storage engine for most of the read-oriented websites, but as soon as we get a lot of writing it tends to break. Apart from security, we also need reliability. Therefore we should switch the default DB engine to the much better InnoDB. To do that, open the MySQL configuration file located in /etc/my.cnf and add these lines in the [mysqld...

PHP configuration


PHP stands for PHP: Hypertext Preprocessor. This kind of idiom is known as a recursive acronym. A recursive acronym is an acronym that refers to itself in the expression for which it stands. It is widely used in programming since recursion is one of the common methods used in everyday programming. PHP is an open source, general purpose scripting language widely used for web development. Moodle is completely written in PHP and therefore to run Moodle we need to install and configure PHP. As any other software PHP has potential and real security problems. Because of that we need to be sure that it is configured properly in order to reduce potential security issues.

Installation

To install the PHP that comes with CentOS, execute the following commands from the command prompt:

yum install php php-cli php-common php-gd php-mysql php-mbstring php-xml php-xmlrpc php-tidy

This version of PHP is not the latest so we need even more security. Luckily there is the Suhosin plugin. Suhosin...

File security permissions


A computer server is a source of many services, resources, and facilities. Some of these are open for public use while others may be protected. The system that permits an authority to specify and control access of individuals to areas and resources in a server is called the Access Control System (ACS). In Linux almost every resource available in the system is defined as a file-system object. Therefore a crucial part of Linux security is file system permission. The following sections describe the several types of ACS available today.

Discretionary Access Control—DAC

This is the basic type of access protection based on the identity of the subjects and/or groups to which they may or may not belong. It is discretionary because a subject with certain permissions is capable of passing that permission on to any other subject. Linux implements DAC using the concept of owner. Every object in the file-system must have an owner and a group specified. Owner controls permissions...

Adequate location for a Moodle installation


RedHat-based Linux distributions closely follow the File System Hierarchy Standard. This standard contains a set of requirements and guidelines for file and directory placement under UNIX-like operating systems. According to this standard any variable set of data should be placed in the /var directory. This directory is assumed to be on a separate partition (whenever possible) and it is mounted as read/write. Under CentOS, Apache web server has a special directory designated to its needs —/var/www. The default directory for any web file is /var/www/html. Files placed in that directory are located on the www root of the web server.

As we already know, Moodle has two major directories. One contains Moodle itself (usually called Moodle) while the other has all user and platform data that can change during the course of usage (usually Moodledata).

There are numerous options available as to where to install Moodle files. Three such possible options...

How to secure Moodle files


Securing Moodle files means to permit only the needed users and groups to access the files in both the Moodle and the moodledata folder. We will approach this task by using standard DAC methods, and later mention alternatives available with ACL.

DAC

In CentOS, the user under which the Apache process is executed is called Apache. That user is a member of the group apache. Therefore, we need to give read-only access to all of the files in the Moodle folder and full read/write access in moodledata. Assuming that we use first option for deploying files, here are the set of commands to set adequate permissions for moodledata:

/bin/chown -R root:apache /var/www/moodledata/
/bin/chmod -R ug=rwX,o= /var/www/moodledata/

The first line sets the owner of the folder (superuser root) and permitted user group (apache). We do this because, as explained earlier, the owner has full rights over anything related to the particular file system object. In case a malicious user manages...

Summary


We learned some basic facts about securing a Linux-based Moodle server: What web server and database server we need to use, how to install and configure MySQL, PHP, and Apache,.and what hat alternatives are available for MySQL and PHP. Explanation was given about file security system in Linux and the reader will feel more comfortable next time he sees acronyms like DAC, ACL, MAC, and SELinux. Next stop—how to transform your Windows server into an impenetrable fortress!

Left arrow icon Right arrow icon

What you will learn

  • Use CAPTCHA to make sure that humans are creating new accounts on Moodle - not Spambots Configure PHP and Apache servers to protect your Windows and Linux systems from malicious threats Assign the most appropriate permissions to different files to ensure the right level of protection Create custom roles to control who accesses what Protect your site from external attacks with secure HTTP Organize regular anti-virus scans to ensure no new risks have been introduced to the system Monitor the security of Moodle easily with notifications and security reports Minimize the downtime of Moodle in the case of actual damage
Estimated delivery fee Deliver to Malta

Premium delivery 7 - 10 business days

€32.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Feb 10, 2011
Length: 204 pages
Edition :
Language : English
ISBN-13 : 9781849512640
Vendor :
Moodle
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Malta

Premium delivery 7 - 10 business days

€32.95
(Includes tracking information)

Product Details

Publication date : Feb 10, 2011
Length: 204 pages
Edition :
Language : English
ISBN-13 : 9781849512640
Vendor :
Moodle
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 121.97
Moodle 2 Administration
€41.99
Moodle as a Curriculum and Information Management System
€41.99
Moodle Security
€37.99
Total 121.97 Stars icon
Banner background image

Table of Contents

10 Chapters
Delving into the World of Security Chevron down icon Chevron up icon
Securing Your Server Linux Chevron down icon Chevron up icon
Securing Your Server—Windows Chevron down icon Chevron up icon
Authentication Chevron down icon Chevron up icon
Roles and Permissions Chevron down icon Chevron up icon
Protection Against Bots Chevron down icon Chevron up icon
Securing User Files Chevron down icon Chevron up icon
Securing Moodle Data Chevron down icon Chevron up icon
Monitoring User Activity Chevron down icon Chevron up icon
Backup Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3
(6 Ratings)
5 star 50%
4 star 33.3%
3 star 16.7%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Martin Biermann Jan 08, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Excellent primer on Moodle security. It even mentions SELinux! The only detail that was out of date was the Moodledata file system. It's now based on hashes. (I have been using Moddle since v. 2.9).
Amazon Verified review Amazon
Mónico Mar 22, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
After of several years of teaching, using, installing, and updating Moodle. Finally, I can get an excellent book of Moodle Security written by Darko. This book has all security topics related with Moodle. Throughout this book you will find useful examples on Linux and Windows Operating system. This is a must-have book for Moodle administrators.By the way, I just installed Moodle 2.2 on Ubuntu server following the book instructions. Most of them are still useful.
Amazon Verified review Amazon
DennisJ Jul 25, 2011
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A valuable "how to" guide on how to set up and strengthen a Moodle site's security. If you're a Moodle administrator, you need to have this book! Although some of the topics are covered in other references, this book brings that information, in more detail, together concerning this important subject. You won't find a lot of theory here - this book covers the threat space topic-by-topic and provides solutions about how to counter each type of threat.
Amazon Verified review Amazon
Isotonic Turtle May 09, 2011
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
The book covers all aspects of Moodle 1.9 Security and explains concepts in a clear and well-written style.It is good to see that the security of underlying components, that is, operating system (Linux and Windows), database, web server and PHP are covered in detail, as this is where a lot of setups fall short of taking precautions. The author then walks you through all the key aspects of Moodle where "something can go wrong" in terms of security. This covers subjects like authentication, roles, permissions, files, etc. An entire chapter has been dedicated to protection against bots, monitoring user activity, and backups, respectively. The book concludes with an appendix that provides some details on authentication plugins used less common, for instance, LDAP.All in all a well-written book on Moodle 1.9 security that doesn't shy away touching on system-related topics.
Amazon Verified review Amazon
mylearningspace Mar 14, 2011
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
This book is a must-have for any LMS administrator who is serious about data security and information privacy for their Moodle learning management system. It is a concisely and expertly written text which covers a range of technical topics in a clear and accessible manner. Naturally, much is said about the configuration of Moodle's global parameters including authentication, roles, files and backups. On the same token, there is good coverage of security-related considerations at a server level for linux and windows. The text is written for Moodle 1.9.x but much of the book is also relevant for 2.0.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela