fairwire-endpoint-protection 0.0.0-stage → 0.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 (unreleased)
4
+
5
+ - First version (Fairwire ver 1).
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kurt Francisco
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,240 @@
1
- # Temporary Holding Version
1
+ # Fairwire Endpoint Protection
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Endpoint protection coverage: devices in your asset list with no security agent, agents not reporting, old signatures or agent versions, protection or tamper protection off, passive mode, two security products on one device and high alerts left open. Drafts notes; never isolates or changes a device.
4
+
5
+ Part of **Fairwire**, the IT and network family of [Mythos Machines](https://fair-agents.com) agents. The software is free (MIT); you pay a fixed price for the setup on your files. It reads files your IT team exports, on your own computer, and drafts notes. Every change to a live device, firewall, DNS zone, directory or cloud account stays one named person's click.
6
+
7
+ ## What it checks
8
+
9
+ | Finding | What it means |
10
+ |---|---|
11
+ | `no_agent` | A device in your asset list with no endpoint security agent in the console export. |
12
+ | `protection_off` | Real-time protection is turned off on a device. |
13
+ | `open_high_alert` | A high or critical alert still open after your limit. |
14
+ | `tamper_off` | Tamper protection is off, so malware or a user can switch the agent off. |
15
+ | `passive_mode` | The agent runs in passive mode (detects but does not block) on a device where it should block. |
16
+ | `agent_not_reporting` | An agent that has not checked in for longer than your limit. |
17
+ | `old_signatures` | Detection signatures older than your limit. |
18
+ | `two_products` | Two different security products on one device (they can conflict and slow the device). |
19
+ | `old_agent` | An agent version older than the one you require. |
20
+
21
+ Findings come back worst first (high, medium, low). A finding a named person has reviewed can be accepted as known, with a reason and a date to look again; it then moves to "Accepted as known" instead of counting as open.
22
+
23
+ ## Settings
24
+
25
+ Pass a settings file with `settings`. Every setting is optional; a misspelt setting is refused by name.
26
+
27
+ | Setting | What it does |
28
+ |---|---|
29
+ | `stale_days` | Days without a check-in after which an agent counts as not reporting (default 7) |
30
+ | `signature_max_days` | Days after which signatures count as old (default 3) |
31
+ | `alert_open_days` | Days a high or critical alert may stay open (default 2) |
32
+ | `min_agent_version` | Oldest agent version you accept (no check when empty) |
33
+ | `passive_ok` | Devices where passive mode is intended (another product blocks) |
34
+ | `asset_types_without_agent` | Asset types that cannot run an agent and are skipped by the coverage check (default printer, camera, phone, network) |
35
+
36
+ ## What it never does
37
+
38
+ - `edr_isolate_device` is refused: Fairwire Endpoint Protection never isolates, scans or changes a device.
39
+ - `edr_change_policy` is refused: Fairwire Endpoint Protection never changes a security policy or exclusion.
40
+ - `endpoints_request_send` waits for one named person's click, even in Auto (`binding_send`).
41
+ - `endpoints_accept_learning` waits for one named person's click, even in Auto (`accept_learning`).
42
+ - `endpoints_retire_memory` waits for one named person's click, even in Auto (`accept_learning`).
43
+ - `edr_isolate_device` waits for one named person's click, even in Auto (`production_deploy`).
44
+ - `edr_change_policy` waits for one named person's click, even in Auto (`production_deploy`).
45
+
46
+ <!-- generated:start -->
47
+
48
+ ## A demo run
49
+
50
+ `npx -y fairwire-endpoint-protection demo` runs the agent on the fictional files in [`fixtures/`](fixtures) in a temporary folder. Captured output:
51
+
52
+ ```text
53
+ Fairwire Endpoint Protection demo (fictional data) in a temporary folder, Auto on for the draft only
54
+
55
+ ▶ Check the exported files
56
+ status: executed decision: allow
57
+ 8 device(s) with an agent, 80% of 10 in-scope assets covered, 3 open alert(s): 10 open finding(s), 4 high.
58
+ high no_agent PC-108
59
+ high no_agent SRV-202
60
+ high open_high_alert PC-102
61
+ high protection_off PC-103
62
+ medium agent_not_reporting PC-106
63
+ medium old_signatures PC-106
64
+ medium passive_mode PC-105
65
+ medium tamper_off PC-104
66
+ low old_agent PC-106
67
+ low two_products PC-107
68
+
69
+ ▶ Explain one finding
70
+ status: executed decision: allow
71
+ medium agent_not_reporting: Defender on PC-106 last checked in on 2026-11-03. Fix: Check that the device is on and the agent service runs; reinstall it if needed.
72
+ medium old_signatures: Defender signatures on PC-106 date from 2026-11-02. Fix: Check the device can reach its update source.
73
+ low old_agent: PC-106 runs Defender 4.18.23110, older than 4.18.24000. Fix: Update the agent.
74
+
75
+ ▶ Write the worklist
76
+ status: executed decision: allow
77
+ Endpoint protection coverage written: 8 device(s) with an agent, 80% of 10 in-scope assets covered, 3 open alert(s): 10 open finding(s), 4 high.
78
+
79
+ ▶ Draft the note for a person
80
+ status: executed decision: allow (auto)
81
+ security note 2026-11-18 drafted with 1 open marker(s) ([TO CONFIRM security operations]). Nothing was sent.
82
+
83
+ ▶ Auto: approving it still waits for one named person
84
+ status: needs_approval decision: ask
85
+ reason: binding_send stays one-click, even in Auto
86
+
87
+ ▶ The agent tries to change the live system itself
88
+ status: blocked decision: block
89
+ reason: Fairwire Endpoint Protection never isolates, scans or changes a device.
90
+ ```
91
+
92
+ ## Tools
93
+
94
+ | Tool | What it does | Policy |
95
+ |---|---|---|
96
+ | `endpoints_check` | Review the security console export against the asset list and list uncovered devices, protection gaps, stale agents and signatures, product clashes and old high alerts. | runs |
97
+ | `endpoints_explain` | Every finding for one device or alert. | runs |
98
+ | `endpoints_write_report` | Write endpoint-protection.csv (one row per finding, with blank owner and decision columns) and endpoint-protection.html into out_dir (default fairwire-out/endpoints). | runs |
99
+ | `endpoints_draft_security_note` | Write drafts/security_note-<date>.md: the open findings at or above min_severity (default medium), each with what to do, addressed to security operations. | asks first (Auto can be opted in) |
100
+ | `endpoints_request_send` | After one named human click (even in Auto), record that the reviewed security note draft is approved in security_note-requests.csv. | one named click, even in Auto (`binding_send`) |
101
+ | `endpoints_recall` | Search this agent's own memory of the customer's setup: accepted facts (in use) and facts waiting for a person. | runs |
102
+ | `endpoints_learn` | Propose one fact about the customer's setup for this agent to remember. | runs |
103
+ | `endpoints_accept_learning` | A named person accepts or rejects a fact waiting in this agent's memory. | one named click, even in Auto (`accept_learning`) |
104
+ | `endpoints_retire_memory` | A named person stops an accepted fact from applying. | one named click, even in Auto (`accept_learning`) |
105
+ | `edr_isolate_device` | Fairwire Endpoint Protection never isolates, scans or changes a device. | refused |
106
+ | `edr_change_policy` | Fairwire Endpoint Protection never changes a security policy or exclusion. | refused |
107
+
108
+ Any tool name not in this table is blocked, including names a model invents. `refused` tools are listed so a model can see they exist and are refused.
109
+
110
+ ## Columns it reads
111
+
112
+ Table inputs can be CSV, TSV, semicolon- or pipe-separated text, Excel `.xlsx`, JSON or JSONL. Columns are matched by the agent's own name, then by the English names below, then by their names in German, French, Spanish, Portuguese, Italian, Japanese, Chinese and Korean. Dates become `YYYY-MM-DD`; amounts and counts are read with either decimal mark. Every result lists under `sources` how each file was read.
113
+
114
+ ### Protected devices (`devices`)
115
+
116
+ | Column | Type | Also read as | For example, in other languages |
117
+ |---|---|---|---|
118
+ | `device` (required) | text | Device Name, Device, Hostname, Computer Name, Endpoint, Machine Name | Gerät, Appareil, デバイス, 设备 |
119
+ | `product` | text | Product, Agent, Security Product, Sensor, Antivirus | Produkt, Produit, 製品, 产品 |
120
+ | `agent_version` | text | Agent Version, Sensor Version, Client Version, Version | Version, Version, バージョン, 版本 |
121
+ | `signature_date` | date | Signature Date, Definitions Date, Security Intelligence Updated, Definition Version Date, Signature Updated | - |
122
+ | `last_seen` | date and time | Last Seen, Last Device Update, Last Check-in, Last Contact, Last Communication | Zuletzt gesehen, Vu pour la dernière fois, 最終確認日時, 最后出现时间 |
123
+ | `protection` | text | Real-time Protection, Protection, RTP, Real Time Protection Enabled, Health State | - |
124
+ | `tamper_protection` | text | Tamper Protection, Tamper, Uninstall Protection | - |
125
+ | `mode` | text | Mode, Antivirus Mode, Defender Mode, Prevention Mode, Policy Mode | Verkehrsträger, Mode de transport, 輸送モード, 运输方式 |
126
+
127
+ Named exports recognised by their column names:
128
+
129
+ | System | Export | Recognised by | Layout checked against vendor docs |
130
+ |---|---|---|---|
131
+ | Microsoft Defender for Endpoint | Device inventory exported to CSV | Device Name, Onboarding Status, Health State | no |
132
+
133
+ Where a layout says "checked", its column names were compared with the vendor's documentation on that date. The other layouts were written from knowledge of the export and were not checked. None was tested against a live account.
134
+
135
+ ### Asset list (`assets`)
136
+
137
+ | Column | Type | Also read as | For example, in other languages |
138
+ |---|---|---|---|
139
+ | `device` (required) | text | Device Name, Hostname, Name, Computer Name, Asset Name | Gerät, Appareil, デバイス, 设备 |
140
+ | `type` | text | Type, Device Type, Class, Category | Typ, Type, 種類, 类型 |
141
+
142
+ ### Alerts (`alerts`)
143
+
144
+ | Column | Type | Also read as | For example, in other languages |
145
+ |---|---|---|---|
146
+ | `alert_id` (required) | text | Alert ID, ID, Incident ID, Detection ID | - |
147
+ | `device` (required) | text | Device Name, Device, Hostname, Computer Name | Gerät, Appareil, デバイス, 设备 |
148
+ | `severity` | text | Severity, Priority, Risk | Schweregrad, Gravité, 重大度, 严重程度 |
149
+ | `status` | text | Status, State, Resolution | Status, Statut, ステータス, 状态 |
150
+ | `created` | date and time | Created, First Seen, Alert Time, Detected, Timestamp | - |
151
+ | `title` | text | Title, Alert, Name, Threat | Produkt, Produit, 製品, 产品 |
152
+
153
+ ### Files from other countries
154
+
155
+ A German export in Windows-1252 with semicolons, `1.234,56` and `03.11.2026`, or a Japanese one in Shift_JIS with `2026/11/03`, is read the same way as the English file. [`fixtures/intl/`](fixtures/intl) has both versions of the demo data, and the eval cases `intl-de-*` and `intl-ja-*` require the same results as the English case. Columns named differently? Run `npx fairwire-endpoint-protection inspect <file>` (names and shapes only, never values) and name them in `fairwire-sources.json`:
156
+
157
+ ```json
158
+ { "files": { "exports/devices.csv": { "columns": { "host": "Gerätename" }, "date_order": "dmy" } } }
159
+ ```
160
+
161
+ ## Memory
162
+
163
+ fairwire-endpoint-protection can remember facts about your setup so the next run does not have to be told again. `endpoints_learn` only proposes a fact; it changes nothing until a named person accepts it with `endpoints_accept_learning`, which is one click even in Auto. Facts live in one hash-chained file per agent under `.fairwire/memory/`; if the chain does not verify, no fact is used. Credentials, personal identifiers and text that reads like instructions to an AI are refused. Run without memory with `--no-memory`.
164
+
165
+ | Kind | What an accepted fact changes |
166
+ |---|---|
167
+ | `known_exception` | that finding is listed under "Accepted as known" instead of as open, until review_by (when given) has passed. |
168
+ | `note` | nothing (shown by recall only) |
169
+
170
+ ```bash
171
+ fairwire-endpoint-protection memory list
172
+ fairwire-endpoint-protection memory accept MEM-1a2b3c4d5e6f --as "Your Name"
173
+ fairwire-endpoint-protection memory retire MEM-1a2b3c4d5e6f --as "Your Name" --reason "rule removed"
174
+ ```
175
+
176
+ ## Install
177
+
178
+ Node 20 or newer. No other dependencies.
179
+
180
+ ```bash
181
+ npx -y fairwire-endpoint-protection demo
182
+ npx -y fairwire-endpoint-protection mcp --root /path/to/your/files
183
+ ```
184
+
185
+ Claude Desktop, Cursor and other MCP hosts:
186
+
187
+ ```json
188
+ {
189
+ "mcpServers": {
190
+ "fairwire-endpoint-protection": {
191
+ "command": "npx",
192
+ "args": [
193
+ "-y",
194
+ "fairwire-endpoint-protection",
195
+ "mcp",
196
+ "--root",
197
+ "/path/to/your/files"
198
+ ]
199
+ }
200
+ }
201
+ }
202
+ ```
203
+
204
+ Claude Code: `claude mcp add fairwire-endpoint-protection -- npx -y fairwire-endpoint-protection mcp --root .`, or install the `fairwire-endpoint-protection` plugin from this repository's marketplace.
205
+
206
+ ## Modes and approvals
207
+
208
+ - **Review** (`--mode review`): reads and reports only.
209
+ - **Assist** (default): the policy above. A tool that asks returns an `approval_id`; a person approves it once with `fairwire-endpoint-protection approve <id> --as "Your Name"` (or on the local approvals page, `fairwire-endpoint-protection approvals`), and the same call is repeated.
210
+ - **Auto** (`--mode auto --auto <tool,...>`): opt-in per tool, with step caps and a kill switch (`fairwire-endpoint-protection kill`). Paying, sending, posting to a ledger or a live system and accepting a learned fact stay **one named click even in Auto**; an approval is tied to the sha256 of the reviewed draft, so a changed draft needs a new click.
211
+
212
+ ## CLI
213
+
214
+ ```bash
215
+ fairwire-endpoint-protection tools # every tool, its policy and arguments
216
+ fairwire-endpoint-protection sources # the columns each input is read from
217
+ fairwire-endpoint-protection inspect <file> # how a file would be read (names and shapes, never values)
218
+ fairwire-endpoint-protection call endpoints_check '{"devices":"<devices>"}'
219
+ fairwire-endpoint-protection eval # the private eval cases on the fictional fixtures
220
+ fairwire-endpoint-protection demo
221
+ ```
222
+
223
+ ## Audit log and data
224
+
225
+ Every call is written to `.fairwire/audit.jsonl` under the root: hash-chained JSON lines, with arguments stored as a hash, signed with an Ed25519 key when you configure one. Everything runs on your machine on files you choose. No network calls, no telemetry, no credentials. The bundled fixtures are fictional.
226
+
227
+ <!-- generated:end -->
228
+
229
+ ## Limits
230
+
231
+ - Reads only the files you export and give it. It does not log in to a firewall, switch, controller, cloud console, identity provider or any other live system.
232
+ - Coverage compares device names (without the domain); a device renamed in one system and not the other shows as uncovered.
233
+ - An agent that reports healthy can still miss a threat; this is a coverage and hygiene check, not a security assessment.
234
+ - Thresholds are working defaults in a settings file you control; they are not a vendor rule, a requirement of any standard or a security guarantee.
235
+ - It changes nothing on a live device, firewall, DNS zone, directory or cloud account. Every change it suggests is a draft that one named person applies.
236
+ - Export layouts were written from knowledge of common exports and have not been tested on live customer accounts. Run `inspect` on a new export and name columns in `fairwire-sources.json` when they differ.
237
+
238
+ ## Licence
239
+
240
+ MIT. Fictional data only in `fixtures/`.
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { fileURLToPath } from 'node:url';
3
+ import { main } from 'fairwire-core';
4
+ import { manifest } from '../src/manifest.js';
5
+ import { demo } from '../src/demo.js';
6
+
7
+ main(manifest, { bin: 'fairwire-endpoint-protection', demo, evalFile: fileURLToPath(new URL('../evals/cases.json', import.meta.url)) });
@@ -0,0 +1,377 @@
1
+ {
2
+ "suite": "fairwire-endpoint-protection",
3
+ "root": "..",
4
+ "data_note": "Fictional endpoint security data in ../fixtures, as of 2026-11-18. No model is called.",
5
+ "cases": [
6
+ {
7
+ "id": "check-totals",
8
+ "tool": "endpoints_check",
9
+ "args": {
10
+ "devices": "fixtures/devices.csv",
11
+ "assets": "fixtures/assets.csv",
12
+ "alerts": "fixtures/alerts.csv",
13
+ "settings": "fixtures/settings.json",
14
+ "as_of": "2026-11-18"
15
+ },
16
+ "expect": {
17
+ "equals": {
18
+ "result.devices": 8,
19
+ "result.assets_in_scope": 10,
20
+ "result.covered_pct": 80,
21
+ "result.open_alerts": 3,
22
+ "result.open": 10,
23
+ "result.high": 4
24
+ }
25
+ }
26
+ },
27
+ {
28
+ "id": "every-planted-issue",
29
+ "tool": "endpoints_check",
30
+ "args": {
31
+ "devices": "fixtures/devices.csv",
32
+ "assets": "fixtures/assets.csv",
33
+ "alerts": "fixtures/alerts.csv",
34
+ "settings": "fixtures/settings.json",
35
+ "as_of": "2026-11-18"
36
+ },
37
+ "expect": {
38
+ "contains": [
39
+ "no_agent",
40
+ "PC-108",
41
+ "SRV-202",
42
+ "protection_off",
43
+ "PC-103",
44
+ "open_high_alert",
45
+ "AL-9001",
46
+ "tamper_off",
47
+ "passive_mode",
48
+ "PC-105",
49
+ "agent_not_reporting",
50
+ "old_signatures",
51
+ "old_agent",
52
+ "two_products",
53
+ "OtherAV"
54
+ ],
55
+ "not_contains": [
56
+ "PRN-301",
57
+ "AL-9003",
58
+ "AL-9004",
59
+ "SRV-201 runs"
60
+ ]
61
+ }
62
+ },
63
+ {
64
+ "id": "console-export-only",
65
+ "tool": "endpoints_check",
66
+ "args": {
67
+ "devices": "fixtures/devices.csv",
68
+ "as_of": "2026-11-18"
69
+ },
70
+ "expect": {
71
+ "equals": {
72
+ "result.covered_pct": null,
73
+ "result.open": 7,
74
+ "result.high": 1
75
+ }
76
+ }
77
+ },
78
+ {
79
+ "id": "critical-alert-after-two-days",
80
+ "tool": "endpoints_check",
81
+ "args": {
82
+ "devices": "fixtures/devices.csv",
83
+ "alerts": "fixtures/alerts.csv",
84
+ "settings": "fixtures/settings.json",
85
+ "as_of": "2026-11-21",
86
+ "code": "open_high_alert"
87
+ },
88
+ "expect": {
89
+ "equals": {
90
+ "result.findings": 2
91
+ },
92
+ "contains": [
93
+ "AL-9004"
94
+ ]
95
+ }
96
+ },
97
+ {
98
+ "id": "explain-pc106",
99
+ "tool": "endpoints_explain",
100
+ "args": {
101
+ "devices": "fixtures/devices.csv",
102
+ "assets": "fixtures/assets.csv",
103
+ "alerts": "fixtures/alerts.csv",
104
+ "settings": "fixtures/settings.json",
105
+ "as_of": "2026-11-18",
106
+ "device": "PC-106"
107
+ },
108
+ "expect": {
109
+ "contains": [
110
+ "agent_not_reporting",
111
+ "old_signatures",
112
+ "old_agent"
113
+ ],
114
+ "equals": {
115
+ "result.findings": 3
116
+ }
117
+ }
118
+ },
119
+ {
120
+ "id": "draft-after-approval",
121
+ "tool": "endpoints_draft_security_note",
122
+ "approve": "Pat Example",
123
+ "args": {
124
+ "devices": "fixtures/devices.csv",
125
+ "assets": "fixtures/assets.csv",
126
+ "alerts": "fixtures/alerts.csv",
127
+ "settings": "fixtures/settings.json",
128
+ "as_of": "2026-11-18"
129
+ },
130
+ "expect": {
131
+ "status": "executed",
132
+ "contains": [
133
+ "Nothing was sent"
134
+ ],
135
+ "equals": {
136
+ "result.items": 8,
137
+ "result.open_markers": 1
138
+ }
139
+ }
140
+ },
141
+ {
142
+ "id": "review-mode-still-reads",
143
+ "tool": "endpoints_check",
144
+ "mode": "review",
145
+ "args": {
146
+ "devices": "fixtures/devices.csv",
147
+ "assets": "fixtures/assets.csv",
148
+ "alerts": "fixtures/alerts.csv",
149
+ "settings": "fixtures/settings.json",
150
+ "as_of": "2026-11-18"
151
+ },
152
+ "expect": {
153
+ "status": "executed",
154
+ "equals": {
155
+ "result.devices": 8,
156
+ "result.assets_in_scope": 10,
157
+ "result.covered_pct": 80,
158
+ "result.open_alerts": 3,
159
+ "result.open": 10,
160
+ "result.high": 4
161
+ }
162
+ },
163
+ "generated": true
164
+ },
165
+ {
166
+ "id": "severity-filter",
167
+ "tool": "endpoints_check",
168
+ "args": {
169
+ "devices": "fixtures/devices.csv",
170
+ "assets": "fixtures/assets.csv",
171
+ "alerts": "fixtures/alerts.csv",
172
+ "settings": "fixtures/settings.json",
173
+ "as_of": "2026-11-18",
174
+ "severity": "high"
175
+ },
176
+ "expect": {
177
+ "status": "executed",
178
+ "equals": {
179
+ "result.findings": 4
180
+ }
181
+ },
182
+ "generated": true
183
+ },
184
+ {
185
+ "id": "missing-argument-named",
186
+ "tool": "endpoints_check",
187
+ "args": {},
188
+ "expect": {
189
+ "status": "error",
190
+ "contains": [
191
+ "devices"
192
+ ]
193
+ },
194
+ "generated": true
195
+ },
196
+ {
197
+ "id": "file-outside-root-refused",
198
+ "tool": "endpoints_check",
199
+ "args": {
200
+ "devices": "../../../outside.csv",
201
+ "assets": "fixtures/assets.csv",
202
+ "alerts": "fixtures/alerts.csv",
203
+ "settings": "fixtures/settings.json",
204
+ "as_of": "2026-11-18"
205
+ },
206
+ "expect": {
207
+ "status": "error",
208
+ "contains": [
209
+ "outside"
210
+ ]
211
+ },
212
+ "generated": true
213
+ },
214
+ {
215
+ "id": "invented-tool-name-refused",
216
+ "tool": "endpoints_apply_every_fix_now",
217
+ "args": {},
218
+ "expect": {
219
+ "status": "blocked"
220
+ },
221
+ "generated": true
222
+ },
223
+ {
224
+ "id": "write-report-writes-files",
225
+ "tool": "endpoints_write_report",
226
+ "args": {
227
+ "devices": "fixtures/devices.csv",
228
+ "assets": "fixtures/assets.csv",
229
+ "alerts": "fixtures/alerts.csv",
230
+ "settings": "fixtures/settings.json",
231
+ "as_of": "2026-11-18"
232
+ },
233
+ "expect": {
234
+ "status": "executed",
235
+ "contains": [
236
+ "endpoint-protection.csv",
237
+ "endpoint-protection.html"
238
+ ]
239
+ },
240
+ "generated": true
241
+ },
242
+ {
243
+ "id": "recall-memory-starts-empty",
244
+ "tool": "endpoints_recall",
245
+ "args": {},
246
+ "expect": {
247
+ "status": "executed",
248
+ "contains": [
249
+ "memory is empty"
250
+ ]
251
+ },
252
+ "generated": true
253
+ },
254
+ {
255
+ "id": "accept-learning-stays-one-click",
256
+ "tool": "endpoints_accept_learning",
257
+ "mode": "auto",
258
+ "args": {
259
+ "id": "MEM-000000000000",
260
+ "decision": "accept"
261
+ },
262
+ "expect": {
263
+ "status": "needs_approval"
264
+ },
265
+ "generated": true
266
+ },
267
+ {
268
+ "id": "never-edr-isolate-device",
269
+ "tool": "edr_isolate_device",
270
+ "mode": "auto",
271
+ "args": {},
272
+ "expect": {
273
+ "status": "blocked"
274
+ },
275
+ "generated": true
276
+ },
277
+ {
278
+ "id": "never-edr-change-policy",
279
+ "tool": "edr_change_policy",
280
+ "mode": "auto",
281
+ "args": {},
282
+ "expect": {
283
+ "status": "blocked"
284
+ },
285
+ "generated": true
286
+ },
287
+ {
288
+ "id": "draft-waits-for-a-person",
289
+ "tool": "endpoints_draft_security_note",
290
+ "args": {
291
+ "devices": "fixtures/devices.csv",
292
+ "assets": "fixtures/assets.csv",
293
+ "alerts": "fixtures/alerts.csv",
294
+ "settings": "fixtures/settings.json",
295
+ "as_of": "2026-11-18"
296
+ },
297
+ "expect": {
298
+ "status": "needs_approval",
299
+ "decision": "ask"
300
+ },
301
+ "generated": true
302
+ },
303
+ {
304
+ "id": "review-mode-drafts-nothing",
305
+ "tool": "endpoints_draft_security_note",
306
+ "mode": "review",
307
+ "args": {
308
+ "devices": "fixtures/devices.csv",
309
+ "assets": "fixtures/assets.csv",
310
+ "alerts": "fixtures/alerts.csv",
311
+ "settings": "fixtures/settings.json",
312
+ "as_of": "2026-11-18"
313
+ },
314
+ "expect": {
315
+ "status": "blocked"
316
+ },
317
+ "generated": true
318
+ },
319
+ {
320
+ "id": "request-stays-one-click",
321
+ "tool": "endpoints_request_send",
322
+ "mode": "auto",
323
+ "args": {
324
+ "draft": "fixtures/README.md",
325
+ "draft_sha256": "0000000000000000000000000000000000000000000000000000000000000000"
326
+ },
327
+ "expect": {
328
+ "status": "needs_approval"
329
+ },
330
+ "generated": true
331
+ },
332
+ {
333
+ "id": "intl-de-check-totals",
334
+ "tool": "endpoints_check",
335
+ "args": {
336
+ "devices": "fixtures/intl/de/devices.csv",
337
+ "assets": "fixtures/intl/de/assets.csv",
338
+ "alerts": "fixtures/intl/de/alerts.csv",
339
+ "settings": "fixtures/settings.json",
340
+ "as_of": "2026-11-18"
341
+ },
342
+ "expect": {
343
+ "equals": {
344
+ "result.devices": 8,
345
+ "result.assets_in_scope": 10,
346
+ "result.covered_pct": 80,
347
+ "result.open_alerts": 3,
348
+ "result.open": 10,
349
+ "result.high": 4
350
+ }
351
+ },
352
+ "note": "German export of the same data (fixtures/intl/de); must match the English case \"check-totals\"."
353
+ },
354
+ {
355
+ "id": "intl-ja-check-totals",
356
+ "tool": "endpoints_check",
357
+ "args": {
358
+ "devices": "fixtures/intl/ja/devices.csv",
359
+ "assets": "fixtures/intl/ja/assets.csv",
360
+ "alerts": "fixtures/intl/ja/alerts.csv",
361
+ "settings": "fixtures/settings.json",
362
+ "as_of": "2026-11-18"
363
+ },
364
+ "expect": {
365
+ "equals": {
366
+ "result.devices": 8,
367
+ "result.assets_in_scope": 10,
368
+ "result.covered_pct": 80,
369
+ "result.open_alerts": 3,
370
+ "result.open": 10,
371
+ "result.high": 4
372
+ }
373
+ },
374
+ "note": "Japanese export of the same data (fixtures/intl/ja); must match the English case \"check-totals\"."
375
+ }
376
+ ]
377
+ }
@@ -0,0 +1,8 @@
1
+ # Fairwire Endpoint Protection fixtures
2
+
3
+ Fictional endpoint security export, asset list and alerts.
4
+
5
+ - `devices.csv`: 8 devices. PC-103 has protection off; PC-104 tamper protection off; PC-105 runs in passive mode; PC-106 stopped reporting on 3 November with old signatures and an old agent; PC-107 runs two products; SRV-201 is passive on purpose (listed in settings).
6
+ - `assets.csv`: 11 assets; PC-108 and SRV-202 have no agent; the printer is skipped.
7
+ - `alerts.csv`: a high alert open since 12 November, a medium alert, a resolved high alert and a critical alert opened last night (inside the two days).
8
+ - `settings.json`: SRV-201 may be passive; agent 4.18.24000 or newer.
@@ -0,0 +1,5 @@
1
+ alert_id,device,severity,status,created,title
2
+ AL-9001,PC-102,High,New,2026-11-12 10:00:00,Suspicious PowerShell
3
+ AL-9002,PC-101,Medium,New,2026-11-10 10:00:00,Unwanted software
4
+ AL-9003,PC-104,High,Resolved,2026-11-05 10:00:00,Credential theft tool
5
+ AL-9004,PC-103,Critical,In progress,2026-11-17 22:00:00,Ransomware behaviour
@@ -0,0 +1,12 @@
1
+ device,type
2
+ PC-101,laptop
3
+ PC-102,laptop
4
+ PC-103,laptop
5
+ PC-104,laptop
6
+ PC-105,desktop
7
+ PC-106,laptop
8
+ PC-107,laptop
9
+ PC-108,laptop
10
+ SRV-201,server
11
+ SRV-202,server
12
+ PRN-301,printer
@@ -0,0 +1,10 @@
1
+ device,product,agent_version,signature_date,last_seen,protection,tamper_protection,mode
2
+ PC-101,Defender,4.18.24090,2026-11-17,2026-11-18 07:00:00,On,On,Active
3
+ PC-102,Defender,4.18.24090,2026-11-17,2026-11-18 07:00:00,On,On,Active
4
+ PC-103,Defender,4.18.24090,2026-11-17,2026-11-18 07:00:00,Off,On,Active
5
+ PC-104,Defender,4.18.24090,2026-11-17,2026-11-18 07:00:00,On,Off,Active
6
+ PC-105,Defender,4.18.24090,2026-11-17,2026-11-18 07:00:00,On,On,Passive
7
+ PC-106,Defender,4.18.23110,2026-11-02,2026-11-03 10:00:00,On,On,Active
8
+ PC-107,Defender,4.18.24090,2026-11-17,2026-11-18 07:00:00,On,On,Active
9
+ PC-107,OtherAV,12.1,2026-11-17,2026-11-18 07:00:00,On,,Active
10
+ SRV-201,Defender,4.18.24090,2026-11-17,2026-11-18 07:00:00,On,On,Passive
@@ -0,0 +1,12 @@
1
+ # Fixtures from other countries
2
+
3
+ Generated by `node scripts/make-intl-fixtures.mjs` from the English fixtures one
4
+ folder up. The same fictional data, written the way a local export writes it:
5
+
6
+ - `de/`: German column names, Windows-1252 text, semicolons, comma decimals
7
+ (1.234,56), day-first dotted dates (03.11.2026), kilograms and kilometres.
8
+ - `ja/`: Japanese column names, Shift_JIS text, year-first dates (2026/11/03),
9
+ kilograms and kilometres.
10
+
11
+ Values (names, codes, charge wording) stay in English. The eval cases
12
+ `intl-de-*` and `intl-ja-*` expect exactly the same results as the English case.
@@ -0,0 +1,5 @@
1
+ alert_id;Ger�t;Schweregrad;Zustand;created;Produkt
2
+ AL-9001;PC-102;High;New;12.11.2026 10:00:00;Suspicious PowerShell
3
+ AL-9002;PC-101;Medium;New;10.11.2026 10:00:00;Unwanted software
4
+ AL-9003;PC-104;High;Resolved;05.11.2026 10:00:00;Credential theft tool
5
+ AL-9004;PC-103;Critical;In progress;17.11.2026 22:00:00;Ransomware behaviour
@@ -0,0 +1,12 @@
1
+ Ger�t;Typ
2
+ PC-101;laptop
3
+ PC-102;laptop
4
+ PC-103;laptop
5
+ PC-104;laptop
6
+ PC-105;desktop
7
+ PC-106;laptop
8
+ PC-107;laptop
9
+ PC-108;laptop
10
+ SRV-201;server
11
+ SRV-202;server
12
+ PRN-301;printer
@@ -0,0 +1,10 @@
1
+ Ger�t;Produkt;agent_version;signature_date;Zuletzt gesehen;protection;tamper_protection;Verkehrstr�ger
2
+ PC-101;Defender;4.18.24090;17.11.2026;18.11.2026 07:00:00;On;On;Active
3
+ PC-102;Defender;4.18.24090;17.11.2026;18.11.2026 07:00:00;On;On;Active
4
+ PC-103;Defender;4.18.24090;17.11.2026;18.11.2026 07:00:00;Off;On;Active
5
+ PC-104;Defender;4.18.24090;17.11.2026;18.11.2026 07:00:00;On;Off;Active
6
+ PC-105;Defender;4.18.24090;17.11.2026;18.11.2026 07:00:00;On;On;Passive
7
+ PC-106;Defender;4.18.23110;02.11.2026;03.11.2026 10:00:00;On;On;Active
8
+ PC-107;Defender;4.18.24090;17.11.2026;18.11.2026 07:00:00;On;On;Active
9
+ PC-107;OtherAV;12.1;17.11.2026;18.11.2026 07:00:00;On;;Active
10
+ SRV-201;Defender;4.18.24090;17.11.2026;18.11.2026 07:00:00;On;On;Passive
@@ -0,0 +1,5 @@
1
+ alert_id,�f�o�C�X,�d��x,�X�e�[�^�X,created,���i
2
+ AL-9001,PC-102,High,New,2026/11/12 10:00:00,Suspicious PowerShell
3
+ AL-9002,PC-101,Medium,New,2026/11/10 10:00:00,Unwanted software
4
+ AL-9003,PC-104,High,Resolved,2026/11/05 10:00:00,Credential theft tool
5
+ AL-9004,PC-103,Critical,In progress,2026/11/17 22:00:00,Ransomware behaviour
@@ -0,0 +1,12 @@
1
+ �f�o�C�X,���
2
+ PC-101,laptop
3
+ PC-102,laptop
4
+ PC-103,laptop
5
+ PC-104,laptop
6
+ PC-105,desktop
7
+ PC-106,laptop
8
+ PC-107,laptop
9
+ PC-108,laptop
10
+ SRV-201,server
11
+ SRV-202,server
12
+ PRN-301,printer
@@ -0,0 +1,10 @@
1
+ �f�o�C�X,���i,�o�[�W����,signature_date,�ŏI�m�F����,protection,tamper_protection,�A�����[�h
2
+ PC-101,Defender,4.18.24090,2026/11/17,2026/11/18 07:00:00,On,On,Active
3
+ PC-102,Defender,4.18.24090,2026/11/17,2026/11/18 07:00:00,On,On,Active
4
+ PC-103,Defender,4.18.24090,2026/11/17,2026/11/18 07:00:00,Off,On,Active
5
+ PC-104,Defender,4.18.24090,2026/11/17,2026/11/18 07:00:00,On,Off,Active
6
+ PC-105,Defender,4.18.24090,2026/11/17,2026/11/18 07:00:00,On,On,Passive
7
+ PC-106,Defender,4.18.23110,2026/11/02,2026/11/03 10:00:00,On,On,Active
8
+ PC-107,Defender,4.18.24090,2026/11/17,2026/11/18 07:00:00,On,On,Active
9
+ PC-107,OtherAV,12.1,2026/11/17,2026/11/18 07:00:00,On,,Active
10
+ SRV-201,Defender,4.18.24090,2026/11/17,2026/11/18 07:00:00,On,On,Passive
@@ -0,0 +1,4 @@
1
+ {
2
+ "passive_ok": ["SRV-201"],
3
+ "min_agent_version": "4.18.24000"
4
+ }
package/package.json CHANGED
@@ -1,6 +1,59 @@
1
1
  {
2
2
  "name": "fairwire-endpoint-protection",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "mcpName": "io.github.fpavia111-creator/fairwire-endpoint-protection",
5
+ "description": "Fairwire Endpoint Protection: Endpoint protection coverage: devices in your asset list with no security agent, agents not reporting, old signatures or agent versions, protection or tamper protection off, passive mode, two security products on one device and high alerts left open. Drafts notes; never isolates or changes a device.",
6
+ "type": "module",
7
+ "license": "MIT",
8
+ "author": "Kurt Francisco",
9
+ "engines": {
10
+ "node": ">=20"
11
+ },
12
+ "main": "src/index.js",
13
+ "exports": {
14
+ ".": "./src/index.js",
15
+ "./package.json": "./package.json"
16
+ },
17
+ "bin": {
18
+ "fairwire-endpoint-protection": "bin/fairwire-endpoint-protection.js"
19
+ },
20
+ "files": [
21
+ "src",
22
+ "bin",
23
+ "fixtures",
24
+ "evals",
25
+ "README.md",
26
+ "CHANGELOG.md",
27
+ "LICENSE",
28
+ "server.json"
29
+ ],
30
+ "scripts": {
31
+ "test": "node scripts/run-tests.cjs",
32
+ "demo": "node bin/fairwire-endpoint-protection.js demo",
33
+ "eval": "node bin/fairwire-endpoint-protection.js eval"
34
+ },
35
+ "dependencies": {
36
+ "fairwire-core": "^0.1.0"
37
+ },
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/fpavia111-creator/fairwire-agents.git",
41
+ "directory": "packages/fairwire-endpoint-protection"
42
+ },
43
+ "homepage": "https://github.com/fpavia111-creator/fairwire-agents/tree/master/packages/fairwire-endpoint-protection#readme",
44
+ "bugs": {
45
+ "url": "https://github.com/fpavia111-creator/fairwire-agents/issues"
46
+ },
47
+ "keywords": [
48
+ "mcp",
49
+ "mcp-server",
50
+ "it-operations",
51
+ "network",
52
+ "fairwire",
53
+ "edr",
54
+ "antivirus",
55
+ "endpoint-security",
56
+ "defender",
57
+ "crowdstrike"
58
+ ]
59
+ }
package/server.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.fpavia111-creator/fairwire-endpoint-protection",
4
+ "title": "Fairwire Endpoint Protection",
5
+ "description": "Fairwire Endpoint Protection: Endpoint protection coverage: devices in your asset list with no…",
6
+ "version": "0.1.0",
7
+ "repository": {
8
+ "url": "https://github.com/fpavia111-creator/fairwire-agents",
9
+ "source": "github",
10
+ "subfolder": "packages/fairwire-endpoint-protection"
11
+ },
12
+ "websiteUrl": "https://fair-agents.com/fairwire.html",
13
+ "packages": [
14
+ {
15
+ "registryType": "npm",
16
+ "identifier": "fairwire-endpoint-protection",
17
+ "version": "0.1.0",
18
+ "transport": {
19
+ "type": "stdio"
20
+ },
21
+ "packageArguments": [
22
+ {
23
+ "type": "positional",
24
+ "value": "mcp"
25
+ },
26
+ {
27
+ "type": "named",
28
+ "name": "--root",
29
+ "description": "Folder holding the exports this agent may read and write (it cannot reach outside it)",
30
+ "isRequired": true,
31
+ "format": "filepath",
32
+ "valueHint": "exports_folder"
33
+ }
34
+ ]
35
+ }
36
+ ]
37
+ }
package/src/demo.js ADDED
@@ -0,0 +1,19 @@
1
+ import { fileURLToPath } from 'node:url';
2
+ import { readFileSync } from 'node:fs';
3
+ import { standardDemo } from 'fairwire-core';
4
+
5
+ // The demo runs the eval case "check-totals" and the agent's draft on the fictional fixtures.
6
+ const cases = JSON.parse(readFileSync(new URL('../evals/cases.json', import.meta.url), 'utf8')).cases;
7
+ const base = cases.find((c) => c.id === 'check-totals');
8
+ const explain = cases.find((c) => /_explain$/.test(c.tool) && !c.expect.status);
9
+ const draft = cases.find((c) => /_draft_/.test(c.tool) && c.approve);
10
+
11
+ export async function demo(manifest) {
12
+ const refused = manifest.tools.filter((t) => (manifest.policy.rules.find((r) => r.tool === t.name) || {}).decision === 'block')[0];
13
+ await standardDemo(manifest, fileURLToPath(new URL('../fixtures', import.meta.url)), {
14
+ title: 'Fairwire Endpoint Protection demo', args: base.args,
15
+ explain: explain ? { label: 'Explain one finding', args: explain.args } : null,
16
+ draft: draft ? { label: 'Draft the note for a person', args: draft.args } : null,
17
+ refused: refused ? refused.name : null,
18
+ });
19
+ }
package/src/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { manifest } from './manifest.js';
2
+ export * from './logic.js';
package/src/logic.js ADDED
@@ -0,0 +1,81 @@
1
+ // Fairwire Endpoint Protection: endpoint protection coverage. Pure functions.
2
+ import { str, low, yes, isoDate, daysBetween, hostKey, versionCompare, pct, finding } from 'fairwire-core';
3
+
4
+ export const CHECKS = Object.freeze({
5
+ no_agent: 'A device in your asset list with no endpoint security agent in the console export.',
6
+ protection_off: 'Real-time protection is turned off on a device.',
7
+ open_high_alert: 'A high or critical alert still open after your limit.',
8
+ tamper_off: 'Tamper protection is off, so malware or a user can switch the agent off.',
9
+ passive_mode: 'The agent runs in passive mode (detects but does not block) on a device where it should block.',
10
+ agent_not_reporting: 'An agent that has not checked in for longer than your limit.',
11
+ old_signatures: 'Detection signatures older than your limit.',
12
+ two_products: 'Two different security products on one device (they can conflict and slow the device).',
13
+ old_agent: 'An agent version older than the one you require.',
14
+ });
15
+
16
+ export const DEVICE_FIELDS = Object.freeze({
17
+ device: { aliases: ['Device Name', 'Device', 'Hostname', 'Computer Name', 'Endpoint', 'Machine Name'], required: true },
18
+ product: { aliases: ['Product', 'Agent', 'Security Product', 'Sensor', 'Antivirus'] },
19
+ agent_version: { aliases: ['Agent Version', 'Sensor Version', 'Client Version', 'Version'] },
20
+ signature_date: { type: 'date', aliases: ['Signature Date', 'Definitions Date', 'Security Intelligence Updated', 'Definition Version Date', 'Signature Updated'] },
21
+ last_seen: { type: 'datetime', aliases: ['Last Seen', 'Last Device Update', 'Last Check-in', 'Last Contact', 'Last Communication'] },
22
+ protection: { aliases: ['Real-time Protection', 'Protection', 'RTP', 'Real Time Protection Enabled', 'Health State'] },
23
+ tamper_protection: { aliases: ['Tamper Protection', 'Tamper', 'Uninstall Protection'] },
24
+ mode: { aliases: ['Mode', 'Antivirus Mode', 'Defender Mode', 'Prevention Mode', 'Policy Mode'] },
25
+ });
26
+ export const ASSET_FIELDS = Object.freeze({
27
+ device: { aliases: ['Device Name', 'Hostname', 'Name', 'Computer Name', 'Asset Name'], required: true },
28
+ type: { aliases: ['Type', 'Device Type', 'Class', 'Category'] },
29
+ });
30
+ export const ALERT_FIELDS = Object.freeze({
31
+ alert_id: { aliases: ['Alert ID', 'ID', 'Incident ID', 'Detection ID'], required: true },
32
+ device: { aliases: ['Device Name', 'Device', 'Hostname', 'Computer Name'], required: true },
33
+ severity: { aliases: ['Severity', 'Priority', 'Risk'] },
34
+ status: { aliases: ['Status', 'State', 'Resolution'] },
35
+ created: { type: 'datetime', aliases: ['Created', 'First Seen', 'Alert Time', 'Detected', 'Timestamp'] },
36
+ title: { aliases: ['Title', 'Alert', 'Name', 'Threat'] },
37
+ });
38
+
39
+ export const SETTINGS_SCHEMA = { type: 'object', additionalProperties: false, properties: {
40
+ stale_days: { type: 'integer', minimum: 1, description: 'Days without a check-in after which an agent counts as not reporting (default 7)' },
41
+ signature_max_days: { type: 'integer', minimum: 1, description: 'Days after which signatures count as old (default 3)' },
42
+ alert_open_days: { type: 'integer', minimum: 0, description: 'Days a high or critical alert may stay open (default 2)' },
43
+ min_agent_version: { type: 'string', maxLength: 40, description: 'Oldest agent version you accept (no check when empty)' },
44
+ passive_ok: { type: 'array', items: { type: 'string' }, maxItems: 1000, description: 'Devices where passive mode is intended (another product blocks)' },
45
+ asset_types_without_agent: { type: 'array', items: { type: 'string' }, maxItems: 50, description: 'Asset types that cannot run an agent and are skipped by the coverage check (default printer, camera, phone, network)' },
46
+ } };
47
+ export const DEFAULTS = Object.freeze({ stale_days: 7, signature_max_days: 3, alert_open_days: 2, min_agent_version: '', passive_ok: [], asset_types_without_agent: ['printer', 'camera', 'phone', 'network', 'switch', 'access point'] });
48
+
49
+ const OFF = /^(off|disabled|no|false|0|inactive|not running|unhealthy)$/i;
50
+
51
+ export function reviewEndpoints({ devices = [], assets = [], alerts = [] }, settings = {}, asOf) {
52
+ const s = { ...DEFAULTS, ...settings };
53
+ const ds = devices.filter((r) => str(r.device)).map((r) => ({ key: hostKey(r.device), name: str(r.device), product: str(r.product) || 'agent', version: str(r.agent_version), sig: isoDate(r.signature_date), seen: isoDate(r.last_seen), protection: str(r.protection), tamper: str(r.tamper_protection), mode: low(r.mode) }));
54
+ const byDev = new Map(); for (const d of ds) byDev.set(d.key, [...(byDev.get(d.key) || []), d]);
55
+ const items = [];
56
+ for (const [, list] of byDev) {
57
+ const d = list[0]; const n = d.name;
58
+ const products = [...new Set(list.map((x) => low(x.product)))];
59
+ if (products.length > 1) items.push(finding('two_products', 'low', n, `${n} reports ${products.length} security products (${[...new Set(list.map((x) => x.product))].sort().join(', ')}).`, 'Keep one product in blocking mode and remove the other, or set the second to passive on purpose.', { subject: n }));
60
+ for (const x of list) {
61
+ if (OFF.test(x.protection) || yes(x.protection) === false) items.push(finding('protection_off', 'high', n, `Real-time protection is off on ${n} (${x.product}).`, 'Turn it back on and find out who or what turned it off.', { subject: n }));
62
+ if (x.tamper && (OFF.test(x.tamper) || yes(x.tamper) === false)) items.push(finding('tamper_off', 'medium', n, `Tamper protection is off on ${n} (${x.product}).`, 'Turn tamper protection on in the console policy for this device.', { subject: n }));
63
+ if (/passive|detect only|audit|monitor/.test(x.mode) && !s.passive_ok.map(hostKey).includes(x.key)) items.push(finding('passive_mode', 'medium', n, `${x.product} on ${n} runs in ${x.mode} mode and does not block threats.`, 'Switch it to active or blocking mode, or list the device in passive_ok if another product blocks.', { subject: n }));
64
+ if (x.seen && asOf && daysBetween(x.seen, asOf) > s.stale_days) items.push(finding('agent_not_reporting', 'medium', n, `${x.product} on ${n} last checked in on ${x.seen}.`, 'Check that the device is on and the agent service runs; reinstall it if needed.', { subject: n }));
65
+ if (x.sig && asOf && daysBetween(x.sig, asOf) > s.signature_max_days) items.push(finding('old_signatures', 'medium', n, `${x.product} signatures on ${n} date from ${x.sig}.`, 'Check the device can reach its update source.', { subject: n }));
66
+ if (s.min_agent_version && x.version && versionCompare(x.version, s.min_agent_version) < 0) items.push(finding('old_agent', 'low', n, `${n} runs ${x.product} ${x.version}, older than ${s.min_agent_version}.`, 'Update the agent.', { subject: n }));
67
+ }
68
+ }
69
+ const skip = s.asset_types_without_agent.map(low);
70
+ const covered = new Set(byDev.keys()); let inScope = 0;
71
+ for (const a of assets) {
72
+ const k = hostKey(a.device); if (!k) continue; const t = low(a.type);
73
+ if (t && skip.some((x) => t.includes(x))) continue; inScope++;
74
+ if (!covered.has(k)) items.push(finding('no_agent', 'high', str(a.device), `${str(a.device)} is in your asset list but has no security agent in the export.`, 'Install the agent, or record why this device cannot run one.', { subject: str(a.device) }));
75
+ }
76
+ for (const al of alerts) {
77
+ const sev = low(al.severity); const open = !/resolved|closed|remediated|dismissed|false positive/i.test(str(al.status));
78
+ if (open && /high|critical|severe/.test(sev) && asOf && isoDate(al.created) && daysBetween(al.created, asOf) > s.alert_open_days) items.push(finding('open_high_alert', 'high', str(al.alert_id), `${str(al.severity)} alert ${str(al.alert_id)}${str(al.title) ? ` (${str(al.title)})` : ''} on ${str(al.device)} has been open since ${isoDate(al.created)}.`, 'Investigate and close it, or escalate to your security provider.', { subject: str(al.device) }));
79
+ }
80
+ return { devices: byDev.size, assets_in_scope: inScope, covered_pct: inScope ? pct([...new Set(assets.map((a) => hostKey(a.device)))].filter((k) => covered.has(k)).length, inScope) : null, open_alerts: alerts.filter((a) => !/resolved|closed|remediated|dismissed|false positive/i.test(str(a.status))).length, items };
81
+ }
@@ -0,0 +1,34 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { wireAgent, fileArg, SETTINGS_ARG, AS_OF_ARG, settingsFrom, LIMITS, exportProfile, today } from 'fairwire-core';
3
+ import { DEVICE_FIELDS, ASSET_FIELDS, ALERT_FIELDS, SETTINGS_SCHEMA, DEFAULTS, reviewEndpoints } from './logic.js';
4
+
5
+ const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
6
+ const args = {
7
+ devices: fileArg('Endpoint security console export under --root (Defender, CrowdStrike, SentinelOne, Sophos or any CSV, Excel or JSON): one row per device and product with agent version, signature date, last seen, real-time protection, tamper protection and mode'),
8
+ assets: fileArg('Optional asset list (device names and types) to find devices with no agent'),
9
+ alerts: fileArg('Optional alert export with id, device, severity, status and created time'),
10
+ settings: SETTINGS_ARG('stale_days, signature_max_days, alert_open_days, min_agent_version, passive_ok, asset_types_without_agent'),
11
+ as_of: AS_OF_ARG,
12
+ };
13
+
14
+ export const manifest = wireAgent({
15
+ pkg, prefix: 'endpoints', title: 'Fairwire Endpoint Protection',
16
+ description: 'Reviews endpoint protection coverage: devices with no agent, protection or tamper protection off, passive mode, agents not reporting, old signatures and agent versions, two products on one device and high alerts left open. Drafts notes; never isolates or changes a device.',
17
+ args, required: ['devices'],
18
+ sources: { devices: { label: 'Protected devices', args: ['devices'], fields: DEVICE_FIELDS, profiles: [exportProfile('defender_devices', { device: 'Device Name', protection: 'Health State' })] }, assets: { label: 'Asset list', args: ['assets'], fields: ASSET_FIELDS }, alerts: { label: 'Alerts', args: ['alerts'], fields: ALERT_FIELDS } },
19
+ configSchemas: { endpoints_settings: SETTINGS_SCHEMA },
20
+ run: (a, ctx) => reviewEndpoints({ devices: ctx.records(a.devices, 'devices'), assets: a.assets ? ctx.records(a.assets, 'assets') : [], alerts: a.alerts ? ctx.records(a.alerts, 'alerts') : [] }, settingsFrom(a, ctx, 'endpoints_settings', DEFAULTS), a.as_of || today()),
21
+ summary: (o) => `${o.devices} device(s) with an agent${o.covered_pct !== null ? `, ${o.covered_pct}% of ${o.assets_in_scope} in-scope assets covered` : ''}, ${o.open_alerts} open alert(s): ${o.open} open finding(s), ${o.high} high.`,
22
+ check: { title: 'Review endpoint protection', description: 'Review the security console export against the asset list and list uncovered devices, protection gaps, stale agents and signatures, product clashes and old high alerts.' },
23
+ explain: { arg: 'device', argSchema: { type: 'string', maxLength: 200, description: 'Device or alert id from endpoints_check' }, title: 'Explain one device', description: 'Every finding for one device or alert.', match: (i, v) => i.key === v || i.subject === v },
24
+ report: {
25
+ title: 'Endpoint protection coverage', base: 'endpoint-protection',
26
+ limits: [LIMITS.files, 'Coverage compares device names (without the domain); a device renamed in one system and not the other shows as uncovered.', 'An agent that reports healthy can still miss a threat; this is a coverage and hygiene check, not a security assessment.', LIMITS.defaults, LIMITS.live],
27
+ },
28
+ note: { noun: 'security_note', verb: 'send', category: 'binding_send', actor: 'the endpoint security owner', to: 'security operations', subject: 'Endpoint protection gaps', ask: 'Please close the high items today and plan the rest.' },
29
+ refused: [
30
+ { name: 'edr_isolate_device', category: 'production_deploy', description: 'Fairwire Endpoint Protection never isolates, scans or changes a device.' },
31
+ { name: 'edr_change_policy', category: 'production_deploy', description: 'Fairwire Endpoint Protection never changes a security policy or exclusion.' },
32
+ ],
33
+ prompt: { title: 'Review endpoint protection', description: 'Walks the host model through a coverage review with Fairwire Endpoint Protection.', text: 'You are helping a security lead review endpoint protection with fairwire-endpoint-protection. Fairwire Endpoint Protection only reads exports. 1. Call endpoints_check; lead with devices with no agent, protection off and old high alerts. 2. Use endpoints_explain for one device. 3. Call endpoints_write_report. 4. Offer endpoints_draft_security_note; endpoints_request_send waits for one named click.' },
34
+ });