mpx-scan 1.0.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/LICENSE ADDED
@@ -0,0 +1,32 @@
1
+ Mesaplex Dual License
2
+
3
+ Copyright (c) 2026 Mesaplex
4
+
5
+ This software is available under two licensing options:
6
+
7
+ 1. FREE TIER (Personal Use)
8
+ - 3 scans per day
9
+ - Basic security checks (headers, SSL, server)
10
+ - Personal and non-commercial use only
11
+ - No JSON export or advanced features
12
+
13
+ Permission is granted to use this software for personal, non-commercial
14
+ purposes subject to the daily scan limit.
15
+
16
+ 2. PRO LICENSE (Commercial Use)
17
+ - Unlimited scans
18
+ - All security checks (DNS, cookies, SRI, exposed files, etc.)
19
+ - JSON/CSV export
20
+ - CI/CD integration
21
+ - Commercial use allowed
22
+ - Priority support
23
+
24
+ To obtain a Pro license, visit: https://mesaplex.com/mpx-scan
25
+
26
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,277 @@
1
+ # mpx-scan šŸ”
2
+
3
+ **Professional website security scanner for developers**
4
+
5
+ Check your site's security headers, SSL/TLS configuration, DNS settings, and get actionable fix suggestions — all from your terminal.
6
+
7
+ Part of the [Mesaplex](https://mesaplex.com) developer toolchain.
8
+
9
+ [![npm version](https://img.shields.io/npm/v/mpx-scan.svg)](https://www.npmjs.com/package/mpx-scan)
10
+ [![License](https://img.shields.io/badge/license-Dual-blue.svg)](LICENSE)
11
+
12
+ ## ✨ Features
13
+
14
+ - **Zero-config security scanning** — just point it at a URL
15
+ - **Beautiful terminal output** with color-coded results
16
+ - **Actionable fix suggestions** — copy-paste config for nginx, Apache, Caddy, Cloudflare
17
+ - **Fast** — scans complete in seconds
18
+ - **Zero native dependencies** — installs cleanly everywhere
19
+ - **CI/CD ready** — JSON output and exit codes for automated testing
20
+
21
+ ### Security Checks
22
+
23
+ - āœ… HTTP security headers (CSP, HSTS, X-Frame-Options, etc.)
24
+ - āœ… SSL/TLS certificate validity, expiration, protocol version
25
+ - āœ… Cookie security flags (Secure, HttpOnly, SameSite)
26
+ - āœ… Server information leakage
27
+ - āœ… CORS misconfiguration
28
+ - āœ… Mixed content detection
29
+ - āœ… DNS security (DNSSEC, CAA records) — *Pro only*
30
+ - āœ… Subresource Integrity (SRI) — *Pro only*
31
+ - āœ… Open redirect detection — *Pro only*
32
+ - āœ… Exposed sensitive files — *Pro only*
33
+
34
+ ## šŸš€ Quick Start
35
+
36
+ ```bash
37
+ # Run once without installing
38
+ npx mpx-scan https://example.com
39
+
40
+ # Or install globally
41
+ npm install -g mpx-scan
42
+ mpx-scan https://example.com
43
+ ```
44
+
45
+ ## šŸ“– Usage
46
+
47
+ ### Basic Scan
48
+
49
+ ```bash
50
+ mpx-scan https://example.com
51
+ ```
52
+
53
+ ![Example output](https://example.com/mpx-scan-demo.gif)
54
+
55
+ ### Get Fix Suggestions
56
+
57
+ ```bash
58
+ mpx-scan https://example.com --fix nginx
59
+ mpx-scan https://example.com --fix apache
60
+ mpx-scan https://example.com --fix caddy
61
+ mpx-scan https://example.com --fix cloudflare
62
+ ```
63
+
64
+ Generates copy-paste configuration snippets for your platform.
65
+
66
+ ### Deep Scan (Pro)
67
+
68
+ ```bash
69
+ mpx-scan https://example.com --full
70
+ ```
71
+
72
+ Runs all security checks including DNS, cookies, SRI, exposed files.
73
+
74
+ ### JSON Output (Pro)
75
+
76
+ ```bash
77
+ mpx-scan https://example.com --json
78
+ ```
79
+
80
+ Perfect for CI/CD pipelines:
81
+
82
+ ```json
83
+ {
84
+ "mpxScan": {
85
+ "version": "1.0.0",
86
+ "scannedAt": "2026-02-15T22:00:00.000Z"
87
+ },
88
+ "target": {
89
+ "url": "https://example.com",
90
+ "hostname": "example.com"
91
+ },
92
+ "score": {
93
+ "grade": "B",
94
+ "numeric": 72.5,
95
+ "maxScore": 100,
96
+ "percentage": 73
97
+ },
98
+ "summary": {
99
+ "passed": 12,
100
+ "warnings": 3,
101
+ "failed": 2
102
+ }
103
+ }
104
+ ```
105
+
106
+ ### Brief Output
107
+
108
+ ```bash
109
+ mpx-scan https://example.com --brief
110
+ ```
111
+
112
+ One-line summary — great for monitoring multiple sites.
113
+
114
+ ## šŸŽÆ Use Cases
115
+
116
+ ### Local Development
117
+
118
+ ```bash
119
+ mpx-scan http://localhost:3000 --fix nginx
120
+ ```
121
+
122
+ Check your security before deploying.
123
+
124
+ ### CI/CD Integration
125
+
126
+ ```yaml
127
+ # .github/workflows/security.yml
128
+ name: Security Scan
129
+ on: [push]
130
+ jobs:
131
+ scan:
132
+ runs-on: ubuntu-latest
133
+ steps:
134
+ - run: npx mpx-scan https://mysite.com --json
135
+ ```
136
+
137
+ ### Batch Scanning (Pro)
138
+
139
+ ```bash
140
+ for site in site1.com site2.com site3.com; do
141
+ mpx-scan $site --json >> security-report.jsonl
142
+ done
143
+ ```
144
+
145
+ ## šŸ“Š Free vs Pro
146
+
147
+ | Feature | Free | Pro |
148
+ |---------|------|-----|
149
+ | **Daily scans** | 3 | Unlimited |
150
+ | **Security headers** | āœ… | āœ… |
151
+ | **SSL/TLS checks** | āœ… | āœ… |
152
+ | **Server info checks** | āœ… | āœ… |
153
+ | **DNS security** | āŒ | āœ… |
154
+ | **Cookie security** | āŒ | āœ… |
155
+ | **SRI checks** | āŒ | āœ… |
156
+ | **Exposed files** | āŒ | āœ… |
157
+ | **Mixed content** | āŒ | āœ… |
158
+ | **JSON export** | āŒ | āœ… |
159
+ | **Batch scanning** | āŒ | āœ… |
160
+ | **CI/CD integration** | āŒ | āœ… |
161
+
162
+ **Upgrade to Pro:** [https://mesaplex.com/mpx-scan](https://mesaplex.com/mpx-scan)
163
+
164
+ ## šŸ” License Management
165
+
166
+ ### Check License Status
167
+
168
+ ```bash
169
+ mpx-scan license
170
+ ```
171
+
172
+ ### Activate Pro License
173
+
174
+ ```bash
175
+ mpx-scan activate MPX-PRO-XXXXXXXXXXXXXXXX
176
+ ```
177
+
178
+ ### Deactivate
179
+
180
+ ```bash
181
+ mpx-scan deactivate
182
+ ```
183
+
184
+ ## šŸ› ļø CLI Options
185
+
186
+ ```
187
+ Usage: mpx-scan [url] [options]
188
+
189
+ Arguments:
190
+ url URL to scan
191
+
192
+ Options:
193
+ -V, --version output the version number
194
+ --full Run all checks (Pro only)
195
+ --json Output as JSON (Pro only)
196
+ --brief Brief output (one-line summary)
197
+ --fix <platform> Generate fix config (nginx, apache, caddy, cloudflare)
198
+ --timeout <seconds> Connection timeout (default: "10")
199
+ -h, --help display help for command
200
+
201
+ Commands:
202
+ license Manage your mpx-scan license
203
+ activate <key> Activate a Pro license
204
+ deactivate Deactivate license
205
+ ```
206
+
207
+ ## šŸ“¦ Installation
208
+
209
+ ### Global Install
210
+
211
+ ```bash
212
+ npm install -g mpx-scan
213
+ ```
214
+
215
+ ### Project Dependency
216
+
217
+ ```bash
218
+ npm install --save-dev mpx-scan
219
+ ```
220
+
221
+ Add to `package.json`:
222
+
223
+ ```json
224
+ {
225
+ "scripts": {
226
+ "security": "mpx-scan https://mysite.com"
227
+ }
228
+ }
229
+ ```
230
+
231
+ ### Requirements
232
+
233
+ - Node.js 18.0.0 or higher
234
+ - No other dependencies required for scanning
235
+ - Works on macOS, Linux, Windows
236
+
237
+ ## 🧪 Testing
238
+
239
+ ```bash
240
+ npm test
241
+ ```
242
+
243
+ Runs the built-in test suite for core scanning logic.
244
+
245
+ ## šŸ¤ Contributing
246
+
247
+ This is a commercial product with a free tier. Security improvements and bug fixes are welcome!
248
+
249
+ ## šŸ“„ License
250
+
251
+ Dual License: Free tier for personal use, Pro license for commercial use and advanced features.
252
+
253
+ See [LICENSE](LICENSE) for full terms.
254
+
255
+ ## šŸ”— Links
256
+
257
+ - **Website:** [https://mesaplex.com/mpx-scan](https://mesaplex.com/mpx-scan)
258
+ - **Documentation:** [https://docs.mesaplex.com/mpx-scan](https://docs.mesaplex.com/mpx-scan)
259
+ - **Support:** support@mesaplex.com
260
+ - **Twitter:** [@mesaplex](https://twitter.com/mesaplex)
261
+
262
+ ## šŸ› Known Issues
263
+
264
+ None currently! Report issues via email: support@mesaplex.com
265
+
266
+ ## šŸ“š Related Tools
267
+
268
+ Part of the Mesaplex developer toolchain:
269
+
270
+ - **mpx-scan** — Security scanner (you are here)
271
+ - **mpx-api** — API testing toolkit *(coming soon)*
272
+ - **mpx-perf** — Performance profiler *(coming soon)*
273
+ - **mpx-deploy** — Deployment automation *(coming soon)*
274
+
275
+ ---
276
+
277
+ **Made with ā¤ļø by [Mesaplex](https://mesaplex.com)**
package/bin/cli.js ADDED
@@ -0,0 +1,211 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * mpx-scan CLI
5
+ *
6
+ * Professional website security scanner
7
+ * Part of the Mesaplex developer toolchain
8
+ */
9
+
10
+ const { Command } = require('commander');
11
+ const chalk = require('chalk');
12
+ const { scan } = require('../src/index');
13
+ const { formatReport, formatBrief } = require('../src/reporters/terminal');
14
+ const { formatJSON } = require('../src/reporters/json');
15
+ const { generateFixes, PLATFORMS } = require('../src/generators/fixes');
16
+ const {
17
+ getLicense,
18
+ activateLicense,
19
+ deactivateLicense,
20
+ checkRateLimit,
21
+ recordScan,
22
+ FREE_DAILY_LIMIT
23
+ } = require('../src/license');
24
+
25
+ const pkg = require('../package.json');
26
+
27
+ const program = new Command();
28
+
29
+ program
30
+ .name('mpx-scan')
31
+ .description('Professional website security scanner — check headers, SSL, DNS, and more')
32
+ .version(pkg.version)
33
+ .argument('[url]', 'URL to scan')
34
+ .option('--full', 'Run all checks (Pro only)')
35
+ .option('--json', 'Output as JSON')
36
+ .option('--brief', 'Brief output (one-line summary)')
37
+ .option('--fix <platform>', `Generate fix config for platform (${PLATFORMS.join(', ')})`)
38
+ .option('--timeout <seconds>', 'Connection timeout', '10')
39
+ .action(async (url, options) => {
40
+ // Show help if no URL provided
41
+ if (!url) {
42
+ program.help();
43
+ return;
44
+ }
45
+
46
+ try {
47
+ // Check license and rate limits
48
+ const license = getLicense();
49
+ const rateLimit = checkRateLimit();
50
+
51
+ // Handle rate limiting
52
+ if (!rateLimit.allowed) {
53
+ console.error(chalk.red.bold('\nāŒ Daily scan limit reached'));
54
+ console.error(chalk.yellow(`Free tier: ${FREE_DAILY_LIMIT} scans/day`));
55
+ console.error(chalk.gray(`Resets: ${new Date(rateLimit.resetsAt).toLocaleString()}\n`));
56
+ console.error(chalk.blue('Upgrade to Pro for unlimited scans:'));
57
+ console.error(chalk.blue(' https://mesaplex.com/mpx-scan\n'));
58
+ process.exit(1);
59
+ }
60
+
61
+ // Check for Pro-only features
62
+ if (options.full && license.tier !== 'pro') {
63
+ console.error(chalk.red.bold('\nāŒ --full flag requires Pro license'));
64
+ console.error(chalk.yellow('Free tier includes: headers, SSL, server checks'));
65
+ console.error(chalk.yellow('Pro includes: all checks (DNS, cookies, SRI, exposed files, etc.)\n'));
66
+ console.error(chalk.blue('Upgrade: https://mesaplex.com/mpx-scan\n'));
67
+ process.exit(1);
68
+ }
69
+
70
+ if (options.json && license.tier !== 'pro') {
71
+ console.error(chalk.red.bold('\nāŒ --json output requires Pro license\n'));
72
+ console.error(chalk.blue('Upgrade: https://mesaplex.com/mpx-scan\n'));
73
+ process.exit(1);
74
+ }
75
+
76
+ // Show scan info
77
+ if (!options.json && !options.brief) {
78
+ console.log('');
79
+ console.log(chalk.bold.cyan('šŸ” Scanning...'));
80
+ if (license.tier === 'free') {
81
+ console.log(chalk.gray(`Free tier: ${rateLimit.remaining} scan(s) remaining today\n`));
82
+ }
83
+ }
84
+
85
+ // Run scan
86
+ const results = await scan(url, {
87
+ timeout: parseInt(options.timeout) * 1000,
88
+ tier: license.tier,
89
+ full: options.full
90
+ });
91
+
92
+ // Record scan for rate limiting
93
+ recordScan();
94
+
95
+ // Output results
96
+ if (options.fix) {
97
+ console.log(generateFixes(options.fix, results));
98
+ } else if (options.json) {
99
+ console.log(formatJSON(results, true));
100
+ } else if (options.brief) {
101
+ console.log(formatBrief(results));
102
+ } else {
103
+ console.log(formatReport(results, options));
104
+ }
105
+
106
+ // Exit code based on grade (for CI/CD)
107
+ const gradeToExitCode = {
108
+ 'A+': 0, 'A': 0, 'B': 0, 'C': 0, 'D': 1, 'F': 1
109
+ };
110
+ process.exit(gradeToExitCode[results.grade] || 1);
111
+
112
+ } catch (err) {
113
+ if (options.json) {
114
+ console.log(JSON.stringify({ error: err.message }, null, 2));
115
+ } else {
116
+ console.error(chalk.red.bold('\nāŒ Error:'), err.message);
117
+ console.error('');
118
+ }
119
+ process.exit(1);
120
+ }
121
+ });
122
+
123
+ // License management subcommands
124
+ program
125
+ .command('license')
126
+ .description('Manage your mpx-scan license')
127
+ .action(() => {
128
+ const license = getLicense();
129
+
130
+ console.log('');
131
+ console.log(chalk.bold('License Status:'));
132
+ console.log(chalk.gray('─'.repeat(50)));
133
+ console.log(chalk.bold('Tier: ') + (license.tier === 'pro' ? chalk.green('Pro āœ“') : chalk.yellow('Free')));
134
+
135
+ if (license.tier === 'pro') {
136
+ console.log(chalk.bold('Key: ') + chalk.gray(license.key));
137
+ if (license.email) {
138
+ console.log(chalk.bold('Email: ') + chalk.gray(license.email));
139
+ }
140
+ } else {
141
+ console.log(chalk.bold('Limit: ') + chalk.yellow(`${FREE_DAILY_LIMIT} scans/day`));
142
+ const rateLimit = checkRateLimit();
143
+ console.log(chalk.bold('Today: ') + chalk.cyan(`${FREE_DAILY_LIMIT - rateLimit.remaining}/${FREE_DAILY_LIMIT} used`));
144
+ }
145
+
146
+ console.log(chalk.gray('─'.repeat(50)));
147
+
148
+ if (license.tier === 'free') {
149
+ console.log('');
150
+ console.log(chalk.blue('Upgrade to Pro:'));
151
+ console.log(chalk.blue(' https://mesaplex.com/mpx-scan'));
152
+ console.log('');
153
+ console.log(chalk.gray('Activate with: mpx-scan activate <license-key>'));
154
+ }
155
+
156
+ console.log('');
157
+ });
158
+
159
+ program
160
+ .command('activate')
161
+ .description('Activate a Pro license')
162
+ .argument('<key>', 'License key')
163
+ .option('--email <email>', 'Your email address')
164
+ .action((key, options) => {
165
+ try {
166
+ activateLicense(key, options.email);
167
+ console.log('');
168
+ console.log(chalk.green.bold('āœ“ License activated!'));
169
+ console.log(chalk.gray('You now have access to:'));
170
+ console.log(chalk.gray(' • Unlimited scans'));
171
+ console.log(chalk.gray(' • All security checks'));
172
+ console.log(chalk.gray(' • JSON/CSV export'));
173
+ console.log(chalk.gray(' • Batch scanning'));
174
+ console.log('');
175
+ } catch (err) {
176
+ console.error(chalk.red.bold('\nāŒ Activation failed:'), err.message);
177
+ console.error('');
178
+ process.exit(1);
179
+ }
180
+ });
181
+
182
+ program
183
+ .command('deactivate')
184
+ .description('Deactivate license and return to free tier')
185
+ .action(() => {
186
+ deactivateLicense();
187
+ console.log('');
188
+ console.log(chalk.yellow('License deactivated'));
189
+ console.log(chalk.gray('You are now on the free tier (3 scans/day)'));
190
+ console.log('');
191
+ });
192
+
193
+ // Examples
194
+ program.addHelpText('after', `
195
+ ${chalk.bold('Examples:')}
196
+ ${chalk.cyan('mpx-scan https://example.com')} Quick security scan
197
+ ${chalk.cyan('mpx-scan example.com --full')} Deep scan (Pro only)
198
+ ${chalk.cyan('mpx-scan example.com --json')} JSON output (Pro only)
199
+ ${chalk.cyan('mpx-scan example.com --fix nginx')} Generate nginx config
200
+ ${chalk.cyan('mpx-scan example.com --brief')} One-line summary
201
+ ${chalk.cyan('mpx-scan license')} Check license status
202
+ ${chalk.cyan('mpx-scan activate MPX-PRO-XXX')} Activate Pro license
203
+
204
+ ${chalk.bold('Free vs Pro:')}
205
+ ${chalk.yellow('Free:')} 3 scans/day, basic checks (headers, SSL, server)
206
+ ${chalk.green('Pro:')} Unlimited scans, all checks, JSON export, CI/CD integration
207
+
208
+ ${chalk.blue('Upgrade: https://mesaplex.com/mpx-scan')}
209
+ `);
210
+
211
+ program.parse();
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "mpx-scan",
3
+ "version": "1.0.0",
4
+ "description": "Professional website security scanner CLI. Check headers, SSL, cookies, DNS, and get actionable fix suggestions. Part of the Mesaplex developer toolchain.",
5
+ "main": "src/index.js",
6
+ "bin": {
7
+ "mpx-scan": "./bin/cli.js"
8
+ },
9
+ "scripts": {
10
+ "test": "node test/run.js",
11
+ "start": "node bin/cli.js"
12
+ },
13
+ "keywords": [
14
+ "security",
15
+ "scanner",
16
+ "headers",
17
+ "ssl",
18
+ "tls",
19
+ "audit",
20
+ "owasp",
21
+ "devops",
22
+ "ci-cd",
23
+ "mesaplex",
24
+ "devtools",
25
+ "security-headers",
26
+ "ssl-check",
27
+ "dns-security",
28
+ "cors"
29
+ ],
30
+ "author": "Mesaplex <support@mesaplex.com>",
31
+ "license": "SEE LICENSE IN LICENSE",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/mesaplexdev/mpx-scan"
35
+ },
36
+ "homepage": "https://github.com/mesaplexdev/mpx-scan#readme",
37
+ "bugs": "https://github.com/mesaplexdev/mpx-scan/issues",
38
+ "engines": {
39
+ "node": ">=18.0.0"
40
+ },
41
+ "dependencies": {
42
+ "chalk": "^4.1.2",
43
+ "commander": "^12.0.0"
44
+ }
45
+ }