matrix-rust-sdk icon indicating copy to clipboard operation
matrix-rust-sdk copied to clipboard

Expose an audit trail API for room key forwarding

Open BillCarsonFr opened this issue 2 years ago • 0 comments

Description

Keep track of main key exchange events so that clients/user could perform an audit and see where/when keys was forwarded or imported. This would just be stored in database as a record of logs of TrailType:

  • OutgoingKeyForward
  • IncomingKeyForward
  • OutgoingKeyWithheld
  • IncomingKeyRequest

Each record consist of

 AuditTrail(
        val ageLocalTs: Long,
        val type: TrailType,
        val info: Map
)

The keyForward records do not hold any key info, just meta-data. E.g current android data

data class ForwardInfo(
        override val roomId: String,
        override val sessionId: String,
        override val senderKey: String,
        override val alg: String,
        override val userId: String,
        override val deviceId: String,
        val chainIndex: Long?
) : AuditInfo

data class IncomingKeyRequestInfo(
        override val roomId: String,
        override val sessionId: String,
        override val senderKey: String,
        override val alg: String,
        override val userId: String,
        override val deviceId: String,
        val requestId: String
) : AuditInfo

Current usage in Element Android

image

Also can be added as part of a rageshake.

BillCarsonFr avatar May 20 '22 07:05 BillCarsonFr