Protecting CloudFlare Workers
Hi there, I am looking to set up my Zen Firewall App at Aikido. I am going through the documentation, but I do not find any option for my current stack that consists of:
- CloudFlare Workers (similar to AWS Lambda)
- itty-router for routing.
Can you provide details on how I can initialize Zen with this stack? Thanks
Hi @nicolaspapp , Sadly Zen does not support Cloudflare workers. Reasons for this are that we are still working on ESM support and that Cloudflare workers are not fully compatible with Node.js. We might support it in the future, but it is not planned right now. Which features would you like to use the most? Are you using a bundler like esbuild?
We have an Aikido Subscription, and I was interested in setting up Zen to scan my API endpoints. But I think I can try Aikidio AI instead.
@nicolaspapp We usually reply faster on Intercom! So you were planning to use Zen for generating an OpenAPI spec for scanning your API? We indeed have an alternative way, using AI, to generate an OpenAPI spec from your code. Try it out and let us know!
Yeah, I´m going through that one now, and so far so good with the AI option! Adding WAF with Zen seemed like an interesting choice for us to consider, hence why I opened the issue.
@timokoessler, to get back to your question, I am not using esbuild. I am also using nodejs compatibility flag, so it might just work. I can give it a try, I just need some help on how I can manually pass the token since the way Cloudflare handles env variables is somewhat different.
It will sadly not work without code changes on our side. Are you using CJS (require) or ESM (import) at runtime?
I'm using ESM
According to this page, Cloudflare workers sadly do not implement the Node.js built-in module node:module, that we will heavily rely on for the upcoming ESM support. So it is unfortunately very unlikely that we can support this setup in the near future.
+1 on this