Content security policy

Local plugins ::: local_csp
Maintained by Catalyst IT, Brendan Heywood
This plugin allows an admin to create a Custom Security Policy (CSP) in both reporting mode and enforcing mode. A simple use case is to detect and cleanup issues with non secure content after a migration from http to https, through to advanced policies to mitigate from XSS attacks.
Latest release:
939 sites
701 downloads
17 fans
Current versions available: 4

This plugin allows you to configure a Custom Security Policy (CSP) which is sent via HTTP headers. CSP headers instruct browsers to make certain actions. For example, if a website is available by HTTPS, then a CSP policy of 'default https:;' will tell the browser to prohibit loading of any sources (scripts, css etc.) via HTTP.

Learn more about CSP here:

https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP

There are many other CSP rules that browsers can understand and by using them administrators can flexibly tune their website if they wanted to get rid of mixed content or classes of cross-site scripting vulnerabilities. 

Any policy you wish to use can be safely tested first using 'Report only' mode, and this plugin has a built in CSP aggregator and reports all errors which are raised. You can have two different policies, one for testing and one for enforcing and gradually move each directive from 'report' to 'enforcing' after the various issues have been found and fixed.

Screenshots

Screenshot #0
Screenshot #1

Contributors

Catalyst IT (Lead maintainer)
Brendan Heywood: Architect
Please login to view contributors details and/or to contact them

Comments RSS

コメントを表示する
  • Plugins bot
    2017年 02月 21日(火) 15:00
    Approval issue created: CONTRIB-6759
  • Susan Mangan
    2017年 07月 13日(木) 03:24
    Hi, just installed this on our test system and seems great so far. Running Moodle version 3.2. I have 2 questions:

    1. The https://github.com/moodlerooms/moodle-tool_httpsreplace reported a far greater number of potentially problematic domains than the CSP violation report did. I guess I'd have to dig around in the code to find out what each is doing exactly to determine why but if anyone has an idea about this that would be very helpful!

    2. I generated a few pages of CSP violation reports, made some changes and reset all statistics. I think perhaps that was not the correct thing to do. Our system technically should be producing the same report it did initially but since I reset statistics I can't seem to find a way to make this happen. I've cleared caches and disabled and re-enabled the plug-in. I can't find anything in the documentation about this. Am I missing something? TIA!
  • Susan Mangan
    2017年 07月 13日(木) 06:02
    One more question.
    Does this plug-in work with IE-11?
    I can block content in Chrome and FFox so far but same content not blocked in IE-11.
    TIA!!
  • Susan Mangan
    2017年 07月 13日(木) 06:09
    Never mind... just viewed the browser compatibility at https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP 悲しい
  • Susan Mangan
    2017年 07月 13日(木) 07:39
    Oh ... I think I got it ... I need to apply specific policy for IE... I just used the default policies that were included in the plug-in. And I figured out my report issue - when I removed the custom css for the theme the report showed nothing, put it back, we get the violations again.
  • Will Lehman
    2017年 08月 28日(月) 10:23
    Any plans to release this for Moodle 3.3?
  • Brendan Heywood
    2017年 08月 29日(火) 07:21
    hi Will,

    Have you actually tested it in 3.3? I'd be surprised if it didn't work as-is in 3.3 but I haven't tested it myself. If there is any issues under 3.3 can you please raise them here https://github.com/catalyst/moodle-local_csp/issues

    thanks
  • Tony G
    2020年 04月 15日(水) 17:08
    Hi,

    May I have the list of what CSP is supported in this plugin? Thank you.
  • Sketch...
    2022年 10月 13日(木) 20:12
    Is this plugin still supported in the currently supported versions of Moodle, as of October 2022, i.e. Moodle 3.9 and up?
    https://github.com/catalyst/moodle-local_csp/issues/77
  • Sketch...
    2022年 10月 19日(水) 16:00
    I tested the version from GitHub on my Moodle 3.9.17+ test server and it installed successfully, although the README.md file is a bit out of date.
    So, install the version from https://github.com/catalyst/moodle-local_csp. This https://moodle.org/plugins/local_csp page doesn't always have the latest version of the plugin.
  • Takeshi Matsuzaki
    2024年 03月 9日(土) 17:04
    Thank you for the nice plugin.
    Let me have a question. I may mis-understand something.
    --
    I made this setting. It seems nice for testing cookies.
    "HttpOnly;Secure;SameSite=Strict"

    But it seems no effect for this value.
    Set-Cookie: MoodleSession
    The cookie is "secure; SameSite=None".
  • Robert Schrenk
    2024年 03月 13日(水) 23:16
    The last change in Github is more than one year old. It would be nice if the current version from github (2022060300) could be published here, was the latest version in the Moodle plugins database is very old ... 2019100100 !!!
  • Takeshi Matsuzaki
    2024年 04月 1日(月) 10:41
    Sorry!!! I was very confuses. Cookie is not relation with CSP. It's on httpd.conf.
    Close my post.
Please login to post comments