@hailbytes/vulnerability-calculator 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/README.md ADDED
@@ -0,0 +1,299 @@
1
+ # HailBytes Vulnerability Scanner Infrastructure Calculator
2
+
3
+ A **zero-dependency web component** for sizing vulnerability scanning infrastructure. Input your target host count, scan intensity, tools, and compliance requirements. Get VM sizing, timing analysis, cost estimates (AWS & Azure), and ROI comparison vs. HailBytes ASM managed service — instantly in the browser with no server or build step required.
4
+
5
+ Works as a single `<script>` tag inside **Hugo**, **React**, **Vue**, **Next.js**, or plain HTML — or install via npm.
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@hailbytes/vulnerability-calculator.svg)](https://www.npmjs.com/package/@hailbytes/vulnerability-calculator)
8
+ [![License: MPL-2.0](https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg)](LICENSE)
9
+ [![Zero deps](https://img.shields.io/badge/dependencies-0-brightgreen.svg)](#)
10
+ [![Bundle Size](https://img.shields.io/bundlephobia/minzip/%40hailbytes%2Fvulnerability-calculator)](https://bundlephobia.com/package/@hailbytes/vulnerability-calculator)
11
+
12
+ ---
13
+
14
+ ## Install
15
+
16
+ ```bash
17
+ npm install @hailbytes/vulnerability-calculator
18
+ ```
19
+
20
+ Or use it without a bundler via a CDN (see below).
21
+
22
+ ## Quick Start
23
+
24
+ ### npm (bundlers, Next.js, Vite, Webpack, etc.)
25
+
26
+ ```js
27
+ // Side-effect import registers the <hailbytes-vuln-calculator> custom element.
28
+ import '@hailbytes/vulnerability-calculator';
29
+
30
+ // Or import the pure DOM-free calculator:
31
+ import { calculate } from '@hailbytes/vulnerability-calculator';
32
+ console.log(calculate({ /* inputs */ }).vm_resources);
33
+ ```
34
+
35
+ ```html
36
+ <hailbytes-vuln-calculator theme="dark"></hailbytes-vuln-calculator>
37
+
38
+ <!-- White-label (no HailBytes branding) -->
39
+ <hailbytes-vuln-calculator theme="dark" branding="off"></hailbytes-vuln-calculator>
40
+ ```
41
+
42
+ ### Plain script tag
43
+
44
+ ```html
45
+ <!-- 1. Load the component -->
46
+ <script type="module" src="hailbytes-vuln-calculator.js"></script>
47
+
48
+ <!-- 2. Drop the tag anywhere -->
49
+ <hailbytes-vuln-calculator></hailbytes-vuln-calculator>
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Integration Examples
55
+
56
+ ### Plain HTML / Hugo
57
+
58
+ ```html
59
+ <!DOCTYPE html>
60
+ <html>
61
+ <head>
62
+ <meta charset="UTF-8">
63
+ <title>Vulnerability Scanner Calculator</title>
64
+ </head>
65
+ <body>
66
+ <hailbytes-vuln-calculator theme="dark"></hailbytes-vuln-calculator>
67
+
68
+ <script type="module"
69
+ src="https://cdn.jsdelivr.net/gh/HailBytes/vulnerability-calculator@main/hailbytes-vuln-calculator.js">
70
+ </script>
71
+ </body>
72
+ </html>
73
+ ```
74
+
75
+ Hugo shortcode (`layouts/shortcodes/vuln-calculator.html`):
76
+ ```html
77
+ <script type="module" src="https://cdn.jsdelivr.net/gh/HailBytes/vulnerability-calculator@main/hailbytes-vuln-calculator.js"></script>
78
+ <hailbytes-vuln-calculator theme="{{ .Get \"theme\" | default \"dark\" }}"></hailbytes-vuln-calculator>
79
+ ```
80
+
81
+ ### CDN via jsDelivr
82
+
83
+ ```html
84
+ <script type="module"
85
+ src="https://cdn.jsdelivr.net/gh/HailBytes/vulnerability-calculator@main/hailbytes-vuln-calculator.js">
86
+ </script>
87
+ <hailbytes-vuln-calculator></hailbytes-vuln-calculator>
88
+ ```
89
+
90
+ ### React
91
+
92
+ ```jsx
93
+ import { useEffect, useRef } from 'react';
94
+
95
+ import('https://cdn.jsdelivr.net/gh/HailBytes/vulnerability-calculator@main/hailbytes-vuln-calculator.js');
96
+
97
+ export default function VulnCalc({ onCalculated }) {
98
+ const ref = useRef(null);
99
+
100
+ useEffect(() => {
101
+ const el = ref.current;
102
+ if (!el) return;
103
+ const handle = (e) => onCalculated?.(e.detail);
104
+ el.addEventListener('vuln-calculated', handle);
105
+ return () => el.removeEventListener('vuln-calculated', handle);
106
+ }, []);
107
+
108
+ return <hailbytes-vuln-calculator ref={ref} theme="dark" />;
109
+ }
110
+ ```
111
+
112
+ ### Vue 3
113
+
114
+ ```vue
115
+ <template>
116
+ <hailbytes-vuln-calculator theme="dark" @vuln-calculated="onCalc" />
117
+ </template>
118
+
119
+ <script setup>
120
+ import 'https://cdn.jsdelivr.net/gh/HailBytes/vulnerability-calculator@main/hailbytes-vuln-calculator.js';
121
+
122
+ function onCalc(e) { console.log('Result:', e.detail); }
123
+ </script>
124
+ ```
125
+
126
+ ---
127
+
128
+ ## API Reference
129
+
130
+ ### Attributes
131
+
132
+ | Attribute | Values | Default | Description |
133
+ |------------|-----------------|---------|---------------------------------------------------|
134
+ | `theme` | `dark` `light` | `dark` | Color scheme |
135
+ | `branding` | `"off"` | _(shown)_ | Hide the "by HailBytes" footer + header badge |
136
+
137
+ ### Events
138
+
139
+ | Event Name | Fired When | `event.detail` |
140
+ |-------------------|--------------------------------|--------------------|
141
+ | `vuln-calculated` | User clicks "Calculate" button | Full result object |
142
+
143
+ ### Input Schema
144
+
145
+ | Field | Type | Range / Options |
146
+ |--------------------|------------|------------------------------------------------------------------------------|
147
+ | `target_hosts` | `number` | 1–50,000 |
148
+ | `scan_intensity` | `string` | `light`, `medium`, `aggressive`, `continuous` |
149
+ | `scan_frequency` | `string` | `daily`, `weekly`, `monthly`, `quarterly` |
150
+ | `scan_window` | `number` | 1–24 (hours) |
151
+ | `scanning_tools` | `string[]` | `hailbytes_asm`, `openvas`, `nessus_professional`, `qualys_vmdr` |
152
+ | `compliance_needs` | `string[]` | `pci`, `hipaa`, `nist`, `iso27001`, `soc2` |
153
+
154
+ ### Result Object Shape
155
+
156
+ ```json
157
+ {
158
+ "vm_resources": {
159
+ "cpu_cores": 8,
160
+ "ram_gb": 16,
161
+ "ram_recommended": 24,
162
+ "storage_gb": 70,
163
+ "network_bandwidth_mbps": 14,
164
+ "docker_required": true,
165
+ "tool_type": "hailbytes_asm"
166
+ },
167
+ "timing": {
168
+ "total_scan_time_minutes": 1500,
169
+ "optimized_scan_time_minutes": 19,
170
+ "parallel_hosts": 800,
171
+ "scan_window_utilization": 3.9,
172
+ "performance_metrics": {
173
+ "efficiency_rating": "excellent",
174
+ "bottleneck_analysis": [],
175
+ "optimization_suggestions": []
176
+ }
177
+ },
178
+ "costs": {
179
+ "infrastructure_monthly_aws": 374,
180
+ "infrastructure_monthly_azure": 352,
181
+ "tool_licensing_annual": 0,
182
+ "tool_management_monthly": 450,
183
+ "tool_setup_cost": 600,
184
+ "total_monthly_aws": 824,
185
+ "total_monthly_azure": 802,
186
+ "roi_analysis": {
187
+ "self_managed_monthly": 824,
188
+ "managed_monthly": 299,
189
+ "monthly_savings": 525,
190
+ "annual_savings": 6300,
191
+ "roi_percentage": 176.3,
192
+ "has_managed_option": true
193
+ },
194
+ "tool_breakdown": { "hailbytes_asm": { "...": "..." } }
195
+ },
196
+ "recommendations": ["..."],
197
+ "has_asm": true,
198
+ "inputs": { "...": "..." },
199
+ "timestamp": "2025-01-01T00:00:00.000Z"
200
+ }
201
+ ```
202
+
203
+ ---
204
+
205
+ ## Scanning Tools
206
+
207
+ | Tool Key | Display Name | License | Notes |
208
+ |----------------------|--------------------|-----------|----------------------------------------------------|
209
+ | `hailbytes_asm` | HailBytes ASM | Free (OSS)| Attack Surface Management; managed service available |
210
+ | `openvas` | OpenVAS | Free (OSS)| Vulnerability scanner; requires feed maintenance |
211
+ | `nessus_professional`| Nessus Professional| ~$3,990/yr| Widely supported commercial scanner |
212
+ | `qualys_vmdr` | Qualys VMDR | ~$3,500/yr| Cloud-native vulnerability management |
213
+
214
+ **HailBytes ASM** is the recommended choice for continuous attack surface visibility. It can be self-hosted (Docker) or used as a fully managed service starting at $299/month — eliminating infrastructure overhead and setup time.
215
+
216
+ ---
217
+
218
+ ## Calculation Methodology
219
+
220
+ ### HailBytes ASM Resource Sizing
221
+
222
+ ```
223
+ host_factor = max(1, target_hosts / 1000)
224
+ compliance_factor = 1.0 + (num_compliance * 0.1)
225
+ total_multiplier = intensity_mult × frequency_mult × compliance_factor
226
+
227
+ cpu_cores = max(2, ceil(4 × host_factor × total_multiplier))
228
+ ram_gb = max(4, ceil(8 × host_factor × total_multiplier))
229
+ storage_gb = max(20, ceil(50 + (target_hosts/100 × 2) × compliance_factor))
230
+ network = max(10, ceil(target_hosts/200 × intensity_mult × compliance_factor))
231
+ ```
232
+
233
+ **Intensity multipliers (HailBytes ASM):** `light=1.0`, `medium=1.3`, `aggressive=1.8`, `continuous=2.2`
234
+ **Frequency multipliers:** `daily=1.5`, `weekly=1.0`, `monthly=0.8`, `quarterly=0.6`
235
+
236
+ ### Traditional Scanner Sizing
237
+
238
+ ```
239
+ host_factor = max(0.001, target_hosts / 1000)
240
+ cpu_cores = max(2, ceil(4 × host_factor × intensity_mult))
241
+ ram_gb = max(4, ceil(8 × host_factor × intensity_mult))
242
+ storage_gb = max(10, ceil(0.5 × target_hosts / 1024))
243
+ network = max(10, ceil(target_hosts/100 × intensity_mult))
244
+ ```
245
+
246
+ **Intensity multipliers (traditional):** `light=1.0`, `medium=1.5`, `aggressive=2.5`, `continuous=3.0`
247
+
248
+ ### Timing
249
+
250
+ ```
251
+ base_scan_time = hailbytes_asm ? 1.5 : 2.0 (min/host)
252
+ time_mult = { light:0.5, medium:1.0, aggressive:2.0, continuous:0.3 }
253
+ total_scan_time = base × target_hosts × time_mult
254
+ parallel_hosts = min(target_hosts, cpu_cores × 100)
255
+ optimized = ceil(total / max(1, parallel_hosts/100))
256
+ window_utilization = min(100, optimized / (scan_window × 60) × 100)
257
+ ```
258
+
259
+ ### Cloud Costs
260
+
261
+ ```
262
+ scale_factor = max(cpu_cores/4, ram_gb/8)
263
+ aws_monthly = ceil(0.17 × scale_factor × 730 + storage_gb × 0.10)
264
+ azure_monthly = ceil(0.16 × scale_factor × 730 + storage_gb × 0.12)
265
+ ```
266
+
267
+ ---
268
+
269
+ ## See also
270
+
271
+ Part of the HailBytes calculator suite — drop-in web components for security and risk:
272
+
273
+ - [`@hailbytes/vulnerability-calculator`](https://www.npmjs.com/package/@hailbytes/vulnerability-calculator) — vulnerability scanner infrastructure sizing _(this package)_
274
+ - [`@hailbytes/password-analyzer`](https://www.npmjs.com/package/@hailbytes/password-analyzer) — password strength + entropy analyzer ([repo](https://github.com/HailBytes/hailbytes-password-analyzer))
275
+ - [`@hailbytes/pentest-calculator`](https://www.npmjs.com/package/@hailbytes/pentest-calculator) — penetration testing scope and cost estimator ([repo](https://github.com/HailBytes/hailbytes-pentest-calculator))
276
+ - [`@hailbytes/security-roi-calculator`](https://www.npmjs.com/package/@hailbytes/security-roi-calculator) — security awareness training ROI ([repo](https://github.com/HailBytes/hailbytes-security-roi-calculator))
277
+
278
+ ---
279
+
280
+ ## License
281
+
282
+ [Mozilla Public License 2.0](LICENSE)
283
+
284
+ ---
285
+
286
+ *Built by [HailBytes](https://hailbytes.com/asm) — Managed Attack Surface Management.*
287
+
288
+ ---
289
+
290
+ ## Enterprise Support
291
+
292
+ [![HailBytes - Managed Attack Surface Management](https://hailbytes.com/images/icons/hb_hb_white_horizontal.png)](https://www.hailbytes.com/asm?utm_source=github&utm_medium=repo_readme&utm_campaign=vulnerability-calculator&utm_content=enterprise_banner)
293
+
294
+ Need managed attack surface management without the operational overhead? **HailBytes ASM** delivers enterprise-grade attack surface management with full support, available on AWS and Azure Marketplaces.
295
+
296
+ [**Get Enterprise Support ->**](https://www.hailbytes.com/asm?utm_source=github&utm_medium=repo_readme&utm_campaign=vulnerability-calculator&utm_content=enterprise_banner)
297
+ ---
298
+
299
+ *Part of the [HailBytes](https://hailbytes.com) open-source security toolkit.*