Last updated

Audit Logging

What Is Audit Logging?

Audit Logging is the process of keeping a history of any modifying actions that users, admins, and sometimes servers have made. Modifying actions are typically creating/adding, deleting, or updating some piece of data, but any instance where data is being altered falls under this umbrella.

Every time an action is called, the audit log will record up to two parts: the attempt and - if the action went through cleanly - the success. If the action has missing parameters, the attempt will not be logged.

For the sake of this documentation, the terms 'action' and 'event' are interchangeable.

Data Storage

At the moment, the default storage location for audit logs uses SQLite and can be found in the audit_log table within your Build/SQLiteDatabase/audit.db file in the catena-tools-core project. However, the storage method itself is modular, and you may wish to reconfigure it. Please see the Choosing Modules page for further information.

Data Format

column nametypedescription
audit_idstringA unique uuid for the log.
log_timelongThe number of seconds since the Unix Epoch.
audit_contextstringified jsonContains session information, API key information, and custom audit context.
eventstringThe calling event, in a dot-name format.
e.g. Accepting a friend request would be friends.accept.attempt and friends.accept.success
event_datastringified jsonData relevant to the event. This varies based on the specific event being called.

The CustomAuditContext section of the audit_context data string includes relevant data from the caller of the action. e.g. When a user attempts to create a party, the following snippet gets logged: "CustomAuditContext":{"AccountId":"account-37715543-9b82-4103-ab4d-61482958182a","AccountRole":"user"}

Services

Below is a complete list of all actions that are logged, along with the data that gets logged when those actions are triggered. Actions are sorted by service, and further split by user actions, admin actions, and server actions.

Accounts

User Actions

FunctionData Logged on AttemptData Logged on Success
CreateOrGetAccountFromTokenPlatform Type, Platform Account IdCatena Account Id, Platform Types linked to Account
LinkAccountToPlatformPlatform TypePlatform Type
UpdateAccountAccount Metadata Key/Value PairsAccount Metadata Key/Value Pairs
CreateMetadataEntryAccount Metadata Key/Value PairAccount Metadata Key/Value Pair
UpdateMetadataEntryAccount Metadata Key/Value PairAccount Metadata Key/Value Pair, Update Operation Type
DeleteMetadataEntryAccount Metadata Key/Value PairAccount Metadata Key/Value Pair, JSON Handling Type

Admin Actions

FunctionData Logged on AttemptData Logged on Success
AdminCreateAccountDisplay NameCatena Account Id, Platform Types linked to Account
AdminDeleteAccountCatena Account IdCatena Account Id
AdminCreateMetadataEntryCatena Account Id, Account Metadata Key/Value PairCatena Account Id, Account Metadata Key/Value Pair
AdminUpdateMetadataEntryCatena Account Id, Account Metadata Key/Value PairCatena Account Id, Account Metadata Key/Value Pair, Update Operation Type
AdminDeleteMetadataEntryCatena Account Id, Account Metadata Key/Value PairCatena Account Id, Account Metadata Key/Value Pair, JSON Handling Type

Server Actions

FunctionData Logged on AttemptData Logged on Success
ServerCreateAccount †Display NameCatena Account Id, Platform Types linked to Account
ServerLinkAccountCatena Account Id, Platform TypeCatena Account Id, Platform Type

ServerCreateAccount is a special case: after creating an account, the server will automatically attempt to link the account to a platform.

Announcements

Admin Actions

FunctionData Logged on AttemptData Logged on Success
AdminAnnounceMessageMessage
AdminClearPersistentAnnouncement †Message

AdminClearPersistentAnnouncement does not have an attempt.

API Keys

Admin Actions

FunctionData Logged on AttemptData Logged on Success
AdminCreateApiKeyPolicyPolicy Name, Policy PermissionsPolicy Id, Policy Name, Policy Permissions
AdminUpdateApiKeyPolicyPolicy Id, Policy Name, Policy PermissionsPolicy Id, Policy Name, Policy Permissions
AdminDeleteApiKeyPolicyPolicy IdPolicy Id
AdminCreateApiKeyApi Key Name, Policy IdApi Key, Api Key Name, Policy Id
AdminUpdateApiKeyApi Key, Api Key Name, Policy IdApi Key, Api Key Name, Policy Id
AdminDeleteApiKeyApi KeyApi Key

Authentication

Session-Based Actions

FunctionData Logged on AttemptData Logged on Redirect †Data Logged on Success
AwaitSessionNoneN/APlatform Type
LogoutAccount IdN/AAccount Id
LoginWithProviderProviderProviderAccount Id, Provider, Platform Type

Because authentication surrounds the account login process, these functions are lacking the usual CustomAuditContext that would usually log account information.

LoginWithProvider can redirect to OAuth2.

Admin Actions

FunctionData Logged on AttemptData Logged on Success
AdminAddOrUpdateProviderConfigProviderProvider
AdminToggleProviderProviderProvider, Is Enabled Status

Entitlements

User Actions

FunctionData Logged on AttemptData Logged on Success
CancelSubscriptionSubscription IdSubscription Id

Admin Actions

