Home

Awesome

Falco-Playground

Falco Infra Repository Sandbox License

A simple web application where you can create, edit and validate falco rules. This is a quick solution for users wanting to easily check the accuracy of their custom rules. This application is completely client side and doesn't make calls to any backend server. It leverages the power of WebAssembly to test your rules.

Usage

Falco-playground is hosted here: https://falcosecurity.github.io/falco-playground

Contributing

Please refer to the contributing guide and the code of conduct for more information on how to contribute.

Development

This application is built using React as its front-end framework and incorporates TypeScript for enhanced type-safety. It also uses Vite as it's build tool.

Install deps

npm install

Steps to download additional artifacts

Since falco-playground uses WebAssembly, it relies on a .wasm file linked to a .js file. You can find the falco.js and falco.wasm in the lastest completed ci build of falco.

  1. Go to https://github.com/falcosecurity/falco/actions/workflows/ci.yml
  2. Select a sucessful workflow.
  3. Download the falco-*-wasm.tar.gz in the Artifact section below.

Move falco.wasm and falco.js files into desired location

Since WebAssembly files (.wasm) can't be transpiled by the bundler, we need to ensure they remain static. To achieve this, we should relocate the falco.wasm file to the public directory. Additionally, for the application to interact with falco.wasm effectively, we should move falco.js to the hooks directory.

After extracting falco-*-wasm.tar.gz, falco.js and falco.wasm can be found at falco-*-wasm/usr/bin.

  1. Move falco.wasm into public
  2. Move falco.js into src/Hooks

Start development server

npm run dev

Testing

falco-playground uses cypress as it's testing tool.

Using cypress with launchpad

npm run cy:open

Using cypress with CLI

npm run cy:run