Skip to content

Record deletes and auto-wipe cross-channel copy-paste spam - #31

Open
alexeygrigorev wants to merge 1 commit into
mainfrom
feat/delete-audit-and-spam-tracker
Open

alexeygrigorev wants to merge 1 commit into
mainfrom
feat/delete-audit-and-spam-tracker

Conversation

@alexeygrigorev

Copy link
Copy Markdown
Member

Why

We need a durable record of what was deleted and why, especially :ban-user: wipes. We also want copy-paste spam across channels removed automatically after the person stops, with the same deactivate DM as :ban-user:.

What

  • Delete audit — each delete writes CloudWatch DELETE_AUDIT, DynamoDB automator-delete-audit (90-day TTL), and S3 dtc-automator-delete-audit-<account>. Query with /delete-audit or automator/scripts/query_delete_audit.py.
  • Router — user message events go to the automator (bots/edits/joins ignored).
  • Spam tracker — similar text in 2+ channels is aggregated in DynamoDB. EventBridge every 5 minutes flushes sessions whose last_seen is older than 3 minutes, deletes those copies (+ thread replies), DMs U01AXE0P5M3 the summary then the user id as its own message.

Infra (already merged): aws-infra#87 and aws-infra#85. Apply main/automator if that has not happened yet.

Slack app

Subscribe the router to message.channels (and message.groups if private channels matter). Message events were off.

Tests

automator: 100 tests. router: 6 tests.

Log every delete/ban with the triggering reaction, admin, and message
text (Dynamo 90-day TTL + S3 archive).

Route user message events to the automator. Similar text in two or more
channels is folded into a Dynamo aggregate; a 5-minute EventBridge scan
deletes quiet sessions and DMs Alexey the same deactivate flow as
:ban-user: (summary, then the user id as a separate message).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant