allow localhost for cron tasks#13
allow localhost for cron tasks#13stevenandres wants to merge 1 commit intocloudflare:masterfrom stevenandres:patch-1
Conversation
It's quite common to have a cron task running on the webserver to trigger database cleanup tasks. By adding localhost (127.0.0.1 and ::1) to the allowed proxy list, we can use cron tasks aimed at localhost instead of making the external long-way-around-the-world request out to Cloudflare and then back into our web server.
|
I assume the reason for this is that you are using |
|
Correct -- Sorry for not mentioning that crucial data point. This is because |
|
@ejcx @dfritsch (sorry to bother) I'm trying to figure out if this has any downsides attached to it. I fear that people will setup internal proxies or something on the same server and possibly cause real world requests to arrive at apache as a local IP. The question is, should that be accepted as a thing that someone can shoot themselfs in the foot with? On the other hand This will also grant localhost to "spoof" the IP of the incoming, another possible issue |
|
Purely from the implementation perspective; not sure we should be adding localhost to a list of trusted proxies; effectively we'd also be allowing IP rewriting from localhost. We are effectively allowing remote IP and SSL header rewriting from requests from localhost. If we go down this route, the logic should purely apply to the denial element (though this of course doesn't address the internal reverse proxying issue described above). Kinda off topic, but there are a lot of ways people can shoot themselves in the foot by running a curl request in their cronjobs. Ideally you should reference the PHP/application binary and run the script directly. The cron script should really be outside anything accessible by the web server. |
|
Please consider this scenario. |
It's quite common to have a cron task running on the webserver to trigger database cleanup tasks. By adding localhost (127.0.0.1 and ::1) to the allowed proxy list, we can use cron tasks aimed at localhost instead of making the external long-way-around-the-world request out to Cloudflare and then back into our web server.