Repository navigation
fix(recommendations)!: remove the vendor-derived catalogues and add site-run collectors - #500
Conversation
There was a problem hiding this comment.
🟡 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
1e511ed to
d325c0e
Compare
somethingwithproof
left a comment
There was a problem hiding this comment.
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.
d325c0e to
93f9c21
Compare
93f9c21 to
cf3adca
Compare
cf3adca to
ffe08b7
Compare
|
@somethingwithproof thanks, addressed:
All three Copilot threads are answered and resolved. CI is green. Please re-review. |
ffe08b7 to
c124edc
Compare
somethingwithproof
left a comment
There was a problem hiding this comment.
No blockers found at c124edc.
- The plugin-directory warning now takes four
dirname()calls, sodocs/is covered. - An unreadable
robots.txtis cached as a refusal, andget()raises before fetching. - Retries wait at least
--delayorCrawl-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.
c124edc to
c84585b
Compare
…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>
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>
c84585b to
1d40a3f
Compare
|




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.gzand their.licensefiles. They are tombstoned inmanifest.json, so a site that upgrades by copying over the old directory loses them too.Removed references:
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 vendorLICENSINGentries and theEXCLUDElists.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 asecurity:entry records the removal.Kept:
%LINK-3-UPDOWNare facts, not vendor text, and sites can still import recommendations they write for their own devices.Vendor collectors (added in aa63eae)
contrib/recommendations/vendors/now has a sharedcollector.pyand 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.mddocuments each one; README, NOTICE,RECOMMENDATION_SOURCES.mdand the CHANGELOG point to it.The scripts obey
robots.txtand anyCrawl-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):
robots.txtcan't be read is not fetched from.--delayor the site'sCrawl-delay.docs/.--urloption is gone;--filereads another copy).--pdffile the user downloads (login)daedalus/php-syslog-ng(pinned commit)--file--pdf/--os10-pdf/--from(robots.txt blocks scripts)--pdf--from--from DIRonly (robots.txt blocks scripts)MikroTik isn't covered. Each output was imported with the plugin's importer with no invalid records. The outputs were written to
/tmponly and aren't committed.Not handled by this PR
The removed files are still in this repository's git history, including commits merged to
developand 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 withgit filter-repo), plus a GitHub Support request to clear cached views. That needs a maintainer decision.Testing
ProcessHelperCompatTest/procprobe) is also present ondevelop.tests/regression/cli_schema_upgrade_test.phppasses. The i18n check finds no translatable-string changes.--helpworks. Palo Alto and Fortinet (--pdf) were rerun after the sharedCrawl-delaychange and produced the same counts.