* send a CSP applying only to frames in the main page
* send a CSP applying to both frames and scripts with attachments
* tools only get included in the frame-src directive
* include the files domain in both for now
* search for course context on a file through submissions, if possible
Test Plan:
- Enable CSP feature flag
- Configure a csp_logging host in dynamic_settings.yml (see example)
- Have a files domain configured
- Turn whitelist on
- Upload html file containing a violation like
<script src="https://www.google.com/nonexistent.js/"></script>
- Preview the file
- The page should load, but your browser console should show that
the JS was blocked
- The browser network log should show a violation reported to the
violation service
- Embed an iframe in RCE stuff referencing some other site (like
YouTube)
- it should get blocked
- Turn the whitelist off
- Retry; the JS or iframe should (attempt) to load, but a violation
should still be reported
- Repeat all of the above, but this time be a student uploading an
html file as a submission for an assignment, and then view the
submission in speedgrader as a teacher/admin
Change-Id: I19823844b3d87fd19e43c17284cf7b987df26e74
Reviewed-on: https://gerrit.instructure.com/182000
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>