Hello. Is there a way I can retrieve the permit.ch...
# general
s
Hello. Is there a way I can retrieve the permit.check detailed result that is logged in the permit.io audit log?
a
Hey @Savin Cristi It is better to ask in #permit-saas to get a faster response from the team and our @Ask Inkeep
a
Thanks for tagging me @Alon Boshi. I'll look through relevant sources and get back to you shortly.
Yes, you can retrieve the detailed
permit.check
results that are logged in the audit log. There are a few ways to access this information: Via API You can use the Audit Logs API to retrieve detailed audit log information (1) . The API provides endpoints to: 1. ​*List audit logs*​ with filtering capabilities:
Copy code
api_instance.list_audit_logs(proj_id, env_id, opts)
2. ​*Get detailed audit log*​ for a specific log entry:
Copy code
api_instance.get_detailed_audit_log(proj_id, env_id, log_id)
The API allows you to filter by various parameters including users, decision results, resources, tenants, actions, and timestamps . Detailed Response Structure The audit logs contain comprehensive information about each authorization check (2) , including: • The authorization decision (Allow/Deny) • Debug information with the reasoning behind the decision • User details and attributes • Resource and action information • The specific roles or policies that allowed/denied access For example, the response includes a
debug
section with details like which role granted permission and why . Direct PDP Access Since audit logs are written to the PDP's stdout/stderr, you can also stream them directly from your deployed PDP microservice into your logging platform . Would you like more specific details about implementing any of these approaches?
To learn more, see the sources I considered: [[1] https://github.com/permitio/permit-ruby/blob/main/docs](https://github.com/permitio/permit-ruby/blob/main/docs) [[2] Best Practices for Authorization Audit Logs](https://www.permit.io/blog/audit-logs)
a
@Savin Cristi, does the AI's answer make sense?
s
Yes, that is worktwhile checking
thx alot
💜 1