alphagov/panopticon — pull request #50 by jamiecobbett (2013-01-14 12:42:47+00:00)
Title: Disable (limited) exception/debug pages in production

Rails has a default of showing limited exceptions to the user in production, IF it thinks
the request is local/from a trusted proxy (and not being proxied from the
internet). Our infrastructure is telling apps that all requests actually come
from trusted proxies, even though they don't, hence our problem.

A wrinkle is that we have apps that are talking to each other, so it's
conceivable that information could get from an inter-app request that errored
and then be displayed to the outside world.

The problem would be limited if the proxies set the headers correctly, but
eliminated if we set config.action_dispatch.show_exceptions to false.

[Nick has dealt with the problem](https://github.com/alphagov/puppet/pull/227) in such a way that prevents exception
information being shown, but which also hides helpful 4xx and 5xx messages
(eg if you don't have "signin" permission for an app, you get a 403 and
explanatory HTML, but now it gets clobbered). I'm sure there are other cases.

I intend to make this same change in each backend Rails app if this gets merged. Once each app is deployed, we can change the configuration that Nick added.