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 \ \
    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
# Compiles and run tests in the given directory
./cerbos compile /path/to/policies/dir

# To skip the tests
./cerbos compile /path/to/policies/dir --skip-tests

# To specify a different path to the tests directory
./cerbos compile /path/to/policies/dir --tests=/path/to/tests
Using Docker
docker run -i -t \
    -v /path/to/policy/dir:/policies \
    -v /path/to/test/dir:/tests \ \
    compile --tests=/tests /policies