Record every policy decision
Keep every policy decision on the audit trail, a user's own allowed requests included, and go back to the default when you're done.
API
By default the trail keeps every deny and every decision an agent is in, so an agent’s trail is whole. During an investigation or an audit period you may want each user’s allowed requests too, to show exactly what a user reached.
Before you start: you hold MODIFY on the realm, as a realm administrator with RealmOwner does, and are signed
in with your session in $CVYUH_SESSION (Call the API shows how).
Keep every decision
Section titled “Keep every decision”-
Set the realm’s
auditDecisionstoall:Terminal window curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/authorizationSettings/authorizationSettings \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "auditDecisions": "all" }' -
Read a user’s trail as requests come in:
Terminal window curl "https://foobar.cvyuh.com/api/v0/am/audit/v1/trail?person=<maya's id>" \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
Check it worked
Section titled “Check it worked”The user’s trail now holds POLICY_DECIDED records with "result": "SUCCESSFUL" for their own allowed requests, not
only denies.
Undo it
Section titled “Undo it”Set auditDecisions back to agents:
curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/authorizationSettings/authorizationSettings \ -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \ -H "Content-Type: application/json" \ -d '{ "auditDecisions": "agents" }'The records already written stay on the trail.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
403 on the PATCH | You don’t hold MODIFY on the realm | Ask a holder of RealmOwner |
400 on the PATCH | A value other than agents or all | Send one of the two |
No allowed POLICY_DECIDED records yet | No request a policy decides has come in since | Wait for one, then read again |
Each change of the setting is itself recorded, with who made it and the value before and after, in the
change history of authorizationSettings/authorizationSettings.
Related
Section titled “Related”- What is recorded: which decisions each setting keeps.
- Policies: the decisions themselves.