Add settings for allowed CORS origins and WebSocket origin validation so
deployments can restrict cross-origin access instead of using a global
wildcard policy.
Move CORS handling into the security middleware and update report cache
usage to use the dedicated report package.