learningequality / kolibri

Kolibri Learning Platform: the offline app for universal education
https://learningequality.org/kolibri/
MIT License
810 stars 684 forks source link

Make Kolibri compliant with a secure Content Security Policy #12851

Open rtibbles opened 6 days ago

rtibbles commented 6 days ago

Summary

References

Fixes #12809

Note: it goes slightly beyond what is outlined in the issue, by actually adding the CSP headers as well with Django CSP, but it seemed like the only way to show it was working as intended!

Reviewer guidance

Do any assets not load properly, is anything too strictly defined for proper functioning either in production or development mode?

Is anything too loosely defined? One particular thing to note is that the iframe src is very permissive when ZIP_CONTENT_ORIGIN is not defined, because we can't set a port on self - so if we wanted to make it stricter, we'd have to dynamically set the CSP based on the host that Kolibri was accessed from.

github-actions[bot] commented 6 days ago

Build Artifacts

Asset type Download link
PEX file kolibri-0.18.0.dev0_git.20241116002312.pex
Windows Installer (EXE) kolibri-0.18.0.dev0+git.20241116002312-windows-setup-unsigned.exe
Debian Package kolibri_0.18.0.dev0+git.20241116002312-0ubuntu1_all.deb
Mac Installer (DMG) kolibri-0.18.0.dev0+git.20241116002312.dmg
Android Package (APK) kolibri-0.18.0.dev0+git.20241116002312-0.1.4-debug.apk
TAR file kolibri-0.18.0.dev0+git.20241116002312.tar.gz
WHL file kolibri-0.18.0.dev0+git.20241116002312-py2.py3-none-any.whl