Hello, I have a question related to storage. My u...
# help
c
Hello, I have a question related to storage. My use case is that users can be assigned preset policies, or custom policies, in a multi-tenant environment. Preset policies are global and "available" to all tenants, custom policies can be created/updated by users and are only available to some tenants. To make local dev and testing easier, and also to version control preset policies, ideally we'd be able to use both preset policies as code in git versioned files, and custom policies stored in a database. If it's not possible, we'd need a way to spawn a local Cerbos stack and seed predefined preset policies. Our app is built in Python, so one option would be to store preset policies in a .py file using Cerbos SDK models, and call the Admin API to seed the db. But I like the option of having .yaml policy files and being able to switch easily from disk to postgres storage Best case scenario we'd be automate creating or updating preset policies from policy files at deployment, and even version them in Cerbos Has anyone encountered a similar use case and found a workaround?
a
Hey @Camille Beguin currently the approach you outlined about bootstrapping the database from existing policies is the way to go. You don't have to go via python though, another option is to use the
cerbosctl put
command as a startup job and load the YAML files directly. https://docs.cerbos.dev/cerbos/latest/cli/cerbosctl#put We are also working in this area with Cerbos Hub to smooth things out. For these custom policies, how are you planning these to be authored by users?