Copacetic Container Vulnerability Hotpatch Engine
In-place container OS package hotpatching with SecOps approval gates and post-patch verification.
Lint Prometheus alert rules with promtool before merge. Escalate every violation as a GitHub issue, a Slack alert, and a failed Kestra execution.
Merge gates usually test application code and leave monitoring configuration to luck, so a broken alert expression only surfaces when the pager fails to fire. This blueprint lints the rules themselves. A keyed webhook fires when your CI sees the rules directory change, the repository is checked out into a shared working directory, and promtool check rules runs inside the official Prometheus image with every lint check enabled, alongside promtool check config when a prometheus.yml sits at the repository root. A Python step turns the raw promtool output into a violations list with the file, the rule, and the message for each hit, and a single branch decides whether the run goes quiet or loud. On any hit the flow opens a labeled GitHub issue with the full list, pings Slack with the first few entries, and fails the execution so the merge stays blocked.
on_rules_change trigger (io.kestra.plugin.core.trigger.Webhook, guarded by the RULES_WEBHOOK_KEY secret) starts a run whenever your CI posts that files under the rules directory changed, and the nightly_lint io.kestra.plugin.core.trigger.Schedule trigger offers a daily cron that ships disabled: true.workspace (io.kestra.plugin.core.flow.WorkingDirectory) opens one shared filesystem for the checkout, the container, and the parser.clone_repository (io.kestra.plugin.git.Clone) checks out {{ inputs.repository }} at {{ inputs.branch }}, authenticating with GITHUB_TOKEN.run_promtool (io.kestra.plugin.scripts.shell.Commands on the io.kestra.plugin.scripts.runner.docker.Docker runner, image prom/prometheus:v2.53.0) finds every yaml and yml file under {{ inputs.rules_dir }}, writes the sorted list to rules-manifest.txt, runs promtool check rules --lint=all over that list, and appends promtool check config --lint=all prometheus.yml when the config file exists. Exit codes are absorbed with || true so the task stays green and the parser, not promtool, decides the verdict. Both files are declared as outputFiles.assess (io.kestra.plugin.scripts.python.Script on the io.kestra.plugin.core.runner.Process runner) pulls those two files in through inputFiles, walks the Checking and FAILED blocks, and emits verdict, gate_passed, files_checked, violation_count, the violations list, violations_markdown, and violations_brief through the outputs protocol.lint_gate (io.kestra.plugin.core.flow.If) opens the escalation path when violation_count is above zero: open_lint_issue (io.kestra.plugin.github.issues.Create) files the markdown list under three labels, alert_slack posts the count and the first hits, and fail_gate (io.kestra.plugin.core.execution.Fail) turns the execution red.log_clean (io.kestra.plugin.core.log.Log), while the errors handler pings Slack whenever the checkout, the container, or the parser itself breaks.verdict, gate_passed, files_checked, violation_count, and a full lint_report for other flows.A promtool step in CI tells you a file failed, but it does not open the issue, tell the team, or give the gate a state anyone can query later. Kestra supplies the keyed event trigger, a hermetic container so the promtool version lives in the flow rather than in a runner image someone maintains, a branch that separates escalation from the all-clear, and routing into GitHub and Slack from one declarative file. Because the check runs as an execution, every lint carries inputs, outputs, and logs you can replay, and the same flow can be called as a subflow from any deploy pipeline that must not proceed with broken rules.
prom/prometheus:v2.53.0 image.nobody and the manifest and report files are written there.yaml files and that allows issue creation with the provided token.assess to a Docker task runner.GITHUB_TOKEN: personal access token used both to clone the repository and to open the issue on violations.RULES_WEBHOOK_KEY: key segment guarding the webhook URL, treat it like a password.SLACK_WEBHOOK_URL: Slack incoming webhook used for violation and failure alerts.repository and rules_dir to match your project layout.verdict plus lint_report from the Outputs tab to confirm promtool is checking the files you expect.# webhook target to paste into CI
https://your-kestra.example.com/api/v1/main/executions/webhook/company.team/prometheus-alert-rule-lint-gate/$RULES_WEBHOOK_KEY
- id: nightly_lint
type: io.kestra.plugin.core.trigger.Schedule
cron: "0 5 * * *"
disabled: false
--lint=all to --lint=duplicate-rules, or add --lint-fatal if you want promtool to stop at the first problem.promtool test rules into the same container command so unit test expectations gate alongside syntax.rules_dir per call or by looping over a list of paths.open_lint_issue with a pull request comment or a ticket in Jira or Linear, or chain a remediation flow from the FAILED state.io.kestra.plugin.core.flow.Subflow.