-
Notifications
You must be signed in to change notification settings - Fork 11
Build
To build from the source, you need:
Tinygo is a go compiler for embedded systems, as such it is able to build WASM files. WASM is a format that can be used to extend Envoy, hence our design choice.
To extend Envoy, we used the dedicated Proxy WASM Go SDK.
To recompile your own WASM plugin from the go source files, do the following:
cd cloud-active-defense/proxy/wasm
tinygo build -o ./cloud-active-defense.wasm -scheduler=none -target=wasi ./main.go
The scheduler is not supported in the WASM format and should thus be removed. The source code is not needed for the application to run, only the compiled WASM file is necessary.
To update the version of the dependencies used before compiling, run:
cd cloud-active-defense/proxy/wasm
go mod tidy
tinygo build -o ./cloud-active-defense.wasm -scheduler=none -target=wasi ./main.go
If you add a new dependency to the source code, this needs to be reflected in the go.mod and go.sum files. Running go mod tidy will update these files.
The go.mod and go.sum files were initially created with the commands:
cd cloud-active-defense/proxy/wasm
go mod init sundew
go mod tidy
sundew is the internal name of the module. This name is reflected in the folder hierarchy of the source code. A sundew is a carnivorous plant which attracts insects with 'dew', a sticky substance which seems to be edible. Cloud active defense deploys decoys in a similar way, with elements which seem to be vulnerable...