1 year ago
#365077
ewassef
OPA Middleware with Dapr not invoking
I am unable to get the OPA middleware to execute on a service to service invocation. I am using the simple OPA example online and cannot seem to get it to trigger when invoking it from another services using service invocation. It seems I can hit it if i curl from the service to the sidecar over localhost. My intent is to add this so that calling services (via Dapr invocation) will pass through the pipeline before reaching my service. The desire is to add authz to my services via configuration and inject them into the Dapr ecosystem. I have not been able to get this to trigger if i call the service via another Dapr service using invocation. ie. service A calls http://localhost:3500/v1.0/invoke/serviceb/method/shouldBlock and ServiceB has a configuration with an http pipeline that defaults to allow=false, however, it doesnt get called. If i shell into ServiceB and call that same method via curl, it will get triggered for more clarity, I am using this model https://carlos.mendible.com/2020/04/05/kubernetes-nginx-ingress-controller-with-dapr/ except this blog post is putting the ingress in the default namespace while i am using it from the default ingress-nginx namespace. the call is made successfully from the ingress, but never propagates the pipeline and gets denied by OPA
Here is a repo that sets up a kind k8s cluster, ingress controller and a dapr app with an opa policy. The setup.sh script should demonstrate the issue https://github.com/ewassef/opa-dapr
middleware
opa
dapr
0 Answers
Your Answer