Commit Graph
654 Commits
Author SHA1 Message Date
JellyfrogandStyleCI Bot 298cfa2876 Apply fixes from StyleCI (#14592)
Co-authored-by: StyleCI Bot <[email protected]>
2022-11-09 16:33:43 +01:00
Jellyfrog 177491239c wip 2022-11-09 16:33:43 +01:00
Jellyfrog cf5ed4fb51 wip 2022-11-09 16:33:43 +01:00
Jellyfrog 0d465ebaaf wip 2022-11-09 16:33:43 +01:00
JellyfrogandStyleCI Bot b1f97a7275 Apply fixes from StyleCI (#14517)
Co-authored-by: StyleCI Bot <[email protected]>
2022-11-09 16:33:43 +01:00
Jellyfrog 5abe2a9ad7 fix cors 2022-11-09 16:33:43 +01:00
Jellyfrog c5e8901845 Fix more flare 2022-11-09 16:33:43 +01:00
Jellyfrog e4ba3955c1 Match new symfony syntax 2022-11-09 16:33:43 +01:00
Jellyfrog 8113ae4286 Fix error provider 2022-11-09 16:33:43 +01:00
ShiftandJellyfrog 7b65cef6bf Convert deprecated $dates property to $casts 2022-11-09 16:33:43 +01:00
ShiftandJellyfrog bb974b24f6 Convert optional() to nullsafe operator 2022-11-09 16:33:43 +01:00
ShiftandJellyfrog b83520bc58 Shift core files 2022-11-09 16:33:43 +01:00
ShiftandJellyfrog 8a7f13c055 Streamline $commands property 2022-11-09 16:33:43 +01:00
ShiftandJellyfrog 555616fbe8 Shift registered middleware 2022-11-09 16:33:42 +01:00
geg347andGitHub 96c7e7166e Adding device's field in get_alert_rule and list-alert-rules API function (new) (#14481)
* Adding device's field in get_alert_rule and lis-alert-rules API function

* Converting SQL request for list/get_alert_rules to Eloquent (thanks a lot to Murrant)

* Manually added #14500 to pass pipeline

* Fixing StyleCI error + trying to fix PHPStan errors

* Trying to fix PHPStan errors (part 2)
2022-11-09 08:21:41 -06:00
JellyfrogandGitHub 71d740770b Remove Log::event (#14526)
* Remove Log::event

Use the Eventlog class directly instead

* wip

* wip

* wip

* Apply fixes from StyleCI

* Update Eventlog.php
2022-11-09 09:47:19 +01:00
Tony MurrayandGitHub 0e9bb04071 API restore ability to update purpose and override_sysLocation (#14596)
fixes #14538
2022-11-08 18:22:37 +01:00
Tony MurrayandGitHub 0801af7a81 Consolidate and improve snmptranslate usage (#14567)
* Consolidate and improve snmptranslate usage

* Fix style

* lint fixes

* fix typo

* allow multiple mib directories

* Only add mib if it is not already set

* oid first, in case we have key length issues

* if there is a full oid, don't add other mibs

* debug in ci

* more debug in ci

* better debug in ci

* remove debug

* Use numeric index

* revert dlink change

* Don't add -On twice

* unit tests and hopefully better heuristics

* remove dump and add one more set of tests

* style fixes

* handle bad input in old functions

* shortcut whole snmp_translate function
2022-11-07 12:00:47 -06:00
JellyfrogandGitHub 009d69a48d Use Collection instead of collect() (#14527)
* Use Collection instead of collect()

* wip
2022-11-05 10:04:36 +01:00
Tony MurrayandGitHub 0c365d08e3 SnmpQuery numeric accept a boolean (#14565) 2022-11-02 18:50:46 -05:00
Tony MurrayandGitHub e938458cde Fix BaseApi uninitialized (#14557) 2022-11-02 09:02:52 -05:00
Félix BouynotandGitHub 3a61955658 Fix Type error (#14555)
Fix production.ERROR: Typed property App\ApiClients\BaseApi::$client must not be accessed before initialization
cf. https://stackoverflow.com/a/59265626/3236342
2022-11-02 14:40:05 +01:00
b59cf980ca Type API methods and properties (#14476)
* Type properties

* Comment method

* Update base_uri child property

* Update BingApi.php

* Update GoogleMapsApi.php

* Update MapquestApi.php

* Update NominatimApi.php

* Update RipeApi.php

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* Fix indent

* Fix escaping

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* Update phpstan-baseline.neon

* StyleCI indent

* Update phpstan-baseline.neon

* Make possible for $client to be null

* Remove comments

* Remove comments

* Remove comments

* Update MapquestApi.php

* Update NominatimApi.php

* Remove comments

* Remove comments

* $base_uri not nullable

* $base_uri not nullable

* $base_uri not nullable

* $base_uri not nullable

* $base_uri not nullable

* $base_uri not nullable

* Type method and properties

* Type method and properties

* Type method and properties

* Type method and properties

* Type method and properties

* Type method and properties

* Type $client

* Type method and properties

* Remove errors not matched anymore

* Fix type errors in graylogapi

* Mixed can't be ORed

* uri never null

* Update app/ApiClients/GraylogApi.php

* Fix getAdresses Type

* Collection changed its folder?

* Fix directory, there was just a backslash missing

Co-authored-by: Tony Murray <[email protected]>
2022-11-02 01:06:15 +01:00
Tony MurrayandGitHub 4b65dc41d2 Graphing cleanup (#14492)
* WIP

* Fixes and cleanups

* Move parseAtTime to Time util class

* lint fixes, explicitly define variables

* Style fixes
2022-10-28 08:06:29 -05:00
44578b2935 Convert string references to ::class (#14508)
PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.

Co-authored-by: Shift <[email protected]>
2022-10-25 08:31:46 -05:00
Tony MurrayandGitHub bfc9c5f846 Fix v2 plugins (#14506)
inverted check caused all v2 plugins to not be shown.
2022-10-24 21:48:13 -05:00
Tony MurrayandGitHub 62aa77c0a0 Fix AlertRule relationships (#14500) 2022-10-24 09:54:59 -05:00
6372041d39 Fix update_device hostname handling #14435 (#14448)
* Fix device_update hostname handling #14435

* Use Eloquent

* Update Device.php

Co-authored-by: Tony Murray <[email protected]>
2022-10-22 15:45:47 -05:00
Tony MurrayandGitHub 4b97abe225 Add --forgot-key to key:rotate command (#14495)
Destroys all encrypted data
2022-10-22 11:45:58 +02:00
Tony MurrayandGitHub da8befca06 Add instance id to error reports (#14444)
* Add instance id to error reports

Alternative to #14261

* lint fix
2022-10-19 18:45:27 -05:00
Tony MurrayandGitHub 7dd3a224fa Block disabled user session auth (#14473)
Do not allow users that are disabled to be logged in via cookie.
Allow all auth methods to disable users
2022-10-17 12:39:15 -05:00
Tony MurrayandGitHub 722791d086 Fix XSS when deleting device and port groups (#14472) 2022-10-17 12:38:16 -05:00
Tony MurrayandGitHub 09a2977adb Fix authentication mass assignment vulnerability (#14468)
Users were able to submit changes to fields they should not have access to change by bypassing the frontend validation.  Correct backend validation to prevent that.
2022-10-17 12:11:14 -05:00
1fd915c8a3 Fix VRP duplicate BGP Peers (#14431)
* fix VRP not cleaning BGP peers properly

* fix missing field in BgpPeer model

* Update includes/discovery/bgp-peers/vrp.inc.php

Co-authored-by: Tony Murray <[email protected]>
2022-10-11 20:26:56 +02:00
JellyfrogandGitHub 071173ffb9 Remove tabs from yaml (#14437)
* Remove tabs from yaml

* Remove tabs from random files
2022-10-10 18:13:10 +02:00
JellyfrogandGitHub b31b992020 Rework socialite integration (#14367)
* Rework socialite integration

Prevents unnecessary work each boot

* Update SocialiteController.php

* Gen 2
2022-10-07 20:52:55 +02:00
daa8c757f6 Fix a few Db* to Eloquent requests (#14278)
* Eloquent for 2 requests

* Eloquent for 1 request

* a few in Dell

* Model

* and more with timos

* and more with timos

* and firebrick

* firebrick

* one query instead of many

* Should use collection get

* Update timos.inc.php

* Update dell-os10.inc.php

* avoid changing timos as it breaks something

* new try with timos

* deps for BGP

* revert deps for BGP

* style

* style

* deps for BGP, 2nd try

* typo

* revert aos7

* fix create

* firebricktests

* firebrick

* firebrick

* cipsec-fix

* cipsec

* timos fix 100th time :)

* ./scripts/save-test-data.php -m os,ports,processors,mempools,vrf,sensors,bgp-peers,mpls,ospf  -o timos -v 7705

* remove timos from this PR

Co-authored-by: Tony Murray <[email protected]>
2022-10-02 16:04:08 +02:00
Tony MurrayandGitHub e4451714e2 version and git helper improvements (#14412)
* Fix up version and git helpers
Improve method names
Move all git calls into the git helper
Allow runtime and external cache of results where appropriate
Consolidate version headers for discovery, poller, and validate

* Style fixes

* improve consistency in git calls

* fix style

* don't send name inconsistently

* Improve database versions

* No need to cache Version it is not used more than once currently.
2022-10-02 00:41:56 -05:00
Tony MurrayandGitHub f60b6788d3 Cache version data (#14404)
* Cache version data
Calling cli commands can be expensive, cache the results.

* style fixes

* Fix pre-laravel usage

* fix lint
2022-09-28 23:23:32 -05:00
Tony MurrayandGitHub e990dfcb35 Disable plugins that have errors (#14383)
* Disable plugins that have errors
Disable plugin if a hook throws an error and set a notification
Move notification code to class, so we can access it
Clear notification when plugin is attempted to be enabled again

* fix style and lint fixes

* another lint fix and handle if property is missing
2022-09-25 22:47:58 -05:00
333ba7c2cd Fix oxidized web requests unclosed connections or responding fast enough (#14370)
* Fix oxidized web requests not closing connections or responding fast enough

* Update showconfig.inc.php

* Add method to get the text content of an oxidized page

* Use Oxidized getContent method instead of file_get_content

* Too much brackets with copy paste

* Fix carriage return errors because of copy paste

* Fix copy paste error again

* Fix indent

* PHPStan is waiting for a return even outside of the if loop

* Single quotes

* Variabilize timeout in baseapi

* Set Oxidized Api class timeout var to 90 because oxidized is slow and to be sure not to break half the installs here

* fix typo

* Variabilize timeout

* Variabilize timeout

* Variabilize timeout

* Variabilize timeout

* Variabilize timeout

* Spacing

* Remove timeout type because of this error

Unexpected 'int' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in app/ApiClients/BaseApi.php on line 34

* Lint needs type finally

* Use contruct instead of setting variable

* Type hinting instead for php7.3

* Type hinting fix

* Set property value instead of calling parent constructor

* Typo

* Remove unneededconstructors

* Remove unneeded constructors

* Remove unneeded constructors

* Remove unneeded constructors

* Remove unneeded constructors

* Remove unneeded constructors

* Typing not casting

* Typing not casting

* Cannot type variables outside of a class

Co-authored-by: PipoCanaja <[email protected]>
2022-09-24 14:24:11 -05:00
4e1f958e16 Fix ping.php skipped results (#14368)
* Update PingCheck.php

* Update PingCheck.php

* Update phpstan-baseline.neon

* Update PingCheck.php

Co-authored-by: Tony Murray <[email protected]>
2022-09-19 15:10:26 -05:00
JellyfrogandGitHub 27a19039dc Defer loading cli option defaults (#14363)
* Defer loading cli option defaults

Also allows passing args to functions

* Update DynamicInputOption.php
2022-09-19 16:03:55 +02:00
JellyfrogandGitHub be4f39a2b4 Remove call to Config from artisan (#14362)
Defers the loading of Config a bit
2022-09-17 23:44:45 -05:00
Tony MurrayandGitHub 0805002086 Fix scheduled maintenance xss (#14360)
Fix for fields title, notes, and maybe recurring_day. Other fields can't store html.

https://huntr.dev/bounties/bcb6ee68-1452-4fdb-932a-f1031d10984f/
2022-09-16 11:59:48 -05:00
Tony MurrayandGitHub 67ad0726b0 Defer loading cli option values (#14354)
* Defer loading option values
Otherwise it causes a cli command to be run every single application boot.

* style and lint

* Just return whatever we have it isn't callable
2022-09-16 11:58:22 +02:00
Félix BouynotandGitHub 9cff8acb29 Match displayname source for graylog (#14339)
* Match displayname source for graylog

* Update GraylogApi.php

* Reorder addresses
2022-09-13 07:44:19 -05:00
JellyfrogandGitHub a22be00c66 Ignore CommandNotFoundException from reporting (#14342)
Prevents user typos from bubbling up to error reports
2022-09-13 07:24:01 -05:00
Tony MurrayandGitHub ad8580d694 Cleanup and optimize the availability widget (#14329)
* Cleanup and optimize the availability widget
Default sort is display name
Sort applies to services too (services always last)
May need to refresh the page to get new css

* style

* We don't need request (lint fix)

* Wrong service field name
2022-09-09 18:22:58 +02:00
JellyfrogandGitHub 152497a098 PHPStan: Enable more checks (#14318)
* PHPStan: Enable more checks

* Fixes

* Fixes

* Deprecation fixes
2022-09-09 07:08:06 -05:00