Commit Graph

170 Commits

Author SHA1 Message Date
Oliver Gorwits
f72acb6006 #1064 implement tags in database and ACL 2023-07-19 11:15:49 +01:00
Oliver Gorwits
2cbb68889a #975 RBAC for port control with new portctl_by_role setting 2023-06-27 22:52:04 +01:00
Oliver Gorwits
bb046f036e tune the portvlanmismatch and include domain name in report view 2023-06-19 21:28:23 +01:00
Oliver Gorwits
f14e495e49 use new faster portvlanmismatch query without duplication 2023-06-13 17:41:20 +01:00
Christian Ramseyer
82dea7de2a Try to fix #1044 by subquery inlining instead of CTE (#1046) 2023-06-08 16:29:14 +01:00
Oliver Gorwits
65a908dcd3 #1036 skip API login for trust_remote_user, trust_x_remote_user, no_auth 2023-06-05 17:02:20 +01:00
Oliver Gorwits
9355f5c2b9 Refactored ACL support with multi-object compare
Squashed commit of the following:

commit 4081e22202693bd7c4ea00e95daad8e628c6fd5a
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Mon May 29 21:02:07 2023 +0100

    large rename of check_acl* to acl_matches*

commit 3cfa284ddd24d68765c255578cc5c184afbdcd83
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Fri May 19 20:39:03 2023 +0100

    update permission doc

commit 8c7bb93cc5e9fafb770f98f446e45cbd94b14894
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed May 17 21:50:07 2023 +0100

    migrate most check_acl_only to acl_matches_only

commit c47f699f2a22f08f2f3e093ed0f24c891e6f9a82
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Wed May 17 21:39:19 2023 +0100

    rename check_acl* to be acl_matches*

commit a884a22c3ab1f3262118c3a47ed8e25b0b0a7336
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 14 16:50:42 2023 +0100

    update macsuck_no_deviceports to use acl_matches

commit 8c256af728721329b64d071fa529dfc844073ac6
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 7 22:54:33 2023 +0100

    update hide_deviceports to use acl_matches multi @things

commit cd5d9978aba1da459be4fed4500f395df13f7784
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sun May 7 22:53:38 2023 +0100

    check_acl fix to allow all @things to offer a property before fallback to missing as empty string

commit 1a3ab9a7646e9f994f03126d45fc36e9e5a13ed5
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 2 15:31:17 2023 +0100

    add ignore_deviceports to portproperties discover; improve comments

commit 51385ce89458dc939587dae902fda431719c22c9
Merge: b97c07d2 3f8ffe78
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Tue May 2 15:21:48 2023 +0100

    Merge branch 'master' into og-acl_multidict

commit b97c07d237d750c1d9eb3095d8ff3908512eac2a
Author: Oliver Gorwits <oliver@cpan.org>
Date:   Sat Mar 25 14:37:53 2023 +0000

    add support for arrayref of items, and unblessed hash, to check_acl
