Clear Pulsar backlogs held by subscriptions nobody consumes
Detect Apache Pulsar subscriptions with no consumers that still pin a large backlog, then clear or remove them behind a dry run, an approval pause and a live re-read that fails the run.
Diff an endpoint osquery configuration snapshot against the blessed baseline, file a GitHub issue listing every drifted key, and keep evidence fresh.
An endpoint tightens its schedule interval, drops a file path glob or picks up a hand edited pack, and the osquery config walks away from the blessed baseline with nothing to catch it. This blueprint takes one config snapshot from the fleet collector, diffs it key by key against the baseline kept in the flow inside a shared workspace, and turns every changed, missing or unexpected key into a tracked issue, a Slack alert and a dated execution record that doubles as the compliance evidence.
post_config_snapshot (io.kestra.plugin.core.trigger.Webhook, keyed with the OSQUERY_WEBHOOK_KEY secret) accepts the snapshot after each config pull; daily_drift_sweep (io.kestra.plugin.core.trigger.Schedule, cron 0 4 * * *) ships disabled: true until an operator switches it on.config_workspace (io.kestra.plugin.core.flow.WorkingDirectory) opens one shared directory. write_snapshot (io.kestra.plugin.scripts.shell.Commands on the Docker runner, image python:3.12-slim) writes the posted body, or the config_snapshot input default on manual runs, into config_snapshot.json with a quoted heredoc, and diff_against_baseline (io.kestra.plugin.scripts.python.Script) reads exactly that file. Both children are scripts inside the workspace and every notification sits after the block, because default tasks are stateless and a temp dir is purged when a task completes.diff_against_baseline flattens the snapshot into dot paths, compares every blessed baseline key such as schedule.system_info.interval and file_paths.system_binaries, flags baseline keys that went missing and snapshot keys that are not in the baseline, and prints compliant, drift, or error as one ::{"outputs": ...}:: line.gate_config_drift (io.kestra.plugin.core.flow.If) escalates drift into open_drift_issue (io.kestra.plugin.github.issues.Create) and alert_drift (io.kestra.plugin.slack.notifications.SlackIncomingWebhook), an error run routes through check_snapshot_error and alert_unreadable_snapshot, and a clean endpoint lands in log_compliant. The flow level errors handler reports any workspace or script failure with the execution id.compliant, drift, or error, that any config management pipeline can branch on.osquery can dump what an endpoint runs but never says whether that still matches the blessed config, so drift waits for an auditor with a spreadsheet. Kestra supplies the keyed webhook for the collector, the baseline living next to the diff in one file, a shared workspace where the snapshot and the comparison agree on one path, a branch that separates drift from unreadable from clean, GitHub and Slack routing from a single definition, and an execution history per endpoint. A scheduled script on the collector gives you none of that, it only diffs the endpoints someone remembers to point it at.
python:3.12-slim.github_repository, classic repo scope or fine grained Issues write.OSQUERY_WEBHOOK_KEY: key guarding the snapshot webhook URL, anyone holding it can post endpoint config.GITHUB_TOKEN: token used to open the drift issue.SLACK_WEBHOOK_URL: Slack incoming webhook URL used by the drift alert and the errors handler.Add the three secrets and point github_repository at a repository where issues are welcome.
Run the flow once with the default inputs and confirm verdict is drift with drift_count at 4, the fixture tightens the interval, drops a glob, leaves options.logger_plugin out and adds a hand rolled pack.
POST a snapshot that matches the baseline and watch verdict flip to compliant with drift_keys empty in the outputs.
curl -X POST -H "Content-Type: application/json" -d '{"schedule":{"system_info":{"interval":300,"query":"select uuid, hostname from system_info"},"pack_events":{"interval":60}},"options":{"logger_plugin":"syslog"},"decorators":{"load":["select uid, username from users where uid < 500"]},"file_paths":{"system_binaries":["/usr/bin/%","/bin/%"]}}' "https://<kestra>/api/v1/<tenant>/executions/webhook/<namespace>/osquery-endpoint-config-drift-audit/<OSQUERY_WEBHOOK_KEY>"
Point the fleet collector at the webhook and enable daily_drift_sweep once every endpoint reports through it.
baseline_file input written next to the snapshot, so staging and production keep their own blessed configs.io.kestra.plugin.core.flow.Loop over an endpoint list, each subflow posting its own snapshot.io.kestra.plugin.core.execution.Fail under gate_config_drift.