@securitychecks/cli 0.1.1-rc.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 +87 -0
- package/README.md +207 -0
- package/bin/scheck.js +17 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7254 -0
- package/dist/index.js.map +1 -0
- package/dist/lib.d.ts +908 -0
- package/dist/lib.js +2187 -0
- package/dist/lib.js.map +1 -0
- package/package.json +67 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
SecurityChecks Proprietary License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2026 SecurityChecks. All rights reserved.
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS
|
|
6
|
+
|
|
7
|
+
1. DEFINITIONS
|
|
8
|
+
|
|
9
|
+
"Software" means the SecurityChecks CLI, collector, MCP server, and all
|
|
10
|
+
associated documentation, source code, and compiled binaries.
|
|
11
|
+
|
|
12
|
+
"License Key" means a valid subscription key obtained from SecurityChecks.
|
|
13
|
+
|
|
14
|
+
"Free Tier" means usage of the Software without a License Key, subject to
|
|
15
|
+
the limitations described in Section 3.
|
|
16
|
+
|
|
17
|
+
2. GRANT OF LICENSE
|
|
18
|
+
|
|
19
|
+
Subject to the terms of this License, SecurityChecks grants you a limited,
|
|
20
|
+
non-exclusive, non-transferable license to:
|
|
21
|
+
|
|
22
|
+
a) Install and use the Software for your internal business purposes
|
|
23
|
+
b) Make copies of the Software for backup purposes only
|
|
24
|
+
c) Use the Software in continuous integration/continuous deployment pipelines
|
|
25
|
+
|
|
26
|
+
3. FREE TIER LIMITATIONS
|
|
27
|
+
|
|
28
|
+
Without a valid License Key, you may use the Software subject to:
|
|
29
|
+
|
|
30
|
+
a) Maximum of 10 scans per calendar month
|
|
31
|
+
b) Basic finding output only (no SARIF export)
|
|
32
|
+
c) No access to calibration API features
|
|
33
|
+
d) No access to Pro patterns
|
|
34
|
+
e) Community support only
|
|
35
|
+
|
|
36
|
+
4. RESTRICTIONS
|
|
37
|
+
|
|
38
|
+
You may NOT:
|
|
39
|
+
|
|
40
|
+
a) Distribute, sublicense, lease, rent, or lend the Software to third parties
|
|
41
|
+
b) Modify, adapt, translate, reverse engineer, decompile, or disassemble the Software
|
|
42
|
+
c) Remove or alter any proprietary notices, labels, or marks on the Software
|
|
43
|
+
d) Use the Software to create a competing product or service
|
|
44
|
+
e) Share or publish License Keys
|
|
45
|
+
f) Circumvent any license enforcement mechanisms
|
|
46
|
+
g) Use the Software for illegal purposes
|
|
47
|
+
|
|
48
|
+
5. INTELLECTUAL PROPERTY
|
|
49
|
+
|
|
50
|
+
The Software and all copies thereof are proprietary to SecurityChecks and
|
|
51
|
+
title thereto remains exclusively with SecurityChecks. All rights in the
|
|
52
|
+
Software not specifically granted in this License are reserved to SecurityChecks.
|
|
53
|
+
|
|
54
|
+
6. DISCLAIMER OF WARRANTY
|
|
55
|
+
|
|
56
|
+
THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
57
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
58
|
+
FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
|
|
59
|
+
|
|
60
|
+
7. LIMITATION OF LIABILITY
|
|
61
|
+
|
|
62
|
+
IN NO EVENT SHALL SECURITYCHECKS BE LIABLE FOR ANY INDIRECT, INCIDENTAL,
|
|
63
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR IN CONNECTION
|
|
64
|
+
WITH THIS LICENSE OR THE USE OF THE SOFTWARE.
|
|
65
|
+
|
|
66
|
+
8. TERMINATION
|
|
67
|
+
|
|
68
|
+
This License is effective until terminated. SecurityChecks may terminate
|
|
69
|
+
this License immediately if you breach any term. Upon termination, you must
|
|
70
|
+
destroy all copies of the Software in your possession.
|
|
71
|
+
|
|
72
|
+
9. GOVERNING LAW
|
|
73
|
+
|
|
74
|
+
This License shall be governed by and construed in accordance with the laws
|
|
75
|
+
of the State of Delaware, United States, without regard to its conflict of
|
|
76
|
+
law provisions.
|
|
77
|
+
|
|
78
|
+
10. ENTIRE AGREEMENT
|
|
79
|
+
|
|
80
|
+
This License constitutes the entire agreement between you and SecurityChecks
|
|
81
|
+
regarding the Software and supersedes all prior agreements and understandings.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
For licensing inquiries: licensing@securitychecks.ai
|
|
86
|
+
For support: support@securitychecks.ai
|
|
87
|
+
Website: https://securitychecks.ai
|
package/README.md
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# @securitychecks/cli
|
|
2
|
+
|
|
3
|
+
Enforce backend invariants in your codebase. Find authorization gaps, race conditions, and transaction bugs before they ship.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx @securitychecks/cli run
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
That's it. No signup required. The CLI runs locally and your code never leaves your machine.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Global install
|
|
17
|
+
npm install -g @securitychecks/cli
|
|
18
|
+
|
|
19
|
+
# Then run
|
|
20
|
+
scheck run
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## What It Checks
|
|
24
|
+
|
|
25
|
+
SecurityChecks enforces backend invariants that cause production incidents:
|
|
26
|
+
|
|
27
|
+
| Invariant | What It Catches |
|
|
28
|
+
|-----------|-----------------|
|
|
29
|
+
| `AUTHZ.SERVICE_LAYER` | Service methods callable without authorization |
|
|
30
|
+
| `WEBHOOK.IDEMPOTENT` | Webhooks that double-process on retry |
|
|
31
|
+
| `WEBHOOK.SIGNATURE.VERIFIED` | Unverified webhook signatures |
|
|
32
|
+
| `TRANSACTION.SIDE_EFFECTS` | Emails/notifications sent before commit |
|
|
33
|
+
| `CACHE.INVALIDATION` | Stale permissions after auth changes |
|
|
34
|
+
| `DATAFLOW.UNTRUSTED.SQL` | SQL injection via string interpolation |
|
|
35
|
+
| `AUTHZ.RLS.MULTI_TENANT` | Missing tenant isolation in queries |
|
|
36
|
+
|
|
37
|
+
## Commands
|
|
38
|
+
|
|
39
|
+
### `scheck run`
|
|
40
|
+
|
|
41
|
+
Scan your codebase for security invariants.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Basic scan
|
|
45
|
+
scheck run
|
|
46
|
+
|
|
47
|
+
# Scan specific path
|
|
48
|
+
scheck run --path ./src
|
|
49
|
+
|
|
50
|
+
# CI mode - fail on new violations
|
|
51
|
+
scheck run --ci
|
|
52
|
+
|
|
53
|
+
# Output as JSON
|
|
54
|
+
scheck run --json
|
|
55
|
+
|
|
56
|
+
# Generate SARIF report (for GitHub Code Scanning)
|
|
57
|
+
scheck run --sarif report.sarif
|
|
58
|
+
|
|
59
|
+
# Only check changed files
|
|
60
|
+
scheck run --changed
|
|
61
|
+
|
|
62
|
+
# Watch mode
|
|
63
|
+
scheck run --watch
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Options:**
|
|
67
|
+
- `-p, --path <path>` - Target path (default: current directory)
|
|
68
|
+
- `--changed` - Only check changed files (requires git)
|
|
69
|
+
- `--ci` - CI mode - fail on new violations
|
|
70
|
+
- `--all` - Show all findings including P2
|
|
71
|
+
- `--only <invariants...>` - Only run specific checks
|
|
72
|
+
- `--skip <invariants...>` - Skip specific checks
|
|
73
|
+
- `--json` - Output as JSON
|
|
74
|
+
- `--sarif <path>` - Write SARIF report
|
|
75
|
+
- `-v, --verbose` - Verbose output
|
|
76
|
+
- `-w, --watch` - Watch for changes
|
|
77
|
+
|
|
78
|
+
### `scheck explain <invariant>`
|
|
79
|
+
|
|
80
|
+
Get a deep-dive on any invariant - why it matters, what good looks like.
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
scheck explain AUTHZ.SERVICE_LAYER
|
|
84
|
+
scheck explain WEBHOOK.IDEMPOTENT
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### `scheck list-invariants`
|
|
88
|
+
|
|
89
|
+
List all supported invariants (optionally filtered).
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Human-readable list
|
|
93
|
+
scheck list-invariants
|
|
94
|
+
|
|
95
|
+
# Filter by severity/category
|
|
96
|
+
scheck list-invariants --severity P0
|
|
97
|
+
scheck list-invariants --category webhooks
|
|
98
|
+
|
|
99
|
+
# JSON for scripting
|
|
100
|
+
scheck list-invariants --json
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### `scheck generate-test <invariantId>`
|
|
104
|
+
|
|
105
|
+
Generate a test skeleton that proves an invariant is enforced.
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
scheck generate-test WEBHOOK.IDEMPOTENT
|
|
109
|
+
scheck generate-test AUTHZ.SERVICE_LAYER.ENFORCED --framework jest
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### `scheck baseline`
|
|
113
|
+
|
|
114
|
+
Manage known issues so you can adopt incrementally.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Mark current findings as known
|
|
118
|
+
scheck baseline --update
|
|
119
|
+
|
|
120
|
+
# Show current baseline
|
|
121
|
+
scheck baseline --show
|
|
122
|
+
|
|
123
|
+
# Remove stale entries
|
|
124
|
+
scheck baseline --prune
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### `scheck waive <findingId>`
|
|
128
|
+
|
|
129
|
+
Temporarily waive a finding with a reason and expiration.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
scheck waive AUTHZ.SERVICE_LAYER:src/services/user.ts:42 \
|
|
133
|
+
--reason-key will_fix_later \
|
|
134
|
+
--reason "Auth handled by upstream middleware" \
|
|
135
|
+
--expires 30d
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### `scheck init`
|
|
139
|
+
|
|
140
|
+
Initialize SecurityChecks in your project.
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Basic init
|
|
144
|
+
scheck init
|
|
145
|
+
|
|
146
|
+
# With git pre-commit hook
|
|
147
|
+
scheck init --hooks
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### `scheck feedback <invariantId>`
|
|
151
|
+
|
|
152
|
+
Report whether a finding was a true positive or false positive.
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
scheck feedback WEBHOOK.IDEMPOTENT --verdict fp --reason not_applicable
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Cloud Features (Optional)
|
|
159
|
+
|
|
160
|
+
Connect to SecurityChecks cloud for dashboards, team collaboration, and CI integration.
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Login with API key
|
|
164
|
+
scheck login --api-key sk_xxx
|
|
165
|
+
|
|
166
|
+
# Or set environment variable
|
|
167
|
+
export SECURITYCHECKS_API_KEY=sk_xxx
|
|
168
|
+
|
|
169
|
+
# Sync findings to dashboard
|
|
170
|
+
scheck sync --project my-project
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Get your API key at [securitychecks.ai](https://securitychecks.ai).
|
|
174
|
+
|
|
175
|
+
## CI Integration
|
|
176
|
+
|
|
177
|
+
### GitHub Actions
|
|
178
|
+
|
|
179
|
+
```yaml
|
|
180
|
+
- name: Run SecurityChecks
|
|
181
|
+
run: npx @securitychecks/cli run --ci
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### With baseline (recommended)
|
|
185
|
+
|
|
186
|
+
```yaml
|
|
187
|
+
- name: Run SecurityChecks
|
|
188
|
+
run: |
|
|
189
|
+
npx @securitychecks/cli run --ci
|
|
190
|
+
# Fails only on NEW findings, not baselined ones
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Privacy
|
|
194
|
+
|
|
195
|
+
- **Local execution**: All analysis runs on your machine
|
|
196
|
+
- **No code upload**: Your code never leaves your environment
|
|
197
|
+
- **Cloud optional**: Dashboard sync is opt-in only
|
|
198
|
+
|
|
199
|
+
## Links
|
|
200
|
+
|
|
201
|
+
- [Documentation](https://securitychecks.ai/docs)
|
|
202
|
+
- [Invariant Reference](https://securitychecks.ai/docs/invariants)
|
|
203
|
+
- [GitHub](https://github.com/CodeWheel-AI/securitychecks)
|
|
204
|
+
|
|
205
|
+
## License
|
|
206
|
+
|
|
207
|
+
Proprietary. See [LICENSE](../../LICENSE) for details.
|
package/bin/scheck.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import { dirname, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const entry = resolve(here, '../dist/index.js');
|
|
9
|
+
|
|
10
|
+
if (!existsSync(entry)) {
|
|
11
|
+
console.error(
|
|
12
|
+
'scheck build artifacts are missing. Run `pnpm --filter @securitychecks/cli build` first.'
|
|
13
|
+
);
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
await import(entry);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|