* Assets journal: one entry for the assets deleted at once (#11206)
Deleting all the assets wrote one journal entry per asset, all with the
same message ("Asset deleted: all the assets of the interface have been
deleted"): useless, misleading, and pushing the other events off the
page. The same happened when deleting the assets not seen since a time.
The code is in pro.
Now every deletion of several assets at once writes a single Delete
entry, with no asset key, the number of assets and the cause:
- "Assets deleted (N): all the host assets of the interface";
- "Assets deleted (N): all the SNMP devices" (SNMP deletions were not
journaled at all);
- "Assets deleted (N): not seen since <time>".
The deletion of a single asset keeps its own entry. The entries already
written are left as they are, so the old templates (cause_all_deleted)
are kept.
- en.lua: assets_journal.assets_deleted, cause_all_host_assets,
cause_all_snmp_devices; assets_journal_page.host_assets and
snmp_devices (Asset column of the entries with no key);
- rest-api-v2.json: delete/host/asset.lua and get/host/assets_journal.lua
(empty asset key for a deletion of several assets);
- user guide (assets_journal.rst) and developer docs
(README.assets_journal.md).
* Assets: the VLAN is no longer part of the key of the host assets (#11208)
The same IP seen on several VLANs was listed as one asset per VLAN (key
`<ifid>_<ip>@<vlan>`). The VLAN is now an attribute of the asset: the
hosts with the same IP on several VLANs update one asset, keyed
`<ifid>_<ip>@0` (the same key as before for the hosts without VLAN, so
nothing changes on installations without VLANs). The Lua side is in pro.
Schemas (SQLite, ClickHouse, ClickHouse cluster):
- new column `vlans` (ClickHouse `Array(UInt16) DEFAULT []`, SQLite TEXT
`",15,188,"`), added with ALTER TABLE ... ADD to the existing tables;
`vlan` is kept, as the VLAN seen last.
Host configuration (get/set host/config.lua):
- the user tags set on a host are set on the hosts of every VLAN of its
asset (live hosts and persistent keys), with one journal entry; the
tags are read and written for `ip@vlan` (they used to go to VLAN 0, so
a host on another VLAN never got them);
- the optional `ifid` of the request is selected (INVALID_INTERFACE when
it cannot be), and a host that is not active on the interface answers
NOT_FOUND instead of failing with a Lua error.
Existing data: at startup the assets recorded per VLAN by an older
version are converted into one asset per IP address, with their journal
entries (see pro).
Assets page: a VLANs column (tables_config/assets.json), shown when the
assets of the interface have VLANs.
Docs: user guide, `README.assets_journal.md` and the new design
document `doc/developers/README.assets_vlan.md`
- Live flows (packet interfaces): when the dissection ends ntopng keeps,
from the nDPI Kerberos metadata, only the client principal
("user@realm", "host$@realm" for a machine), which of its names nDPI
truncated, delegation (S4U) yes/no and the reply (OK, error code, or
none). Flow info: the client principal, plus the error of a KRB-ERROR
reply. Exported in Lua (protos.kerberos.*) and in the flow JSON
("kerberos" block), shown by the live and historical flow details.
- Hosts: the Kerberos client of a flow (the host that is not the KDC, port
88 or 464), from reliable data only (OK reply, no delegation, no
truncated names), gets:
- the machine account: names.kerberos, also the name of the host with
the lowest priority;
- the users, as usernames of the host: a generic list of up to
MAX_USERNAMES_PER_HOST (3) usernames, whatever the protocol, each with
its protocol and first/last seen; when full the oldest last_seen is
replaced.
In memory only, local hosts only.
- Assets: kerberos_name and usernames ("<name> (<protocol>), ..."). Journal:
the machine account as a field, the usernames as a list (one cause per
username, added or replaced): AssetJournalCause.key,
addJournalListCause()
- Host details REST: usernames; host names escaped
- Labels (en, it), user guide (assets journal, asset and host details)
TODO: ZMQ
Add a journal of the assets (Enterprise L): one entry per event (an asset
created, deleted, a field changed, a tag added or removed), with when it
happened, who caused it (ntopng or the user), the action, what it is about,
and a message with its cause. Entries are never deleted.
See `doc/developers/README.assets_journal.md` for the design.
This repo:
- Table assets_journal (ClickHouse, ClickHouse cluster, SQLite).
- Causes of the changes seen in the traffic (C++): the hosts keep, for each
change not yet dumped with their asset, its cause (the evidence and the
flow) and send it with the asset snapshot ("journal" key). The flow is
passed explicitly to the setters (Flow* argument); LocalHost grows by 8
bytes (one pointer).
- The flow that creates a host is recorded (Flow constructor, and the view
walker for the hosts of a view).
- Flow destructor (viewed interfaces): the client address is freed after
updateView() of both hosts, that can now print the flow.
- Asset DNS name stored lowercase, as the host name.
- Preference "Enable Assets Journal" (disabled by default).
- REST handlers: user actions with the username (tags set/unset on a host,
tag deleted).
- User documentation (Advanced Features > Assets Journal).
The Lua module, the assets code and the tests are in the pro repo.
* Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-TAULY9R0.
* Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-J5YN9UU6