Skip to content

fix(recommendations)!: remove the vendor-derived catalogues and add site-run collectors - #500

Merged
TheWitness merged 4 commits into
developfrom
chore/remove-vendor-catalogues
Dec 3, 2026
Merged

TheWitness merged 4 commits into
developfrom
chore/remove-vendor-catalogues

Conversation

@TheWitness

@TheWitness TheWitness commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Final PR in the stack: #496 → #497 → #498 → #499 → this one. It targets feat/linux-curated-catalogue. Retarget it after #499 merges, and merge the stack in order.

Summary

This PR removes the recommendation catalogues derived from network vendors' documentation, and every reference to them, and adds scripts so each site can build those catalogues itself for internal use. Their explanations and recommended actions were condensed from vendor documentation whose terms don't permit redistribution with the plugin, and being a non-profit or GPL project creates no exception. NVIDIA's Cumulus material is CC BY-NC-SA 4.0, which isn't GPL-compatible either.

Removed files (22): docs/{arista,cisco,dell,fortinet,hpe,huawei,juniper,mikrotik,nokia,nvidia,paloalto}.json.gz and their .license files. They are tombstoned in manifest.json, so a site that upgrades by copying over the old directory loses them too.

Removed references:

  • README:
    • the vendor rows of the catalogue table;
    • the Cisco and Juniper catalogue paragraphs and the "bundled data has 860 of them" count;
    • the vendor rows and vendor-terms wording of the "Recommendation sources and licensing" table, which now says the plugin ships no vendor-derived recommendations and why.
  • docs/RECOMMENDATION_SOURCES.md: the intro, the excluded-identifier table, and the Arista, Dell, Fortinet, HPE, Huawei, MikroTik, Nokia, NVIDIA and Palo Alto Networks sections. Only the three Linux sections remain.
  • contrib/recommendations/build_catalogues.py: the vendor LICENSING entries and the EXCLUDE lists.
  • NOTICE: the vendor-derived section.
  • tests/Unit/RecommendationsTest.php: the vendor rows of the shipped-catalogue test.
  • CHANGELOG.md: the entries that added or seeded the vendor catalogues are removed or reworded, and a security: entry records the removal.

Kept:

  • The three openly licensed Linux catalogues: systemd (LGPL-2.1-or-later), Wazuh (GPL-2.0-only) and curated (GPL-2.0-or-later). They are unchanged and rebuild byte-identically.
  • Device vendor recognition and vendor scoping in the code, and synthetic vendor examples in the tests. Identifier formats such as %LINK-3-UPDOWN are facts, not vendor text, and sites can still import recommendations they write for their own devices.
  • Records already imported into users' databases. Upgrading does not delete them, and they can still be exported. To remove them, filter the Recommendations page by vendor, select all, then Delete; the CHANGELOG says the same.

Vendor collectors (added in aa63eae)

contrib/recommendations/vendors/ now has a shared collector.py and one script per vendor. Each builds a catalogue from the vendor's published documentation, for a site to import on its own Recommendations page. The scripts contain no vendor documentation. The catalogues they write stay under the vendor's terms: they carry the vendor's copyright, terms and a do-not-redistribute notice, and the scripts warn if the output is inside the plugin directory. docs/VENDOR_COLLECTORS.md documents each one; README, NOTICE, RECOMMENDATION_SOURCES.md and the CHANGELOG point to it.

The scripts obey robots.txt and any Crawl-delay, cache downloads, and never work around a block or login. Where a vendor doesn't allow scripted downloads, they read documents the user saves with a browser.

Safety checks (c39888a and the SonarCloud fixes in aa63eae):

  • A host whose robots.txt can't be read is not fetched from.
  • Retries wait at least --delay or the site's Crawl-delay.
  • A run that collects no records exits with an error and leaves an existing catalogue in place.
  • The warning about writing inside the plugin directory now fires for docs/.
  • Downloads are HTTPS-only, from each vendor's own documentation hosts (the Cisco --url option is gone; --file reads another copy).
  • Files and directories named on the command line must be inside the user's home, the working directory or the temporary directory.
