summaryrefslogtreecommitdiff
path: root/python
AgeCommit message (Collapse)Author
2026-08-11Merge pull request #5388 from c-po/remove-acme-autocertChristian Breunig
pki: T9135: derive ACME certificate chains from disk
2026-08-11Merge pull request #5382 from BradKollmyer/T9167-kea-ha-timer-defaultsJohn Estabrook
dhcp: T9167: align Kea HA timer defaults with Kea ARM
2026-08-11Merge pull request #5365 from l0crian1/last-usedJohn Estabrook
firewall: T8221: Add last-used option to firewall rules
2026-08-11Merge pull request #5363 from natali-rs1985/T9134Kyrylo Yatsenko
qos: T9134: Fix commit crash when classes match different protocols
2026-08-10Merge pull request #5377 from l0crian1/better-fw-error-outputChristian Breunig
firewall: T7552: Output rule in verify_rule() ConfigError messages
2026-08-10pki: T9135: preserve every certificate in an ACME chain, not just the firstChristian Breunig
certbot's chain.pem commonly holds more than one certificate - e.g. the immediate intermediate plus its own issuing root - but the synthetic CA entry built from it only ever kept the first, silently dropping the rest before find_chain() ever saw them. This left a shorter chain than certbot itself actually has, e.g. requiring a root to also be configured manually to reach the same result certbot's own data already provides. Parse every certificate block in chain.pem and emit one synthetic entry per certificate, numbering entries after the first so each is still its own addressable, non-redundant, non-settable object exactly like before.
2026-08-10pki: T9135: don't crash on an ACME certificate not yet issuedChristian Breunig
Both the with_pki=True chain injection and "show pki ca" unconditionally read a certificate's own content to check whether an explicit CA already covers its chain. For an ACME certificate with no cert.pem yet (pending its first issuance, or after a failed request), that content is never populated and the lookup raised KeyError - crashing every with_pki=True consumer and "show pki" alike.
2026-08-10pki: T9135: derive ACME certificate chains from diskChristian Breunig
An ACME-issued certificate's intermediate CA was previously imported into the running configuration as a synthetic object, purely so consumers building a full certificate chain (HAProxy, HTTPS, IPsec, stunnel, EAPOL, ...) could find it. This leaked certbot's internal state into the CLI as a real, deletable object that never needed to exist there: the intermediate is available on disk the moment the certificate is issued, same as the leaf certificate and its key. Read it live from disk instead, purely in memory, wherever a full chain is resolved or displayed - never as a settable or deletable configuration object. An already-configured CA that completes the chain on its own takes precedence and nothing synthetic is added. Adding, changing, or removing a CA now reloads only the services whose resolved chain is actually affected, with no side effect on certificates whose own content did not change.
2026-08-06Merge pull request #5305 from natali-rs1985/T8996Daniil Baturin
qos: T8996: Implement set-dscp packet remarking for shaper policy
2026-08-05dhcp: T9167: align Kea HA timer defaults with Kea ARMBrad Kollmyer
Stock kea_high_availability_json set max-response-delay equal to heartbeat-delay (both 10000 ms) and max-unacked-clients to 0. The Kea ARM documents max-response-delay default 60000 ms (must be greater than heartbeat-delay, typically a multiple) and max-unacked-clients default 10 (0 disables client failure-detection and partner-downs immediately). Equal 10s/10s timers false-fire communication-interrupted every heartbeat cycle on healthy pairs. https://vyos.dev/T9167
2026-08-04container: T7736: give container veths a deterministic host_interface_nameChristian Breunig
Podman's default "vethN" auto-naming for a container's host-side veth can collide with VyOS's own "virtual-ethernet vethN" interfaces. Bump the minimum Podman dependency to 5.8 (which supports "host_interface_name" network connect option) and use it to name every non-macvlan container network attachment "veth-<container name>" instead, eliminating the collision by construction. Container names too long to fit are shortened to a recognizable prefix plus a short hash of the full name; verify() rejects the rare case where two containers still generate the same interface name. Add "show container interface" to display the resulting name-to-container mapping.
2026-08-04T7552: Added more detail to error messagesl0crian1
2026-08-03configsession: T9156: add consistent use of finalizersJohn Estabrook
2026-08-03qos: T9134: Fix commit crash when classes match different protocolsNataliia Solomko
Every class match is installed as its own tc filter, and tc binds a filter priority ("prio"/"pref") to a single protocol. Two filters with the same priority but different protocols are rejected by the kernel, so the commit crashes - e.g. one class matching "ether protocol arp" and another matching IP. The filter priority came from the class id, the class "priority" (which the limiter defaults to 20 for every class), or the per-class match index - none of which is unique across classes. Assign every match a unique tc filter priority by ranking the matches in evaluation order (class id, an explicit or default class "priority", or the per-class match index) and numbering them 1, 2, 3, ... This keeps the match evaluation order unchanged across all class-based policies (shaper, shaper-hfsc, limiter, round-robin, priority-queue). The class "priority" still drives the HTB class scheduling priority on the shaper; the tc filter priority is an internal evaluation-order rank, not the CLI "priority" value. Add smoketests for mixed-protocol classes (shaper and limiter) and for match evaluation order.
2026-08-01T8221: Add last-used option to firewall rulesl0crian1
- Add last-used option to firewall rules - Updated output of show firewall to include last-used - Added smoketest for last-used option
2026-07-29vpp: T8468: Apply MAC address changes on VPP interfacesNataliia Solomko
The interface config filter stripped the "mac" node, so a MAC address configured on a VPP interface never reached the dataplane. Allow "mac" through the filter; VPP applies it to the hardware interface via lcp-sync. Some DPDK drivers (e.g. vmxnet3) cannot change the MAC and would fail to bring the interface up. Reject such a change at verify time - both when setting the MAC and when adding an interface that already has one to VPP.
2026-07-28qos: T8996: Implement set-dscp packet remarking for shaper policyNataliia Solomko
The set-dscp option was defined in XML but never implemented in Python — no tc commands were generated to rewrite DSCP on egress. Add tc pedit actions to shaper filter commands. The pedit target is chosen per-match: IPv4 uses "ip dsfield", IPv6 uses "ip6 traffic_class". Ether matches with protocol ip or ipv6 also get the corresponding pedit; other non-IP match types skip pedit to avoid corrupting packets like ARP. The retain 0xfc mask preserves ECN bits. For IPv4, a csum ip4h action recalculates the header checksum after pedit. For the default class, separate catch-all filters (prio 255/256) are added per protocol.
2026-07-23Merge pull request #5335 from natali-rs1985/T8367Daniil Baturin
vpp: T8367: Fix identical default MAC on bridged loopback interfaces
2026-07-23Merge pull request #5327 from BradKollmyer/T9076-remote-group-intervalDaniil Baturin
firewall: T9076: add per-remote-group update interval
2026-07-20T9105: confirm existence of config-mode file before useJohn Estabrook
The vyos-configd list of config mode files available for loading is generated at build time, however, this can be a superset of files present on the running system; confirm existence before load. An example of the above discrepancy is apparent in case supplementary *.deb packages are not required. Recent refactoring of vyos-configd dropped a legacy construction independent of the build-time list, introducing the regression.
2026-07-20vpp: T8367: Fix identical default MAC on bridged loopback interfacesNataliia Solomko
VPP assigns loopback interfaces a default MAC address derived only from the interface instance number (de:ad:00:00:00:<instance>), with no host-specific entropy. Two independent VPP nodes configuring the same loopback instance (e.g. as a bridge BVI over VXLAN) therefore end up with an identical MAC address. When that MAC arrives from a peer over the shared L2 segment, VPP's L2 learning logic rejects it as a `mac move violation` - it's statically pinned to the local BVI and cannot legitimately appear on another port. This silently drops ARP traffic between the loopbacks while ordinary bridged client traffic (unique MACs) is unaffected, breaking loopback-to-loopback connectivity. Add a mac-address option to the VPP loopback interface, and fall back to a deterministic, host-unique MAC (derived from host UUID/hostname, same scheme already used for container interfaces) whenever none is configured, so the collision can no longer occur by default. Also fix a related bug found while reproducing the above: a loopback is fully deleted and recreated in VPP on every apply, receiving a new `sw_if_index` each time. The loopback conf_mode script never registered the bridge it's a BVI member of as a dependent, so the bridge kept its L2 membership bound to the stale, deleted index instead of reattaching the current one. Register the bridge dependency and reuse the existing `verify_vpp_remove_bridge_interface()` check to block deleting a loopback still in use as a BVI.
2026-07-17utils: T9008: migrate remaining cmd() callers to cmdl() and remove cmd()Christian Breunig
Complete the safer-subprocess migration started by the cmdl()/ifconfig refactoring and convert every remaining vyos.utils.process.cmd() call site to the list-based cmdl(). Drop the vyos.utils.process.cmd() implementation as it is no longer in use.
2026-07-15Merge pull request #5318 from jestabro/config-managerViacheslav Hletenko
T9068: Add config manager module and refactor vyos-configd
2026-07-10firewall: T9076: add per-remote-group update intervalBrad Kollmyer
Add 'set firewall group remote-group <name> interval <value>' to control how often each remote group list is re-downloaded, independent of the global resolver-interval that also drives domain-group/FQDN resolution. The value accepts plain seconds or time-unit suffixes s/m/h/d/w (e.g. 4h), range 60 seconds to 4 weeks, enforced at commit time after conversion. When unset, the group keeps following 'firewall global-options resolver-interval', so existing configurations are unaffected. vyos-domain-resolver now tracks a last-update timestamp per remote group and sleeps until the next due update instead of a fixed resolver-interval tick, honoring per-group intervals both shorter and longer than the global one. A group is only stamped as updated after a successful download; failed downloads fall back to the cached list and are retried at the resolver cadence rather than after the full group interval. human_to_seconds() now treats a plain number as seconds instead of returning 0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09Merge pull request #5314 from natali-rs1985/T9018Viacheslav Hletenko
vpp: T9018: Auto-enable promiscuous mode for interfaces with VLANs
2026-07-08T9068: add config manager module for vyos-configd dependency controlJohn Estabrook
2026-07-07Merge pull request #5275 from BradKollmyer/remote-T8829-head-fallbackJohn Estabrook
remote: T8829: fall back to GET when HEAD is not supported
2026-07-07vpp: T9018: Auto-enable promiscuous mode for interfaces with VLANsNataliia Solomko
VPP drops VLAN-tagged frames unless the parent interface has promiscuous mode enabled, causing VLAN sub-interfaces to lose connectivity. Automatically enable promiscuous mode on VPP interfaces that have VLAN sub-interfaces (vif/vif-s) configured.
2026-07-06frrender: T9054: keep PPPoE/DHCP default route when "protocols static" is ↵Christian Breunig
deleted Deleting "protocols static" set config_dict['static'] to a dict object shared by reference across every deleted protocol. Merging the PPPoE/DHCP default-route data into it left the "deleted" marker in place, so the entire staticd section - including the just-merged default route - was skipped during FRR rendering, dropping the default route from the RIB/FIB. Copy the shared deleted-protocol marker before mutating it, and clear the marker once DHCP/PPPoE content has been merged in so the section is still rendered.
2026-07-01firewall: T8761: re-introduce VRF interface names in generated firewall configDavid Vølker
This change re-implements the intended behaviour from T4180 aswell as from T4506, it ensures that both the vrf-member interface aswell as the vrf itself is added as an oifname -> meaning that traffic traversing and originating from withing VyOS is matches outbound. Changes done by c-po: * re-sort dependency list to keep diff low * vyos.configdict.is_vrf_changed() should return early and not carry over the to-be return value * keep common coding style (dict by . separation) in nftables-zone.j2 Co-authored-by: Christian Breunig <christian@breunig.cc>
2026-06-30vyos.utils: T8981: catch_broken_pipe() decorator must return func(*args, ↵Christian Breunig
**kwargs) "show system commit diff <rev>" produces no output (exit 0) for any revision, regardless of how much the revisions differ. The revision store and diff engine are intact - "show system commit file <rev>" works, and so does ConfigMgmt().compare(rev1=0, rev2=1) which returns the correct diff when called directly. Commit a29d73d00 ("op-mode: T8362: "compare" command lacks catch_broken_pipe decorator") added @catch_broken_pipe to ConfigMgmt.show_commit_diff to suppress BrokenPipeError tracebacks when piping output, but the decorator calls the wrapped function without returning its value. Thus the op-mode framework will receive None and prints nothing.
2026-06-29Merge pull request #5286 from c-po/ifconfig-refactoringChristian Breunig
ifconfig: T9008: refactor vyos.ifconfig to use cmdl() for safer subprocess execution
2026-06-29Merge pull request #5298 from vyos/ci/T8490-typos-vyos-1xDaniil Baturin
ci: T8490: fix typos in comments, strings, and local identifiers
2026-06-29Merge pull request #5285 from c-po/cmdlDaniil Baturin
utils: T9003: add list-argument variant of cmd() for safer subprocess execution
2026-06-29ci: T8490: fix typos in comments, strings, and local identifiersYuriy Andamasov
Reaches a clean typos baseline for the T8490 ruleset pilot. Categories: - Comments/docs: recursivly, taret, passsed, characted, arhive, AtrributeError; "ned" -> "new" (migration comments). - Messages/strings: writeable -> writable (x5); OCaml log "Commandis" -> "Command is". - Local variables (all refs in-function): commited, formating, presistent; inpt_range -> input_range; tz_datas -> tz_data_raw (avoids the tz_data collision). - Self-contained renames (definition + all references in-file): formated_stats, _get_formatted_output_conections -> ..._connections, expension_failure -> expansion_failure (ping + traceroute), snmpd_restart_reqired -> ..._required. False positives are allowlisted centrally (vyos/.github, separate PR), NOT changed here: mke2fs, Maya-calendar "Mak", RFC 4122 "IDentifier" (hostapd), and VPP's "U-Forwrd" bridge-domain column header (op_mode/vpp.py + the VPP smoketest assert the real upstream `vppctl` output). Verified: typos clean, py_compile of every edited .py, zero remaining old-identifier references. 🤖 Generated by [robots](https://vyos.io)
2026-06-26Merge pull request #5282 from sarthurdev/T8987Christian Breunig
geoip: T8987: Support updates via source-address/vrf
2026-06-25Merge pull request #5284 from vyos/T8097-strongswan-esnChristian Breunig
T8097: strongswan: add CLI for ESN
2026-06-25geoip: T8987: Support updates via source-address/vrfsarthurdev
2026-06-25Merge pull request #5294 from jestabro/configtree-thread-safe-initJohn Estabrook
T9015: fix thread safety of configtree read/write_cache
2026-06-25Merge pull request #5291 from jestabro/reference-tree-thread-safe-initJohn Estabrook
T8993: initialize ReferenceTree module from string not file
2026-06-25Merge pull request #5155 from sarthurdev/geoipViacheslav Hletenko
geoip: T5746: Add GeoIP ASN support
2026-06-24T9015: use file operations on Python side for read/write_cache to fileJohn Estabrook
For thread-safe calls, move file operations to the Python side, leaving only string operations for calls to ctypes bindings.
2026-06-24T8993: initialize ReferenceTree module from string not fileJohn Estabrook
Avoid initialization error in threaded applications, for example when calling libvyosconfig functions from FastAPI background tasks. The read_internal function from file relies on the inherently non thread-safe Unix module; read string first and pass to lib read_string.
2026-06-23ipsec: T8975: lock vti-up-down state DB to prevent lost updates under ↵Robert Navarro
concurrent rekey The vti-up-down hook and vpn_ipsec.py modify a flat-file DB (/tmp/ipsec_vti_interfaces) through three context managers that do an unlocked read-modify-write. During a coordinated rekey, strongSwan fires the hook for many VTIs concurrently, so the writers lost-update each other: an interface whose up-client add is overwritten is left admin-down while its CHILD_SA stays installed. Serialise all DB access by reusing vyos.utils.locking.Lock. A new _vti_updown_db_lock() context manager wraps the three public context managers, and remove_vti_updown_db() holds the lock across both the DB processing and the os.unlink() to close the create/delete race. Make the helpers absence-safe under the lock so callers no longer compose a separate existence check with a locked operation: open_vti_updown_db_readonly() yields None when the DB does not exist and remove_vti_updown_db() is a no-op when it is absent. Drop the now-redundant unlocked vti_updown_db_exists() pre-checks in vti.py and vpn_ipsec.py and handle the None yield.
2026-06-23Merge pull request #5267 from vyos/T8099-strongswan-6.0John Estabrook
T8099: strongswan: 6.0.6 + Post quantum options
2026-06-23Merge pull request #5252 from natali-rs1985/T8913Daniil Baturin
vpp: T8913: Skip bond teardown for non-structural config changes
2026-06-22T8099: strongswan: Post quantum optionsKyrylo Yatsenko
Add options for mlkem*
2026-06-22pseudo-ethernet: T8540: Add anycast-gateway support for EVPNOleksandr Kuchmystyi
Introduce 'anycast-gateway' leafNode for pseudo-ethernet interfaces. When set, a local FDB entry is installed on the parent bridge to prevent the shared anycast MAC from leaking over the VXLAN overlay.
2026-06-22Merge pull request #5280 from natali-rs1985/T8603Viacheslav Hletenko
vpp: T8603: Expand ACL support to logical interfaces
2026-06-21remote: T8829: fall back to GET when HEAD is not supportedBrad Kollmyer
HttpC.download() always probed remote URLs with HEAD before GET to discover redirects and Content-Length. Some APIs (e.g. AbuseIPDB) reject HEAD with 405 Method Not Allowed, causing firewall remote-group downloads to fail and leave empty cached list files. Treat HEAD 405/501 as unsupported and proceed with GET using the original URL. When HEAD does not provide Content-Length, read it from the GET response headers instead. Validate available storage after determining file size and before opening the destination file. Log sanitized download errors in vyos-domain-resolver when a remote- group list-file fetch fails. Add unit tests with mock servers that return 405 or 501 on HEAD and 200 on GET.