open-policy-agent

open policy agent - How to persist policies from REST API?


I'm new to OPA (open policy agent) and trying to create new policy using REST API /v1/policies/{id}. It works! But, OPA server saves it to memory and after rebooting all my policies are removed. How can I fix it, which parameters should I use to persist created policies ?


Solution

  • OPA saves all policy and data used for evaluation in memory. Consider using Bundles to distribute policy and data to OPA. Furthermore, you have the option to persist activated bundles to disk for recovery purposes. When bundle persistence is enabled, OPA will attempt to read the bundle from disk on startup. The documentation covers more details about bundle persistence.