pinata-security-cli 0.2.3 → 0.4.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Pinata
2
2
 
3
- AI-powered security scanner that finds vulnerabilities hiding in your codebase. 45 detection categories across security, data integrity, concurrency, and performance domains.
3
+ AI-powered security scanner that finds vulnerabilities hiding in your codebase. 47 detection categories across security, data integrity, concurrency, and performance domains.
4
4
 
5
5
  ## Quick Start
6
6
 
@@ -42,20 +42,21 @@ pinata analyze .
42
42
  ```bash
43
43
  pinata analyze . # Fast scan
44
44
  pinata analyze . --verify # AI-verified scan
45
+ pinata analyze . --execute # Dynamic execution (requires Docker)
46
+ pinata analyze . --execute --dry-run # Preview tests without running
45
47
  pinata analyze . --confidence low # Include all matches
46
48
  pinata analyze . --output json # JSON output
47
49
  pinata analyze . --output sarif # SARIF for GitHub
48
50
  pinata generate --gaps # Generate tests for gaps
49
- pinata explain sql-injection src/db.ts:45 # AI explanation
50
- pinata dashboard # Interactive TUI
51
+ pinata audit-deps # Check npm dependencies
51
52
  pinata config set anthropic-api-key sk-ant-xxx
52
53
  ```
53
54
 
54
55
  ## Detection Categories
55
56
 
56
- 45 categories across 7 risk domains:
57
+ 47 categories across 7 risk domains:
57
58
 
58
- **Security (16)** - SQL injection, XSS, command injection, path traversal, SSRF, XXE, CSRF, deserialization, hardcoded secrets, LDAP injection, timing attacks, auth failures, file upload, data exposure, rate limiting, dependency risks
59
+ **Security (17)** - SQL injection, XSS, command injection, path traversal, SSRF, XXE, CSRF, deserialization, hardcoded secrets, LDAP injection, timing attacks, auth failures, file upload, data exposure, rate limiting, dependency risks, prompt injection
59
60
 
60
61
  **Data (8)** - Data race, truncation, precision loss, validation, null handling, encoding, schema migration, bulk operations
61
62
 
@@ -85,9 +86,12 @@ dist/
85
86
 
86
87
  ```bash
87
88
  --verify # AI verification (requires API key)
89
+ --execute # Dynamic test execution (requires Docker)
90
+ --dry-run # Preview generated tests without running
88
91
  --confidence <level> # high (default), medium, low
89
92
  --output <format> # terminal, json, sarif, junit, markdown
90
- --domain <domain> # security, data, concurrency, etc.
93
+ --output-file <path> # Write results to file (for SARIF upload)
94
+ --domains <domains> # security, data, concurrency, etc.
91
95
  --severity <level> # critical, high, medium, low
92
96
  --exclude <dirs> # Comma-separated directories to skip
93
97
  ```
@@ -114,23 +118,82 @@ pinata analyze . --verify
114
118
 
115
119
  **Performance:** ~2.5 minutes for 350 matches (batched 10/request, 3 concurrent)
116
120
 
121
+ ## Dynamic Execution (Layer 5)
122
+
123
+ The `--execute` flag runs generated exploit tests in a Docker sandbox to **prove** vulnerabilities exist:
124
+
125
+ ```bash
126
+ # Requires Docker
127
+ pinata analyze . --execute
128
+
129
+ # Preview tests without running
130
+ pinata analyze . --execute --dry-run
131
+ ```
132
+
133
+ **How it works:**
134
+ - Generates exploit tests for each vulnerability
135
+ - Runs tests in isolated Docker container (no network, limited resources)
136
+ - Reports **CONFIRMED** vs **POTENTIAL** vulnerabilities
137
+ - Evidence includes payload and actual exploit result
138
+
139
+ **Testable vulnerability types:**
140
+ - SQL injection (boolean blind, UNION attacks)
141
+ - XSS (script injection, innerHTML)
142
+ - Command injection (shell metacharacters)
143
+ - Path traversal (../ attacks)
144
+
145
+ **Security constraints:**
146
+ - Network disabled (no exfiltration)
147
+ - 1 CPU, 512MB RAM, 30s timeout
148
+ - Read-only filesystem, unprivileged user
149
+ - No capabilities
150
+
117
151
  ## CI/CD Integration
118
152
 
119
- **GitHub Actions**
153
+ **GitHub Action (recommended)**
154
+
120
155
  ```yaml
121
156
  name: Security Scan
122
157
  on: [push, pull_request]
123
158
 
124
159
  jobs:
125
- pinata:
160
+ security:
126
161
  runs-on: ubuntu-latest
162
+ permissions:
163
+ contents: read
164
+ security-events: write
127
165
  steps:
128
166
  - uses: actions/checkout@v4
129
- - name: Run Pinata
130
- run: npx --yes pinata-security-cli@latest analyze . --output sarif > results.sarif
131
- - uses: github/codeql-action/upload-sarif@v3
167
+ - uses: christiancattaneo/pinata-security@v1
132
168
  with:
133
- sarif_file: results.sarif
169
+ confidence: high
170
+ sarif-output: pinata.sarif
171
+ # Optional: AI verification
172
+ # with:
173
+ # verify: true
174
+ # env:
175
+ # ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
176
+ ```
177
+
178
+ **Action inputs:**
179
+ - `path` - Directory to scan (default: `.`)
180
+ - `confidence` - high, medium, low (default: `high`)
181
+ - `domains` - Comma-separated domains to scan
182
+ - `verify` - Enable AI verification (default: `false`)
183
+ - `fail-on-gaps` - Fail if gaps found (default: `true`)
184
+ - `sarif-output` - Path for SARIF file (auto-uploads to GitHub Security)
185
+
186
+ **Action outputs:**
187
+ - `score` - Pinata score (0-100)
188
+ - `gaps` - Number of gaps found
189
+ - `sarif-file` - Path to SARIF file
190
+
191
+ **Manual workflow (any CI)**
192
+ ```yaml
193
+ - run: npx --yes pinata-security-cli@latest analyze . --output sarif --output-file results.sarif
194
+ - uses: github/codeql-action/upload-sarif@v3
195
+ with:
196
+ sarif_file: results.sarif
134
197
  ```
135
198
 
136
199
  **GitLab CI**