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
$9.99 $28.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
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

Billing Address

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

Product Details

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

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
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

Billing Address

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.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
$199.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
$279.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 $ 158.97
Moodle 2 Administration
$54.99
Moodle as a Curriculum and Information Management System
$54.99
Moodle Security
$48.99
Total $ 158.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

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.