diff --git a/server-admin/reference.md b/server-admin/reference.md index ccfbff9..fd02ab2 100644 --- a/server-admin/reference.md +++ b/server-admin/reference.md @@ -308,6 +308,8 @@ monitoring: # Dagu Console Monitoring cloud: report: "" # "off", "health", "runs", or "errors"; empty (default) = choose in the web UI + audit: "" # "off" (default), "changes", or "all": audit entries this server sends to Dagu Console + audit_drain_timeout: "25s" # On SIGINT/SIGTERM, how long to keep sending the audit entries left (0 = stop at once) remote_access: "" # "off", "viewer", "operator", or "developer"; empty (default) = choose in the web UI # remote_approvals: true # Let Dagu Cloud calls decide waiting steps; omit (default) to choose in the web UI run_key: "" # Run key (drk_...) from Dagu Console; top-level runs report as job runs (v2.28 or later) @@ -616,6 +618,8 @@ Legacy YAML keys `scheduler.heartbeat_interval` and `scheduler.stale_threshold` ### Dagu Console Monitoring - `DAGU_CLOUD_REPORT` - What the server reports to Dagu Console: `off`, `health`, `runs`, or, on v2.22 or later, `errors` (`cloud.report`; default: empty, which reports nothing until an administrator chooses in the web UI). A set value, `off` included, fixes the level and the web UI shows it read-only. See [Monitoring](/overview/console-monitoring). +- `DAGU_CLOUD_AUDIT` - Which audit entries the server sends to Dagu Console: `off`, `changes` (every entry but successful reads, which are MCP resource reads and read-only tool calls that succeeded), or `all` (`cloud.audit`; default: `off`). It takes effect with `audit.enabled`, on a server connected to Dagu Console with a license that includes audit logs. Dagu Console stores the entries in the United States for the workspace's audit retention. See [Send to Dagu Console](/server-admin/server#send-to-dagu-console). +- `DAGU_CLOUD_AUDIT_DRAIN_TIMEOUT` - How long a server stopping on SIGINT or SIGTERM keeps sending the audit entries left (`cloud.audit_drain_timeout`; default: `25s`, which fits Kubernetes' default 30-second grace period). `0` stops at once; any other value is at least `5s`. Its last 3 seconds report the entries still left as a gap. - `DAGU_CLOUD_REMOTE_ACCESS` - Highest role a Dagu Cloud user gets on calls Dagu Cloud carries to this server: `off`, `viewer`, `operator`, or `developer` (`cloud.remote_access`; default: empty, which leaves the choice to an administrator in the web UI, where it starts at `off`). A set value fixes it. - `DAGU_CLOUD_REMOTE_APPROVALS` - Whether those calls, at `operator` or above, may approve, reject, or push back steps waiting for a person (`cloud.remote_approvals`; default: unset, which leaves the choice to the web UI, where it starts off). A set value fixes it. - `DAGU_CLOUD_RUN_KEY` - Run key from Dagu Console, starting with `drk_` (`cloud.run_key`; default: empty). With it, a top-level run of `dagu start`, `exec`, `retry`, or `restart` reports itself to Dagu Console as a job run, at `cloud.report`, or `runs` when that is empty. Steps never inherit it. Needs v2.28 or later. See [Job Runs](/overview/console-job-runs). diff --git a/server-admin/server.md b/server-admin/server.md index 3d8895a..1290501 100644 --- a/server-admin/server.md +++ b/server-admin/server.md @@ -771,6 +771,8 @@ When enabled, the following events are recorded: - **Secrets**: Secret changes and [`dagu secret resolve`](/getting-started/cli#secret) reads - **Terminal**: Shell command executions +Each entry is masked before it is written: the values of `dagu-managed` secrets and common token formats, such as GitHub, AWS, and Slack tokens, are replaced with `*******`. An entry whose secret values could not be loaded is still written and masked with the values loaded last, but lacks `"masked": true`. + ### Retention Audit logs are written as daily records and can be reviewed in the Web UI at **Settings > Audit Logs**. Keep the admin log directory on persistent storage if you want that history to survive restarts. @@ -781,6 +783,23 @@ The 7-day default is short for most audit requirements. Set `audit.retention_day Audit files are daily JSON Lines at `logs/admin/audit/YYYY-MM-DD.jsonl`. To forward them to your SIEM, tail them with a log shipper such as Fluent Bit. +### Send to Dagu Console + +A server connected to Dagu Console with a license that includes audit logs can keep a copy of its audit entries in Dagu Console, so the record of who did what outlives the server and its local retention. Set `cloud.audit`: + +```yaml +cloud: + audit: changes # off (default), changes, or all +``` + +- `changes` sends every entry but successful reads: MCP resource reads and calls to read-only tools that succeeded. Failed and denied reads, sign-ins, terminal commands, and every change are sent. +- `all` sends every entry. +- Of an MCP call, only its result is sent, not its `received` and `started` entries. + +Only entries with `"masked": true` are sent, so entries written before masking never leave the server. Each entry is masked again with the current secret values before it is sent. Local audit files and the Audit Logs page are unchanged, and one process per installation sends. Dagu Console stores the entries in the United States for the workspace's audit retention. + +When an entry cannot be sent, as when a file is removed by retention before it was read, Dagu Console records a gap for the time range. On SIGINT or SIGTERM, the server keeps sending for `cloud.audit_drain_timeout` (default `25s`) and reports what is left as a gap; those entries go after the next start if the disk survives. The **Plan & features** page shows the setting. + ## Event Store The centralized event store persists operational events such as DAG-run outcomes and LLM usage records. It is enabled by default in `dagu server` and `dagu start-all`.