Schedule icon
Commands icon
Docker icon
Script icon
If icon
SlackIncomingWebhook icon
Fail icon
Log icon

Autonomous Darkmoon Pentest Gate with Slack Triage Digest

Run an autonomous Darkmoon AI pentest from Kestra, fail the flow on critical or high findings, and post a prioritized Slack digest.

Categories
Infrastructure

Scheduled vulnerability scanners find known CVEs, but they do not show whether a flaw is actually exploitable in your running application. Darkmoon is an open source (GPL-3.0) autonomous AI penetration testing platform that proves findings with real exploits. This blueprint runs a Darkmoon campaign from Kestra, turns the result into a pass or fail gate, and sends a short, prioritized digest to Slack.

Requires Darkmoon Pro. The engine and CLI are open source, but this blueprint talks to the Darkmoon Pro REST API (self-hosted, with the web dashboard) through the published darkmoon-ci CLI of @darkmoon_ai/client. With the open source CLI alone, use the Darkmoon GitHub Action or consume the CLI's SARIF/JSON output instead.

Only test systems you own or are explicitly authorized in writing to test. A campaign sends real attack traffic. The schedule trigger is disabled by default for that reason.

How it works

  1. run_campaign runs darkmoon-ci run in a node:20-slim container through the Docker task runner. It launches the campaign, waits for completion and applies the fail_on policy. Exit code 2 (policy tripped) is recorded, any other non-zero exit is treated as a tool error. The findings are then exported to findings.json.
  2. triage_findings parses the findings in Python and builds a digest: counts by severity and status, then the top findings ordered by severity and CVSS score. Evidence is never copied into the digest.
  3. evaluate_gate (io.kestra.plugin.core.flow.If) branches on the gate result. If the policy tripped, Slack receives the digest and fail_gate fails the execution. Otherwise log_gate_passed records the clean result.
  4. The errors block alerts Slack when the campaign itself could not run (Pro API unreachable, bad credentials, timeout).

Prerequisites

  • A self-hosted Darkmoon Pro instance reachable from the Kestra worker.
  • Docker access on the Kestra worker for the Docker task runner.
  • A Slack incoming webhook.

Secrets

  • DARKMOON_PRO_URL: base URL of your Darkmoon Pro instance (required).
  • DARKMOON_PRO_USER: dashboard user for the CI account (required).
  • DARKMOON_PRO_PASS: password of that user (required). The CLI refuses to run against an admin still on the default password.
  • SLACK_WEBHOOK_URL: Slack incoming webhook for the digest and error alert.

Inputs

  • target (STRING, default staging.example.com): host or URL to test, validated against a conservative pattern.
  • fail_on (STRING, default critical,high): severities that trip the gate.
  • timeout_seconds (INT, default 3600): maximum wait for the campaign.
  • notify_slack (BOOL, default true): post the digest when the gate trips.

Quick start

  1. Create the four secrets in your namespace.
  2. Set target to a host you are authorized to test and run the flow manually.
  3. Inspect outputs.triage_findings.vars.digest and the exported findings.json.
  4. Remove disabled: true from weekly_pentest to run it on a schedule.

Outputs

  • campaign_id: the Darkmoon campaign evaluated.
  • total_findings: number of findings.
  • digest: the plain text triage digest.
  • {{ outputs.run_campaign.outputFiles['findings.json'] }}: redaction-safe findings as JSON.

Notes

Darkmoon runs a wide net, so some findings are candidates that deserve a human check before action. The digest says so.

How to extend

  • Open a Jira or GitHub issue per exploited finding with the matching Kestra plugin.
  • Use a Flow trigger to run the gate after each staging deployment flow.
  • Loop over several authorized targets with io.kestra.plugin.core.flow.Loop.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.