Skip to content

feat(security): vulnerability management (agent 1.12.0) - #7

Merged
Badar159 merged 3 commits into
mainfrom
feature/vulnerability-management
Dec 1, 2026
Merged

Badar159 merged 3 commits into
mainfrom
feature/vulnerability-management

Conversation

@Badar159

@Badar159 Badar159 commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Vulnerability management for IdaraOS Agent devices, similar to Microsoft Defender's: each device's installed software is matched against public vulnerability feeds and every finding is rated Critical / High / Medium / Low.

  • Agent 1.12.0 collects a read-only software inventory at most every 4 h and uploads only when it changed (hash compared at check-in): exact Windows build + UBR, registry and Store apps, Node.js runtimes (incl. nvm-windows), global npm packages, and npm packages pinned in package-lock.json, pnpm-lock.yaml and yarn.lock under users' code folders (bounded scan). New endpoint POST /api/updater/v1/inventory.
  • Global vulnerability catalog synced from Microsoft MSRC (Windows fixed builds + KBs, last 12 months), NVD (version ranges for 58 verified desktop apps/runtimes/dev tools), OSV.dev (npm, cached per package version) and CISA KEV (known exploited).
  • Matcher produces per-device findings with open → fixed history (re-opens if software returns). Skips NVD CVEs whose description limits them to Android/iOS/macOS/Linux/ChromeOS (853 false positives removed).
  • Self-scheduling sync: instrumentation.ts checks hourly and runs a full sync when the catalog is over a day old. Opt out with VULNERABILITY_SYNC=off and call POST /api/internal/vulnerabilities/sync instead. "Sync now" button for admins.
  • Portal: Security → Vulnerabilities (overview by severity, weaknesses with detail panel, software inventory) and a Vulnerabilities tab on each device.
  • Permissions: new security.vulnerabilities module (view / edit = Sync now). When first created, it's granted to every role that already has Software Updates view/edit (once only).
  • Deploy: each environment reads the optional Key Vault secret nvd-api-key and sets NVD_API_KEY (higher NVD rate limit; notice if missing).
  • Migration 0031_vulnerability_management (idempotent).

Test plan

  • Unit tests: severity mapping, CVSS 3.x calculator, version ranges, product catalog, MSRC/NVD/OSV parsing, non-Windows filter, scheduler (28 tests). Full suite: only the 3 pre-existing types.test.ts failures (also failing on main).
  • Typecheck, eslint, commit hooks.
  • Real feed syncs on the local Docker stack: MSRC (~83k Windows fixes), NVD (58 products, 541 s without a key), KEV, OSV.
  • Real agent script run (copy, user context) against the local server: check-in + inventory upload of 38 apps / 4,971 npm packages in ~4 s; next check-in skips collection.
  • Outdated test device: Windows 23H2 old build, Chrome 120, Firefox 115, 7-Zip, Node 18, lodash/minimist → expected Windows KBs, app CVEs and npm advisories with fixed versions.
  • Portal pages, filters, detail panel, device tab and Sync now checked in the browser.
  • Store-app listing as SYSTEM on a real device (needs admin; not testable here).
  • Confirm the nvd-api-key secret is picked up on the first deploy (look for the absence of the "No nvd-api-key" notice).

After deploying, update devices to agent 1.12.0 (Software Updates → Update all agents, or auto-update) so they start reporting.

🤖 Generated with Claude Code

Badar159 and others added 3 commits November 23, 2026 14:55
Detect CVEs on IdaraOS Agent devices, like Defender's vulnerability management,
rated Critical / High / Medium / Low:

- Agent 1.12.0 collects a read-only software inventory (Windows build + UBR,
  registry/Store apps, Node.js runtimes incl. nvm-windows, global npm packages
  and packages pinned in package-lock.json / pnpm-lock.yaml under users' code
  folders) at most every 4 h and uploads only when its hash changed
  (POST /api/updater/v1/inventory; check-in returns inventoryHash).
- Global vulnerability catalog synced from Microsoft MSRC (Windows fixed
  builds/KBs), NVD (version ranges for curated desktop apps), OSV.dev (npm,
  cached per package version) and CISA KEV (known exploited).
- Matcher derives per-device findings with open/fixed history; daily sync via
  POST /api/internal/vulnerabilities/sync or "Sync now".
- Portal: Security > Vulnerabilities (overview, weaknesses, software inventory)
  and a Vulnerabilities tab on each device; new security.vulnerabilities module.
- Migration 0031_vulnerability_management; unit tests for severity, CVSS 3.x,
  version ranges, MSRC/NVD/OSV parsing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
….lock

- Sync runs itself: instrumentation.ts starts an hourly check that runs a full
  MSRC/NVD/KEV sync + re-match when the catalog is over a day old (fresh
  installs fill themselves; VULNERABILITY_SYNC=off to use your own cron).
- Permissions: a new module can inherit grants once, when first created;
  security.vulnerabilities inherits from security.software-updates so
  existing device admins get it without re-editing roles.
- Catalog grows from 23 to 58 NVD-verified products (Zoom, Python, Go, .NET,
  ASP.NET Core, Visual Studio 2022, VirtualBox, VPN clients, ...), with
  versionFromName for apps whose installer version doesn't match NVD.
- Inventory is re-tagged against the current catalog at every match, so new
  products are found on devices that haven't re-uploaded.
- NVD: skip CVEs whose description limits them to Android/iOS/macOS/Linux/
  ChromeOS (853 false positives), and replace ranges for every CVE in a page.
- Agent parses yarn.lock (v1 and Berry).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each environment's deploy job reads the optional Key Vault secret
nvd-api-key (masked; a notice when it's missing) and sets NVD_API_KEY on the
container app, so vulnerability feed syncs use NVD's higher rate limit. The
dev compose stack takes NVD_API_KEY from the git-ignored deployment/docker/.env.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Badar159
Badar159 merged commit e740624 into main Dec 1, 2026
8 of 10 checks passed

This branch was previously deployed

1 inactive deployment
dev — e7406243 Deployed Dec 1, 2026 by Badar159 via Deploy to Dev #154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant