
These bindings will give us a way to call the C functions from JavaScript. Binding code to make LibSqreen available from Node.js.A static build of LibSqreen (libSqreenStatic.a).To interface LibSqreen with Node.js, we only needed two things: Thankfully, all the technologies we support provide a way to call native code. We have built a native library that we plan to use in all of our agents. This article will pick up on the items we discussed in the post above and take a look at how we built the native add-on for Node.js. The HTTP request is checked in its actual contextĪs we developed the In-App WAF, we made a series of implementation decisions and tradeoffs, and settled on building a native library, which we called libsqreen. The request is interpreted by the framework.The pattern set is chosen according to the stack itself.This gives a result way more accurate than a regular on-network WAF:



A bit of contextĪt Sqreen, we protect applications by leveraging microagents in multiple technologies (Node.js, Ruby, Python, PHP, Java, and Go). For Sqreen, this situation arose when we set out to build our In-App WAF. This is what prompted us to set out to build a native add-on for Node.js. However, sometimes you might need something that is not offered by the runtime or the ecosystem, no matter how strong it is.

Also, the latest features of the language and the incredible work by the Node.js/V8/libuv teams ensures that Node.js runs everywhere with great performance. The Node.js/JavaScript ecosystem is the most popular in the world with more than 1 million packages hosted on. Okay, but first: why the hell would you build a native add-on for Node.js?
