build icon indicating copy to clipboard operation
build copied to clipboard

Cloudflare captchas break automated tooling, like nvm

Open ljharb opened this issue 3 years ago • 17 comments

Captchas under https://nodejs.org/dist break things like nvm (https://github.com/nvm-sh/nvm/issues/2694)

Since that content is highly CDN-able, is there a reason there's captchas enabled on that URL segment at all?

ljharb avatar Dec 21 '21 02:12 ljharb

Think you meant https://github.com/nvm-sh/nvm/issues/2694

nschonni avatar Dec 21 '21 02:12 nschonni

@rvagg @jbergstroem Do you know if this is something we turned on deliberately?

richardlau avatar Dec 21 '21 15:12 richardlau

@rvagg @jbergstroem Do you know if this is something we turned on deliberately?

Its usually related to the security level chosen for the account. Based on the level you can also choose how to deal with said traffic; drop, captcha, etc.

We can review security settings but as far as I know there hasn't been any changes to this recently. Lets check the audit logs.

Finally, there might be a way to lower it per route; will look shortly.

jbergstroem avatar Dec 21 '21 16:12 jbergstroem

It definitely could be an old change; it’s just that a user newly encountered it and reported it.

ljharb avatar Dec 21 '21 16:12 ljharb

So, the best we can do in our current level (business) is "essentially off"; whereas enterprise accounts would get "off" as an option. I can check in with our account exec's and see if that is possible. They have been very helpful in enabling other (enterprise-only) features in the past on request.

jbergstroem avatar Dec 21 '21 17:12 jbergstroem

It'd also be fine to have most of nodejs.org on "essentially off" and "/dist" on "off", since only nodejs.org/dist is really something programmatic tools are expected to use, if that's an option.

ljharb avatar Dec 21 '21 22:12 ljharb

@ljharb yes, agreed. I'm checking with our contacts at cloudflare if we can get the "off" setting made available.

jbergstroem avatar Dec 21 '21 22:12 jbergstroem

@jbergstroem happy new year! any chance we've heard back?

ljharb avatar Jan 12 '22 05:01 ljharb

It's possible to configure Cloudflare page rules to set custom security levels, and other security settings, which can lead to the CAPTCHA appearing.

Given the URL that needs to be "unblocked" is on a single path /dist, it looks like this would be an approach that works.

fredpotvin-platformsh avatar Mar 24 '22 13:03 fredpotvin-platformsh

It's possible to configure Cloudflare page rules to set custom security levels, and other security settings, which can lead to the CAPTCHA appearing.

Unfortunately not "off" unless you're using an enterprise account: Screen Shot 2022-03-24 at 11 00 39 AM

More info here: https://support.cloudflare.com/hc/en-us/articles/200170056-Understanding-the-Cloudflare-Security-Level

I will revisit now.

jbergstroem avatar Mar 24 '22 14:03 jbergstroem

is it possible to disable security entirely?

image

jww-cw avatar Mar 24 '22 14:03 jww-cw

I don't feel like this is going to help contribute to a solution (because after reading it I don't see anything that can address this issue), but it's Cloudflare guide on how to deal with CAPTCHA, so, I feel like it's a least related enough so that I post it. Community Tip - Best Practices For Captcha Challenges

fredpotvin-platformsh avatar Mar 24 '22 14:03 fredpotvin-platformsh

Hello! Did anything change today? We've started getting cloudflare captchas on a few of our projects. They are hosted on platform.sh, so i fear a lot more projects will start getting impacted soon..

alexthunder3 avatar Mar 24 '22 19:03 alexthunder3

Did anything change today?

No changes as far as I am aware of. Let me check the audit log.

Edit: other than automated purge events, I see nothing of interest. This applies to at least the last 10 days.

jbergstroem avatar Mar 24 '22 20:03 jbergstroem

Hello! Did anything change today? We've started getting cloudflare captchas on a few of our projects. They are hosted on platform.sh, so i fear a lot more projects will start getting impacted soon..

Indeed. This problem effected some projects hosted on Platform.sh. Our public incident report => https://status.platform.sh/incidents/bp6khw4pm490

Cloudflare was returning 403 to build containers on some project using nodejs.org domain.

It's now working properly. An RCA will be published as soon as it's available. Usually it takes 2 weeks to publish.

fredpotvin-platformsh avatar Mar 25 '22 07:03 fredpotvin-platformsh

It's now working properly. An RCA will be published as soon as it's available. Usually it takes 2 weeks to publish.

Does this mean the issue is resolve? I'm not 100% sure having read through the issue.

mhdawson avatar Mar 25 '22 20:03 mhdawson

It's now working properly. An RCA will be published as soon as it's available. Usually it takes 2 weeks to publish.

Does this mean the issue is resolve? I'm not 100% sure having read through the issue.

Calls to nodejs.org might still get CAPTCHA, from any server, if Cloudflare decide to block the host, for whatever reasons. Which can include Platform.sh servers, but isn't happening at the moment. So, it resolve for us and our customers.

fredpotvin-platformsh avatar Mar 28 '22 06:03 fredpotvin-platformsh

This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

github-actions[bot] avatar Jan 23 '23 00:01 github-actions[bot]

This is still an occasional, albeit rare, issue.

ljharb avatar Jan 23 '23 05:01 ljharb

This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.

github-actions[bot] avatar Nov 21 '23 00:11 github-actions[bot]

Bump, until captchas are completely disabled on endpoints that are expected to be used programmatically.

ljharb avatar Nov 21 '23 01:11 ljharb

Now that we have an enterprise account, here's what I suggest we enable:

CleanShot 2023-11-21 at 10 10 49

CleanShot 2023-11-21 at 10 11 15

targos avatar Nov 21 '23 09:11 targos

/cc @nodejs/build @nodejs/web-infra

targos avatar Nov 21 '23 09:11 targos

That rule sounds good to me. Is that a Security Rule?

ovflowd avatar Nov 21 '23 09:11 ovflowd

It's a Configuration Rule: https://dash.cloudflare.com/07be8d2fbc940503ca1be344714cb0d1/nodejs.org/rules/configuration-rules

targos avatar Nov 21 '23 09:11 targos

Looks good to me.

ovflowd avatar Nov 21 '23 09:11 ovflowd

Awesome, that seems perfect!

ljharb avatar Nov 21 '23 12:11 ljharb

+1 to the proposed rule change.

richardlau avatar Nov 21 '23 12:11 richardlau

+1 on the proposed rule addition

anonrig avatar Nov 21 '23 13:11 anonrig

The new rule is enabled.

targos avatar Nov 21 '23 15:11 targos