id: aikido-reachability-gated-triage
namespace: company.security
inputs:
- id: issue_group_id
type: STRING
defaults: "5001"
description: Aikido issue group to triage. The trigger overrides this on every
automated run.
- id: auto_snooze_days
type: INT
defaults: 30
description: How long an unreachable finding stays snoozed before Aikido
surfaces it again.
- id: escalation_score
type: INT
defaults: 80
description: Aikido severity_score at or above which a reachable finding pages
the on-call engineer.
variables:
api_base: https://app.aikido.dev
token_url: https://app.aikido.dev/api/oauth/token
tasks:
- id: authenticate
type: io.kestra.plugin.core.http.Request
description: Exchange the Aikido client credentials for a short-lived bearer
token used by the reachability calls.
uri: "{{ vars.token_url }}"
method: POST
contentType: application/json
body: '{"grant_type": "client_credentials"}'
options:
auth:
type: BASIC
username: "{{ secret('AIKIDO_CLIENT_ID') }}"
password: "{{ secret('AIKIDO_CLIENT_SECRET') }}"
timeout:
connectTimeout: PT10S
readIdleTimeout: PT30S
retry:
type: constant
interval: PT5S
maxAttempts: 3
- id: issue_detail
type: io.kestra.plugin.core.http.Request
description: Read the full issue so the gate can see reachability_status,
exploitability, and Aikido's re-scored severity.
uri: "{{ vars.api_base }}/api/public/v1/issues/{{ inputs.issue_group_id }}"
method: GET
headers:
Authorization: "Bearer {{ fromJson(outputs.authenticate.body).access_token }}"
options:
timeout:
connectTimeout: PT10S
readIdleTimeout: PT30S
retry:
type: constant
interval: PT5S
maxAttempts: 3
- id: reachability
type: io.kestra.plugin.core.http.Request
description: Fetch the call chains Aikido traced from application code into the
vulnerable package.
uri: "{{ vars.api_base }}/api/public/v1/issues/{{ inputs.issue_group_id
}}/reachability"
method: GET
headers:
Authorization: "Bearer {{ fromJson(outputs.authenticate.body).access_token }}"
options:
allowFailed: true
timeout:
connectTimeout: PT10S
readIdleTimeout: PT30S
- id: classify
type: io.kestra.plugin.core.debug.Return
description: Collapse reachability, exploitability, and the CVSS re-scoring
delta into a single routing verdict.
format: |
{{
{
"status": fromJson(outputs.issue_detail.body).reachability_status ?? 'unknown',
"exploitability": fromJson(outputs.issue_detail.body).exploitability ?? 'no_known_exploit',
"score": fromJson(outputs.issue_detail.body).severity_score ?? 0,
"cvss": fromJson(outputs.issue_detail.body).original_cvss_severity_score ?? 0,
"chains": (outputs.reachability.code == 200) ? (fromJson(outputs.reachability.body).chains | length) : 0,
"repo": fromJson(outputs.issue_detail.body).code_repo_name ?? 'unknown',
"verdict": (
(fromJson(outputs.issue_detail.body).reachability_status ?? 'unknown') == 'not_reachable'
and (fromJson(outputs.issue_detail.body).exploitability ?? 'no_known_exploit') == 'no_known_exploit'
) ? 'suppress' : (
(
(fromJson(outputs.issue_detail.body).reachability_status ?? 'unknown') == 'reachable'
or (fromJson(outputs.issue_detail.body).exploitability ?? 'no_known_exploit') == 'actively_exploited'
) ? 'escalate' : 'review'
)
} | toJson
}}
- id: route
type: io.kestra.plugin.core.flow.Switch
description: Unreachable findings are suppressed with an audit trail, reachable
ones escalate, everything else waits for a human.
value: "{{ fromJson(outputs.classify.value).verdict }}"
cases:
suppress:
- id: snooze_unreachable
type: io.kestra.plugin.aikido.issues.Snooze
clientId: "{{ secret('AIKIDO_CLIENT_ID') }}"
clientSecret: "{{ secret('AIKIDO_CLIENT_SECRET') }}"
issueGroupId: "{{ inputs.issue_group_id }}"
until: "{{ now() | dateAdd(inputs.auto_snooze_days, 'DAYS') }}"
reason: "Auto-snoozed by Kestra: Aikido reachability analysis found no call
chain from application code, and no known exploit exists.
Re-surfaces in {{ inputs.auto_snooze_days }} days."
- id: record_suppression
type: io.kestra.plugin.core.log.Log
message: "SUPPRESSED issue {{ inputs.issue_group_id }} in {{
fromJson(outputs.classify.value).repo }}: not reachable, no known
exploit, {{ outputs.snooze_unreachable.snoozedSingleIssuesAmount }}
single issues snoozed."
escalate:
- id: page_on_call
type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
url: "{{ secret('SLACK_WEBHOOK') }}"
payload: |
{
"text": ":rotating_light: Reachable vulnerability in {{ fromJson(outputs.classify.value).repo }}",
"blocks": [
{"type": "header", "text": {"type": "plain_text", "text": "Reachable vulnerability confirmed"}},
{"type": "section", "fields": [
{"type": "mrkdwn", "text": "*Repository*\n{{ fromJson(outputs.classify.value).repo }}"},
{"type": "mrkdwn", "text": "*Aikido score*\n{{ fromJson(outputs.classify.value).score }} (CVSS {{ fromJson(outputs.classify.value).cvss }})"},
{"type": "mrkdwn", "text": "*Reachability*\n{{ fromJson(outputs.classify.value).status }} via {{ fromJson(outputs.classify.value).chains }} call chain(s)"},
{"type": "mrkdwn", "text": "*Exploitability*\n{{ fromJson(outputs.classify.value).exploitability }}"}
]},
{"type": "section", "text": {"type": "mrkdwn", "text": "*Issue group* {{ inputs.issue_group_id }} | *Execution* {{ execution.id }}"}}
]
}
- id: log_escalation
type: io.kestra.plugin.core.log.Log
message: "ESCALATED issue {{ inputs.issue_group_id }}: score {{
fromJson(outputs.classify.value).score }}, {{
fromJson(outputs.classify.value).chains }} reachable call chain(s)."
review:
- id: queue_for_review
type: io.kestra.plugin.core.log.Log
message: "REVIEW issue {{ inputs.issue_group_id }} in {{
fromJson(outputs.classify.value).repo }}: reachability is {{
fromJson(outputs.classify.value).status }}, needs a human decision."
- id: triage_summary
type: io.kestra.plugin.core.log.Log
message: "Triage complete for issue group {{ inputs.issue_group_id }}:
verdict={{ outputs.route.value }}, reachability={{
fromJson(outputs.classify.value).status }}, score={{
fromJson(outputs.classify.value).score }}."
triggers:
- id: on_new_high_severity_issue
type: io.kestra.plugin.aikido.issues.Trigger
description: Fires once per newly detected Aikido issue group at or above the
escalation score.
clientId: "{{ secret('AIKIDO_CLIENT_ID') }}"
clientSecret: "{{ secret('AIKIDO_CLIENT_SECRET') }}"
severityThreshold: 80
interval: PT10M
errors:
- id: triage_failed
type: io.kestra.plugin.slack.notifications.SlackIncomingWebhook
url: "{{ secret('SLACK_WEBHOOK') }}"
payload: |
{
"text": ":warning: Aikido reachability triage failed for issue group {{ inputs.issue_group_id }}. The finding was neither suppressed nor escalated, so it needs manual review. Execution {{ execution.id }}."
}
outputs:
- id: verdict
type: STRING
value: "{{ outputs.route.value }}"
- id: reachability_status
type: STRING
value: "{{ fromJson(outputs.classify.value).status }}"