Setting Content-Security-Policy is definitely a good idea. Like Strict-Transport-Security, I think it's a basic best practice for any modern website.
I think this needs quite a lot of thinking through before it's implemented, but I like the careful, measured approach the proposer has taken to in proposing an incremental rollout instead of a flag day update.
Two questions:
- is there any way that we can either scan for, or instrument, what's going on at the moment to help find out what might break as we tighten up security?
- could we perhaps centralize CSS and JS content on separate domains devoted solely to serving such executable content across all Wikimedia sites, so that, for example, content now at //en.wikipedia.org/.../something.js would be served via //js-server.wikimedia.org/en.wikipedia.org/.../something.js , and ditto for sinilar corresponding css-server.wikimedia.org. font-server.wikimedia.org etc. etc. hostnames? (These domains could, of course, all point to the same servers/server cluster as everything else: the distinction is purely semantic, to allow for fine-grained policy filtering.)
This would require some more (but relatively simple) infrastructural changes to create the necessary server-side configuration to serve the content from the new URLs, but would make the policy much smaller and easier to understand.