Where can we set up decision log config through OPAL? #93
-
Based on OPA doc, for decision logs, we are able to either let to a remote server to receive decision logs or log locally. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @hongbo-miao, you can definitely use OPAL to configure OPA's decision logs: Running with standalone OPAIf running OPA standalone (in its own container), you can use the OPA Running with inline OPA (recommended)If you run OPA inline (by using the official opal-client docker image), you can use the Since the Let's prepare a real configuration with decision logsI am patching the example opal docker compose configuration. I created a step by step tutorial how to do this with docker-compose but you can use this in kubernetes as well - you should change the environment variables to the proper values matching to your kubernetes config.
the relevant part is this:
This is the example config i used:
please replace
i created an example server on my machine using fastapi, this is the code to my server: server gist. you can run my example server with this command:
docker compose (opal client):
example server (after receiving the OPA decision logs):
Hope that is clear enough, please let me know if there are any follow up questions :) |
Beta Was this translation helpful? Give feedback.
Hi @hongbo-miao, you can definitely use OPAL to configure OPA's decision logs:
Running with standalone OPA
If running OPA standalone (in its own container), you can use the OPA
--config-file
option described here and pass a YAML with the options.Running with inline OPA (recommended)
If you run OPA inline (by using the official opal-client docker image), you can use the
OPAL_INLINE_OPA_CONFIG
env var to setup the runtime options when the OPA process is invoked. The value of that env var is a dict that matches the OpaServerOptions pydantic schema, and inside this schema - you need to pass the path to the OPA configuration YAML insideconfig_file
.Since the
config_file
key expects a path ac…