Allow health checks behind Access or a WAF

Allow Fleet's health check through Cloudflare Access or a WAF rule, so that Health check blocked goes away.

Allow the two health addresses of the site in Cloudflare Access or in a WAF rule, then wait up to 5 minutes for the next read.

Before you start

  • You hold the Developer role or above in Fleet. You can also edit Access policies or WAF rules in the Cloudflare account that hosts the site. Fleet never changes Access or WAF settings in your Cloudflare account.
  • The site page shows Health check blocked, the hint Allow requests from Fleet's health check in your firewall and the ring Needs attention. The site did answer, so it never counts towards Down.
  • Every 5 minutes Fleet sends a GET to /_emdash/api/health and to /_emdash/api/setup/status. The request carries the header User-Agent: EmDashFleet-HealthPoller/1, no cookie and no credential. Fleet never follows a redirect and cannot sign in to Cloudflare Access. It never accepts a service token or any other key from you. See How Fleet checks a site's health.

Steps

  1. Open the site page and check that the health panel shows Health check blocked.
  2. Run curl -si -A "EmDashFleet-HealthPoller/1" https://<site host>/_emdash/api/health on your computer, then the same for /_emdash/api/setup/status. Each of these answers makes Fleet show Health check blocked. A redirect to a sign-in page points to Cloudflare Access. A challenge page with the header cf-mitigated: challenge points to a WAF rule or Bot Fight Mode. An answer such as a 403 or 429 without a JSON body points to a block or a rate limit. Your own output is the evidence.
  3. For Cloudflare Access, open Zero Trust and find the Access application that covers the site's hostname. See Access policies.
  4. Limit the application to /_emdash/admin and /_emdash/api/admin, so the two health addresses fall outside it. Or add a policy with the action Bypass for the two health addresses only. Bypass does not enforce any Access security controls and does not log the requests, so use it for those two paths and nothing else.
  5. For a WAF rule, open the security rules of the site's zone and create a custom rule with the expression User Agent equals EmDashFleet-HealthPoller/1 and URI Path is one of /_emdash/api/health and /_emdash/api/setup/status. Limit it to those two paths, because any visitor can send that header.
  6. Give the rule the action Skip. Select All remaining custom rules, and add All rate limiting rules when a 429 came back. See Skip action.
  7. Place the rule above the rule that challenges, blocks or limits. Cloudflare evaluates custom rules in order.
  8. Run the two curl commands again. Both must answer 200 with a JSON body.
  9. Wait up to 5 minutes for the next read, then reload the site page.

Result

Health check blocked goes away after the next read. The ring shows Healthy unless another observation applies.

If something goes wrong

  • If a curl command in step 8 still shows a redirect, a challenge, a 403 or a 429, the change did not cover that request. Check the order of the rules and the two paths, then try again.
  • If the challenge comes from Bot Fight Mode, a custom rule cannot skip it. Cloudflare states that you cannot bypass or skip Bot Fight Mode using WAF custom rules. See Bot Fight Mode for the other options of your plan.
  • If a service you do not control sits in front of the site, ask its administrator to allow the User-Agent EmDashFleet-HealthPoller/1 for the two addresses.
  • If the ring is Down, the site did not answer at all. See Site shows Down.

When you link an existing site, Fleet shows this message if the site did not answer as an EmDash site.

<host> did not answer as an EmDash site: <observation>. Check that the site is live and that its WAF allows the User-Agent `EmDashFleet-HealthPoller/1`, then try again.

If you cannot find the cause, ask from Support in the dashboard with the site name and the output of step 2. Never send a token, a password or an API key. See Contact support.

Related

Report a problem with this page