The standard's ratchet: models.py may not grow, and a new function stays within
complexity 10. NASShareDict and ShareAccessDict move to share_models; models
re-exports both, so every import keeps working.
- PosixSharesMixin (get_shares): an ordinary Linux server's NFS exports from the
kernel's export table and its Samba shares from testparm -s, each naming the
service that serves it.
- NASShareDict: optional service, export, access (ShareAccessDict) and guest.
- NetworkMountsMixin (get_network_mounts): the NFS exports and SMB shares a host
has mounted, from /proc/self/mounts, with the address the kernel connected to.
- get_services reports nfs-server running while its unit is active
(KERNEL_SERVED_UNITS); get_listening_sockets names it as the unit of the
sockets /proc/fs/nfsd/portlist lists.
One bad apt source line, two Signed-By for one repository, makes apt refuse
every source. The update read then failed with "exit status 100" and nothing
else, because APT_UPGRADABLE_COMMAND threw stderr away.
The command now passes apt's E: lines on, marked __APT_E:, and still keeps
its warnings out. parse_apt_upgradable raises PackageSourcesUnreadable, a
ValueError, with apt's errors when apt could not read its sources, and names
them after the exit status for any other failure.
An application whose worker gives a run less time than the driver's bound
passes limit (seconds), so the run fails with what it printed instead of
being cut off by the worker.
get_host_firewall gains an optional windows key: a Windows host's
profiles, enabled rules with their filters, and the profile of each
connected interface, beside the netfilter chains rather than in them.
WindowsFeaturesMixin declares get_windows_features: every optional
feature of the host's image and its state.
The netfilter shapes move to host_firewall_models; models re-exports
them.
- HostEventsMixin.get_host_events(since=None), declared: the events of a fixed
set of kinds a host's own log recorded (unexpected shutdowns, system crashes,
hardware errors, disk errors, programs and services that crashed), with
HostEventDict, HostEventsDict and host_event().
- LogSourceDict: kind "eventlog" for a Windows event channel, named by the new
optional channel field (eventlog_source, LOG_SOURCE_KINDS).
- ServiceDict: optional result, exit_code, trigger_start and account; exported.
Secure Boot, the TPM, disk encryption per volume, the antimalware product,
the firewall's profiles and virtualization-based security, in terms no OS
owns, so a Windows host's protection fits the reading Linux fills. The new
keys are NotRequired; every key Linux fills stays required and unchanged.
HostStorageMixin declares get_disks, get_disk_pools and get_volumes in
StorageDriver's shapes, and get_disk_smart, drive health per disk, with
no role: a Windows or Linux host reports its storage and stays a host.
DiskSmartDict names the keys Proxmox's get_disk_smart already fills and
adds the highest temperature and the uncorrected read and write errors.
HostVolumeDict adds a volume's file system and health to
LogicalVolumeDict. A disk that does not say reads temperature -1 and
health "unknown", never a zero or a "healthy" nobody measured.
Additive: nothing changes for StorageDriver or its drivers.
UpdateDict takes optional title, advisories, cves and vendor_severity, for a
source that says more of an update than a package name: Windows Update's
title, KBArticleIDs, CveIDs and MsrcSeverity. UpdateHistoryPackageDict takes
an optional title. Additive: every reader that leaves them out conforms.
LoginAccountDict may carry sid, administrator and remote_desktop; uid
stays an int and is the RID where a SID is given. LoginAccountsDict may
carry groups (LoginGroupDict, LoginGroupMemberDict, LOGIN_GRANTS): the
groups that grant administering the host or a remote desktop login,
with every member. LoginSessionsDict may carry records_since, the oldest
entry the record still holds. All optional: the Linux reading and every
driver that builds one are unchanged.
clean_system_identity applies parse_system_identity's placeholder rules to values a
host reads through an interface of its own (Windows' CIM classes,
NetOrk/netork#2888); parse_system_identity now uses it. UserDict gains an optional
sid beside the int uid (NetOrk/netork#2889).
HostRepairMixin declares one method per run -- verify_system_files,
repair_system_files, check_component_store, repair_component_store,
update_antimalware_signatures and scan_antimalware -- so the method list is the
guard, and a repair is never offered with its check. Each streams the tool's
lines to log and returns a HostRepairResultDict; tool_outcome builds it from the
lines and the exit code, failing a non-zero code with the tool's last lines.
offered_host_repairs lists the runs a driver defines.
LoginSessionsMixin reads wtmpdb's and wtmp's records of the last seven
days with ISO times, bounded on the host, keeps terminal logins only and
names the driver's own SSH client address (SSH_CONNECTION), whose sessions
it leaves out. A driver supplies _run_login_sessions_command; a host
without a readable record raises LoginSessionsUnavailable.
WirelessWritesMixin declares push_ssid_config(ssid, SsidConfigDict), a
partial write, and set_radio_channels({radio: channel}), every radio in
one restart; AccessPointDriver and ResidentialGatewayDriver carry it.
AccessPointDriver declares set_vlan_name(vlan_id, name) and, through
ApConfigMixin, apply_ap_config(ApConfigDict, parts): the desired state
in vendor-neutral terms, of which the driver writes the parts the caller
found different, answered by ApConfigResultDict. The part names and
their I/O-free readers live in ap_config.
DhcpLeasesMixin declares get_dhcp_leases() with DhcpLeaseDict, apart
from DhcpServerMixin, so an access point can report the leases it serves.
UpdateMixin.apply_updates declares a keyword-only log, as
harden_ssh_server does: it receives each line of the package manager's
output as the host prints it. A driver that cannot stream does not call
it and returns the output at the end, as before; the declaration stays
compatible with every driver that implements it without the keyword.
get_hardening() reads virtualization (systemd-detect-virt, else the cpuinfo
hypervisor flag) and cpu_vendor. CpuMicrocodeMixin.install_cpu_microcode()
refuses a guest, picks the package of the distribution and CPU vendor
(microcode_package), adds Debian's firmware component to Debian's own sources
where it is missing, reloads the index and installs the package; it loads at
the next boot.
models.py had grown past its recorded size with the live patches;
KernelFactsDict moves to kernel_models, re-exported by models, and the
record shrinks to what is left (1336). The root read of Canonical's status
returns on a refusal instead of passing (bandit B110).
bandit reads password == "locked" as a hardcoded password (B105) and fails
the security job. A state word is none; STATE_SET, STATE_LOCKED and
STATE_NONE name them.
LoginSourceDict names one source with the device's word for its kind and what
it asks for: password, password_otp, external or unknown. WebLoginAuthDict is
what a driver's get_web_login_auth returns, every source the web interface
tries, in the device's order. SshServerAuthDict takes password_sources and
server_enabled for a platform that writes sshd_config itself.
/sys/kernel/livepatch with each patch's enabled and transition, kpatch
list, and Canonical Livepatch's status for the running kernel with the
CVEs it names. status reads the daemon's last state; refresh is never run.
Where the client is installed and its status needs root, a driver that
supplies _run_livepatch_status_command reads it again as root.
LoginAccountsMixin.get_login_accounts: root and UID 1000 on with a login
shell, from /etc/passwd without the comment field; the newest last login of
lastlog2, lastlog, wtmpdb last and last, with where it came from; the
password state and expiry from passwd -S and chage -l; the failed attempts
since the last login from lastb, else faillock. Root first, the login user
where root is refused, when what needs root is None.