Skip to content

chore!: route connection logs to new table #18340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Jun 12, 2025

This is the first PR of a few for moving connection events out of the audit log, and into a new database table and web UI page called the 'Connection Log'.

This PR:

  • Creates the new table
  • Adds and tests queries for inserting and reading, including reading with an RBAC filter.
  • Implements the corresponding RBAC changes, such that anyone who can view the audit log can read from the table
  • Implements, under the enterprise package, a ConnectionLogger abstraction to replace the Auditor abstraction for these logs. (No-op'd in AGPL, like the Auditor)
  • Routes SSH connection and Workspace App events into the new ConnectionLogger
  • Updates all existing tests to check the values of the ConnectionLogger instead of the Auditor.

Future PRs:

  • Add filtering to the query
  • Add an enterprise endpoint to query the new table
  • Write a query to delete old events from the audit log, call it from dbpurge.
  • Implement a table in the Web UI for viewing connection logs.

Note

The PRs in this stack obviously won't be (completely) atomic. Whilst they'll each pass CI, the stack is designed to be merged all at once. I'm splitting them up for the sake of those reviewing, and so changes can be reviewed as early as possible. Despite this, it's really hard to make this PR any smaller than it already is. I'll be keeping it in draft until it's actually ready to merge.

Copy link
Member Author

ethanndickson commented Jun 12, 2025

@ethanndickson ethanndickson requested a review from Copilot June 12, 2025 07:58
Copilot

This comment was marked as resolved.

@ethanndickson
Copy link
Member Author

Requesting a draft review just to confirm we're happy with the DB schema, the RBAC setup, and the overall direction.

Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! I think this looks great in general, but the upsert part of the logic here doesn't fully make sense to me (see related comment). Could you elaborate on the intent?

@github-actions github-actions bot added the stale This issue is like stale bread. label Jun 24, 2025
@ethanndickson ethanndickson removed the stale This issue is like stale bread. label Jun 24, 2025
@ethanndickson ethanndickson force-pushed the ethan/reroute-connection-logs branch from 011b276 to 947ccd1 Compare June 27, 2025 04:01
@ethanndickson ethanndickson force-pushed the ethan/reroute-connection-logs branch from e4e1a04 to 1fcd8d7 Compare June 30, 2025 12:03
@ethanndickson ethanndickson changed the title chore: route connection logs to new table chore!: route connection logs to new table Jul 2, 2025
@ethanndickson ethanndickson added the release/breaking This label is applied to PRs to detect breaking changes as part of the release process label Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/breaking This label is applied to PRs to detect breaking changes as part of the release process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants