Skip to content

Commit

Permalink
Revert "Rename to @aikidosec/zen"
Browse files Browse the repository at this point in the history
This reverts commit 8b259c1.
  • Loading branch information
timokoessler committed Sep 12, 2024
1 parent 8b259c1 commit bd8fdb7
Show file tree
Hide file tree
Showing 128 changed files with 354 additions and 354 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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 Zen software without
develop commercial activities involving the Aikido Firewall software without
disclosing the source code of your own applications. These activities include
but are not limited to: offering paid services to customers in a web application
or shipping Aikido with a closed source product.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ hapi-postgres:

.PHONY: micro
micro:
cd sample-apps/micro && AIKIDO_DEBUG=true AIKIDO_BLOCKING=true node --preserve-symlinks --require @aikidosec/zen ./node_modules/.bin/micro
cd sample-apps/micro && AIKIDO_DEBUG=true AIKIDO_BLOCKING=true node --preserve-symlinks --require @aikidosec/firewall ./node_modules/.bin/micro

.PHONY: lambda-mongodb-nosql-injection
lambda-mongodb-nosql-injection:
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/api-discovery/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion benchmarks/api-discovery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"main": "benchmark.js",
"private": true,
"dependencies": {
"@aikidosec/zen": "file:../../build"
"@aikidosec/firewall": "file:../../build"
}
}
2 changes: 1 addition & 1 deletion benchmarks/hono-pg/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function startServer(firewallEnabled) {
env = {
...env,
AIKIDO_BLOCKING: "true",
NODE_OPTIONS: "-r @aikidosec/zen",
NODE_OPTIONS: "-r @aikidosec/firewall",
};
}

Expand Down
6 changes: 3 additions & 3 deletions benchmarks/hono-pg/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion benchmarks/hono-pg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "benchmark.js",
"private": true,
"dependencies": {
"@aikidosec/zen": "file:../../build",
"@aikidosec/firewall": "file:../../build",
"@hono/node-server": "^1.12.0",
"hono": "^4.5.1",
"pg": "^8.12.0"
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/nosql-injection/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion benchmarks/nosql-injection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "benchmark.js",
"private": true,
"dependencies": {
"@aikidosec/zen": "file:../../build",
"@aikidosec/firewall": "file:../../build",
"mongodb": "^6.3.0",
"percentile": "^1.6.0"
}
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/shell-injection/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion benchmarks/shell-injection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"main": "benchmark.js",
"private": true,
"dependencies": {
"@aikidosec/zen": "file:../../build"
"@aikidosec/firewall": "file:../../build"
}
}
6 changes: 3 additions & 3 deletions benchmarks/sql-injection/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion benchmarks/sql-injection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"main": "benchmark.js",
"private": true,
"dependencies": {
"@aikidosec/zen": "file:../../build"
"@aikidosec/firewall": "file:../../build"
}
}
8 changes: 4 additions & 4 deletions docs/cloud-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
If you're using the `@google-cloud/functions-framework` package to register your handlers, your cloud function will be protected by Zen automatically:

```js
require("@aikidosec/zen/cloud-function"); // <-- Include this before any other code or imports
require("@aikidosec/firewall/cloud-function"); // <-- Include this before any other code or imports

const functions = require("@google-cloud/functions-framework");

Expand All @@ -15,7 +15,7 @@ functions.http("handler", async (req, res) => {
or ESM import style:

```js
import "@aikidosec/zen/cloud-function";
import "@aikidosec/firewall/cloud-function";

// ...
```
Expand All @@ -25,7 +25,7 @@ If you're using the `exports.handler` style, you'll need to wrap your handler ma
At the very beginning of the file that contains your handler, add the following line:

```js
const protect = require("@aikidosec/zen/cloud-function"); // <-- Include this before any other code or imports
const protect = require("@aikidosec/firewall/cloud-function"); // <-- Include this before any other code or imports

const dependency = require("dependency");

Expand All @@ -38,7 +38,7 @@ exports.handler = protect(async (event, context) => {
or ESM import style:

```js
import protect from "@aikidosec/zen/cloud-function";
import protect from "@aikidosec/firewall/cloud-function";

// ...
```
Expand Down
4 changes: 2 additions & 2 deletions docs/express.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
At the very beginning of your app.js file, add the following line:

```js
require("@aikidosec/zen"); // <-- Include this before any other code or imports
require("@aikidosec/firewall"); // <-- Include this before any other code or imports

const express = require("express");

Expand All @@ -15,7 +15,7 @@ const app = express();
or ESM import style:

```js
import "@aikidosec/zen";
import "@aikidosec/firewall";

// ...
```
Expand Down
4 changes: 2 additions & 2 deletions docs/hapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
At the very beginning of your app.js file, add the following line:

```js
require("@aikidosec/zen"); // <-- Include this before any other code or imports
require("@aikidosec/firewall"); // <-- Include this before any other code or imports

const Hapi = require("@hapi/hapi");

Expand All @@ -18,7 +18,7 @@ const server = Hapi.server({
or ESM import style:

```js
import "@aikidosec/zen";
import "@aikidosec/firewall";

// ...
```
Expand Down
4 changes: 2 additions & 2 deletions docs/hono.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
At the very beginning of your app.js file, add the following line:

```js
require("@aikidosec/zen"); // <-- Include this before any other code or imports
require("@aikidosec/firewall"); // <-- Include this before any other code or imports

const { Hono } = require("hono");

Expand All @@ -17,7 +17,7 @@ const app = Hono();
or ESM import style:

```js
import "@aikidosec/zen";
import "@aikidosec/firewall";

// ...
```
Expand Down
4 changes: 2 additions & 2 deletions docs/lambda.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
At the very beginning of the file that contains your handler, add the following line:

```js
const protect = require("@aikidosec/zen/lambda"); // <-- Include this before any other code or imports
const protect = require("@aikidosec/firewall/lambda"); // <-- Include this before any other code or imports

const dependency = require("dependency");

Expand All @@ -16,7 +16,7 @@ exports.handler = protect(async (event, context) => {
or ESM import style:

```js
import protect from "@aikidosec/zen/lambda";
import protect from "@aikidosec/firewall/lambda";

// ...
```
Expand Down
4 changes: 2 additions & 2 deletions docs/micro.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Since micro loads your handler from a file, you'll need to use `NODE_OPTIONS` to
```json
{
"scripts": {
"start": "NODE_OPTIONS='-r @aikidosec/zen' micro"
"start": "NODE_OPTIONS='-r @aikidosec/firewall' micro"
}
}
```

or when using `node`:

```sh
node --require @aikidosec/zen ./node_modules/.bin/micro
node --require @aikidosec/firewall ./node_modules/.bin/micro
```

That's it! Your app is now protected by Zen.
Expand Down
22 changes: 11 additions & 11 deletions docs/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ const nextConfig = {
};
```

Next.js will create a `standalone` directory in your `.next` directory. This directory contains the standalone server that you can run with Node.js. Next.js will only copy dependencies that are required for the server to run. It does not know about @aikidosec/zen, so you need to copy it manually:
Next.js will create a `standalone` directory in your `.next` directory. This directory contains the standalone server that you can run with Node.js. Next.js will only copy dependencies that are required for the server to run. It does not know about @aikidosec/firewall, so you need to copy it manually:

```sh
mkdir -p .next/standalone/node_modules/@aikidosec
cp -r node_modules/@aikidosec/zen .next/standalone/node_modules/@aikidosec
cp -r node_modules/@aikidosec/firewall .next/standalone/node_modules/@aikidosec
```

After building your Next.js app, you can run the standalone server with the following command:

```sh
node -r @aikidosec/zen .next/standalone/server.js
node -r @aikidosec/firewall .next/standalone/server.js
```

If you're using Docker:

```Dockerfile
CMD node -r @aikidosec/zen server.js
CMD node -r @aikidosec/firewall server.js
```

You can also use the firewall when developing locally by updating the `dev` and `start` scripts in your `package.json`:
Expand All @@ -33,16 +33,16 @@ You can also use the firewall when developing locally by updating the `dev` and
{
"scripts": {
"build": "next build",
"postbuild": "mkdir -p .next/standalone/node_modules/@aikidosec && cp -r node_modules/@aikidosec/zen .next/standalone/node_modules/@aikidosec",
"dev": "NODE_OPTIONS='-r @aikidosec/zen' next dev",
"start": "NODE_OPTIONS='-r @aikidosec/zen' next start"
"postbuild": "mkdir -p .next/standalone/node_modules/@aikidosec && cp -r node_modules/@aikidosec/firewall .next/standalone/node_modules/@aikidosec",
"dev": "NODE_OPTIONS='-r @aikidosec/firewall' next dev",
"start": "NODE_OPTIONS='-r @aikidosec/firewall' next start"
}
}
```

You don't need to copy the `@aikidosec/zen` directory when using `npm run dev` or `npm run start`.
You don't need to copy the `@aikidosec/firewall` directory when using `npm run dev` or `npm run start`.

Note: Including `@aikidosec/zen` in `middleware.js` or `instrumentation.js` will not work due to the build process of Next.js.
Note: Including `@aikidosec/firewall` in `middleware.js` or `instrumentation.js` will not work due to the build process of Next.js.

## Caveats

Expand All @@ -57,7 +57,7 @@ By default, Zen will run in detection only mode. When it detects an attack, the
You can enable blocking mode by setting the environment variable `AIKIDO_BLOCKING` to `true`:

```sh
AIKIDO_BLOCKING=true node -r @aikidosec/zen .next/standalone/server.js
AIKIDO_BLOCKING=true node -r @aikidosec/firewall .next/standalone/server.js
```

It's recommended to enable this on your staging environment for a considerable amount of time before enabling it on your production environment (e.g. one week).
Expand All @@ -67,7 +67,7 @@ It's recommended to enable this on your staging environment for a considerable a
If you need to debug Zen, you can run your next app with the environment variable `AIKIDO_DEBUG` set to `true`:

```sh
AIKIDO_DEBUG=true node -r @aikidosec/zen .next/standalone/server.js
AIKIDO_DEBUG=true node -r @aikidosec/firewall .next/standalone/server.js
```

This will output debug information to the console (e.g. if the agent failed to start, no token was found, unsupported packages, ...).
Loading

0 comments on commit bd8fdb7

Please sign in to comment.