/opa-sandbox

Testing out opa

Primary LanguageOpen Policy Agent

opa-sandbox

Testing out opa

Things you will need

  • docker
  • docker-compose
  • opa cli (optional)

Resources

Getting Started

First you will need to get OPA running locally. For this we will use docker-compose to make sure things are nice and simple

docker-compose up -d

if you would like to start from scratch

docker-compose down

Then test that it is up and running

curl localhost:8500/v1/data/foo/bar
> {}

Setting Up Policies

We can use the OPA Rest API to upload our policies via

curl -X PUT localhost:8500/v1/policies/{id} --data-binary "@example.rego"

And if you would like to check the current state of a policy

curl localhost:8500/v1/policies/{id}

or delete the polict

curl -X DELETE localhost:8500/v1/policies/{id}