Usage

Starting the server

The server is configured with a YAML file that is passed using the --config flag. Values in the configuration file can be overridden from the command-line by the --set flag — which can be used multiple times. See Configuration for more information about available configuration options.

Using the binary
./cerbos server --config=/path/to/config.yaml --set=server.httpListenAddr=:3592
Using Docker
docker run -i -t -p 3592:3592 \
    -v /path/to/conf/dir:/config \
    ghcr.io/cerbos/cerbos:0.9.0 \
    server --config=/config/conf.yaml --set=server.httpListenAddr=:3592

Compiling and testing policies

After authoring your policies you should run the compiler over the files to make sure they are valid. If you have policy tests they can be executed at this time as well.

Using the binary
./cerbos compile /path/to/policies/dir

# To run tests, provide the path to the tests directory
./cerbos compile --tests=/path/to/tests /path/to/policies/dir
Using Docker
docker run -i -t \
    -v /path/to/policy/dir:/policies \
    -v /path/to/test/dir:/tests \
    ghcr.io/cerbos/cerbos:0.9.0 \
    compile --tests=/tests /policies