Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPA filter smoke tests #157

Closed
pavolloffay opened this issue Dec 7, 2020 · 1 comment
Closed

OPA filter smoke tests #157

pavolloffay opened this issue Dec 7, 2020 · 1 comment

Comments

@pavolloffay
Copy link
Member

pavolloffay commented Dec 7, 2020

This is a tracking issue for discussing OPA filter testing. The idea is that in agent we want to be able to test OPA filter https://github.com/hypertrace/javaagent/tree/main/filter-custom-opa against running https://github.com/open-policy-agent/opa. The filter gets data from /v1/data and runs evaluation on every request.

I would like to package https://github.com/open-policy-agent/opa into a docker container and make data.json and /v1/policies/remote-bundle/traceable/http/request/policy.rego configurable. This container could be used in smoke tests in all Hypertrace agents. There is already a docker container https://hub.docker.com/r/openpolicyagent/opa - we should have a look if it could be used.

In the meantime the OPA filter can be tested by:

  1. port-forwarding OPA agent from traceableai namespace k port-forward service/opa 8181:8181 -n traceableai
  2. get the data from OPA agent curl localhost:8181/v1/data and pick some IP address from denylist
  3. run agent on a test/demo app and do curl localhost:8080 -H "X-Forwarded-For: <IP from deny list> - the request should be blocked with 403

cc) @mohit-a21 @jcchavezs @davexroth

@pavolloffay
Copy link
Member Author

Removing OPA is moved to a private repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant