From e4ca593eb6c3ddd4ee98091553df5f92344fc587 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Thu, 12 Jun 2025 11:21:39 +0100 Subject: [PATCH] Log user deactivations (#18541) One liner to give us more clarity when auditing deactivations of user accounts. ### Pull Request Checklist * [ ] Pull request is based on the develop branch * [ ] Pull request includes a [changelog file](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#changelog). The entry should: - Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from `EventStore` to `EventWorkerStore`.". - Use markdown where necessary, mostly for `code blocks`. - End with either a period (.) or an exclamation mark (!). - Start with a capital letter. - Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry. * [ ] [Code style](https://element-hq.github.io/synapse/latest/code_style.html) is correct (run the [linters](https://element-hq.github.io/synapse/latest/development/contributing_guide.html#run-the-linters)) --- changelog.d/18541.misc | 1 + synapse/handlers/deactivate_account.py | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 changelog.d/18541.misc diff --git a/changelog.d/18541.misc b/changelog.d/18541.misc new file mode 100644 index 0000000000..2c733e3e50 --- /dev/null +++ b/changelog.d/18541.misc @@ -0,0 +1 @@ +Log user deactivations. diff --git a/synapse/handlers/deactivate_account.py b/synapse/handlers/deactivate_account.py index 12a7cace55..42e53d920a 100644 --- a/synapse/handlers/deactivate_account.py +++ b/synapse/handlers/deactivate_account.py @@ -96,6 +96,14 @@ class DeactivateAccountHandler: 403, "Deactivation of this user is forbidden", Codes.FORBIDDEN ) + logger.info( + "%s requested deactivation of %s erase_data=%s id_server=%s", + requester.user, + user_id, + erase_data, + id_server, + ) + # FIXME: Theoretically there is a race here wherein user resets # password using threepid.