Vendor Source How documents are obtained Test run (old count)
Arista EOS System Message Guide PDF --pdf file the user downloads (login) 1,047 (1,047)
Cisco CEMDB dump in daedalus/php-syslog-ng (pinned commit) Downloaded from GitHub; --file 27,315 (27,318); the 3 missing are case-only duplicates
Dell PowerEdge EEMI and OS10 System Log Message Reference PDFs --pdf/--os10-pdf/--from (robots.txt blocks scripts) 7,138 (7,142); OS9 not collected
Fortinet FortiOS 7.6.8 Log Message Reference Page by page (about 70 min at the site's crawl delay) or --pdf 1,462 (1,462)
HPE Comware 7/5, AOS-CX, ArubaOS-Switch references HPE Support Center API; --from 4,887 (4,883)
Huawei CloudEngine and S-series Log References --from DIR only (robots.txt blocks scripts) Tested on synthetic pages only
Juniper Juniper System Log Explorer Explorer's public JSON 500-record sample; full run about 6,900 records, about 3 h (old: 14 hand-curated)
Nokia SR OS 25.10 Log Events Guide documentation.nokia.com 2,016 (2,016)
NVIDIA Cumulus 5.18 switchd/FRR, Xid, SXid docs.nvidia.com and NVIDIA's public Cumulus docs repo 257 (251)
Palo Alto Networks PAN-OS System Log Reference docs.paloaltonetworks.com 363 (364); Knowledge Base actions not reproduced

MikroTik isn't covered. Each output was imported with the plugin's importer with no invalid records. The outputs were written to /tmp only and aren't committed.

Not handled by this PR

The removed files are still in this repository's git history, including commits merged to develop and the v5.0 tag. Deleting the v5.0 GitHub release removes its download assets. Purging the files from history needs a history rewrite and a force-push (for example with git filter-repo), plus a GitHub Support request to clear cached views. That needs a maintainer decision.

Testing

  • Full Pest suite against Cacti 1.2.x: 923 passed. The removed catalogue-load cases are gone. The one warning (ProcessHelperCompatTest /proc probe) is also present on develop.
  • tests/regression/cli_schema_upgrade_test.php passes. The i18n check finds no translatable-string changes.
  • A repository-wide search finds no remaining references to the removed files outside the new collectors and their documentation.
  • All collectors compile, and --help works. Palo Alto and Fortinet (--pdf) were rerun after the shared Crawl-delay change and produced the same counts.

@TheWitness
TheWitness added this pull request to stack #501 December 3, 2026 18:10
Copilot AI balanced review requested due to automatic review settings December 3, 2026 18:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved issues allow crawling when robots.txt retrieval fails, retry requests sooner than configured delays, and overwrite existing catalogues with empty results after source failures.

3 open issues
What changed in this PR

Replaces bundled vendor-derived recommendations with site-run collectors, while retaining the three openly licensed Linux catalogues and existing imported records.

Changes:

  • Removes vendor catalogue licensing and build references.
  • Adds ten vendor collectors with shared download and output helpers.
  • Updates documentation, changelog, and shipped-catalogue tests.
File Description
tests/​Unit/​RecommendationsTest.php Removes vendor catalogue test cases.
README.md Documents Linux catalogues and local collectors.
NOTICE Updates catalogue licensing notices.
docs/​VENDOR_COLLECTORS.md Adds collector usage instructions.
docs/​RECOMMENDATION_SOURCES.md Limits bundled sources to Linux.
docs/​paloalto.json.gz.license Removes Palo Alto licence sidecar.
docs/​nvidia.json.gz.license Removes NVIDIA licence sidecar.
docs/​nokia.json.gz.license Removes Nokia licence sidecar.
docs/​mikrotik.json.gz.license Removes MikroTik licence sidecar.
docs/​juniper.json.gz.license Removes Juniper licence sidecar.
docs/​huawei.json.gz.license Removes Huawei licence sidecar.
docs/​hpe.json.gz.license Removes HPE licence sidecar.
docs/​fortinet.json.gz.license Removes Fortinet licence sidecar.
docs/​dell.json.gz.license Removes Dell licence sidecar.
docs/​cisco.json.gz.license Removes Cisco licence sidecar.
docs/​arista.json.gz.license Removes Arista licence sidecar.
contrib/​recommendations/​vendors/​index.php Adds directory redirect.
contrib/​recommendations/​vendors/​collector.py Adds shared fetching and catalogue output.
contrib/​recommendations/​vendors/​collect_paloalto.py Collects PAN-OS reference tables.
contrib/​recommendations/​vendors/​collect_nvidia.py Collects Cumulus, Xid and SXid references.
contrib/​recommendations/​vendors/​collect_nokia.py Collects SR OS event references.
contrib/​recommendations/​vendors/​collect_juniper.py Collects System Log Explorer records.
contrib/​recommendations/​vendors/​collect_huawei.py Parses browser-saved Huawei documents.
contrib/​recommendations/​vendors/​collect_hpe.py Collects Comware and Aruba references.
contrib/​recommendations/​vendors/​collect_fortinet.py Parses FortiOS web or PDF references.
contrib/​recommendations/​vendors/​collect_dell.py Parses EEMI and OS10 references.
contrib/​recommendations/​vendors/​collect_cisco.py Converts CEMDB SQL dumps.
contrib/​recommendations/​vendors/​collect_arista.py Parses supplied EOS guide PDFs.
contrib/​recommendations/​build_catalogues.py Restricts bundled builds to Linux catalogues.
CHANGELOG.md Records removal and collector additions.

Review effort: Balanced

xmacan
xmacan previously approved these changes Dec 3, 2026

@somethingwithproof somethingwithproof left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal itself is fine: nothing outside the collectors and their docs refers to the deleted docs/*.json.gz files. The blockers are in the collectors, where the code does not do what the description says.

Blocker: the "writing inside the plugin directory" warning never fires for docs/. collector.py:264 takes three dirname() calls from contrib/recommendations/vendors/collector.py, which gives <plugin>/contrib, not the plugin root. An output of <plugin>/docs/cisco.json.gz passes silently, and that is the one place the warning is for. It needs a fourth dirname().

Blocker: robots.txt fails open. _robots() stores None when the fetch raises (collector.py:120), and allowed() returns true for None (collector.py:128), so a timeout or DNS error on robots.txt allows every URL on that host for the rest of the run. The description and the CHANGELOG say the scripts obey robots.txt. Treat an unreadable robots.txt as disallowed, or stop with a message.

Suggestion: add tombstones in manifest.json for the removed docs/<vendor>.json.gz and .license files, as was done for docs/recommendations.sql.gz. A site that upgrades by copying over the old directory keeps the vendor files otherwise.

Suggestion: retries sleep 5 and 10 seconds whatever --delay or Crawl-delay says (collector.py:174-176), and an empty result still overwrites an existing output file. Both are open Copilot threads.

Suggestion: rows already imported from the removed catalogues stay in syslog_recommendations and can be exported again. The CHANGELOG tells the admin to delete them by vendor; say so in the description too.

Nit: the title and first paragraph describe a removal, while 3,654 of the added lines are the collectors. A title that names both, or a split, would make the history easier to read. The code scanning alerts on the collectors have no reply; local_path() and the per-vendor host allowlists look like they answer them.

Not verified here: I did not run the collectors or check any vendor's terms. CI on this head was cancelled.

@TheWitness
TheWitness force-pushed the chore/remove-vendor-catalogues branch from d325c0e to 93f9c21 Compare December 3, 2026 20:16
@TheWitness
TheWitness force-pushed the chore/remove-vendor-catalogues branch from 93f9c21 to cf3adca Compare December 3, 2026 20:24
@TheWitness TheWitness changed the title fix(recommendations)!: remove the vendor-derived recommendation catalogues fix(recommendations)!: remove the vendor-derived catalogues and add site-run collectors Dec 3, 2026
@bmfmancini
bmfmancini force-pushed the chore/remove-vendor-catalogues branch from cf3adca to ffe08b7 Compare December 3, 2026 20:27
@TheWitness

Copy link
Copy Markdown
Member Author

@somethingwithproof thanks, addressed:

  • Blocker (plugin root): write() now uses four dirname() calls, and the warning fires for <plugin>/docs/... (checked).
  • Blocker (robots.txt fails open): an unreadable robots.txt is now a refusal. allowed() returns false, and get() stops with "robots.txt for could not be read".
  • Suggestions:
    • The removed docs/<vendor>.json.gz and .license files are tombstoned in manifest.json.
    • Retries wait at least --delay or the site's Crawl-delay.
    • An empty result exits with an error and leaves the existing output alone.
    • The description now says upgrading keeps already-imported vendor rows, and how to delete them.
  • Nit (title): renamed to "remove the vendor-derived catalogues and add site-run collectors".
  • Code scanning: local_path() and the per-vendor HTTPS host allowlists answer the Sonar path-traversal and SSRF findings. Cisco's --url is removed; --file covers other copies. The SonarCloud gate is OK, with 0 open CodeQL alerts.

All three Copilot threads are answered and resolved. CI is green. Please re-review.

@TheWitness
TheWitness force-pushed the chore/remove-vendor-catalogues branch from ffe08b7 to c124edc Compare December 3, 2026 20:34

@somethingwithproof somethingwithproof left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blockers found at c124edc.

  • The plugin-directory warning now takes four dirname() calls, so docs/ is covered.
  • An unreadable robots.txt is cached as a refusal, and get() raises before fetching.
  • Retries wait at least --delay or Crawl-delay.
  • An empty run exits before opening the output.
  • The removed vendor files are tombstoned in manifest.json.

CI is green on PHP 8.2 to 8.6. The collectors were not run and no vendor terms were checked.

@TheWitness
TheWitness force-pushed the chore/remove-vendor-catalogues branch from c124edc to c84585b Compare December 3, 2026 20:46
Base automatically changed from feat/linux-curated-catalogue to develop December 3, 2026 20:47
…ogues

Remove docs/{arista,cisco,dell,fortinet,hpe,huawei,juniper,mikrotik,nokia,
nvidia,paloalto}.json.gz and their .license files. Their explanations and
recommended actions were condensed from network vendors' documentation,
whose terms do not permit redistribution with the plugin (the NVIDIA
Cumulus material is CC BY-NC-SA 4.0, which is not GPL-compatible).

Remove every reference to them: the README catalogue and licensing tables,
the Cisco and Juniper paragraphs and the bundled-data counts,
RECOMMENDATION_SOURCES.md's vendor sections and excluded-identifier table,
the vendor entries and EXCLUDE lists in build_catalogues.py, the NOTICE
vendor section, the shipped-catalogue test rows, and the CHANGELOG entries
that added or seeded them.

Only the openly licensed Linux catalogues remain (systemd LGPL-2.1-or-later,
Wazuh GPL-2.0-only, curated GPL-2.0-or-later). Vendor recognition and
scoping are unchanged, so sites can still import recommendations they
create for their own devices. Records already imported into a database are
not deleted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TheWitness and others added 3 commits December 3, 2026 15:47
Add contrib/recommendations/vendors/ with a shared collector module and one
script each for Arista, Cisco, Dell, Fortinet, HPE, Huawei, Juniper, Nokia,
NVIDIA and Palo Alto Networks. Each builds a recommendation catalogue from the
vendor's published documentation for import on a site's own Recommendations
page, replacing the catalogues removed in the previous commit.

The scripts contain no vendor documentation. They obey robots.txt and any
Crawl-delay, cache downloads, and read documents saved with a browser where a
vendor does not allow scripted downloads (Arista, Dell, Huawei; optional for
Fortinet and HPE). Every catalogue they write carries the vendor's copyright,
terms and a do-not-redistribute notice, and the scripts warn when the output
is inside the plugin directory.

docs/VENDOR_COLLECTORS.md documents usage per vendor; README, NOTICE,
RECOMMENDATION_SOURCES.md and the CHANGELOG point to it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Review follow-up for the site-run collectors:

- Treat an unreadable robots.txt as a refusal instead of permission to
  fetch everything on that host for the rest of the run.
- Space retries by at least --delay or the site's Crawl-delay.
- Refuse to write a catalogue with no records, so a failed refresh exits
  with an error and leaves the previous catalogue in place.
- Find the plugin root with four dirname() calls, so the warning about
  writing inside the plugin directory fires for docs/.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A site that upgrades by copying the new release over the old directory
would otherwise keep docs/<vendor>.json.gz and their .license files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@TheWitness
TheWitness force-pushed the chore/remove-vendor-catalogues branch from c84585b to 1d40a3f Compare December 3, 2026 20:47
@TheWitness
TheWitness merged commit 5016001 into develop Dec 3, 2026
2 checks passed
@TheWitness
TheWitness deleted the chore/remove-vendor-catalogues branch December 3, 2026 20:47
@sonarqubecloud

sonarqubecloud Bot commented Dec 3, 2026

Copy link
Copy Markdown

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.

6 participants