FunctionData Logged on AttemptData Logged on Success
AdminCreateCatalogItemItem NameItem Name, Item Id
AdminDeleteCatalogItemItem IdItem Id
AdminUpdateCatalogItemVaries †Varies †
AdminRevokeAccountCatalogItemAccount Id, Item IdAccount Id, Item Id
AdminSetAccountCountableCatalogItemAccount Id, Item Id, Item CountAccount Id, Item Id, Item Count
AdminIncrementAccountCountableCatalogItemAccount Id, Item Id, Item Count DeltaAccount Id, Item Id, Item Count Delta
AdminDecrementAccountCountableCatalogItemAccount Id, Item Id, Item Count DeltaAccount Id, Item Id, Item Count Delta
AdminPlaceOrderWithProviderProvider, Account Id, Item Id(s)Order Id, Provider Id, Account Id, Item Id(s)
AdminRefundOrderWithProviderOrder Id, Provider IdOrder Id, Provider Id
AdminStartSubscriptionWithProviderProvider, Account Id, Item Id(s)Subscription Id, Order Id, Provider, Account Id, Item Id(s)
AdminCancelSubscriptionSubscription IdSubscription Id
AdminModifyProviderCatalogItemDataProvider, Item Id, Update Operation TypeProvider, Item Id, Update Operation Type
AdminRemoveProviderCatalogItemDataProvider, Item IdProvider, Item Id
AdminAddCatalogItemPurchasePriceProvider, Item Id, Item PriceProvider, Item Id, Item Price
AdminUpdateCatalogItemPurchasePriceProvider, Item Id, Item PriceProvider, Item Id, Item Price
AdminDeleteCatalogItemPurchasePriceProvider, Item IdProvider, Item Id

AdminUpdateCatalogItem logs information specific to the update action: Item Name, Item Description, Is Item Published, Custom Item Id

Server Actions

FunctionData Logged on AttemptData Logged on Success
ServerCancelSubscriptionSubscription IdSubscription Id
ServerModifyProviderCatalogItemDataProvider Id, Item Id, Update Operation TypeProvider Id, Item Id, Update Operation Type
ServerRemoveProviderCatalogItemDataProvider, Item IdProvider, Item Id
ServerIncrementAccountCountableCatalogItemAccount Id, Item Id, Item Count DeltaAccount Id, Item Id, Item Count Delta
ServerDecrementAccountCountableCatalogItemAccount Id, Item Id, Item Count DeltaAccount Id, Item Id, Item Count Delta

Friends

User Actions

FunctionData Logged on AttemptData Logged on Success
SendFriendRequestAccount IdAccount Id
AcceptFriendRequestAccount IdAccount Id
DeclineFriendRequestAccount IdAccount Id
RemoveFriendAccount IdAccount Id

Match Broker

Admin Actions

FunctionData Logged on AttemptData Logged on Success
AdminEndActiveMatchMatch IdMatch Id

Matchmaking

User Actions

FunctionData Logged on AttemptData Logged on Success
StartMatchmakingEntityEntity
CancelMatchmakingTicket IdTicket Id

Server Actions

FunctionData Logged on AttemptData Logged on Success
ServerStartMatchmakingEntityEntity
ServerCancelMatchmakingTicket IdTicket Id

Node Control

Admin Actions

FunctionData Logged on AttemptData Logged on Success
AdminRestartNodeNoneNone
AdminSetPreferredImplementationOverrideInterface, ImplementationInterface, Implementation

Parties

User Actions

FunctionData Logged on AttemptData Logged on Success
CreatePartyNoneParty Id
UpdatePartyPlayerNoneVaries †
JoinPartyWithInviteCodeInvite CodeInvite Code, Party Id
SetPartyLeaderParty Id, Account IdParty Id, Account Id
KickFromPartyParty Id, Account IdParty Id, Account Id
LeavePartyParty IdParty Id
CreateMetadataEntryParty Id, Party Metadata Key/Value PairParty Id, Party Metadata Key/Value Pair
UpdateMetadataEntryParty Id, Party Metadata Key/Value Pair, Update Operation TypeParty Id, Party Metadata Key/Value Pair, Update Operation Type
DeleteMetadataEntryParty Id, Party Metadata Key/Value Pair, JSON Handling TypeParty Id, Party Metadata Key/Value Pair, JSON Handling Type

UpdatePartyPlayer logs information specific to the update action: Display Name, Is Ready, Is Leader, Team Number, Metadata

Admin Actions

FunctionData Logged on AttemptData Logged on Success
AdminCreatePartyLeader Account IdParty Id, Leader Account Id
AdminUpdatePartyParty IdParty Id, Varies †
AdminDeletePartyParty IdParty Id
AdminDeleteAllPartiesNoneNone

AdminUpdateParty logs information specific to the update action: Leader Account Id, Kick Ids, Join Ids, Metadata

Platform Auth

Admin Actions

FunctionData Logged on AttemptData Logged on Success
AdminDeleteLoginInfoReplay TokenReplay Token
AdminRegisterDeviceForAuthDevice IdDevice Id
AdminRemoveDeviceForAuthDevice IdDevice Id

Titles

Admin Actions

FunctionData Logged on AttemptData Logged on Success
AdminCreateTitleTitle NameTitle Name, Title Id
AdminUpdateTitleTitle Id, Title NameTitle Id, Title Name
AdminDeleteTitleTitle IdTitle Id
AdminCreateTitleReleaseTitle Id, Title Uri, Byte Count, Checksum, Checksum Alg, Platform TypeTitle Id, Release Id, Title Name, Title Uri, Byte Count, Checksum, Checksum Alg, Platform Type
AdminUpdateTitleReleaseRelease Id, Title Id, Title Uri, Byte Count, Checksum, Checksum Alg, Platform TypeRelease Id, Title Id, Title Uri, Byte Count, Checksum, Checksum Alg, Platform Type
AdminDeleteTitleReleaseRelease IdRelease Id
AdminCreateTitlePatchRelease Id, Title Uri, Byte Count, Checksum, Checksum AlgRelease Id, Patch Id, Title Uri, Byte Count, Checksum, Checksum Alg
AdminUpdateTitlePatchPatch Id, Release Id, Title Uri, Byte Count, Checksum, Checksum AlgPatch Id, Release Id, Title Uri, Byte Count, Checksum, Checksum Alg
AdminDeleteTitlePatchPatch IdPatch Id