Reasonably usable self-hosted version of OPA's Playground
Ever wanted to have your own version of OPA's Playground? now it's possible with a reasonably usable version of the original Playground, called Alfred!
- Syntax Highlighting
- Policy Publishing
- Coverage Highlighting
- Data / Input / Policy Editor
- Restrict Execution of Builtins, such as:
http.send
oropa.runtime
- Download Policy as File / Copy to Clipboard
There is not a whole lot of configurations required for Alfred. If you want to restrict certain builtins from running in policies, you can do so in config.py
:
RESTRICTED_BUILTINS = [
'http.send',
'opa.runtime'
]
By default, all builtins are allowed.
git clone https://github.com/dolevf/Open-Policy-Agent-Alfred
cd Open-Policy-Agent-Alfred
docker build -t alfred .
docker run -d -p 5000:5000 alfred
docker pull dolevf/alfred
docker run -d -p 5000:5000 dolevf/alfred
pip3 install -r requirements.txt
For Linux:
curl -L -o bin/opa https://openpolicyagent.org/downloads/latest/opa_linux_amd64_static
For MacOSX:
curl -L -o bin/opa https://openpolicyagent.org/downloads/latest/opa_darwin_amd64
chmod u+x bin/opa
python3 alfred.py
- Dolev Farhi
It is distributed under the MIT License. See LICENSE for more information.