@mlabsh/n8n-nodes-mlab 0.1.2 → 1.1.2

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,29 +1,29 @@
1
1
  # @mlabsh/n8n-nodes-mlab
2
2
 
3
- n8n community nodes for [**mlab.sh**](https://mlab.sh) — bring core scanning, CVE
3
+ n8n community node for [**mlab.sh**](https://mlab.sh) — bring core scanning, CVE
4
4
  vulnerability intelligence and threat-actor data into your n8n workflows.
5
5
 
6
- This package ships three nodes:
6
+ The package ships a single **mlab.sh** node whose surfaces are exposed as resources:
7
7
 
8
- | Node | Service | Auth |
9
- |------|---------|------|
10
- | **mlab.sh Core** | `mlab.sh/api/v1` — domain / IP / crypto / file scans | API key |
11
- | **mlab.sh CVE** | `vuln.mlab.sh/api/v1` — CVE search & details | none (public) |
12
- | **mlab.sh Threat Actors** | `actors.mlab.sh/api/v1` — threat-actor intel | none (public) |
8
+ | Resource | Service | Auth |
9
+ |----------|---------|------|
10
+ | **Domain / IP Address / Crypto Address / File / Quota** (Core) | `mlab.sh/api/v1` — domain / IP / crypto / file scans | API key |
11
+ | **CVE** | `vuln.mlab.sh/api/v1` — CVE search & details | none (public) |
12
+ | **Threat Actor** | `actors.mlab.sh/api/v1` — threat-actor intel | none (public) |
13
13
 
14
- [Installation](#installation) · [Credentials](#credentials) · [Operations](#operations) · [Local development](#local-development) · [Publishing to npm](#publishing-to-npm) · [Becoming a verified / official node](#becoming-a-verified--official-node)
14
+ [Installation](#installation) · [Credentials](#credentials) · [Resources & operations](#resources--operations) · [Examples](#examples)
15
15
 
16
16
  ---
17
17
 
18
18
  ## Installation
19
19
 
20
- ### From the n8n UI (recommended)
20
+ ### From the n8n UI
21
21
 
22
22
  1. In n8n, go to **Settings → Community Nodes → Install**.
23
23
  2. Enter the npm package name: `@mlabsh/n8n-nodes-mlab`.
24
24
  3. Agree to the risk prompt and install.
25
25
 
26
- > Community nodes require `N8N_COMMUNITY_PACKAGES_ENABLED=true` (the default on self-hosted instances). On **n8n Cloud**, only *verified* community nodes can be installed (see below).
26
+ > Community nodes require `N8N_COMMUNITY_PACKAGES_ENABLED=true` (the default on self-hosted instances).
27
27
 
28
28
  ### Manually (self-hosted)
29
29
 
@@ -32,97 +32,88 @@ cd ~/.n8n/nodes # or your N8N_CUSTOM_EXTENSIONS path
32
32
  npm install @mlabsh/n8n-nodes-mlab
33
33
  ```
34
34
 
35
- Restart n8n afterwards.
35
+ Restart n8n afterwards. The **mlab.sh** node then appears in the nodes panel.
36
36
 
37
37
  ---
38
38
 
39
39
  ## Credentials
40
40
 
41
- Only the **Core** node needs credentials.
41
+ Only the **Core** resources (Domain / IP Address / Crypto Address / File / Quota) need credentials. The credential field is hidden when a public resource (CVE / Threat Actor) is selected.
42
42
 
43
43
  1. Create an API key at **mlab.sh → Account → Settings → API Keys** (it starts with `mlab_`).
44
44
  2. In n8n, add a new **mlab.sh API** credential and paste the key.
45
45
  3. The node sends it as `Authorization: token mlab_...`. The credential's *Test* button hits `GET /limit/ip` to validate the key.
46
46
 
47
- The **CVE** and **Threat Actors** nodes call public, unauthenticated APIs — no credential required.
47
+ The **CVE** and **Threat Actor** resources call public, unauthenticated APIs — no credential required.
48
48
 
49
49
  ---
50
50
 
51
- ## Operations
51
+ ## Resources & operations
52
52
 
53
- ### mlab.sh Core
53
+ Pick a **Resource**, then an **Operation**. The node processes every input item and outputs the raw JSON returned by mlab.sh.
54
54
 
55
- - **Domain → Scan** — launches `POST /scan/domain`. With *Wait for Completion* on (default) it polls `/scan/domain/status` and returns the full `/scan/domain/results` payload (subdomains, DNS, SSL, security.txt…).
56
- - **Domain → Get Status** / **Get Results** — for managing an async scan yourself.
57
- - **IP → Lookup** — `GET /scan/ip` (geolocation, ASN, ownership).
58
- - **Crypto → Lookup** — `GET /scan/crypto` (sanctions, labels, risk score). Chain auto-detected or forced.
59
- - **File → Upload** — `POST /upload/file` from an input binary field (max 10MB) and returns the `sha256`.
60
- - **File → Get Results** — `GET /scan/file/results?sha256=…`.
61
- - **Quota → Get** — remaining daily quota for a scan type (`GET /limit/{type}`).
55
+ ### Core — Domain
62
56
 
63
- ### mlab.sh CVE
57
+ | Operation | Endpoint | Notes |
58
+ |-----------|----------|-------|
59
+ | **Scan** | `POST /scan/domain` | Launches a scan. With **Wait for Completion** on (default) it polls `/scan/domain/status` and returns the full `/scan/domain/results` payload (subdomains, DNS, SSL, security.txt…). Disable it to return only the job acknowledgement. **Timeout (Seconds)** controls how long polling waits. |
60
+ | **Get Status** | `GET /scan/domain/status` | Check an async scan you launched yourself. |
61
+ | **Get Results** | `GET /scan/domain/results` | Fetch results once a scan has finished. |
64
62
 
65
- - **Search** — `GET /cve?q=…` with optional `severity`, `dateStart`, `exact`, `kev` filters.
66
- - **Get** — `GET /cve/CVE-XXXX-XXXX` (full detail incl. EPSS & KEV).
67
- - **Get Latest** — `GET /cve/latest` (last 7 days).
63
+ ### Core — IP Address
68
64
 
69
- ### mlab.sh Threat Actors
65
+ | Operation | Endpoint | Notes |
66
+ |-----------|----------|-------|
67
+ | **Lookup** | `GET /scan/ip` | Geolocation, ASN and ownership for an IPv4/IPv6 address. |
70
68
 
71
- - **List / Search** — `GET /actors` with `origin`, `motivation`, `sector`, `limit`, `offset`.
72
- - **Get** — `GET /actors/:slug` (aliases, tools, CVEs, techniques).
73
- - **Get by CVE** — `GET /cves/CVE-XXXX-XXXX/actors` (reverse lookup).
69
+ ### Core — Crypto Address
74
70
 
75
- ---
71
+ | Operation | Endpoint | Notes |
72
+ |-----------|----------|-------|
73
+ | **Lookup** | `GET /scan/crypto` | Sanctions, labels and risk score. **Chain** can be auto-detected (leave blank) or forced (BTC, ETH, SOL, TRON, …). |
76
74
 
77
- ## Local development
75
+ ### Core — File
78
76
 
79
- ```bash
80
- npm install
81
- npm run build # compiles TS → dist/ and copies icons
82
- npm run lint # n8n-nodes-base lint rules
83
-
84
- # Link into a local n8n for testing:
85
- npm link
86
- cd ~/.n8n/nodes && npm link @mlabsh/n8n-nodes-mlab
87
- n8n start
88
- ```
77
+ | Operation | Endpoint | Notes |
78
+ |-----------|----------|-------|
79
+ | **Upload** | `POST /upload/file` | Uploads the file from the **Input Binary Field** (max 10 MB) and returns its `sha256`. |
80
+ | **Get Results** | `GET /scan/file/results` | Fetch analysis results by **SHA-256** hash. |
89
81
 
90
- Requires Node ≥ 20.15 (same as n8n).
82
+ ### Core — Quota
91
83
 
92
- ---
84
+ | Operation | Endpoint | Notes |
85
+ |-----------|----------|-------|
86
+ | **Get** | `GET /limit/{type}` | Remaining daily quota for a **Scan Type** (domain / IP / file / crypto). |
93
87
 
94
- ## Publishing to npm
88
+ ### CVE
95
89
 
96
- ```bash
97
- npm login # scope @mlabsh must exist / you must own it
98
- npm run build
99
- npm publish --access public # scoped packages are private by default
100
- ```
90
+ | Operation | Endpoint | Notes |
91
+ |-----------|----------|-------|
92
+ | **Search** | `GET /cve?q=…` | Search by keyword, vendor or product. Optional **Filters**: severity, published-after date, exact match, KEV-only. |
93
+ | **Get** | `GET /cve/{id}` | Full detail for a CVE, including EPSS and KEV data. |
94
+ | **Get Latest** | `GET /cve/latest` | Vulnerabilities from the last 7 days. |
95
+
96
+ ### Threat Actor
101
97
 
102
- `prepublishOnly` re-runs the build + lint, and `.npmignore` ships only `dist/`, `package.json`, `README.md` and `LICENSE`.
98
+ | Operation | Endpoint | Notes |
99
+ |-----------|----------|-------|
100
+ | **List / Search** | `GET /actors` | Optional **Filters**: origin, motivation, sector. Paginate with **Limit** / **Offset**. |
101
+ | **Get** | `GET /actors/{slug}` | A single actor by slug, including aliases, tools, CVEs and techniques. |
102
+ | **Get by CVE** | `GET /cves/{id}/actors` | Reverse lookup — which actors are known to exploit a given CVE. |
103
103
 
104
104
  ---
105
105
 
106
- ## Becoming a verified / official node
106
+ ## Examples
107
107
 
108
- n8n has three tiers. This package starts at tier 1.
108
+ **Enrich a domain on demand.** Webhook → **mlab.sh** (Resource: *Domain*, Operation: *Scan*, Wait for Completion: on) → use the returned subdomains / SSL / DNS data downstream.
109
109
 
110
- 1. **Community node (now).** Any package named `n8n-nodes-*` (or scoped `@scope/n8n-nodes-*`) published to npm with the `n8n-community-node-package` keyword. Installable on self-hosted n8n immediately after `npm publish`.
110
+ **Vulnerability watch.** Schedule Trigger (daily) → **mlab.sh** (Resource: *CVE*, Operation: *Get Latest*) → Filter on `severity = CRITICAL` → notify Slack / email.
111
111
 
112
- 2. **Verified community node** (installable on n8n Cloud). Submit the package for n8n's review. Requirements:
113
- - Package name matches `n8n-nodes-*` / `@scope/n8n-nodes-*` ✅
114
- - `package.json` declares `n8n.n8nNodesApiVersion`, `nodes`, `credentials` ✅
115
- - Passes `eslint-plugin-n8n-nodes-base` with **zero errors** on the `community`, `nodes` and `credentials` rulesets — run `npm run lint` ✅ (a few opinionated rules are relaxed in `.eslintrc.js`; tighten them before submitting)
116
- - No runtime dependencies beyond `n8n-workflow` (this package has none) ✅
117
- - Icons, `description`, `documentationUrl`, codex/category metadata present
118
- - Submit via the form linked from n8n's docs: **Creating nodes → Submit community nodes for verification** (<https://docs.n8n.io/integrations/creating-nodes/deploy/submit-community-nodes/>). n8n reviews the source and, once approved, the node appears in the in-app nodes panel and is installable on Cloud.
112
+ **Threat-actor context for an alert.** **mlab.sh** (Resource: *Threat Actor*, Operation: *Get by CVE*, CVE ID: `CVE-2021-44228`) → attach the matching actors to your incident record.
119
113
 
120
- 3. **Official / built-in node** (ships inside n8n core). This is owned by n8n, not by package authors. The realistic path:
121
- - Get adoption + verification first (tier 2).
122
- - Open a discussion/issue on <https://github.com/n8n-io/n8n> proposing the integration, or contact n8n's partnerships team (integrations are often prioritised via the partner program).
123
- - If accepted, the node source is contributed into the `n8n-nodes-base` package via PR following n8n's contribution guide. From then on n8n maintains it and the community package can be deprecated.
114
+ **Crypto / IP triage.** Feed a list of addresses or IPs into **mlab.sh** (Resource: *Crypto Address* or *IP Address*, Operation: *Lookup*); the node runs once per input item and returns risk/ownership data per row.
124
115
 
125
- **Recommended sequence:** publish this package → gather usage → submit for verification (tier 2) → propose upstreaming to n8n core (tier 3).
116
+ > Each Core operation consumes daily quota. Use the **Quota → Get** operation to check remaining budget before large batch runs.
126
117
 
127
118
  ---
128
119
 
@@ -1,5 +1,5 @@
1
1
  import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
- export declare class MlabCve implements INodeType {
2
+ export declare class Mlab implements INodeType {
3
3
  description: INodeTypeDescription;
4
4
  execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
5
  }