My rego policy always returns false #612
Replies: 4 comments 2 replies
-
If you provide the policy and data loaded in OPA and the input you use to query OPA, we could help investigate. |
Beta Was this translation helpful? Give feedback.
-
Thanks for reply! I have updated my question |
Beta Was this translation helpful? Give feedback.
-
Your policy says bearer_token := split(input.event.identitySource[0], " ")[1] but your input doesn't have bearer_token := split(input.dentitySource[0], " ")[1] Also, some payload
[true, _, payload] = io.jwt.decode_verify(...) Also, I don't think passing in your Unrelated -- if you're not using envoy, import input.attributes.request.http as http_request has no effect whatsoever. |
Beta Was this translation helpful? Give feedback.
-
I think my updated policy is not used by OPA server inside docker . HOw to update policy OPA is using
This is my updated policy
|
Beta Was this translation helpful? Give feedback.
-
This is how I set up OPA in docker
![image](https://private-user-images.githubusercontent.com/135230962/348351221-9b8aad6f-1f71-418f-9b0a-353289b2e2d3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NTUwMDksIm5iZiI6MTczOTU1NDcwOSwicGF0aCI6Ii8xMzUyMzA5NjIvMzQ4MzUxMjIxLTliOGFhZDZmLTFmNzEtNDE4Zi05YjBhLTM1MzI4OWIyZTJkMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE0JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNFQxNzM4MjlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05YzVjYzhkMzc4OTU2OWQyZWVjMWUwMWU3ZTNjNDJhNjE3MTBhM2FiODkxNTM1OWM3OTI0YTg0ZmM0NzlhNWYxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.Mc00LgqL5bLt68yXENVPAEjRCBcsG3wA_AFKoNArx4U)
I am trying to validate AWS cognito access token . Its not working , and dont know how to debug or add more logging .
input.json
Not sure how to debug why its not working . Do I need to add --authentication=token when I start OPA as service ?
Beta Was this translation helpful? Give feedback.
All reactions