ResourceSpace plugins
ResourceSpace 11 plugin

Security Guard

Virtual patches for known ResourceSpace weaknesses and a light application firewall.

Security Guard protects ResourceSpace against known weaknesses until they are fixed in ResourceSpace itself, and works as a light application firewall. It runs on every request – pages, API and SimpleSAMLphp – before the page code, and costs almost nothing: a normal request needs no database query and writes nothing to disk.

Features

Virtual patches

Fixes for known weaknesses (report parameters, open redirect after login, API authentication, API login lockout, session in the URL), each with its own switch.

Application firewall

IP allow and block lists, admin pages and API keys only from chosen addresses, scanner blocking and attack patterns in parameters (log only or block).

SimpleSAMLphp

Hide error details, restrict the local login form and admin pages, and limit login attempts per address – SSO itself stays open.

Deletion protection

Limits on deleting many resources at once, approval by a second administrator and a forced trash state.

Share policy

Passwords and generated passwords for external shares and an expiry period enforced on the server.

Upload verification

Allowed file types, content checked against the extension, dangerous content detected, doubtful files held in quarantine for approval.

Local login page

A separate address for local account logins, which can be the only place where local accounts log in.

Log, notifications, fail2ban

A security log with reference numbers, incident notifications for chosen users and groups, and templates for fail2ban and nginx.

Easy to control

Protection levels in a configurator, pause for 15 minutes to 24 hours, and emergency switches on the server.

Installation

In ResourceSpace

  1. Download the .zip above.
  2. In ResourceSpace open Plugin Manager > Upload a plugin and upload the file.
  3. Activate Security Guard in the list of installed plugins, then open its Options.

Updating: upload the new .zip and choose Overwrite. Settings and data are kept in the filestore, outside the plugin folder.

On the server (command line)

# download and unpack – <RS_ROOT> is your ResourceSpace folder
cd /tmp
curl -fLO https://github.com/s29829/security_guard/releases/download/v1.08/security_guard-1.08.zip
# only when updating – the plugin data stays in the filestore
sudo rm -rf <RS_ROOT>/plugins/security_guard
sudo unzip -q security_guard-1.08.zip -d <RS_ROOT>/plugins/
sudo chown -R www-data:www-data <RS_ROOT>/plugins/security_guard

www-data is the user that runs PHP (Apache on the RHEL family: apache). Then activate the plugin in System > Plugins. With git: git clone https://github.com/s29829/security_guard <RS_ROOT>/plugins/security_guard

Requirements

  • ResourceSpace 11
  • No extra PHP extensions
  • Works with nginx and Apache (templates for both)
A plugin only sees requests that reach ResourceSpace's PHP code. It does not replace ResourceSpace updates – keep ResourceSpace up to date.