2023-05-29 21:32:07 +01:00
Oliver Gorwits
701ef51a53 #990 API error: Not Authorized due to time zone calc error 2023-03-29 10:58:01 +01:00
Oliver Gorwits
6586815fc6 #1001 support for FQDN node search while domain_suffix is set; add fallback to IPv4 host lookup search 2023-03-16 15:53:25 +00:00
Oliver Gorwits
2b8a45ef08 better name for variable 2023-03-16 13:54:59 +00:00
Oliver Gorwits
1d988bbf7c implement ignore_layers, force_macsuck, force_arpnip config settings (#1002)
* implementation of ignore_layers, force_macsuck, force_arpnip and macwalk

* use new WalkJobs view to get devices needing macsuck

* also new query for discoverall, arpwalk, nbtwalk

* faux record has a last_defer stamp so we can see when the backend started

* fix typo
2023-03-15 14:44:42 +00:00
Oliver Gorwits
91e783e96f fix bug with ILIKE/LIKE on UTF8 encoded field 2023-03-08 22:52:13 +00:00
Oliver Gorwits
1d00ebc91e #949 inconsistencies in time values due to time zone handling 2023-03-03 15:01:06 +00:00
Oliver Gorwits
214b98d28f #949 replace other occurances of now() with LOCALTIMESTAMP 2023-03-03 14:22:21 +00:00
Oliver Gorwits
cbc32eb032 #949 replace other occurances of now() with LOCALTIMESTAMP 2023-03-03 14:21:18 +00:00
Oliver Gorwits
29402f0726 #949 replace now() with LOCALTIMESTAMP and cast to_timestamp() as ::timestamp 2023-03-03 14:08:10 +00:00
Christian Ramseyer
8cc8bdcd19 Add NAC columns to UI (#941)
* Add NAC columns to UI

* Compact variant with a "NAC Summary" column

* display PAE stuff as very short summary in web and full columbs in csv

* add tooltips for actual port status and state detail

* minor naming tweaks

Co-authored-by: Oliver Gorwits <oliver@cpan.org>
2022-12-13 09:16:32 +01:00
Oliver Gorwits
1c7c749f0e custom fields on devices and ports in the web from config (#945)
* custom device field web display and edit

* make display work; relies on T::T calling dict slot or method with same syntax

* add storing port custom fields

* use resultset method instead, use cf_ prefix

* update Pg min ver for jsonb

* allow override of position and default for port custom fields

* support hidden for custom fields

* update description of Objects API class

* allow left and mid position for custom fields

* add custom fields in csv

* change port control sidebar label

* fix default missing bug on backend jobs
2022-12-09 10:20:26 +00:00
Oliver Gorwits
d03eab02db #944 DevicePort.pm should use vlan_entry instead of vlan 2022-12-06 19:11:51 +00:00
Oliver Gorwits
826e1db39d API Endpoints to submit arpnip and macsuck results (#942)
* Add macsuck worker to collect various PortAccessEntity (NAC) attributes

* Incorporate PAE feedback on #937

 * missing Result/Device.pm column added
 * pae_is... columns instead of pae_capabilities
 * moved most code to Util/PortAccessEntity.pm so the update can
   be done in discover and macsuck

* Refactor PAE attributes during discover as separate Plugin

* PortAccessEntity: don't use device->dns in log string

* Fix "Experimental keys on scalar is now forbidden" test failure

* Revamp pae_control and add missing attribute

 - device.pae_control (text) is now device.pae_is_enabled (bool)
 - also store pae_authconfig_port_control (port mode auto/force(un)Auth)

* Fix "Experimental keys on scalar is now forbidden" test failure

 - ... again because of botched merge
 - at least perlgolfed away a set of curly braces

* Update PortAccessEntity.pm

* Incorporate @ollyg PR feedback

* allow actions without transport to run when there are also no creds

* initial refactor for separate gather, process, store phases for macsuck

* factor out the vlan sanity check

* additional help with log of action workers

* cleanup logic in check macsuck

* refactor to make main phases only

* some fixes

* implement file slurp. amazingly the whole thing works

* remove outdated noop from test

* treat error as critical, use cancel to suppress further drivers

* big refactor to share mac sanity code to both paths

* fix inverted logic on vlan sanity filter

* some code tidy

* fix error in default value

* fix for vlan 0 nodes input from cli

* ensure imported MACs are IEEE format

* add api endpoint, no useful return status yet

* exit status if error from nodes PUT

* suppress other networked workers when direct workers are active

* better log showing worker

* fix status recording to get first error or last done message

* implement arpnip API PUT

* avoid package redeclaration error

* make sure write API methods require admin status

* add doc for passing JSON data to arpnip and macsuck

* update manifest

* remove option to do jobs in web handler; all by queue now

* use job entry timestamp for offline queued jobs

* fix store username and IP on api PUT

* never de-duplicate user-submitted jobs; never reset DeviceSkip for offline jobs

* myworker no longer needed

* make logic cleaner

Co-authored-by: Christian Ramseyer <ramseyer@netnea.com>
2022-11-25 15:24:23 +00:00
Oliver Gorwits
0e9ff81cf5 Add worker to collect various PortAccessEntity (NAC) attributes (PR #937, partially implements #887)
* Add macsuck worker to collect various PortAccessEntity (NAC) attributes

* Incorporate PAE feedback on #937

 * missing Result/Device.pm column added
 * pae_is... columns instead of pae_capabilities
 * moved most code to Util/PortAccessEntity.pm so the update can
   be done in discover and macsuck

* Refactor PAE attributes during discover as separate Plugin

* PortAccessEntity: don't use device->dns in log string

* Fix "Experimental keys on scalar is now forbidden" test failure

* Revamp pae_control and add missing attribute

 - device.pae_control (text) is now device.pae_is_enabled (bool)
 - also store pae_authconfig_port_control (port mode auto/force(un)Auth)

* Fix "Experimental keys on scalar is now forbidden" test failure

 - ... again because of botched merge
 - at least perlgolfed away a set of curly braces

* Update PortAccessEntity.pm

* Incorporate @ollyg PR feedback

Co-authored-by: Christian Ramseyer <ramseyer@netnea.com>
2022-11-04 10:03:26 +01:00
Oliver Gorwits
790c51b257 #925 implement ignore_deviceports and hide_deviceports 2022-09-20 20:32:35 +01:00
Oliver Gorwits
73862d5ac8 fix device sysname showing in node search 2022-08-17 06:09:43 -04:00
Oliver Gorwits
4d49f04d2a #875 Node Search - swap IP and DNS, add system name, highlight most recent, in the Switch Port rows 2022-08-16 22:25:27 +01:00
Oliver Gorwits
dd468efdd5 #834 VLAN Mismatch report - add sysname, port comment, and vlan diff 2022-08-16 18:12:35 +01:00
Oliver Gorwits
e85198731f add remote dns to undiscovered neighbors report 2022-08-15 09:17:11 -04:00
Oliver Gorwits
b01d0f08fd add a remote_dns port property 2022-08-14 21:36:50 +01:00
Oliver Gorwits
3684451f2a add ifindex column for show 2022-08-14 21:13:27 +01:00
Oliver Gorwits
1e2d9f36bf #912 use new all_oids format with additional status,enum,descr 2022-08-07 23:03:45 +01:00
Oliver Gorwits
2ae86b9fcd make the SNMP Browser faster and colour branches with data 2022-08-04 22:56:23 +01:00
Oliver Gorwits
94c43fcc33 #906 snmp browser is very slow sometimes 2022-08-03 17:43:23 +01:00
Oliver Gorwits
b40c30606e #900 make Port VLAN mismatch respect p_hide1002 setting 2022-08-03 10:25:23 +01:00
Oliver Gorwits
db7c480be4 #877 fix Port VLAN Mismatches report incorrect with Cisco subinterfaces 2022-08-02 20:25:50 +01:00
Oliver Gorwits
a1aac2777d use i_subinterfaces to group vlan subinterfaces like link aggregates in device ports view 2022-08-02 18:22:36 +01:00
Oliver Gorwits
2c5c344ece fix bug in vlan names feature missing ports without vlan table entry 2022-08-01 17:48:50 +01:00
Oliver Gorwits
ec4cf74cea #872 separate column for NetBIOS name in IP Inventory 2022-07-27 22:48:36 +01:00
Oliver Gorwits
5ecb09dcb7 option to renumber to existing interface address 2022-07-26 22:32:58 +01:00
Oliver Gorwits
56ce4956cc #877 ignore vlan 1002-1005 in port vlan mismatch report 2022-07-26 21:09:34 +01:00
Oliver Gorwits
1d2e41975c #895 fix for neighbor showing phantom connections when remote_ip is not unique 2022-07-26 20:54:31 +01:00
Oliver Gorwits
7566e64886 #882 option to display vlan names instead of numbers in device ports table 2022-07-26 09:49:07 +01:00
Oliver Gorwits
a9b0d58b79 #897 port free should only apply to physical interfaces 2022-07-25 17:42:38 +01:00
Oliver Gorwits
e1bfd917a9 update undiscovered neighbors and port properties discovery to use remote_is_discoverable 2022-05-15 23:16:49 +01:00
Oliver Gorwits
1a810d89f3 support for storing remote_is_discoverable on a port 2022-05-15 22:17:36 +01:00
Oliver Gorwits
dc1f76c1aa Feature to gather SNMP Walk, use as Pseudo Device, and Browse Objects
* fix anomalous name

* add gather worker

* fix encoding of binary storage

* store results back to job

* now parsing mbis report to translate

* fix the broken report parser

* rename gather to snapshot

* implement walk code copied from SNMP::Info

* can now bulkwalk and parse mibs report and store resolved walk in cache

* add func/glob aliasing broken

* better aliasing

* implement aliasing from globals and funcs

* fix regexp for matching netdisco-mibs report

* fake cache entry for all ND2 methods called, add comments

* also save to logs/snapshots/IP

* add doc for netdisco-do

* add is_pseudo column to device table

* support for loading cache for pseudo devices

* check for hrSystemUptime as well as sysUpTime for snmp connect

* display pseudo devices with yellow pill for name

* color all cells for layers for pseudo

* no need to b64 encode binary data in scalars as we b64 whole thing after

* tweaked uptime check

* store snapshot to database instead of Job

* expose snapshots in device details tab

* small ux improvements on snap download

* fixes for errors in subnet mask searching

* hide snapshot management for pseudo devices

* update to use new netdisco-mibs object cache

* update for new format oids file

* start of work on loading walk into db for browsing

* store values and meta

* add auto increment col and oid index to browser

* start web plugin for browser

* add virtual search for oid children

* have all oid in separte table (60 seconds load on my laptop)

* rename table and add relation

* store oid as int array

* fix sql for children

* make jstree start working

* working very slow tree expand

* fix to work when first displaying tree

* store both oid and oid_parts

* simplify SQL to speed up (more complicated perl)

* fix sql bug, add better index, prettify tree

* render the snmp node detail

* add node template, make scrollable, pretty print data values (insecure)

* store munge hint

* some dubious code to munge the data

* make sure to filter by IP on device_browser

* make safer the rendering of value data (but need to come back to key ordering)

* fix sorting on object values

* limit the opening of child nodes to keep response good and unclutter

* factor out the munge and make safer

* reject unknown mungers

* show the munger and option (not working) to change

* additional js for munge select

* complete custom munge

* change so that saving to database is only at CLI and on request

* hide snmp tab if no browser rows in the db

* add helpful message when no browser rows for the device

* stub handler for search and add recurse control

* working search

* minor ui fixes

* implement typeahead for leaf search

* limit rows in typeahead

* make sure device_browser is visited in delete and renumber

* add requirements for this branch

* update manifest

* make sure node search and typeahead are restricted to current device only
2021-11-06 07:47:29 +00:00
Oliver Gorwits
d8a9ad9007 #808 avoid dns for fuzzy search on IPish thing 2021-10-06 08:28:56 +01:00
Oliver Gorwits
a040e8ae38 #814 when deleting device, avoid deleting jobs running on the device 2021-10-04 19:35:42 +01:00
Oliver Gorwits
3e6ec6883f #809 fix crash in Node search due to regexp translation perl to SQL 2021-09-08 20:39:50 +01:00
Oliver Gorwits
2498d9766b #800 gather and report SNMP Chassis ID http://oid-info.com/cgi-bin/display?oid=1.3.6.1.4.1.9.3.6.3&a=display 2021-08-14 13:28:13 +01:00
Oliver Gorwits
d206b9ccbf a bunch of logic changes to allow tests to run standalone 2021-08-12 10:58:55 +01:00
nick n
83a946d36e replace unicode nonbreaking space with ascii space (#794) 2021-06-23 22:00:33 +01:00