@vibecontrols/vibe-plugin-security-secrets-pr 2026.528.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Proprietary License
2
+
3
+ Copyright (c) 2026 Burdenoff Consultancy Services Pvt. Ltd. All rights reserved.
4
+
5
+ This software and associated documentation files (the "Software") are
6
+ proprietary to Burdenoff Consultancy Services Pvt. Ltd. ("Burdenoff").
7
+
8
+ Permission is NOT granted to any person obtaining a copy of this Software
9
+ to use, copy, modify, merge, publish, distribute, sublicense, or sell
10
+ copies of the Software outside of authorized internal use at Burdenoff and
11
+ its designated customers.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # @vibecontrols/vibe-plugin-security-secrets-pr
2
+
3
+ Gitleaks-backed secret scanner for the `pull_request.fast` lifecycle stage in [VibeControls](https://vibecontrols.com).
4
+
5
+ Registers itself with [`@vibecontrols/vibe-plugin-security`](https://www.npmjs.com/package/@vibecontrols/vibe-plugin-security) under the per-stage provider type `security.secrets` and the provider name `gitleaks`. When the user picks "Gitleaks" as their default provider for `pull_request.fast` (or any other supported stage), the security meta plugin dispatches scan runs to this provider.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ vibe plugin install @vibecontrols/vibe-plugin-security-secrets-pr
11
+ vibe security providers set-default --stage pull_request.fast --provider gitleaks
12
+ ```
13
+
14
+ The plugin downloads the Gitleaks binary automatically on first use (sha256-verified per platform) into `~/.boff/vibecontrols/agents/<profile>/tools/gitleaks/`.
15
+
16
+ ## Behavior
17
+
18
+ - Output format: SARIF v2.1.0 via `--report-format=sarif --report-path=<workdir>/gitleaks.sarif`
19
+ - Scans the working tree at `repoLocalPath`; if `--depth` is configured, restricts to that many commits of history (default 200)
20
+ - Findings normalized to `category: "secret"` with `severity` derived from `properties.severity` (Gitleaks rule field) when present, falling back to SARIF level
21
+ - Secret samples redacted before persistence: only the sha256 + first-4 + last-4 chars are stored
22
+
23
+ ## Configuration
24
+
25
+ Per-vibe config (stored in `RepositorySecurityConfig.pluginAssignments["pull_request.fast"].config`):
26
+
27
+ ```yaml
28
+ provider: gitleaks
29
+ config:
30
+ configPath: .gitleaks.toml # optional, repo-local config file
31
+ ignorePath: .gitleaksignore # optional, ignored matches re-reported as info
32
+ historyDepth: 200 # commits of history to scan
33
+ extraArgs: [] # additional CLI flags
34
+ ```
35
+
36
+ ## License
37
+
38
+ Proprietary — Burdenoff Consultancy Services Pvt. Ltd.
@@ -0,0 +1,4 @@
1
+ import type { VibePluginFactory } from "@vibecontrols/plugin-sdk/contract";
2
+ export declare const createPlugin: VibePluginFactory;
3
+ export default createPlugin;
4
+ export { GitleaksProvider } from "./provider.js";
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ProviderRegistry,TelemetryEmitter,createLifecycleHooks}from"@vibecontrols/plugin-sdk";import{spawn}from"child_process";import{createHash}from"crypto";import{promises as fs}from"fs";import*as path from"path";import{normalizeSarif}from"@vibecontrols/vibe-plugin-security/normalizer";import{resolveToolPath}from"@vibecontrols/vibe-plugin-security/tool-installer";var GITLEAKS_VERSION="8.21.2",TOOLS_MANIFEST={gitleaks:{version:"8.21.2",binaryName:"gitleaks",versionMatcher:`${"8.21.2".replace(/\./g,"\\.")}`,downloads:{"linux-x64":{url:"https://github.com/gitleaks/gitleaks/releases/download/v8.21.2/gitleaks_8.21.2_linux_x64.tar.gz",sha256:"5bc41815076e6ed6ef8fbecc9d9b75bcae31f39029ceb55da08086315316e3ba",binaryWithinArchive:"gitleaks",archive:"tar.gz"},"linux-arm64":{url:"https://github.com/gitleaks/gitleaks/releases/download/v8.21.2/gitleaks_8.21.2_linux_arm64.tar.gz",sha256:"654c935542c89f565aabe7bf7c6c500830f116c114f0aeb509d2460c1ac2e6da",binaryWithinArchive:"gitleaks",archive:"tar.gz"},"darwin-x64":{url:"https://github.com/gitleaks/gitleaks/releases/download/v8.21.2/gitleaks_8.21.2_darwin_x64.tar.gz",sha256:"5b42c6e4b1fd693eaeb2b5b7faa5f17a1434299d4deb2de63d4b2efd7c753128",binaryWithinArchive:"gitleaks",archive:"tar.gz"},"darwin-arm64":{url:"https://github.com/gitleaks/gitleaks/releases/download/v8.21.2/gitleaks_8.21.2_darwin_arm64.tar.gz",sha256:"cad3de5dc9a4d5447d967a70a4d49499c557f04db028274cc324f9ff983f6502",binaryWithinArchive:"gitleaks",archive:"tar.gz"}}}};class GitleaksProvider{name="gitleaks";stage="pull_request.fast";toolVersion=GITLEAKS_VERSION;host;toolPath;active=new Map;async init(host){this.host=host}async ensureToolInstalled(){let dataDir=this.host?.getDataDir?.()??path.join(process.env.HOME??".",".boff/vibecontrols");this.toolPath=await resolveToolPath({dataDir,log:{info:(m)=>this.host?.logger?.info?.("gitleaks-provider",m),warn:(m)=>this.host?.logger?.warn?.("gitleaks-provider",m),error:(m)=>this.host?.logger?.error?.("gitleaks-provider",m)}},"gitleaks",TOOLS_MANIFEST.gitleaks)}async run(input){if(!this.toolPath)await this.ensureToolInstalled();if(!this.toolPath)throw Error("gitleaks-provider: toolPath unavailable");let cfg=input.config??{},sarifPath=path.join(input.workdir,"gitleaks.sarif"),args=["detect","--source",input.repoLocalPath,"--report-format","sarif","--report-path",sarifPath,"--no-banner","--exit-code","0"];if(cfg.configPath)args.push("--config",cfg.configPath);if(cfg.extraArgs)args.push(...cfg.extraArgs);let startedAt=Date.now();input.onProgress?.({pct:5,message:"Starting Gitleaks scan"});let result=await this.spawnAndWait(input.runId,args);if(result.code!==0&&result.code!==1)return{runId:input.runId,status:"errored",findings:[],evidence:[],durationMs:Date.now()-startedAt,summary:{critical:0,high:0,medium:0,low:0,info:0},errorReason:`gitleaks exited ${result.code}: ${result.stderr.slice(0,500)}`};input.onProgress?.({pct:80,message:"Parsing SARIF report"});let findings=[],evidence=[];try{let raw=await fs.readFile(sarifPath,"utf-8");findings=normalizeSarif(raw,this.name,"secret");let sha256=createHash("sha256").update(raw).digest("hex"),stat=await fs.stat(sarifPath);evidence=[{type:"sarif",localPath:sarifPath,sha256,sizeBytes:stat.size}]}catch(err){this.host?.logger?.warn?.("gitleaks-provider",`no SARIF produced: ${String(err)}`)}input.onProgress?.({pct:100,message:"Scan complete"});let summary=summarize(findings);return{runId:input.runId,status:"succeeded",findings,evidence,durationMs:Date.now()-startedAt,summary}}async cancel(runId){let child=this.active.get(runId);if(!child)return;try{child.kill("SIGTERM"),setTimeout(()=>{try{child.kill("SIGKILL")}catch{}},5000)}finally{this.active.delete(runId)}}metadata(){return{stage:this.stage,supportedProfiles:["backend","frontend","cli","sdk","mcp","chrome-extension","vscode-extension"],toolVersion:this.toolVersion,description:"Gitleaks SARIF-output secrets scan for pull_request.fast"}}spawnAndWait(runId,args){if(!this.toolPath)throw Error("gitleaks-provider: toolPath unavailable");return new Promise((resolve)=>{let child=spawn(this.toolPath,args,{stdio:["ignore","pipe","pipe"]});this.active.set(runId,child);let stdout="",stderr="";child.stdout?.on("data",(b)=>stdout+=b.toString()),child.stderr?.on("data",(b)=>stderr+=b.toString()),child.on("close",(code)=>{this.active.delete(runId),resolve({code,stdout,stderr})}),child.on("error",(err)=>{this.active.delete(runId),resolve({code:-1,stdout,stderr:err.message})})})}}function summarize(findings){let s={critical:0,high:0,medium:0,low:0,info:0};for(let f of findings)s[f.severity]++;return s}var PLUGIN_NAME="security-secrets-pr",PLUGIN_VERSION="2026.527.1",createPlugin=(_ctx)=>{let provider=new GitleaksProvider,telemetry=new TelemetryEmitter(PLUGIN_NAME,PLUGIN_VERSION),lifecycle=createLifecycleHooks({name:PLUGIN_NAME,telemetryEventName:"security.secrets-pr.ready",onInit:async(host)=>{await provider.init(host),new ProviderRegistry(host).registerProvider("security.secrets","gitleaks",provider),telemetry.emit("security.secrets-pr.registered",{provider:"gitleaks",toolVersion:provider.toolVersion})}});return{name:PLUGIN_NAME,version:PLUGIN_VERSION,description:"Gitleaks-backed secret scanner for the pull_request.fast lifecycle stage.",tags:["backend","provider","integration"],capabilities:{storage:"rw",subprocess:!0,audit:!0,telemetry:!0},onServerStart:lifecycle.onServerStart,onServerStop:lifecycle.onServerStop}},src_default=createPlugin;export{src_default as default,createPlugin,GitleaksProvider};
@@ -0,0 +1,16 @@
1
+ import type { HostServices } from "@vibecontrols/plugin-sdk/contract";
2
+ import type { SecurityProvider, SecurityProviderMetadata, SecurityScanInput, SecurityScanResult, SecurityStage } from "@vibecontrols/vibe-plugin-security/types";
3
+ export declare class GitleaksProvider implements SecurityProvider {
4
+ readonly name = "gitleaks";
5
+ readonly stage: SecurityStage;
6
+ readonly toolVersion = "8.21.2";
7
+ private host?;
8
+ private toolPath?;
9
+ private active;
10
+ init(host: HostServices): Promise<void>;
11
+ ensureToolInstalled(): Promise<void>;
12
+ run(input: SecurityScanInput): Promise<SecurityScanResult>;
13
+ cancel(runId: string): Promise<void>;
14
+ metadata(): SecurityProviderMetadata;
15
+ private spawnAndWait;
16
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Gitleaks binary manifest. sha256 values pinned to v8.21.2 release
3
+ * assets at https://github.com/gitleaks/gitleaks/releases/tag/v8.21.2.
4
+ *
5
+ * Updating the version is a deliberate, audited operation: bump the
6
+ * version + sha256 here, re-run sanity, publish a new CalVer release.
7
+ * The agent picks up the new pin via the new plugin version.
8
+ */
9
+ import type { ToolManifest } from "@vibecontrols/vibe-plugin-security/tool-installer";
10
+ export declare const GITLEAKS_VERSION = "8.21.2";
11
+ export declare const TOOLS_MANIFEST: ToolManifest;
package/package.json ADDED
@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "@vibecontrols/vibe-plugin-security-secrets-pr",
3
+ "version": "2026.528.1",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "description": "Gitleaks-backed secret scanner for the pull_request.fast lifecycle stage. Registers as a security.secrets provider with @vibecontrols/vibe-plugin-security.",
8
+ "engines": {
9
+ "bun": ">=1.3.14"
10
+ },
11
+ "author": {
12
+ "name": "Vignesh T.V",
13
+ "email": "vignesh@burdenoff.com",
14
+ "url": "https://github.com/tvvignesh"
15
+ },
16
+ "license": "SEE LICENSE IN LICENSE",
17
+ "scripts": {
18
+ "build": "bun build ./src/index.ts --outdir ./dist --target bun --minify-syntax --minify-whitespace --external elysia --external @vibecontrols/vibe-plugin-security --external @vibecontrols/plugin-sdk && tsc --emitDeclarationOnly --declaration --outDir ./dist",
19
+ "dev": "tsc --watch",
20
+ "lint": "eslint ./src ./tests",
21
+ "format": "bunx prettier . --write",
22
+ "format:check": "bunx prettier . --check",
23
+ "type:check": "tsc --noEmit",
24
+ "test": "bun test ./tests",
25
+ "clean": "rimraf dist",
26
+ "prebuild": "bun run clean",
27
+ "prepublishOnly": "bun run build",
28
+ "sanity": "bun run format:check && bun run lint && bun run type:check && bun run test && bun run build"
29
+ },
30
+ "dependencies": {
31
+ "@vibecontrols/plugin-sdk": "2026.527.1",
32
+ "@vibecontrols/vibe-plugin-security": "2026.528.1"
33
+ },
34
+ "devDependencies": {
35
+ "@eslint/js": "^10.0.1",
36
+ "@types/node": "^22.0.0",
37
+ "bun-types": "^1.3.9",
38
+ "eslint": "^9.30.1",
39
+ "globals": "^17.3.0",
40
+ "prettier": "^3.6.2",
41
+ "rimraf": "^6.0.1",
42
+ "typescript": "^5.9.3",
43
+ "typescript-eslint": "^8.56.0"
44
+ },
45
+ "peerDependencies": {
46
+ "@vibecontrols/agent": ">=2026.428.0"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "@vibecontrols/agent": {
50
+ "optional": true
51
+ }
52
+ },
53
+ "keywords": [
54
+ "vibecontrols",
55
+ "vibe",
56
+ "vibe-plugin",
57
+ "security",
58
+ "secrets",
59
+ "gitleaks",
60
+ "sast",
61
+ "pull-request",
62
+ "bun"
63
+ ],
64
+ "repository": {
65
+ "type": "git",
66
+ "url": "git+https://github.com/algoshred/vibe-plugin-security-secrets-pr.git"
67
+ },
68
+ "bugs": {
69
+ "url": "https://github.com/algoshred/vibe-plugin-security-secrets-pr/issues"
70
+ },
71
+ "homepage": "https://vibecontrols.com",
72
+ "publishConfig": {
73
+ "access": "public",
74
+ "registry": "https://registry.npmjs.org/"
75
+ },
76
+ "files": [
77
+ "dist/**/*",
78
+ "!dist/**/*.map",
79
+ "README.md",
80
+ "LICENSE"
81
+ ]
82
+ }