Parallel icon
GetReport icon
ListOpen icon
Get icon
Script icon
AIAgent icon
OpenAI icon
Write icon
Set icon
If icon
SlackIncomingWebhook icon
Log icon

Turn Aikido Compliance Reports into a Dated Evidence Pack That Shows Control Drift, Not Just a Score

Pull SOC2, ISO 27001 and NIS2 overviews from Aikido, diff controls against the last period, and archive an auditor-ready evidence narrative with Kestra.

Categories
AIBusiness

A compliance dashboard tells you where you stand today. An auditor asks a harder question: what changed since last period, and what did you do about it. That answer is usually reconstructed by hand from screenshots and memory. This blueprint builds it automatically. It snapshots SOC2, ISO 27001 and NIS2 posture from Aikido, diffs every control against the previous snapshot, separates genuine regressions from improvements, and has an AI agent write the narrative grounded strictly in those figures. The result is archived as a dated evidence pack with a stable URI, and any regression is announced as a finding rather than buried in an attachment.

How it works

  1. The collect_frameworks task (io.kestra.plugin.core.flow.Parallel) fetches all three framework overviews concurrently through io.kestra.plugin.aikido.compliance.GetReport. They are independent endpoints, so there is no reason to fetch them in series.
  2. The open_findings task (io.kestra.plugin.aikido.issues.ListOpen) pulls current critical and high findings, which are the actual evidence behind a failing vulnerability management control.
  3. The read_previous task (io.kestra.plugin.core.kv.Get) loads last period's snapshot with errorOnMissing: false, so the first run establishes a baseline instead of failing.
  4. The detect_drift task (io.kestra.plugin.scripts.python.Script) walks every control in every framework, compares it to its previous status, and classifies the change as a regression or an improvement. It also computes the complying-rule delta per framework, which is the number that actually moves in a board report.
  5. The write_evidence task (io.kestra.plugin.ai.agent.AIAgent) writes three plain paragraphs from those figures. The system message forbids inventing controls, dates, or remediation, which is the difference between an evidence pack and a liability.
  6. The archive_pack task (io.kestra.plugin.core.storage.Write) persists the structured pack plus the narrative to internal storage and returns a URI you can attach to an audit request.
  7. The record_snapshot task stores the current posture as the comparison point for next period, and drift_alert announces regressions to Slack.

What you get

  • Control-level drift detection, not just a percentage that moved.
  • A dated, archived evidence pack per reporting period with a stable storage URI.
  • An AI narrative constrained to the supplied figures, so it reads well without inventing facts.
  • Complying-rule deltas per framework, the figure leadership actually tracks.
  • Regressions surfaced as alerts the moment they appear rather than at audit time.

Who it's for

  • Compliance and GRC teams preparing SOC2 or ISO 27001 evidence on a recurring cadence.
  • Security leads who have to explain a posture change to an auditor months after it happened.
  • Teams in scope for NIS2 who need demonstrable, dated control monitoring.

Why orchestrate this with Kestra

Drift detection is inherently stateful: you cannot compute it without last period's numbers, and last period's numbers have to live somewhere trustworthy. Kestra gives you a durable KV snapshot, a parallel fetch across three endpoints, an archived artifact with a permanent URI tied to an execution id, and a full audit trail of when each pack was generated and from which figures. The alternative is a notebook someone runs by hand, whose output nobody can later prove corresponds to a particular day. The execution record is itself part of the evidence.

Prerequisites

  • An Aikido workspace with API credentials carrying the reports:read and issues:read scopes.
  • Aikido compliance monitoring enabled for the frameworks you want to report on. Remove any framework task you do not subscribe to.
  • An OpenAI API key for the narrative agent, or swap in another provider from the Kestra AI plugin.
  • Docker available to the Kestra worker for the Python drift step.

Secrets

  • AIKIDO_CLIENT_ID, AIKIDO_CLIENT_SECRET: OAuth2 credentials for the Aikido public API.
  • OPENAI_API_KEY: key used by the evidence narrative agent.
  • SLACK_WEBHOOK: incoming webhook used for drift alerts and failures.

Quick start

  1. Add the secrets above to your Kestra namespace.
  2. Remove any of the three framework tasks your workspace does not track. The Python step reads whichever remain.
  3. Run the flow once to establish the baseline snapshot. The first run reports no drift by design.
  4. Run it again at the end of your next control period with the matching reporting_period label.
  5. Attach the evidence_uri output to your audit evidence request.

How to extend

  • Fetch Aikido's own PDF report from the /report/export/pdf endpoint with io.kestra.plugin.core.http.Request and archive it next to the narrative for a complete pack.
  • Add GDPR, CIS, PCI or DORA once those overviews are exposed by the plugin, or reach them directly over HTTP in the meantime.
  • Upload the pack to object storage with io.kestra.plugin.aws.s3.Upload so it lands in an immutable, versioned bucket.
  • Add a Pause task so the compliance owner signs off on the narrative before it is archived as final.
  • Post the quarter-over-quarter complying-rule delta to a dashboard with io.kestra.plugin.core.http.Request for a trend line across periods.
  • Correlate each regressed control with the Aikido issues that caused it by filtering issues.Export on the relevant repository or team.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.