Skip to content

Commit d72f929

Browse files
authored
Merge pull request #8 from ShieldNet-360/feat/audit-ci
Feat/audit ci
2 parents 5d4e924 + be51d0e commit d72f929

68 files changed

Lines changed: 2403 additions & 330 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude/workflows/secure-vibe-audit.js‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ export const meta = {
1313
// single Go binary — this script only fans the deterministic audit out per
1414
// directory and synthesizes one ranked report, so it stays a convenience layer,
1515
// not a reimplementation. Point it at a repo via args (default: current dir).
16-
// To turn on the AI lanes, add `--model <provider>` to the audit command below
17-
// and export SECURE_VIBE_MODEL_API_KEY (bring your own key).
16+
// The binary is deterministic and passive: it never calls an LLM and never
17+
// sends attack traffic. The reasoning here is the agent's — the per-directory
18+
// agents may read code and reason about each finding, and any dynamic
19+
// verification is the agent's job via the scope-gated http_probe / oob_listener
20+
// MCP primitives (see the dynamic-verification skill), never this script.
1821

1922
const TARGET = typeof args === 'string' && args.trim() ? args.trim() : '.'
2023

‎DATA_QUALITY.md‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Auto-generated by `scripts/generate-data-quality.py`. Re-run after any change to the on-disk vulnerability or skills data; CI fails if the committed file is out of date.
44

5-
_Generated: 2026-07-08 03:18 UTC_
5+
_Generated: 2026-07-09 08:11 UTC_
66

77
## Summary
88

@@ -17,54 +17,54 @@ _Generated: 2026-07-08 03:18 UTC_
1717

1818
| Ecosystem | Entries | Curated | OSSF-derived | Other | Reference coverage | Last updated | Age |
1919
|---|---:|---:|---:|---:|---:|---|---:|
20-
| composer | 10 | 10 | 0 | 0 | 100.0% | 2026-06-21 | 16d |
21-
| crates | 30 | 22 | 8 | 0 | 100.0% | 2026-06-21 | 16d |
22-
| docker | 12 | 12 | 0 | 0 | 100.0% | 2026-06-21 | 16d |
23-
| github-actions | 12 | 12 | 0 | 0 | 100.0% | 2026-06-21 | 16d |
24-
| go | 30 | 13 | 17 | 0 | 100.0% | 2026-06-21 | 16d |
25-
| maven | 14 | 12 | 2 | 0 | 100.0% | 2026-06-21 | 16d |
26-
| npm | 2028 | 88 | 1940 | 0 | 100.0% | 2026-06-23 | 15d |
27-
| nuget | 608 | 8 | 600 | 0 | 100.0% | 2026-05-14 | 54d ⚠️ |
28-
| pypi | 618 | 59 | 559 | 0 | 100.0% | 2026-06-23 | 15d |
29-
| rubygems | 456 | 9 | 447 | 0 | 100.0% | 2026-06-22 | 15d |
20+
| composer | 10 | 10 | 0 | 0 | 100.0% | 2026-06-21 | 17d |
21+
| crates | 30 | 22 | 8 | 0 | 100.0% | 2026-06-21 | 17d |
22+
| docker | 12 | 12 | 0 | 0 | 100.0% | 2026-06-21 | 17d |
23+
| github-actions | 12 | 12 | 0 | 0 | 100.0% | 2026-06-21 | 17d |
24+
| go | 30 | 13 | 17 | 0 | 100.0% | 2026-06-21 | 17d |
25+
| maven | 14 | 12 | 2 | 0 | 100.0% | 2026-06-21 | 17d |
26+
| npm | 2028 | 88 | 1940 | 0 | 100.0% | 2026-06-23 | 16d |
27+
| nuget | 608 | 8 | 600 | 0 | 100.0% | 2026-05-14 | 55d ⚠️ |
28+
| pypi | 618 | 59 | 559 | 0 | 100.0% | 2026-06-23 | 16d |
29+
| rubygems | 456 | 9 | 447 | 0 | 100.0% | 2026-06-22 | 17d |
3030

3131
## Typosquat database
3232

3333
- File: `vulnerabilities/supply-chain/typosquat-db/known_typosquats.json`
3434
- Entries: **302**
3535
- By source: `curated`: 71, `ossf-malicious-packages-derived`: 231
3636
- Reference coverage: 100.0%
37-
- Last updated: 2026-06-23 (15d)
37+
- Last updated: 2026-06-23 (16d)
3838

3939
## OSV cache (SAMPLED)
4040

4141
> **SAMPLED.** This repo ships a stride-sampled subset of each ecosystem's OSV archive so the tree stays reviewable. The current sample target is set by `scripts/ingest-osv.py --per-ecosystem` (default 500). Operators who need full coverage should re-run with `--per-ecosystem 0`.
4242
4343
| Ecosystem | Advisories | Packages indexed | Generated at | Age |
4444
|---|---:|---:|---|---:|
45-
| composer | 122 | 38 | 2026-05-16 | 52d ⚠️ |
46-
| crates | 139 | 69 | 2026-05-16 | 52d ⚠️ |
47-
| go | 123 | 45 | 2026-05-16 | 52d ⚠️ |
48-
| maven | 310 | 107 | 2026-05-16 | 52d ⚠️ |
49-
| npm | 105 | 98 | 2026-05-16 | 52d ⚠️ |
50-
| nuget | 767 | 107 | 2026-05-16 | 52d ⚠️ |
51-
| pub | 26 | 18 | 2026-05-16 | 52d ⚠️ |
52-
| pypi | 111 | 42 | 2026-05-16 | 52d ⚠️ |
53-
| rubygems | 179 | 71 | 2026-05-16 | 52d ⚠️ |
54-
| swift | 117 | 56 | 2026-05-16 | 52d ⚠️ |
45+
| composer | 122 | 38 | 2026-05-16 | 54d ⚠️ |
46+
| crates | 139 | 69 | 2026-05-16 | 54d ⚠️ |
47+
| go | 123 | 45 | 2026-05-16 | 54d ⚠️ |
48+
| maven | 310 | 107 | 2026-05-16 | 54d ⚠️ |
49+
| npm | 105 | 98 | 2026-05-16 | 54d ⚠️ |
50+
| nuget | 767 | 107 | 2026-05-16 | 54d ⚠️ |
51+
| pub | 26 | 18 | 2026-05-16 | 54d ⚠️ |
52+
| pypi | 111 | 42 | 2026-05-16 | 54d ⚠️ |
53+
| rubygems | 179 | 71 | 2026-05-16 | 54d ⚠️ |
54+
| swift | 117 | 56 | 2026-05-16 | 54d ⚠️ |
5555

5656
## CVE patterns (code-relevant)
5757

5858
- File: `vulnerabilities/cve/code-relevant/cve_patterns.json`
5959
- Entries: **58**
6060
- Reference coverage: 100.0%
61-
- Last updated: 2026-06-20 (18d)
61+
- Last updated: 2026-06-20 (19d)
6262

6363
## Manifest integrity
6464

6565
- File: `manifest.json`
6666
- Release version: `2026.05.12.1`
6767
- Released at: 2026-05-12T10:00:00Z
68-
- Files indexed: 1358
68+
- Files indexed: 1368
6969
- Signature: unsigned
7070

‎README.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
44
[![npm](https://img.shields.io/npm/v/@shieldnet360/secure-vibe?color=cb3837&logo=npm)](https://www.npmjs.com/package/@shieldnet360/secure-vibe)
5-
[![Skills](https://img.shields.io/badge/skills-30-blue)](./skills)
5+
[![Skills](https://img.shields.io/badge/skills-33-blue)](./skills)
66
[![Platforms](https://img.shields.io/badge/platforms-win%20%7C%20mac%20%7C%20linux-green)](#platform-support)
77

88
**Prevention-first security for AI-written code.** SecureVibe feeds your AI coding
@@ -18,7 +18,7 @@ Maintained by **[ShieldNet360](https://www.shieldnet360.com)** · MIT — free t
1818
npm bundles the library data (skills + vuln DB), so it works on macOS, Linux, and Windows out of the box:
1919

2020
```bash
21-
npx -y @shieldnet360/secure-vibe <command> # run on demand: scan · gate · check · init · mcp · status
21+
npx -y @shieldnet360/secure-vibe <command> # run on demand: audit · check · init · mcp · status
2222
npm install -g @shieldnet360/secure-vibe # …or install globally for a persistent `secure-vibe`
2323
```
2424

@@ -60,7 +60,7 @@ secure-vibe audit . --fail-on high --format sarif
6060
# 4 · vet one package before adding it
6161
secure-vibe check event-stream@3.3.6 -e npm
6262

63-
# 5 · the MCP server (17 tools over stdio) — this is the command clients spawn:
63+
# 5 · the MCP server (20 tools over stdio) — this is the command clients spawn:
6464
secure-vibe mcp # or: npx -y @shieldnet360/secure-vibe mcp
6565
# register it with Claude Code in one line:
6666
claude mcp add SecureVibe -- npx -y @shieldnet360/secure-vibe mcp
@@ -112,11 +112,11 @@ deterministic and passive — it never calls an LLM and never sends attack traff
112112
the *reasoning* and *dynamic verification* are your coding agent's job, so the
113113
tool stays keyless and works the same in Claude Code, Codex, Gemini, or plain CI.
114114

115-
- **PREVENT** — 30 signed skills across 8 assistants, consulted as code is written.
115+
- **PREVENT** — 33 signed skills across 8 assistants, consulted as code is written.
116116
- **DETECT** — one command, `audit`: fans the deterministic scanners (secrets, dependencies via a curated malicious / typosquat DB + CVE / OSV across 10 ecosystems, Dockerfile, GitHub Actions) across the tree (or a PR's `--diff`), then dedups, ranks by severity, and triages likely fixtures.
117117
- **ENFORCE** — `audit --fail-on <severity>` exits non-zero for CI; `--format sarif` for Code Scanning, `--report-dir` for an HTML + PDF report, `--no-triage` for a strict gate.
118-
- **VERIFY** — the coding agent confirms candidates dynamically, guided by the `dynamic-verification` skill (SecureVibe hands it the finding + method; the agent, with your authorization and scope, does the probing — the binary never sends the payload).
119-
- **LEARN** — `secure-vibe contribute add -p <pkg> -e npm` writes a signed `.secure-vibe/overlay.json`; commit it (team) or point `$SECURE_VIBE_OVERLAY` at a shared file (org).
118+
- **VERIFY** — the coding agent confirms candidates dynamically using two scope-gated MCP primitives — `http_probe` (send one crafted request) and `oob_listener` (catch blind callbacks) — guided by the `dynamic-verification` skill. In CI (no agent), verification is a committed **regression test** (`security-regression-tests` skill), not a live probe. The binary never sends attack traffic on its own.
119+
- **LEARN** — two feedback loops that improve the tool from real use. *Data:* `secure-vibe contribute add -p <pkg> -e npm` writes a `.secure-vibe/overlay.json` the gate enforces — commit it (team) or point `$SECURE_VIBE_OVERLAY` at a shared file (org). *Knowledge:* when the agent finds a skill is wrong or missing a fact, it records an inert proposal via the `propose_skill_update` MCP tool; review with `secure-vibe contribute skill`, then edit the skill and re-sign. Proposals never touch the signed skill on their own — a human review is the gate.
120120

121121
> **Narrow by design.** Detection is four deterministic scanners, not a general SAST. It catches known patterns and known-bad packages with near-zero false positives; it does not claim to find every vulnerability. The semantic and dynamic depth comes from the agent driving it.
122122

@@ -127,8 +127,8 @@ tool stays keyless and works the same in Claude Code, Codex, Gemini, or plain CI
127127
| `init --tool <ide>` | Write the assistant config (`CLAUDE.md`, `.cursorrules`, …) that embeds the skills |
128128
| `audit [path...]` | The scanner: fan out every scanner, dedup, rank, triage. Reports by default; `--fail-on` gates CI; `--diff` scopes to a PR; `--format sarif` for Code Scanning |
129129
| `check <pkg>[@ver] -e <eco>` | Look up one package: malicious / typosquat / CVE / OSV |
130-
| `mcp` | Run the MCP server (17 tools); `mcp connect` registers it with Claude Code |
131-
| `contribute` | The LEARN loop — block a bad package locally, share via git / overlay |
130+
| `mcp` | Run the MCP server (20 tools); `mcp connect` registers it with Claude Code |
131+
| `contribute` | The LEARN loop — block a bad package (`add`), or review agent-proposed skill fixes (`skill`) |
132132
| `update` | Pull signed skills + vuln data (`--self` updates the binary) · `status` reports freshness |
133133

134134
Full reference: [docs/reference/cli.md](./docs/reference/cli.md) · `secure-vibe --help`.
@@ -137,7 +137,7 @@ Full reference: [docs/reference/cli.md](./docs/reference/cli.md) · `secure-vibe
137137

138138
- [ARCHITECTURE.md](./ARCHITECTURE.md) — design, compiler, update protocol, repo layout.
139139
- [docs/](./docs/) — guides (developer · devops · security · evaluator), install, air-gapped, team rollout.
140-
- [docs/reference/mcp-clients.md](./docs/reference/mcp-clients.md) — connect the MCP server to any agent (Claude Code · Cursor · Windsurf · VS Code · Cline · Zed) · [docs/reference/mcp-tools.md](./docs/reference/mcp-tools.md) — the 17 MCP tools · [skills/](./skills) — the 30-skill catalogue.
140+
- [docs/reference/mcp-clients.md](./docs/reference/mcp-clients.md) — connect the MCP server to any agent (Claude Code · Cursor · Windsurf · VS Code · Cline · Zed) · [docs/reference/mcp-tools.md](./docs/reference/mcp-tools.md) — the 20 MCP tools · [skills/](./skills) — the 33-skill catalogue.
141141
- [SIGNING.md](./SIGNING.md) — Ed25519 release signing · [CONTRIBUTING.md](./CONTRIBUTING.md) · [SECURITY.md](./SECURITY.md).
142142

143143
## Platform support

‎cmd/secure-vibe/cmd/banner.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ func renderBanner(w io.Writer) {
129129
rows := []string{
130130
bold("Quick start"),
131131
cmd("secure-vibe init --tool <ide>", "embed skills in your IDE"),
132-
cmd("secure-vibe scan <path>", "find secrets / bad deps / misconfig"),
133-
cmd("secure-vibe gate <path>", "CI gate — fail on findings"),
132+
cmd("secure-vibe audit <path>", "scan: secrets / bad deps / misconfig"),
133+
cmd("secure-vibe audit --fail-on high", "CI gate — fail on findings"),
134134
cmd("secure-vibe mcp", "MCP server over stdio"),
135135
cmd("secure-vibe --help", "list every command"),
136136
}

‎cmd/secure-vibe/cmd/contribute.go‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ Sharing the block (the LEARN flywheel), in order of blast radius:
5050
all repos and CI jobs.
5151
5252
Run "contribute submit" to export a portable, optionally-signed candidate you
53-
can attach to an upstream issue/PR for review into the central database.`,
53+
can attach to an upstream issue/PR for review into the central database.
54+
55+
The same LEARN loop covers knowledge, not just data: when a coding agent finds
56+
a skill is missing a fact or is wrong, it records an inert proposal via the
57+
propose_skill_update MCP tool. Review those with "contribute skill".`,
5458
}
5559
c.AddCommand(contributeAddCmd())
5660
c.AddCommand(contributeListCmd())
@@ -59,6 +63,7 @@ can attach to an upstream issue/PR for review into the central database.`,
5963
c.AddCommand(contributeKeygenCmd())
6064
c.AddCommand(contributeVerifyCmd())
6165
c.AddCommand(contributeImportCmd())
66+
c.AddCommand(contributeSkillCmd())
6267
return c
6368
}
6469

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
package cmd
2+
3+
import (
4+
"fmt"
5+
"io"
6+
"net/url"
7+
"strings"
8+
9+
"github.com/spf13/cobra"
10+
11+
"github.com/shieldnet-360/secure-vibe/internal/proposal"
12+
)
13+
14+
// upstreamRepo is where a reviewed knowledge proposal is contributed.
15+
const upstreamRepo = "ShieldNet-360/secure-vibe"
16+
17+
// contributeSkillCmd is the review half of the knowledge LEARN loop. An
18+
// agent records proposals via the propose_skill_update MCP tool (an
19+
// inert append to .secure-vibe/skill-proposals.jsonl); a maintainer uses
20+
// this command to read them, and — when one holds up — to turn it into a
21+
// paste-ready upstream contribution.
22+
//
23+
// The command deliberately does NOT edit any SKILL.md, sign anything, or
24+
// open a PR. Applying a proposal is a human act: edit skills/<id>/SKILL.md
25+
// by hand, then re-run the signing pipeline (validate → regenerate →
26+
// manifest compute → sign). That human review + re-sign is the trust gate
27+
// that keeps a model — steerable by prompt injection — from mutating
28+
// signed knowledge.
29+
func contributeSkillCmd() *cobra.Command {
30+
var dir, show, upstream string
31+
c := &cobra.Command{
32+
Use: "skill",
33+
Short: "Review agent-recorded skill-update proposals (knowledge LEARN loop)",
34+
Long: `Review the skill-knowledge proposals an agent recorded via the
35+
propose_skill_update MCP tool. Proposals are inert suggestions in
36+
.secure-vibe/skill-proposals.jsonl — this command reads them; it never edits
37+
or signs a skill.
38+
39+
secure-vibe contribute skill # list pending proposals
40+
secure-vibe contribute skill --show <id> # full detail for one proposal
41+
secure-vibe contribute skill --upstream <id> # a paste-ready upstream contribution
42+
43+
To adopt a proposal: edit skills/<skill-id>/SKILL.md by hand, then re-run the
44+
signing pipeline. To share it upstream, use --upstream and open the printed URL.`,
45+
RunE: func(cmd *cobra.Command, args []string) error {
46+
path, err := proposal.PathFor(dir)
47+
if err != nil {
48+
return err
49+
}
50+
w := cmd.OutOrStdout()
51+
switch {
52+
case strings.TrimSpace(show) != "":
53+
p, err := proposal.Get(path, show)
54+
if err != nil {
55+
return err
56+
}
57+
if p == nil {
58+
return fmt.Errorf("no proposal matching %q in %s", show, path)
59+
}
60+
printProposalDetail(w, p)
61+
return nil
62+
case strings.TrimSpace(upstream) != "":
63+
p, err := proposal.Get(path, upstream)
64+
if err != nil {
65+
return err
66+
}
67+
if p == nil {
68+
return fmt.Errorf("no proposal matching %q in %s", upstream, path)
69+
}
70+
printUpstreamBundle(w, p)
71+
return nil
72+
default:
73+
return listProposals(w, path)
74+
}
75+
},
76+
}
77+
c.Flags().StringVar(&dir, "dir", "", "project directory holding .secure-vibe/skill-proposals.jsonl (default: cwd)")
78+
c.Flags().StringVar(&show, "show", "", "print full detail for one proposal id")
79+
c.Flags().StringVar(&upstream, "upstream", "", "print a paste-ready upstream contribution for one proposal id")
80+
return c
81+
}
82+
83+
func listProposals(w io.Writer, path string) error {
84+
all, err := proposal.Load(path)
85+
if err != nil {
86+
return err
87+
}
88+
if len(all) == 0 {
89+
fmt.Fprintf(w, "No skill proposals yet (%s).\nAgents record them via the propose_skill_update MCP tool.\n", path)
90+
return nil
91+
}
92+
fmt.Fprintf(w, "%d skill proposal(s) in %s:\n", len(all), path)
93+
for _, p := range all {
94+
fmt.Fprintf(w, " %s [%s] %s\n %s\n", p.ID, p.Kind, p.SkillID, oneLine(p.Claim, 100))
95+
}
96+
fmt.Fprintf(w, "\nInspect one: secure-vibe contribute skill --show <id>\n")
97+
return nil
98+
}
99+
100+
func printProposalDetail(w io.Writer, p *proposal.Proposal) {
101+
fmt.Fprintf(w, "id: %s\n", p.ID)
102+
fmt.Fprintf(w, "skill: %s\n", p.SkillID)
103+
fmt.Fprintf(w, "kind: %s\n", p.Kind)
104+
fmt.Fprintf(w, "recorded: %s (by %s)\n", p.Recorded, p.Source)
105+
fmt.Fprintf(w, "\nclaim:\n %s\n", p.Claim)
106+
fmt.Fprintf(w, "\nevidence:\n %s\n", p.Evidence)
107+
if strings.TrimSpace(p.SuggestedText) != "" {
108+
fmt.Fprintf(w, "\nsuggested text:\n %s\n", p.SuggestedText)
109+
}
110+
fmt.Fprintf(w, "\nTo adopt: edit skills/%s/SKILL.md, then re-run the signing pipeline.\n", p.SkillID)
111+
fmt.Fprintf(w, "To share: secure-vibe contribute skill --upstream %s\n", p.ID)
112+
}
113+
114+
// printUpstreamBundle emits a Markdown block a maintainer can paste into
115+
// an upstream issue/PR, plus a prefilled "new issue" URL. It never opens
116+
// anything — publishing is the human's explicit act.
117+
func printUpstreamBundle(w io.Writer, p *proposal.Proposal) {
118+
title := fmt.Sprintf("skill(%s): %s knowledge — %s", p.SkillID, p.Kind, oneLine(p.Claim, 60))
119+
var b strings.Builder
120+
fmt.Fprintf(&b, "## Proposed skill update: `%s`\n\n", p.SkillID)
121+
fmt.Fprintf(&b, "**Kind:** %s\n\n", p.Kind)
122+
fmt.Fprintf(&b, "**Claim**\n\n%s\n\n", p.Claim)
123+
fmt.Fprintf(&b, "**Evidence**\n\n%s\n\n", p.Evidence)
124+
if strings.TrimSpace(p.SuggestedText) != "" {
125+
fmt.Fprintf(&b, "**Suggested wording for `skills/%s/SKILL.md`**\n\n%s\n\n", p.SkillID, p.SuggestedText)
126+
}
127+
fmt.Fprintf(&b, "_Recorded locally by %s on %s (proposal %s). A maintainer should verify the evidence, edit `skills/%s/SKILL.md`, and re-sign._\n",
128+
p.Source, p.Recorded, p.ID, p.SkillID)
129+
body := b.String()
130+
131+
issueURL := fmt.Sprintf("https://github.com/%s/issues/new?title=%s&body=%s&labels=%s",
132+
upstreamRepo, url.QueryEscape(title), url.QueryEscape(body), url.QueryEscape("skill-knowledge"))
133+
134+
fmt.Fprintf(w, "%s\n", body)
135+
fmt.Fprintf(w, "----\nPaste the block above into a PR, or open a prefilled issue:\n\n%s\n", issueURL)
136+
}
137+
138+
// oneLine collapses whitespace and truncates s to n runes for compact
139+
// listings and titles.
140+
func oneLine(s string, n int) string {
141+
s = strings.Join(strings.Fields(s), " ")
142+
if r := []rune(s); len(r) > n {
143+
return string(r[:n-1]) + "…"
144+
}
145+
return s
146+
}

0 commit comments

Comments
 (0)