You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+85-4Lines changed: 85 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,12 @@ VibeSafe helps developers quickly check their projects for common security issue
7
7
## Features
8
8
9
9
***Secret Scanning:** Detects potential secrets using regex patterns (AWS Keys, JWTs, SSH Keys, generic high-entropy strings) and specifically flags secrets found in `.env` files.
10
-
***Dependency Scanning:** Parses `package.json` (for npm/yarn projects) and checks dependencies against the OSV.dev vulnerability database for known CVEs.
11
-
***Configuration Scanning:** Checks JSON and YAML files for common insecure settings (e.g., `DEBUG = true`, `devMode = true`, permissive CORS like `origin: '*'`).
10
+
***Dependency Scanning:** Parses `package.json` (for npm/yarn projects) and checks dependencies against the OSV.dev vulnerability database for known CVEs.*(Note: Currently only scans direct dependencies listed in `package.json`. Lockfile analysis for precise versions and transitive dependencies is planned for a future update.)*
11
+
***Configuration Scanning:** Checks JSON and YAML files for common insecure settings (e.g., `DEBUG = true`, `devMode = true`, permissive CORS like `origin: '*'`)
12
12
***HTTP Client Issues:** Detects potential missing timeout or cancellation configurations in calls using `axios`, `fetch`, `got`, and `request`. (*See Limitations below*).
13
13
***Unvalidated Upload Detection:** Identifies potential missing file size/type restrictions in common upload libraries (`multer`, `formidable`, `express-fileupload`, `busboy`) and generic patterns (`new FormData()`, `<input type="file">`).
14
14
***Exposed Endpoint Detection:** Flags potentially sensitive endpoints (e.g., `/admin`, `/debug`, `/status`, `/info`, `/metrics`) in Express/Node.js applications using common routing patterns or string literals.
15
-
***Rate Limit Check (Heuristic):**Suggests reviewing rate limiting if Express/Node.js routes are detected in a file without an `express-rate-limit` import.
15
+
***Rate Limit Check (Heuristic):**Issues a project-level advisory if API routes are detected but no known rate-limiting package (e.g., `express-rate-limit`, `@upstash/ratelimit`) is found in dependencies.
16
16
***Improper Logging Detection:** Flags potential logging of full error objects (e.g., `console.error(err)`), which can leak stack traces, and detects logging of potentially sensitive data based on keywords (e.g., `password`, `email`, `token`).
17
17
***Multiple Output Formats:** Provides results via console output (with colors!), JSON (`--output`), or a Markdown report (`--report` with default `VIBESAFE-REPORT.md`).
18
18
***AI-Powered Suggestions (Optional):** Generates fix suggestions in the Markdown report using OpenAI (requires API key).
@@ -21,4 +21,85 @@ VibeSafe helps developers quickly check their projects for common security issue
21
21
22
22
## Installation
23
23
24
-
```
24
+
```bash
25
+
npm install -g vibesafe
26
+
```
27
+
28
+
*(Note: Currently, for local development, use `npm link` after building)*
29
+
30
+
## Usage
31
+
32
+
**Basic Scan (Current Directory):**
33
+
34
+
```bash
35
+
vibesafe scan
36
+
```
37
+
38
+
**Scan a Specific Directory:**
39
+
40
+
```bash
41
+
vibesafe scan ./path/to/your/project
42
+
```
43
+
44
+
**Output to JSON:**
45
+
46
+
```bash
47
+
vibesafe scan -o scan-results.json
48
+
```
49
+
50
+
**Generate Markdown Report:**
51
+
52
+
To generate a Markdown report, use the `-r` or `--report` flag. You can optionally provide a filename. If no filename is given, it defaults to `VIBESAFE-REPORT.md` in the scanned directory.
53
+
54
+
*With a specific filename:*
55
+
```bash
56
+
vibesafe scan -r scan-report.md
57
+
```
58
+
59
+
*Using the default filename (`VIBESAFE-REPORT.md`):*
60
+
```bash
61
+
vibesafe scan -r
62
+
# or
63
+
vibesafe scan --report
64
+
```
65
+
66
+
**Generate AI Report (Requires API Key):**
67
+
68
+
To generate fix suggestions in the Markdown report, you need an OpenAI API key.
69
+
70
+
1. Create a `.env` file in the root of the directory where you run `vibesafe` (or in the project root if running locally during development).
71
+
2. Add your key to the `.env` file:
72
+
```
73
+
OPENAI_API_KEY=sk-YourActualOpenAIKeyHere
74
+
```
75
+
3. Run the scan with the report flag:
76
+
```bash
77
+
vibesafe scan -r ai-report.md
78
+
```
79
+
80
+
**Show Only High/Critical Issues:**
81
+
82
+
```bash
83
+
vibesafe scan --high-only
84
+
```
85
+
86
+
## Ignoring Files (.vibesafeignore)
87
+
88
+
Create a `.vibesafeignore` file in the root of the directory being scanned. Add file paths or glob patterns (one per line) to exclude them from the scan. The syntax is the same as `.gitignore`.
89
+
90
+
**Example `.vibesafeignore**:
91
+
92
+
```
93
+
# Ignore all test data
94
+
test-data/
95
+
96
+
# Ignore a specific configuration file
97
+
config/legacy-secrets.conf
98
+
99
+
# Allow scanning a specific .env file if needed (overrides default info behavior)
100
+
# !.env.production
101
+
```
102
+
103
+
## License
104
+
105
+
This project uses a custom proprietary license. Please see the [LICENSE](LICENSE) file for details. TL;DR: Free to use, source visible, but no modification, copying, or redistribution allowed.
0 commit comments