Aikido triage

From ShulkwiSEC/bb-huge · View interactive version

Aikido triage is an AI agent skill from the GitHub repository ShulkwiSEC/bb-huge. Triages an Aikido security findings CSV against a local codebase. For each finding, reads the flagged file, traces the code path, and verdicts it as KEEP OPEN or CLOSE with a specific reason. Outputs a reviewed CSV and a self-contained HTML evidence report. Run this at the end of a pentest when an A

How to use this skill

Skill file

Aikido Findings Triage Workflow

You are triaging an Aikido SAST/SCA/secret-scanning CSV export against a local codebase. Your job is to read every finding, investigate the flagged code, and verdict each one with evidence. At the end you produce a reviewed CSV and a self-contained HTML report.

Do not guess. Read the actual files before rendering a verdict.


Arguments

Parse from the user's invocation:

If either argument is missing, ask the user before proceeding.


Phase 1 — Parse the CSV

  1. Read CSV_PATH with the Read tool.
  2. Parse every row. Key columns to extract per finding:
  1. Group findings by type so you can batch-investigate efficiently.

Phase 2 — Investigate Each Finding

Work through findings type by type. For each one, read the flagged file and apply the investigation playbook for that type.

2a — `leaked_secret` findings

Step 1 — Does the file exist?

Use the Read tool on CODEBASE_PATH/affected_file. If the file does not exist:

→ Verdict: CLOSE — File Removed

→ Note: "File does not exist at HEAD. Finding references removed code in git history."

→ Move on. Do not investigate further.

Step 2 — Read the flagged lines.

Read start_line to end_line (expand by ±3 lines for context).

Apply these patterns:

| What you see | Verdict |

|---|---|

| ENV.fetch(...), ENV[...], ENV.fetch(..., nil) | CLOSE — False Positive (env var read) |

| ${{ secrets.* }} (GitHub Actions) | CLOSE — False Positive (GH Actions secret) |

| ${VARIABLE_NAME} in .npmrc/.env.example | CLOSE — False Positive (env var placeholder) |

| --mount=type=secret in Dockerfile | CLOSE — False Positive (Docker build secret) |

| A long regex, UA string, or binary-looking data | CLOSE — False Positive (pattern mismatch) |

| An actual hardcoded token/key/password string | KEEP OPEN — check liveness if possible |

| A real URL with embedded credentials (user:pass@host) | KEEP OPEN |

For sidekiq-sensitive-url rule: check whether the flagged content is a Redis URL with credentials or just a gem declaration. Almost always a false positive in Gemfile/Gemfile.lock.

Step 3 — If hardcoded secret found:


2b — `sast` findings

Step 1 — Read the flagged file and lines.

Read CODEBASE_PATH/affected_file at start_line ± 10 lines of context.

Step 2 — Apply rule-specific investigation:

NoSQL injection (NoSQL injection attack possible)

1. What does the flagged function call?

2. Does it call a NoSQL driver (MongoDB, Redis query, Elasticsearch, Mongoose)?

3. Or does it call an HTTP client (axios, fetch, HTTParty)?

SQL injection (SQL injection, string-based query concatenation)

1. Is there actual string interpolation into a raw SQL string? ("... #{variable}")

2. What is the type of the interpolated variable? (Ruby Date, Integer, String?)

3. Is it executed via select_all, execute, or connection.exec?

4. Trace the variable back to its source — is it user-controlled?

Unpinned GitHub Actions (3rd party Github Actions should be pinned)

NODE_AUTH_TOKEN (Use of NODE_AUTH_TOKEN)

Other SAST rules


2c — `open_source` / SCA findings

For each SCA finding:

Step 1 — Identify the vulnerable function from the CVE/advisory.

Use your knowledge of the CVE to identify what specific function/class is vulnerable. If you need more detail, use /analyze-cve to do a full dataflow trace.

Step 2 — Check if the package is used in application source code.

Use Grep to search for imports of the package in the application source:

Step 3 — Apply these verdicts:

| Scenario | Verdict |

|---|---|

| Package not imported anywhere in app source (transitive/build-only) | CLOSE — Not Exploitable |

| Package imported but vulnerable function never called | CLOSE — Not Exploitable |

| Package imported, vulnerable function called, no user input reaches it | CLOSE — Not Exploitable |

| Package imported, vulnerable function called with user-controlled input, no sanitization | KEEP OPEN |

| devDependency only (webpack-dev-server, jest, babel plugins) | CLOSE — Not Exploitable |

Step 4 — For complex SCA findings with user-reachable code paths:

Run /analyze-cve skill to do a full dataflow trace before rendering the verdict.


2d — `eol` findings


Phase 3 — Assign Final Verdicts

For every finding, assign:

| Field | Values |

|---|---|

| recommended_action | KEEP OPEN or CLOSE |

| close_category | False Positive / File Removed / Not Exploitable / Real Finding |

| analyst_notes | One sentence — what you found and why |

| evidence | Specific file:line references and code fragments proving the verdict |


Phase 4 — Output the Reviewed CSV

Write a new CSV to the same directory as the input CSV, named <original-name>-reviewed.csv.

Column set (lean — do not include empty cloud/VM/container columns from the original):

aikido_issue_id, type, severity, affected_file, related_cve, rule, start_line,
recommended_action, close_category, analyst_notes, evidence

Rules:


Phase 5 — Generate the HTML Evidence Report

Write a self-contained HTML file to the same directory as the CSV, named <project-name>-security-review.html.

HTML structure (follow this exactly)

1. <header>  — project name, analyst, date, branch/source
2. Stats bar — total / close / keep open / false positive / file removed / not exploitable counts
3. Jump nav  — anchor links to each section
4. Full summary table — all findings, colour-coded by severity and action
5. KEEP OPEN section — one detailed card per finding with full code evidence
6. FALSE POSITIVES section — one card per finding with evidence showing why it's a FP
7. FILE REMOVED section — simple table (no code to show)
8. NOT EXPLOITABLE section — one card per finding with code evidence
9. <footer>

Card anatomy (for sections 5, 6, 8)

Each finding card must contain:

Code block style

Use <pre> blocks with dark background. Add inline <span> highlights:

Severity badge colours

Action badge colours

Close category badge colours

CSS

Embed all CSS in a <style> block in <head>. No external dependencies — the file must be fully self-contained and openable offline.

Use a clean, professional light theme. Monospace font for file paths and code. System font stack for prose.


Phase 6 — Summary to User

After writing both files, output a short summary:

## Triage complete

**CSV:** /path/to/reviewed.csv
**Report:** /path/to/report.html

| Action     | Count |
|------------|-------|
| KEEP OPEN  | N     |
| CLOSE      | N     |
| — False Positive | N |
| — File Removed   | N |
| — Not Exploitable| N |

**Keep open findings:**
- [ID] severity — short description
- ...

Rules


Finding type quick reference

| Aikido type | Primary check | Most common outcome |

|---|---|---|

| leaked_secret | Does file exist? Then read flagged lines. | False Positive or File Removed |

| sast — NoSQL | Trace call chain to actual DB driver | Almost always False Positive if MySQL/Postgres stack |

| sast — SQLi | Read raw SQL method, check interpolation + type coercion | Medium finding, often partially mitigated |

| sast — Actions | Check for SHA pin vs tag pin | Real finding if tag-pinned |

| open_source | Grep app source for import, check if vulnerable function used | Often Not Exploitable (transitive/build-only) |

| eol | Read version file, check EOL date | Always a real finding if EOL date passed |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.