Skip to content
Audit & ReportsMarkdown

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).

  1. Set the realm’s auditDecisions to all:

    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" }'
  2. 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"

The user’s trail now holds POLICY_DECIDED records with "result": "SUCCESSFUL" for their own allowed requests, not only denies.

Set auditDecisions back to agents:

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": "agents" }'

The records already written stay on the trail.

SymptomCauseFix
403 on the PATCHYou don’t hold MODIFY on the realmAsk a holder of RealmOwner
400 on the PATCHA value other than agents or allSend one of the two
No allowed POLICY_DECIDED records yetNo request a policy decides has come in sinceWait 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.