Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

--- develop ---

* feature: Add a manually importable Linux pattern recommendation catalogue in docs/linux-wazuh.json.gz with 434 records converted from 315 rules of the Wazuh 4.14.11 ruleset (GPL-2.0), covering core Linux services, mail, network services and databases; contrib/recommendations/extract_wazuh_rules.py converts the rules and decoders, and build_catalogues.py now keeps the regex and program fields
* docs: Add a Recommendation sources and licensing table to the README naming, for every bundled catalogue, its vendor, source, copyright holder and license, and how it was obtained
* feature: Add pattern recommendations. A recommendation may carry a PCRE pattern (`regex`) and an optional syslog program (`program`, which may start or end with a `*` wildcard); it is then matched by the pattern instead of its identifier, after identifier matches, and applies to every sender except a Cacti device recognised as a different vendor. Patterns are validated on save and import (they must compile, be at most 1,024 characters and not match an empty message), run under a reduced PCRE backtracking limit, and are loaded once per request (at most 2,000, within PHP's compiled-pattern cache). The Recommendations page gains Pattern and Program fields, a Pattern column and a Match By filter; import and export carry the new fields only for records that use them. Upgrades add the `regex` and `program` columns to `syslog_recommendations`
* feature: Add a manually importable Linux recommendation catalogue in docs/linux.json.gz with the 102 entries of systemd's journal message catalog (v262.2), keyed on the journal MESSAGE_ID that rsyslog or syslog-ng forwarders can append to the message; contrib/recommendations/extract_systemd_catalog.py converts the catalog for build_catalogues.py, and devices whose sysDescr or template mentions Linux but no network vendor are now recognised as Linux for recommendation scoping
* dev: Sync js/cards.js with the Cacti core Card API controller (Cacti/cacti#8928): defer a card refresh until an in-flight grow or shrink settles so it no longer reverts the resize, target drops by row start so a taller card no longer captures a drop in a later row and a dragged card alone in its row no longer jumps up a row, and bind the add-card control once so a re-initialised grid receives added cards
Expand Down
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,7 @@ lists the source documents, versions and retrieval dates of each file, and
| `docs/paloalto.json.gz` | Palo Alto Networks | 364 | PAN-OS System log event IDs from the Syslog Severity Reference, such as `tunnel-status-down`. Generic event IDs (`general`, `auth`) and event IDs that are ordinary networking phrases other vendors also log (`link-down`, `admin-down`, `auth-fail`, `lacp-up`) are excluded. Few records have a recommended action. |
| `docs/mikrotik.json.gz` | MikroTik | 11 | RouterOS has no message IDs and MikroTik publishes no message catalogue; only documented messages that carry a distinctive word are included (for example `hashtype`, `auto-initialization`, `hw-limit`, `bpdu-guard`, `CTSYNC`, `deassigned`). |
| `docs/linux.json.gz` | Linux | 102 | systemd's journal message catalog (systemd v262.2), keyed on the 32-digit hexadecimal journal `MESSAGE_ID`, such as `be02cf6855d2428ba40df7e9d022f03d` for a failed unit start. Covers units, PID 1, journald, logind, core dumps, the OOM killer, shutdown and time changes. Only matches when the forwarder appends the ID; see [Linux and systemd message IDs](#linux-and-systemd-message-ids). |
| `docs/linux-wazuh.json.gz` | Linux | 434 | [Pattern recommendations](#pattern-recommendations) converted from the Wazuh 4.14.11 ruleset: core Linux (syslog, kernel, sshd, PAM, su, sudo, systemd, auditd, AppArmor, firewalld, Docker, USB), mail (Postfix, Sendmail, Exim, Dovecot, Courier and others), network services (BIND, Unbound, FTP servers, Samba, Apache, nginx, Squid, OpenVPN and others) and databases and applications (MySQL, MariaDB, PostgreSQL, MongoDB, Redis, ClamAV, Puppet, FreeIPA). Matched by message text and program, so no forwarder change is needed. Explanations are Wazuh's one-line rule descriptions with its classification; there are no recommended actions. |

Numeric identifiers, such as HPE event IDs, Fortinet log IDs and FRRouting
error codes, only match messages from a Cacti device whose vendor is recognised
Expand Down Expand Up @@ -1004,6 +1005,42 @@ reason, for example `SYSLOG WARNING: Recommendation import rejected record 12
(identifier 'LINK UPDOWN'): the identifier contains spaces or line breaks`,
followed by a one-line summary of the whole import.

### Recommendation sources and licensing

The table below lists every recommendation catalogue in `docs/` with the vendor
it applies to and where its records come from. **Copyright and license** names
who owns the source material and the terms it is published under. **How it was
obtained** summarises how the records were produced.

Only three catalogues come from openly licensed sources: the systemd catalogue
(LGPL-2.1-or-later), the Wazuh-derived catalogue (GPL-2.0) and the FRRouting
error codes in the NVIDIA catalogue (GPL-2.0-or-later). Those records keep
their source's license. All the others are condensed from vendors' public
documentation, which remains the copyright of the vendor under the website
terms linked below. Those records are short factual summaries that link back to
the vendor's page in their `reference` field. They are not relicensed under
this plugin's GPL, and the vendor's own documentation is the authoritative text.
Check the linked terms before you redistribute a catalogue outside your
organisation. This section describes where the data comes from; it is not legal
advice. Source documents, versions and retrieval dates are listed in
[RECOMMENDATION_SOURCES.md](docs/RECOMMENDATION_SOURCES.md).

| Vendor | File | Source | Copyright and license | How it was obtained |
|--------|------|--------|-----------------------|---------------------|
| Arista | `docs/arista.json.gz` | EOS System Message Guide (EOS 4.15, 2015) | © Arista Networks, Inc.; proprietary documentation, [Arista Terms of Use](https://www.arista.com/en/terms-of-use) | Extracted from Internet Archive copies of the public EOS 4.15 System Message Guide PDF. |
| Cisco | `docs/cisco.json.gz` | Cisco Error Message Database (CEMDB) | © Cisco and/or its affiliates; proprietary documentation, [Cisco Terms of Use](https://www.cisco.com/c/en/us/about/legal/terms-conditions.html) and [Copyright Use Policies](https://www.cisco.com/c/en/us/about/brand-center/copyright-use.html). The data was distributed with the GPL-2.0 php-syslog-ng project. | Converted from the CEMDB data shipped with php-syslog-ng; this is the only catalogue loaded automatically. |
| Dell | `docs/dell.json.gz` | PowerEdge Error and Event Messages Reference (EEMI), SmartFabric OS10 System Log Message Reference, OS9 configuration guide | © Dell Inc.; proprietary documentation, [Dell Terms of Use](https://www.dell.com/en-us/legal/lp/site-terms-of-use) | Extracted from Dell's public EEMI guide and OS10 and OS9 documentation pages. |
| Fortinet | `docs/fortinet.json.gz` | FortiOS 7.6.8 Log Message Reference | © Fortinet, Inc.; proprietary documentation, [Fortinet Legal, Limited License](https://www.fortinet.com/corporate/about-us/legal) | Generated from the public FortiOS Log Message Reference pages; explanations are built from the documented message, type and level. |
| HPE | `docs/hpe.json.gz` | Comware 5 and 7 System Log Messages References, AOS-CX 10.17 and ArubaOS-Switch 16.10 Event Log Message References | © Hewlett Packard Enterprise Development LP; proprietary documentation, [HPE Terms of Use](https://www.hpe.com/us/en/about/legal/terms-of-use.html) | Extracted from public HPE and Aruba log message reference guides on support.hpe.com. |
| Huawei | `docs/huawei.json.gz` | CloudEngine and S-series (VRP5 and VRP8) Log References | © Huawei Technologies Co., Ltd.; proprietary documentation, [Huawei Terms of Use](https://www.huawei.com/en/legal) | Extracted from Huawei's public log references through its regional documentation mirror. |
| Juniper | `docs/juniper.json.gz` | Juniper System Log Explorer (EX Series `ESWD` messages) | © Juniper Networks, Inc.; proprietary documentation, [Juniper Legal Notices](https://www.juniper.net/us/en/legal-notices.html) | Hand-curated from 14 EX Series entries in Juniper's public System Log Explorer. |
| Linux | `docs/linux.json.gz` | systemd journal message catalog (systemd v262.2) | systemd contributors; open source, [LGPL-2.1-or-later](https://github.com/systemd/systemd/blob/v262.2/catalog/systemd.catalog.in) | Converted from systemd's `catalog/systemd.catalog.in` with `contrib/recommendations/extract_systemd_catalog.py`. |
| Linux | `docs/linux-wazuh.json.gz` | Wazuh ruleset 4.14.11 (rules and decoders, based on OSSEC) | © Wazuh Inc., portions © Trend Micro Inc.; open source, [GPL-2.0](https://github.com/wazuh/wazuh/blob/v4.14.11/LICENSE) | Converted from the Wazuh rule and decoder XML with `contrib/recommendations/extract_wazuh_rules.py`. |
| MikroTik | `docs/mikrotik.json.gz` | RouterOS documentation pages on help.mikrotik.com | MikroTik; no license or terms are stated for the documentation | Hand-picked from messages documented on public RouterOS help pages. |
| Nokia | `docs/nokia.json.gz` | SR OS 25.10 Log Events Guide | © Nokia; proprietary documentation, [Nokia Terms of Use](https://www.nokia.com/notices/terms/) | Extracted from the public SR OS Log Events Guide HTML pages. |
| NVIDIA | `docs/nvidia.json.gz` | Cumulus Linux 5.18 switchd and FRRouting Log Message References, Xid errors, Fabric Manager SXid errors | © NVIDIA Corporation & affiliates; proprietary documentation, [NVIDIA Terms of Service](https://www.nvidia.com/en-us/about-nvidia/terms-of-service/). The FRRouting error codes come from [FRRouting](https://github.com/FRRouting/frr/blob/master/COPYING) (GPL-2.0-or-later). | Extracted from NVIDIA's public Cumulus Linux, Xid and Fabric Manager documentation. |
| Palo Alto Networks | `docs/paloalto.json.gz` | PAN-OS System Log Reference, System Log Fields and selected Knowledge Base articles | © Palo Alto Networks, Inc.; proprietary documentation, [Palo Alto Networks Terms of Use](https://www.paloaltonetworks.com/legal-notices/terms-of-use) | Extracted from the public PAN-OS System Log Reference; most explanations are generated from the documented message and severity. |

## Settings

The settings are under Settings > Syslog. Selected names and defaults:
Expand Down
15 changes: 11 additions & 4 deletions contrib/recommendations/build_catalogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
the plugin's docs/ directory.

Usage: build_catalogues.py VENDOR < extracted/<vendor>.json
VENDOR is one of: arista dell fortinet hpe huawei linux mikrotik nokia nvidia paloalto
VENDOR is one of: arista dell fortinet hpe huawei linux linux-wazuh mikrotik nokia nvidia paloalto

For linux, the extracted JSON comes from extract_systemd_catalog.py.
For linux, the extracted JSON comes from extract_systemd_catalog.py; for
linux-wazuh, from extract_wazuh_rules.py.
"""

import gzip
Expand All @@ -35,13 +36,17 @@

# Output names are taken from this table, never from the command line.
VENDORS = {name: name for name in
('arista', 'dell', 'fortinet', 'hpe', 'huawei', 'linux', 'mikrotik', 'nokia', 'nvidia', 'paloalto')}
('arista', 'dell', 'fortinet', 'hpe', 'huawei', 'linux', 'linux-wazuh', 'mikrotik', 'nokia', 'nvidia',
'paloalto')}

DOCS_DIR = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), 'docs')

FIELDS = ['vendor', 'identifier', 'component', 'severity', 'message',
'explanation', 'recommended_action', 'reference']

# Pattern record fields, kept only when set.
OPTIONAL_FIELDS = ['regex', 'program']

# Identifiers that are ordinary words or protocol terms other vendors also log
# as a single token; they would show this vendor's advice for unrelated messages.
EXCLUDE = {
Expand Down Expand Up @@ -80,7 +85,9 @@ def build(vendor, source):
continue

seen.add(key)
out.append({field: record.get(field, None if field == 'severity' else '') for field in FIELDS})
record_out = {field: record.get(field, None if field == 'severity' else '') for field in FIELDS}
record_out.update({field: record[field] for field in OPTIONAL_FIELDS if record.get(field)})
out.append(record_out)

text = json.dumps({'format': 'syslog-recommendations', 'version': 1, 'recommendations': out},
indent=2, ensure_ascii=False) + '\n'
Expand Down
Loading