SeaweedFS Filer Lookup Latency and Dir Count Sentinel
Audits SeaweedFS filer for metadata lookup latency, directory entry growth, and metastore connectivity.
Run Semgrep SAST on every push, parse the report, and escalate findings with a labeled GitHub issue and a Slack alert in Kestra.
Secrets scanners catch leaked keys, but they say nothing about SQL injection, command injection, unsafe deserialization, or the dozen other classes of flaw that live in application source. This blueprint wires Semgrep into your push pipeline. CI POSTs to a keyed webhook, the repository is checked out into a shared working directory, Semgrep runs in its official container with the community p/security-audit pack, and a small Python step turns the JSON report into a verdict with a findings count, the rules that fired, and the scan timestamp. When findings exist the flow opens a labeled GitHub issue and alerts Slack, so SAST debt lands in the team's existing backlog instead of a report nobody opens. A clean scan records the all-clear with a pointer to the stored report, and a disabled daily schedule ships as a net for pushes whose webhook was skipped.
on_push trigger (io.kestra.plugin.core.trigger.Webhook) exposes a keyed URL for your CI push hook to POST to with the repository, ref, and commit.daily_net (io.kestra.plugin.core.trigger.Schedule) is a 06:00 UTC daily run shipped disabled. Remove disabled: true once the webhook is proven so a missed hook cannot silently skip the gate.workspace (io.kestra.plugin.core.flow.WorkingDirectory) opens one shared filesystem for everything that follows, so the scanner sees the clone and the parser sees the report.clone_repository (io.kestra.plugin.git.Clone) checks out {{ inputs.repository }} at {{ inputs.ref }}, authenticating with the GITHUB_TOKEN secret.run_semgrep (io.kestra.plugin.scripts.shell.Commands on the io.kestra.plugin.scripts.runner.docker.Docker runner, image semgrep/semgrep:latest) executes semgrep scan --config p/security-audit --json --output semgrep-report.txt || true. The trailing || true absorbs the non-zero exit Semgrep returns when findings exist, the JSON report is always written, and the parsed report drives the gate.parse_report (io.kestra.plugin.scripts.python.Script on the Process runner) reads the report and emits verdict, findings_count, error_count, top_rules, top_rules_summary, and scan_time as a single-line ::{"outputs": ...}:: JSON payload. A missing or unparseable report yields verdict: error rather than a false clean.check_findings (io.kestra.plugin.core.flow.If) branches on findings_count. Over zero, create_issue (io.kestra.plugin.github.issues.Create) opens an issue titled with the repository and the count and labeled security and sast, and alert_slack posts the count and top rules. At zero, log_clean records the all-clear with the stored report URI.errors block alerts Slack when the scan itself fails - clone error, image pull failure, parser crash - because a broken scanner looks exactly like a clean repository.verdict, findings_count, top_rules, and report_uri as flow outputs, ready for status checks and dashboards.Semgrep is an excellent scanner, but a scanner nobody configures catches nothing. Kestra supplies the loop around it: an event trigger for every push, a hermetic Docker runner so the tool version lives in the flow, a branch that separates escalation from the all-clear, retries and execution history for every run, and alert routing into GitHub and Slack from one file. A CI job running Semgrep gives developers none of that - it only protects the repositories whose pipelines someone remembered to update, and skipped runs vanish without a trace.
parse_report to a Docker task runner.repo, or fine-grained Contents: read plus Issues: write).GITHUB_TOKEN: personal access token used both to clone the repository and to open the issue on findings.SAST_WEBHOOK_KEY: key segment guarding the webhook URL - anyone with it can trigger a scan, so treat it as a secret.SLACK_WEBHOOK_URL: Slack incoming webhook URL for escalation and failure alerts.repository to the owner/repo you want gated and ref if it is not main./api/v1/{tenant}/executions/webhook/{namespace}/semgrep-sast-pr-gate/{SAST_WEBHOOK_KEY}, or trigger the webhook manually.os.system call on user input) and confirm the issue, the Slack alert, and the fail verdict.disabled: true from daily_net so skipped pushes still get scanned.{{ fromJson(trigger.body).repository.full_name }} for multi-repo setups.--config p/security-audit for a committed .semgrep.yml or a different registry pack per repository.then branch with io.kestra.plugin.core.execution.Fail so branch protection blocks the merge.io.kestra.plugin.core.flow.Loop over a repository list.io.kestra.plugin.aws.s3.Upload after the parse step for long-term retention.