secureflow-cli 2.8.2 → 2.10.0
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/README.md +338 -306
- package/dist/entropy.d.ts +4 -2
- package/dist/entropy.d.ts.map +1 -1
- package/dist/entropy.js +4 -2
- package/dist/entropy.js.map +1 -1
- package/dist/exporters.js +58 -58
- package/dist/index.js +118 -24
- package/dist/index.js.map +1 -1
- package/dist/lib/api-client.d.ts +58 -0
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +120 -1
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/audio-player.d.ts.map +1 -1
- package/dist/lib/audio-player.js +5 -2
- package/dist/lib/audio-player.js.map +1 -1
- package/dist/lib/local-mode.d.ts.map +1 -1
- package/dist/lib/local-mode.js +6 -1
- package/dist/lib/local-mode.js.map +1 -1
- package/dist/sarif.d.ts.map +1 -1
- package/dist/sarif.js +5 -1
- package/dist/sarif.js.map +1 -1
- package/dist/scanner.d.ts +4 -0
- package/dist/scanner.d.ts.map +1 -1
- package/dist/scanner.js +23 -5
- package/dist/scanner.js.map +1 -1
- package/dist/threat-intel.d.ts.map +1 -1
- package/dist/threat-intel.js +8 -3
- package/dist/threat-intel.js.map +1 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +5 -1
- package/dist/workspace.js.map +1 -1
- package/package.json +43 -43
package/README.md
CHANGED
|
@@ -1,306 +1,338 @@
|
|
|
1
|
-
# 🛡️ SecureFlow CLI (`secureflow-cli`)
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/secureflow-cli)
|
|
4
|
-
[](https://github.com/GauravKarakoti/SecureFlow/blob/main/LICENSE)
|
|
5
|
-
[](https://www.typescriptlang.org/)
|
|
6
|
-
[](https://modelcontextprotocol.io/)
|
|
7
|
-
|
|
8
|
-
**Pre-commit secret logging detector, AI vulnerability scanner, and Threat Intelligence MCP Server for modern developer workflows.**
|
|
9
|
-
|
|
10
|
-
The SecureFlow CLI intercepts code vulnerabilities and exposed secrets right at the developer terminal before commits reach remote repositories. It operates in both cloud-assisted and completely offline / air-gapped modes, features audio debriefs, and acts as an MCP server for AI coding assistants.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## 📋 Table of Contents
|
|
15
|
-
|
|
16
|
-
- [🌟 Features](#-features)
|
|
17
|
-
- [📦 Installation](#-installation)
|
|
18
|
-
- [🚀 Quick Start](#-quick-start)
|
|
19
|
-
- [🪝 Git Hook Setup (Husky)](#-git-hook-setup-husky)
|
|
20
|
-
- [📖 Command Line Reference](#-command-line-reference)
|
|
21
|
-
- [Options & Flags](#options--flags)
|
|
22
|
-
- [Failure Thresholds (`--fail-on`)](#failure-thresholds---fail-on)
|
|
23
|
-
- [Multi-Format Reports (`--format`)](#multi-format-reports---format)
|
|
24
|
-
- [🔒 Air-Gapped & Local Mode (`--local`)](#-air-gapped--local-mode---local)
|
|
25
|
-
- [🎙️ Audio Summary Debriefs (`--voice`)](#️-audio-summary-debriefs---voice)
|
|
26
|
-
- [🤖 Threat Intelligence MCP Server (`mcp`)](#-threat-intelligence-mcp-server-mcp)
|
|
27
|
-
- [Connecting to Cursor / Windsurf / Claude Desktop](#connecting-to-cursor--windsurf--claude-desktop)
|
|
28
|
-
- [Available MCP Tools](#available-mcp-tools)
|
|
29
|
-
- [⚙️ Configuration (`.secureflowignore`)](#️-configuration-secureflowignore)
|
|
30
|
-
- [🔄 CI/CD Pipeline Integration](#-cicd-pipeline-integration)
|
|
31
|
-
- [📄 License](#-license)
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## 🌟 Features
|
|
36
|
-
|
|
37
|
-
- **⚡ Instant Pre-Commit Scans**: Evaluates staged git files in milliseconds to prevent accidental secret leaks and credential logging.
|
|
38
|
-
- **🧠 Hybrid AI Security Analysis**: Combines deterministic heuristic pattern matching with LLM-backed vulnerability reasoning.
|
|
39
|
-
- **🔐 Air-Gapped / Zero-Upload Mode**: Run with `--local` to guarantee that code snippets never leave your workstation.
|
|
40
|
-
- **🎙️ Voice Debriefs (`--voice` / `-v`)**: Audio debriefs of scan findings directly in your terminal upon scan completion, with automatic headless CI bypass.
|
|
41
|
-
- **🤖 Built-in MCP Server**: `secureflow mcp` exposes live threat intelligence, CVE lookups, and ArmorIQ cryptographic intent verification over JSON-RPC stdio.
|
|
42
|
-
- **📊 Comprehensive Exporters**: Export audit-grade reports in **SARIF** (GitHub Code Scanning), **HTML**, **CSV** (formula injection hardened), **JSON**, and **Markdown**.
|
|
43
|
-
- **🚦 Configurable Quality Gates**: Strict build-failing control using `--fail-on <low|medium|high|critical>`.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## 📦 Installation
|
|
48
|
-
|
|
49
|
-
### Global Installation (Recommended)
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
npm install -g secureflow-cli
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Project Dev Dependency
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
npm install --save-dev secureflow-cli
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Run Instantly via `npx`
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
npx secureflow --help
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## 🚀 Quick Start
|
|
70
|
-
|
|
71
|
-
1. **Stage your changes in git:**
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
git add src/
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
2. **Run the security scanner:**
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
secureflow
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
3. **Run with an audio summary debrief:**
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
secureflow --voice
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
4. **Export a SARIF report for GitHub Code Scanning:**
|
|
90
|
-
```bash
|
|
91
|
-
secureflow --format sarif -o results.sarif
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## 🪝 Git Hook Setup (Husky)
|
|
97
|
-
|
|
98
|
-
Prevent sensitive data from ever entering your git history by configuring SecureFlow in your pre-commit hook:
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
# Initialize husky in your project
|
|
102
|
-
npx husky init
|
|
103
|
-
|
|
104
|
-
# Add secureflow to your pre-commit hook
|
|
105
|
-
echo "npx secureflow --fail-on high" > .husky/pre-commit
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
Now, every `git commit` automatically triggers a security check on staged files. If a high or critical finding is detected, the commit is safely blocked.
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## 📖 Command Line Reference
|
|
113
|
-
|
|
114
|
-
```text
|
|
115
|
-
Usage:
|
|
116
|
-
secureflow [options]
|
|
117
|
-
secureflow mcp [options]
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
| `--
|
|
132
|
-
| `--
|
|
133
|
-
| `--
|
|
134
|
-
| `--
|
|
135
|
-
| `--
|
|
136
|
-
| `--
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
secureflow --
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
secureflow -
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
1
|
+
# 🛡️ SecureFlow CLI (`secureflow-cli`)
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/secureflow-cli)
|
|
4
|
+
[](https://github.com/GauravKarakoti/SecureFlow/blob/main/LICENSE)
|
|
5
|
+
[](https://www.typescriptlang.org/)
|
|
6
|
+
[](https://modelcontextprotocol.io/)
|
|
7
|
+
|
|
8
|
+
**Pre-commit secret logging detector, AI vulnerability scanner, and Threat Intelligence MCP Server for modern developer workflows.**
|
|
9
|
+
|
|
10
|
+
The SecureFlow CLI intercepts code vulnerabilities and exposed secrets right at the developer terminal before commits reach remote repositories. It operates in both cloud-assisted and completely offline / air-gapped modes, features audio debriefs, and acts as an MCP server for AI coding assistants.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 📋 Table of Contents
|
|
15
|
+
|
|
16
|
+
- [🌟 Features](#-features)
|
|
17
|
+
- [📦 Installation](#-installation)
|
|
18
|
+
- [🚀 Quick Start](#-quick-start)
|
|
19
|
+
- [🪝 Git Hook Setup (Husky)](#-git-hook-setup-husky)
|
|
20
|
+
- [📖 Command Line Reference](#-command-line-reference)
|
|
21
|
+
- [Options & Flags](#options--flags)
|
|
22
|
+
- [Failure Thresholds (`--fail-on`)](#failure-thresholds---fail-on)
|
|
23
|
+
- [Multi-Format Reports (`--format`)](#multi-format-reports---format)
|
|
24
|
+
- [🔒 Air-Gapped & Local Mode (`--local`)](#-air-gapped--local-mode---local)
|
|
25
|
+
- [🎙️ Audio Summary Debriefs (`--voice`)](#️-audio-summary-debriefs---voice)
|
|
26
|
+
- [🤖 Threat Intelligence MCP Server (`mcp`)](#-threat-intelligence-mcp-server-mcp)
|
|
27
|
+
- [Connecting to Cursor / Windsurf / Claude Desktop](#connecting-to-cursor--windsurf--claude-desktop)
|
|
28
|
+
- [Available MCP Tools](#available-mcp-tools)
|
|
29
|
+
- [⚙️ Configuration (`.secureflowignore`)](#️-configuration-secureflowignore)
|
|
30
|
+
- [🔄 CI/CD Pipeline Integration](#-cicd-pipeline-integration)
|
|
31
|
+
- [📄 License](#-license)
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 🌟 Features
|
|
36
|
+
|
|
37
|
+
- **⚡ Instant Pre-Commit Scans**: Evaluates staged git files in milliseconds to prevent accidental secret leaks and credential logging.
|
|
38
|
+
- **🧠 Hybrid AI Security Analysis**: Combines deterministic heuristic pattern matching with LLM-backed vulnerability reasoning.
|
|
39
|
+
- **🔐 Air-Gapped / Zero-Upload Mode**: Run with `--local` to guarantee that code snippets never leave your workstation.
|
|
40
|
+
- **🎙️ Voice Debriefs (`--voice` / `-v`)**: Audio debriefs of scan findings directly in your terminal upon scan completion, with automatic headless CI bypass.
|
|
41
|
+
- **🤖 Built-in MCP Server**: `secureflow mcp` exposes live threat intelligence, CVE lookups, and ArmorIQ cryptographic intent verification over JSON-RPC stdio.
|
|
42
|
+
- **📊 Comprehensive Exporters**: Export audit-grade reports in **SARIF** (GitHub Code Scanning), **HTML**, **CSV** (formula injection hardened), **JSON**, and **Markdown**.
|
|
43
|
+
- **🚦 Configurable Quality Gates**: Strict build-failing control using `--fail-on <low|medium|high|critical>`.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 📦 Installation
|
|
48
|
+
|
|
49
|
+
### Global Installation (Recommended)
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install -g secureflow-cli
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Project Dev Dependency
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm install --save-dev secureflow-cli
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Run Instantly via `npx`
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npx secureflow --help
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## 🚀 Quick Start
|
|
70
|
+
|
|
71
|
+
1. **Stage your changes in git:**
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
git add src/
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
2. **Run the security scanner:**
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
secureflow
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
3. **Run with an audio summary debrief:**
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
secureflow --voice
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
4. **Export a SARIF report for GitHub Code Scanning:**
|
|
90
|
+
```bash
|
|
91
|
+
secureflow --format sarif -o results.sarif
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 🪝 Git Hook Setup (Husky)
|
|
97
|
+
|
|
98
|
+
Prevent sensitive data from ever entering your git history by configuring SecureFlow in your pre-commit hook:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Initialize husky in your project
|
|
102
|
+
npx husky init
|
|
103
|
+
|
|
104
|
+
# Add secureflow to your pre-commit hook
|
|
105
|
+
echo "npx secureflow --fail-on high" > .husky/pre-commit
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Now, every `git commit` automatically triggers a security check on staged files. If a high or critical finding is detected, the commit is safely blocked.
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 📖 Command Line Reference
|
|
113
|
+
|
|
114
|
+
```text
|
|
115
|
+
Usage:
|
|
116
|
+
secureflow [options]
|
|
117
|
+
secureflow mcp [options]
|
|
118
|
+
secureflow sbom <file> [options]
|
|
119
|
+
secureflow explain --web3 [options]
|
|
120
|
+
|
|
121
|
+
Commands:
|
|
122
|
+
mcp Start the Threat Intelligence Model Context Protocol (MCP) server over stdio
|
|
123
|
+
sbom <file> Scan software bill of materials (package.json, requirements.txt) for vulnerabilities
|
|
124
|
+
explain --web3 Generate AI security analysis and remediation for Web3 / Smart Contract findings
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Options & Flags
|
|
128
|
+
|
|
129
|
+
| Flag | Shorthand | Default | Description |
|
|
130
|
+
| :--------------------- | :-------- | :------------------ | :------------------------------------------------------------------------------------------------- |
|
|
131
|
+
| `--fail-on <level>` | | `medium` | Exit with error code `1` if findings meet or exceed severity (`low`, `medium`, `high`, `critical`) |
|
|
132
|
+
| `--format <format>` | | `text` | Output report format: `text`, `json`, `sarif`, `csv`, `html`, `markdown` |
|
|
133
|
+
| `--output <path>` | `-o` | `stdout` | Write report to the specified file path |
|
|
134
|
+
| `--poll` | | `false` | Poll SBOM scan status until background worker processing completes |
|
|
135
|
+
| `--file <path>` | | | Target file for smart contract analysis with `explain --web3` |
|
|
136
|
+
| `--finding-type <id>` | | | Vulnerability type (e.g. Reentrancy, Overflow) for `explain --web3` |
|
|
137
|
+
| `--voice` | `-v` | `false` | Play an audio debrief of findings in your terminal upon completion |
|
|
138
|
+
| `--local` | | `false` | Skip cloud AI upload and run fully local pattern analysis |
|
|
139
|
+
| `--local-model <tag>` | | `llama3` | Specify local model tag when using local AI providers |
|
|
140
|
+
| `--ignore-file <path>` | | `.secureflowignore` | Custom path to ignore configuration file |
|
|
141
|
+
| `--dry-run` | | `false` | Simulate scan execution without writing output files |
|
|
142
|
+
| `--verbose` | | `false` | Enable verbose diagnostic logging |
|
|
143
|
+
| `--help` | `-h` | | Display CLI usage instructions and exit |
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
### 📦 SBOM Scanning (`secureflow sbom`)
|
|
148
|
+
|
|
149
|
+
Scan third-party dependencies directly against OSV vulnerability databases via background queue processing:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Enqueue a scan for a package.json manifest
|
|
153
|
+
secureflow sbom package.json
|
|
154
|
+
|
|
155
|
+
# Enqueue and poll until background scan finishes
|
|
156
|
+
secureflow sbom requirements.txt --poll
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
### 🧠 Web3 Security Explanations (`secureflow explain --web3`)
|
|
162
|
+
|
|
163
|
+
Audit smart contracts (Solidity, Soroban/Rust, Circom, Leo) with domain-specific AI analysis and remediation patterns:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# Analyze a Solidity contract for reentrancy vectors
|
|
167
|
+
secureflow explain --web3 --file contracts/Vault.sol --finding-type Reentrancy
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### Failure Thresholds (`--fail-on`)
|
|
173
|
+
|
|
174
|
+
Control the sensitivity of the pre-commit gate:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
# Block only on high and critical findings (standard CI recommendation)
|
|
178
|
+
secureflow --fail-on high
|
|
179
|
+
|
|
180
|
+
# Strict zero-tolerance gate (blocks on any finding, including low)
|
|
181
|
+
secureflow --fail-on low
|
|
182
|
+
|
|
183
|
+
# Allow commits while logging warnings
|
|
184
|
+
secureflow --fail-on none
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
### Multi-Format Reports (`--format`)
|
|
190
|
+
|
|
191
|
+
- **Text (`text`)**: Clean, ANSI-colored terminal overview with source code context snippets.
|
|
192
|
+
- **SARIF (`sarif`)**: Industry-standard OASIS SARIF 2.1.0 format, ready for direct upload to GitHub Security tab.
|
|
193
|
+
- **HTML (`html`)**: Self-contained, responsive HTML report suitable for sharing and compliance reviews.
|
|
194
|
+
- **CSV (`csv`)**: Formatted tabular output hardened against spreadsheet formula injection (CWE-1236).
|
|
195
|
+
- **JSON (`json`)**: Machine-readable JSON object representing findings and metadata.
|
|
196
|
+
- **Markdown (`markdown` / `md`)**: GitHub-Flavored Markdown table with sanitized code fences.
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
secureflow --format html -o security-report.html
|
|
200
|
+
secureflow --format sarif -o results.sarif
|
|
201
|
+
secureflow --format markdown -o findings.md
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## 🔒 Air-Gapped & Local Mode (`--local`)
|
|
207
|
+
|
|
208
|
+
When handling proprietary or classified source code, use the `--local` flag:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
secureflow --local
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Guarantees under `--local`:
|
|
215
|
+
|
|
216
|
+
- **Zero Cloud Uploads**: The hosted AI API pass (`/api/cli/scan`) is completely bypassed.
|
|
217
|
+
- **Staged Code Stays Local**: File contents are parsed and scanned strictly in-memory on your local machine.
|
|
218
|
+
- **Compatible with Local Models**: Seamlessly pairs with local Ollama or vLLM deployments (`--local-model <tag>`).
|
|
219
|
+
|
|
220
|
+
For hardware requirements, VRAM sizing, and fallback configuration, see the [Local Model & VRAM Guide](../docs/local-inference.md).
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## 🎙️ Audio Summary Debriefs (`--voice`)
|
|
225
|
+
|
|
226
|
+
Listen to hands-free voice briefings of scan findings right in your terminal:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
secureflow --voice
|
|
230
|
+
# or shorthand
|
|
231
|
+
secureflow -v
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Capabilities:
|
|
235
|
+
|
|
236
|
+
- **Native OS Playback**:
|
|
237
|
+
- macOS: `afplay`
|
|
238
|
+
- Windows: PowerShell `System.Media.SoundPlayer` / `Windows.Media.Playback`
|
|
239
|
+
- Linux: `mpg123` or `aplay`
|
|
240
|
+
- **Fallback**: Automatically saves findings to `secureflow-summary.mp3` if no audio player is present.
|
|
241
|
+
- **CI Safe**: Detects non-interactive environments (`CI=true`, `GITHUB_ACTIONS=true`) and silently skips playback without stalling build runners.
|
|
242
|
+
- **ElevenLabs Integration**: Synthesizes natural voice summaries if `ELEVENLABS_API_KEY` is present.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## 🤖 Threat Intelligence MCP Server (`mcp`)
|
|
247
|
+
|
|
248
|
+
SecureFlow CLI doubles as a **Model Context Protocol (MCP)** server, allowing AI agents in **Cursor**, **Windsurf**, **Claude Desktop**, or **Antigravity** to query threat intelligence and verify tool actions against ArmorIQ policy boundaries.
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
secureflow mcp
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Connecting to Cursor / Windsurf / Claude Desktop
|
|
255
|
+
|
|
256
|
+
Add this configuration to your `claude_desktop_config.json` or Cursor MCP settings:
|
|
257
|
+
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"mcpServers": {
|
|
261
|
+
"secureflow": {
|
|
262
|
+
"command": "npx",
|
|
263
|
+
"args": ["-y", "secureflow-cli", "mcp"]
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Available MCP Tools
|
|
270
|
+
|
|
271
|
+
| Tool | Parameters | Description |
|
|
272
|
+
| :-------------------------- | :-------------------------------------- | :------------------------------------------------------------------------------------------ |
|
|
273
|
+
| `query_threat_intelligence` | `query: string`, `intentToken?: string` | Search CVE and threat intelligence databases for vulnerabilities and remediation guidance. |
|
|
274
|
+
| `lookup_cve` | `cveId: string`, `intentToken?: string` | Look up detailed advisories, severity scores, and fix patterns for a CVE or CWE identifier. |
|
|
275
|
+
|
|
276
|
+
_All MCP tool calls are gated behind ArmorIQ cryptographic intent verification to enforce zero-trust boundary compliance and mitigate Prompt Injection (CWE-94)._
|
|
277
|
+
|
|
278
|
+
For comprehensive IDE configuration steps, intent signing keys, and manual testing instructions, see the dedicated [Threat Intelligence MCP Server Guide](../docs/mcp-server.md).
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## ⚙️ Configuration (`.secureflowignore`)
|
|
283
|
+
|
|
284
|
+
Define exclusion patterns and placeholder allowances in `.secureflowignore` at the root of your project:
|
|
285
|
+
|
|
286
|
+
```gitignore
|
|
287
|
+
# Ignore specific directories and generated bundles
|
|
288
|
+
dist/
|
|
289
|
+
coverage/
|
|
290
|
+
node_modules/
|
|
291
|
+
*.min.js
|
|
292
|
+
|
|
293
|
+
# Ignore documentation examples
|
|
294
|
+
docs/samples/**
|
|
295
|
+
|
|
296
|
+
# Allow safe mock/test tokens
|
|
297
|
+
[placeholders]
|
|
298
|
+
mock-token-*
|
|
299
|
+
test_api_key_dummy
|
|
300
|
+
EXAMPLE_SECRET
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## 🔄 CI/CD Pipeline Integration
|
|
306
|
+
|
|
307
|
+
### GitHub Actions Workflow
|
|
308
|
+
|
|
309
|
+
```yaml
|
|
310
|
+
name: Security Scan
|
|
311
|
+
on: [push, pull_request]
|
|
312
|
+
|
|
313
|
+
jobs:
|
|
314
|
+
secureflow-scan:
|
|
315
|
+
runs-on: ubuntu-latest
|
|
316
|
+
steps:
|
|
317
|
+
- uses: actions/checkout@v4
|
|
318
|
+
|
|
319
|
+
- name: Setup Node.js
|
|
320
|
+
uses: actions/setup-node@v4
|
|
321
|
+
with:
|
|
322
|
+
node-version: 20
|
|
323
|
+
|
|
324
|
+
- name: Run SecureFlow Scanner
|
|
325
|
+
run: npx secureflow-cli --format sarif -o results.sarif --fail-on high
|
|
326
|
+
|
|
327
|
+
- name: Upload SARIF to GitHub Security tab
|
|
328
|
+
if: always()
|
|
329
|
+
uses: github/codeql-action/upload-sarif@v3
|
|
330
|
+
with:
|
|
331
|
+
sarif_file: results.sarif
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## 📄 License
|
|
337
|
+
|
|
338
|
+
This package is licensed under the [ISC License](https://github.com/GauravKarakoti/SecureFlow/blob/main/LICENSE). Built with ❤️ by the SecureFlow Team.
|