-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:AikidoSec/node-RASP into dont-shado…
…w-ports-in-hostnames * 'main' of github.com:AikidoSec/node-RASP: (484 commits) Fix linting Add unit tests for hono/context-storage Fix addHonoMiddleware types Upgrade mongodb in sample app Add comment about mongodb v6.10.0 Keep same order Use process.nextTick before wrapping Collection Fix lock files Add links to docs Update end2end/tests/node-red.test.js Update end2end/tests/node-red.test.js Add node-red e2e test Fix property definition fix: Do not use wrap helper for req handler Improve package.json Fix test Fix lint Fix lint Fix type import Test express v4 and v5 ...
- Loading branch information
Showing
464 changed files
with
87,083 additions
and
17,775 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ jobs: | |
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: make install | ||
- run: make build | ||
- run: make lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,9 +35,26 @@ jobs: | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 -e MYSQL_ROOT_PASSWORD=mypassword -e MYSQL_DATABASE=catsdb --entrypoint sh mysql:8.0 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" | ||
ports: | ||
- "27015:3306" | ||
mariadb: | ||
image: mariadb:11 | ||
env: | ||
MARIADB_ROOT_PASSWORD: mypassword | ||
MARIADB_DATABASE: catsdb | ||
ports: | ||
- "27018:3306" | ||
clickhouse: | ||
image: clickhouse/clickhouse-server:24 | ||
env: | ||
"CLICKHOUSE_USER": "clickhouse" | ||
"CLICKHOUSE_PASSWORD": "clickhouse" | ||
"CLICKHOUSE_DB": "main_db" | ||
"CLICKHOUSE_DEFAULT_ACCESS": "MANAGEMENT=1" | ||
ports: | ||
- "27019:8123" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: [16.x, 18.x, 20.x, 22.x] | ||
node-version: [16.x, 18.x, 20.x, 22.x, 23.x] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
|
@@ -48,6 +65,7 @@ jobs: | |
run: | | ||
sudo echo "127.0.0.1 local.aikido.io" | sudo tee -a /etc/hosts | ||
- run: make install | ||
- run: make build | ||
- run: make test-ci | ||
- name: "Upload coverage" | ||
uses: codecov/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
![Aikido Firewall for Node.js](./docs/banner.svg) | ||
![Zen by Aikido for Node.js](./docs/banner.svg) | ||
|
||
# Aikido Firewall for Node.js | ||
# Zen, in-app firewall for Node.js | by Aikido | ||
|
||
[![NPM Version](https://img.shields.io/npm/v/%40aikidosec%2Ffirewall?style=flat-square)](https://www.npmjs.com/package/@aikidosec/firewall) | ||
[![Codecov](https://img.shields.io/codecov/c/github/AikidoSec/firewall-node?style=flat-square&token=AJK9LU35GY)](https://app.codecov.io/gh/aikidosec/firewall-node) | ||
|
@@ -9,39 +9,43 @@ | |
[![Unit tests](https://github.com/AikidoSec/firewall-node/actions/workflows/unit-test.yml/badge.svg)](https://github.com/AikidoSec/firewall-node/actions/workflows/unit-test.yml) | ||
[![End to end tests](https://github.com/AikidoSec/firewall-node/actions/workflows/end-to-end-tests.yml/badge.svg)](https://github.com/AikidoSec/firewall-node/actions/workflows/end-to-end-tests.yml) | ||
|
||
Aikido Firewall is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks. | ||
Zen, your in-app firewall for peace of mind– at runtime. | ||
|
||
Zen by Aikido is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks. | ||
|
||
It protects your Node.js apps by preventing user input containing dangerous strings, which allow injection, pollution, and path traversal attacks. It runs on the same server as your Node.js app for simple [installation](#installation) and zero maintenance. | ||
|
||
## Features | ||
|
||
Firewall autonomously protects your Node.js applications against: | ||
Zen will autonomously protect your Node.js applications against: | ||
|
||
* 🛡️ [NoSQL injection attacks](https://www.aikido.dev/blog/web-application-security-vulnerabilities) | ||
* 🛡️ [SQL injection attacks]([https://www.aikido.dev/blog/web-application-security-vulnerabilities](https://owasp.org/www-community/attacks/SQL_Injection)) | ||
* 🛡️ [SQL injection attacks](https://www.aikido.dev/blog/the-state-of-sql-injections) | ||
* 🛡️ [Command injection attacks](https://owasp.org/www-community/attacks/Command_Injection) | ||
* 🛡️ [Prototype pollution](./docs/prototype-pollution.md) | ||
* 🛡️ [Path traversal attacks](https://owasp.org/www-community/attacks/Path_Traversal) | ||
* 🛡️ [Server-side request forgery (SSRF)](./docs/ssrf.md) | ||
|
||
Firewall operates autonomously on the same server as your Node.js app to: | ||
Zen operates autonomously on the same server as your Node.js app to: | ||
|
||
* ✅ Secure your app like a classic web application firewall (WAF), but with none of the infrastructure or cost. | ||
* ✅ Rate limit specific API endpoints by IP or by user | ||
* ✅ Allow you to block specific users manually | ||
|
||
## Supported libraries and frameworks | ||
|
||
Aikido Firewall for Node.js 16+ is compatible with: | ||
Zen for Node.js 16+ is compatible with: | ||
|
||
### Web frameworks | ||
|
||
* ✅ [Express](docs/express.md) 4.x | ||
* ✅ [Express](docs/express.md) 4.x, 5.x | ||
* ✅ [Hono](docs/hono.md) 4.x | ||
* ✅ [hapi](docs/hapi.md) 21.x | ||
* ✅ [micro](docs/micro.md) 10.x | ||
* ✅ [Next.js](docs/next.md) 12.x, 13.x and 14.x | ||
* ✅ Fastify (upcoming) | ||
* ✅ [Fastify](docs/fastify.md) 4.x and 5.x | ||
* ✅ [Koa](docs/koa.md) 2.x | ||
* ✅ [NestJS](docs/nestjs.md) 10.x | ||
|
||
### Database drivers | ||
|
||
|
@@ -50,9 +54,12 @@ Aikido Firewall for Node.js 16+ is compatible with: | |
* ✅ [`pg`](https://www.npmjs.com/package/pg) 8.x and 7.x | ||
* ✅ [`mysql`](https://www.npmjs.com/package/mysql) 2.x | ||
* ✅ [`mysql2`](https://www.npmjs.com/package/mysql2) 3.x | ||
* ✅ [`mariadb`](https://www.npmjs.com/package/mariadb) 3.x | ||
* ✅ [`sqlite3`](https://www.npmjs.com/package/sqlite3) 5.x | ||
* ✅ [`node:sqlite`](https://nodejs.org/api/sqlite.html) | ||
* ✅ [`better-sqlite3`](https://www.npmjs.com/package/better-sqlite3) 11.x, 10.x, 9.x and 8.x | ||
* ✅ [`postgres`](https://www.npmjs.com/package/postgres) 3.x | ||
* ✅ [`@clickhouse/client`](https://www.npmjs.com/package/@clickhouse/client) 1.x | ||
|
||
### Cloud providers | ||
|
||
|
@@ -85,9 +92,14 @@ See list above for supported database drivers. | |
|
||
* ✅ [`ShellJS`](https://www.npmjs.com/package/shelljs) 0.8.x, 0.7.x | ||
|
||
### Routers | ||
|
||
* ✅ [`@koa/router`](https://www.npmjs.com/package/@koa/router) 13.x, 12.x, 11.x and 10.x | ||
|
||
|
||
## Installation | ||
|
||
We recommend you test Aikido's Firewall on local or staging first before moving to production. | ||
We recommend testing Zen locally or on staging before deploying to production. | ||
|
||
```shell | ||
# The --save-exact makes sure that you don't automatically install a newer version | ||
|
@@ -99,22 +111,33 @@ $ yarn add --exact @aikidosec/firewall | |
|
||
For framework- and provider- specific instructions, check out our docs: | ||
|
||
- [Express.js-based apps](docs/express.md) | ||
- [Express](docs/express.md) | ||
- [Fastify](docs/fastify.md) | ||
- [Hapi](docs/hapi.md) | ||
- [Koa](docs/koa.md) | ||
- [Hono](docs/hono.md) | ||
- [NestJS](docs/nestjs.md) | ||
- [micro](docs/micro.md) | ||
- [Next.js](docs/next.md) | ||
- [AWS Lambda](docs/lambda.md) | ||
- [Google Cloud Functions](docs/cloud-functions.md) | ||
- [Google Cloud Pub/Sub](docs/pubsub.md) | ||
|
||
## Reporting to your Aikido Security dashboard | ||
|
||
> Aikido Security is a developer-first software security platform. We scan your source code & cloud to show you which vulnerabilities are actually important. | ||
> Aikido is your no nonsense application security platform. One central system that scans your source code & cloud, shows you what vulnerabilities matter, and how to fix them - fast. So you can get back to building. | ||
Zen is a new product by Aikido. Built for developers to level up their security. While Aikido scans, get Zen for always-on protection. | ||
|
||
You can use some of Zen’s features without Aikido, of course. Peace of mind is just a few lines of code away. | ||
|
||
You can use some of Firewalls's features without Aikido, but you will get the most value by reporting your data to Aikido. | ||
But you will get the most value by reporting your data to Aikido. | ||
|
||
You will need an Aikido account and a token to report events to Aikido. If you don't have an account, you can [sign up for free](https://app.aikido.dev/login). | ||
|
||
Here's how: | ||
* [Log in to your Aikido account](https://app.aikido.dev/login). | ||
* Go to [Firewall](https://app.aikido.dev/runtime/services). | ||
* Go to [Zen](https://app.aikido.dev/runtime/services). | ||
* Go to apps. | ||
* Click on **Add app**. | ||
* Choose a name for your app. | ||
|
@@ -124,9 +147,9 @@ Here's how: | |
|
||
## Running in production (blocking) mode | ||
|
||
By default, Firewall will only detect and report attacks to Aikido. | ||
By default, Zen will only detect and report attacks to Aikido. | ||
|
||
To block requests, set the `AIKIDO_BLOCKING` environment variable to `true`. | ||
To block requests, set the `AIKIDO_BLOCK` environment variable to `true`. | ||
|
||
See [Reporting to Aikido](#reporting-to-your-aikido-security-dashboard) to learn how to send events to Aikido. | ||
|
||
|
@@ -135,19 +158,19 @@ See [Reporting to Aikido](#reporting-to-your-aikido-security-dashboard) to learn | |
This program is offered under a commercial and under the AGPL license. | ||
You can be released from the requirements of the AGPL license by purchasing | ||
a commercial license. Buying such a license is mandatory as soon as you | ||
develop commercial activities involving the Aikido Firewall software without | ||
develop commercial activities involving the Zen software without | ||
disclosing the source code of your own applications. | ||
|
||
For more information, please contact Aikido Security at this | ||
address: [email protected] or create an account at https://app.aikido.dev. | ||
|
||
## Performance | ||
|
||
We run a benchmark on every commit to ensure Firewall has a minimal impact on your application's performance. | ||
We run a benchmark on every commit to ensure Zen has a minimal impact on your application's performance. | ||
|
||
The benchmark runs [a simple MongoDB query](benchmarks/nosql-injection/getUser.js) to measure the difference between two runs with and without Firewall: | ||
The benchmark runs [a simple MongoDB query](benchmarks/nosql-injection/getUser.js) to measure the difference between two runs with and without Zen: | ||
|
||
| Without Firewall | With Firewall | Difference in ms | | ||
| Without Zen | With Zen | Difference in ms | | ||
|------------------|---------------|------------------| | ||
| 0.214ms | 0.222ms | +0.008ms | | ||
|
||
|
Oops, something went wrong.