Ship audit logs to Logs & Metrics providers on self-hosted (enterprise)

オープン
#6,126 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
postgresql, typescript

調査の方向性

Wait for #6123 to merge, then trace its audit stream and the telemetry provider form and adapter used for log shipping. Check how the local Vector agent routes container logs and how organization and license settings are represented. Done means licensed self-hosted organizations can opt in per log provider, and Vector sends only their audit events to those providers.

索引モデルが issue の本文から書いたものです。

説明

enhancement
What problem will this feature address?

On self-hosted Enterprise, audit logs stay in Dokploy's Postgres. You can browse them in the UI or export them by hand as CSV, TSV or JSON (#5797), but nothing sends them to the log platform where we keep everything else (OpenObserve in our case; Elasticsearch, Loki, Datadog or Splunk for others). To alert on them or keep them under the same retention, someone has to export and upload them manually.

Logs & Metrics already runs a Vector agent that ships container logs to these providers. #6123 adds a structured audit stream, written to stdout as log_type: "dokploy.audit" JSON lines, which Vector ships to ClickHouse. That stream is only enabled when IS_CLOUD is set.

Describe the solution you'd like

A self-hosted Enterprise organization should be able to send its audit events to the Logs & Metrics providers it has already configured.

In the telemetry provider form, when the provider sends logs ("Logs" or "Logs & Metrics"), show an "Also send audit logs" checkbox. It is available only with a valid enterprise license.

On the backend, reuse the audit stream from #6123 and turn it on for self-hosted when a licensed organization has at least one provider with the option enabled.

Vector needs a dedicated route for these events. The local agent currently keeps only container logs whose dokploy.organization.id label matches the organization that claimed it (dokploy_scope_local_only). The Dokploy container has no such label, so its stdout, where the audit lines go, is dropped. The new route would parse the Dokploy container's output, keep the log_type == "dokploy.audit" events that belong to that organization, and send them to the providers that have the option on. Filtering by organization keeps one organization's audit events out of another's provider.

The events go through the same adapter and sink as the provider's container logs, so any provider that supports logs works without provider-specific code. #6123 already redacts the events (keys, URL credentials, PEM blocks, inline command secrets), so this sends nothing the Cloud stream doesn't.

Describe alternatives you've considered
  • Exporting from the Audit Logs page and uploading periodically. It's manual, and alerts would always lag.
  • A scheduled job that reads the audit_log table and pushes new rows to the provider. It would duplicate what Vector already does, and the table only holds the explicit audit() calls, which cover less than the #6123 stream.
  • A separate "Audit logs" option next to Logs and Metrics in the provider select. That means a new signal type across the adapters, the schema and the UI, while the data is just another log stream.
Additional context

This builds on #6123, so we'd wait for it to be merged before starting. If the team already has plans for the self-hosted side of the audit stream, we're happy to follow a different design.

We run Dokploy self-hosted with an Enterprise license and ship our logs to OpenObserve (#5991).

Will you send a PR to implement it?

Yes

主要言語
TypeScript
スター
38.8k
フォーク
3.2k
平均マージ
1日 10時間
マージ済み PR(30日)
110

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Dokploy/dokploy のほかの issue

Dokploy/dokploy の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。