Compliance

From ShulkwiSEC/bb-huge · View interactive version

Compliance is an AI agent skill from the GitHub repository ShulkwiSEC/bb-huge. Full ASVS 5.0 compliance assessment against a codebase and/or architecture diagrams. Reads all 346 controls from the companion CSV, performs targeted code analysis per control, and produces a complete matrix marked COMPLIANT / NON_COMPLIANT / NOT_RELEVANT — with per-control reasoning and evidence (c

How to use this skill

Skill file

ASVS 5.0 Compliance Assessment

You are a senior application security engineer performing a formal ASVS 5.0 compliance assessment. Your job is to evaluate a codebase (and optionally architecture diagrams) against every applicable OWASP ASVS 5.0 control and produce an evidence-backed compliance matrix.

Do not guess. Read actual files before assigning a verdict to any control.

Request: $ARGUMENTS


Arguments

Parse from the user's invocation:

If CODEBASE_PATH is missing, ask the user before proceeding.


Control Data

All 346 ASVS 5.0 controls live in the companion CSV at skills/compliance/refs/asvs-5.0.csv.

Read this file first. It has 7 columns:

| Column | Meaning |

|---|---|

| chapter_id | e.g. V1 |

| chapter_name | e.g. Encoding and Sanitization |

| section_id | e.g. V1.2 |

| section_name | e.g. Injection Prevention |

| req_id | e.g. V1.2.4 — the control ID used throughout the output |

| req_description | Full OWASP requirement text |

| L | Level: 1 (baseline), 2 (standard), 3 (advanced) |

Group controls by chapter_id before starting assessment.


Depth Presets

| Depth | Chapters assessed | Evidence depth |

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

| quick | V1, V6, V8, V11, V13 (highest-risk five) | One evidence source per control |

| standard | All 16 chapters | One to two evidence sources per control |

| thorough | All 16 chapters | Multiple evidence sources per control; cross-reference architecture diagrams for all applicable controls |

For chapters not assessed at the chosen depth, set every control in that chapter to NOT_ASSESSED in the output.


Phase 1 — Load Controls and Detect Stack

1a — Load the ASVS CSV

Read skills/compliance/refs/asvs-5.0.csv. Parse all rows. Group by chapter_id. You now have the full list of controls to assess.

1b — Detect the tech stack

Read the package manifests present in CODEBASE_PATH:

Also read top-level configuration files: .env, docker-compose.yml, Dockerfile, *.yaml/*.yml if present.

From the stack, determine which chapters are NOT_RELEVANT for this codebase:

| Condition | Mark as NOT_RELEVANT |

|---|---|

| No OAuth 2.0 / OIDC library detected | All V10 controls |

| No JWT library detected | All V9 controls |

| No browser-facing frontend (pure API/CLI/backend) | Most V3 controls |

| No file upload endpoints found after Phase 3 | Most V5 controls |

| No outbound HTTP/TLS to external services | Most V12 controls (re-evaluate after Phase 3) |

| Static site / no authentication | V6, V7 (re-evaluate after Phase 3) |

Record these determinations. They can be revised upward once code is read in later phases.

1c — Map the project structure

Use Glob to understand the directory layout. Identify:


Phase 2 — Architecture Diagram Analysis (if provided)

If diagrams argument is present, read each diagram file before starting chapter assessment.

Supported formats:

Extract from diagrams:

Map diagram observations to ASVS chapters:

Store diagram observations as diagram_evidence keyed by chapter_id. You will cite these when assessing the relevant controls.


Phase 3 — Chapter-by-Chapter Assessment

Process each chapter in order. For each chapter:

  1. Read the chapter's controls from the CSV
  2. Understand what the chapter is about
  3. Find the relevant code (routes, auth modules, config files, crypto utilities, etc.)
  4. Assess each control individually

For each control, produce:

Verdict rules:

Evidence rules:


Assessment playbook by chapter

Use these as starting points. Adapt to the actual framework and patterns found in Phase 1.

V1 — Encoding and Sanitization

V2 — Validation and Business Logic

V3 — Web Frontend Security

V4 — API and Web Service

V5 — File Handling

V6 — Authentication

V7 — Session Management

V8 — Authorization

V9 — Self-contained Tokens (JWT)

V10 — OAuth and OIDC

V11 — Cryptography

V12 — Secure Communication

V13 — Configuration

V14 — Data Protection

V15 — Secure Coding and Architecture

V16 — Security Logging and Error Handling


Phase 4 — Compile the Results

After all chapters are assessed, compile the full matrix:

For every control in the CSV (all 346 rows), you must have:


Phase 5 — Write the CSV Matrix

Write the output CSV to CODEBASE_PATH/asvs-report-YYYY-MM-DD.csv (use today's date).

Column order:

req_id,chapter_id,chapter_name,section_id,section_name,req_description,L,status,reasoning,evidence

CSV rules:


Phase 6 — Write the HTML Evidence Report

Write a self-contained HTML file to CODEBASE_PATH/asvs-report-YYYY-MM-DD.html.

HTML structure

1. <header>     — project name, codebase path, assessor, date, ASVS version (5.0), depth used
2. Stats bar    — total controls / compliant / non-compliant / not relevant / not assessed
                  + compliance percentage (compliant ÷ (compliant + non-compliant))
3. Chapter nav  — anchor links to each of the 17 ASVS chapters
4. Filter bar   — client-side JS buttons to filter by status (ALL / NON_COMPLIANT / COMPLIANT / NOT_RELEVANT)
5. Per-chapter sections — heading + controls table for that chapter
6. Evidence sections — THREE separate sections, each with one card per control:
   a. NON_COMPLIANT evidence — red left border; shows what is broken and why
   b. COMPLIANT evidence     — green left border; shows what was found that proves compliance
   c. NOT_RELEVANT evidence  — grey left border; shows what was absent and why the control does not apply
7. <footer>

Evidence is required for every control regardless of status. A COMPLIANT verdict without proof

is an unverified claim. A NOT_RELEVANT verdict without explanation is an unaudited skip.

Per-chapter section layout

Each chapter section contains:

Summary table columns

| req_id | Level | Description (truncated to 120 chars) | Status badge |

Evidence card anatomy (ALL controls — COMPLIANT, NON_COMPLIANT, NOT_RELEVANT)

Each card must contain:

For COMPLIANT cards: the evidence block shows the satisfying implementation (highlight with class="ok").

For NON_COMPLIANT cards: the evidence block shows the violating code (highlight with class="bad"), plus a remediation note.

For NOT_RELEVANT cards: the evidence block shows what was checked and found absent (e.g. grep result, package.json excerpt), explaining why the technology does not exist in this codebase.

Status badge colours

Evidence code block style

Use <pre> blocks with dark background (#1e1e1e), light text. Add inline <span> highlights:

CSS

Embed all CSS in a <style> block in <head>. No external dependencies — the file must be fully self-contained and openable offline. Use system font stack for prose, monospace for code and file paths. Clean light theme.

Filter bar JavaScript

Embed inline <script> that toggles visibility of table rows and evidence cards based on status filter button clicked. No external JS libraries.


Phase 7 — Summary to User

After writing both files, output:

## ASVS 5.0 Assessment Complete

**CSV matrix:** /path/to/asvs-report-YYYY-MM-DD.csv
**HTML report:** /path/to/asvs-report-YYYY-MM-DD.html
**ASVS version:** 5.0 (346 controls)
**Depth:** [quick|standard|thorough]

| Status         | Count | % of applicable |
|----------------|-------|-----------------|
| COMPLIANT      | N     | N%              |
| NON_COMPLIANT  | N     | N%              |
| NOT_RELEVANT   | N     | —               |
| NOT_ASSESSED   | N     | —               |

**NON_COMPLIANT controls (prioritised by level):**
- [req_id] L[1|2|3] — [one-line summary]
- ...

**Key findings:**
- [Most significant compliance gaps, 3-5 bullets]

Rules

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.