How to only allow Cloudflare connections and Known Bots

I want to allow only requests/connections coming through Cloudflare and KnownBots to access my site and block any other connection.
Is there a way to do this?

Best regards.

If you only want to allow Cloudflare connections, you have to do this at your server. Block anything not from the list at

And if you want to only allow Known Bots to your site (that means no regular users…quite strange), add this Firewall Rule:

Sorry i mean allowing only traffic (regular users) passing through Cloudflare first and Known Bots