Repository navigation
Add a management realm and limit the raised PHP limits (stacked on #60) - #62
Open
somethingwithproof wants to merge 4 commits into
Open
somethingwithproof wants to merge 4 commits into
somethingwithproof wants to merge 4 commits into
Conversation
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



fix: add a management realm and limit the raised PHP limits (2.8)
This PR is stacked on #60 and must merge after it. Open it with base
fix/review-hardening, which is at c81fe12; the branch isfix/management-realm, rebased onto that commit and holding three commits. It bumps the plugin version from 2.7 (set in #60) to 2.8 and adds a step to the version-change upgrade that #60 reorders, so it cannot be applied on its own. When #60 is merged, retarget this PR tomain; no further rebase is needed because the branch already contains #60's last commit.Description
Two leftovers from the review that #60 does not cover:
memory_limitand the execution time were unlimited for every request to the page. They are now raised only for the import form, an upload and a delete.Related issue
No open issue covers these. This follows the review findings noted in #60.
Behaviour
How has this been tested?
ManagementRealmTest(realm id, allowed and denied, fail closed, install registers both realms, the grants and their failure cases),RequestLimitsTest(each action), and three added cases inSlowlogCheckUpgradeTest(grant before the version is recorded when upgrading from 2.7, no grant at 2.8 or later, version left unchanged when the grant fails).AccessFlowTest: a user with the viewing realm only reads the list but sees no Import link, checkboxes or actions, and a delete post, an upload post and the import form are all refused; users holding both realms directly or through a group see the controls and can delete; revoking the management realm stops deleting while viewing continues.RealmFlowTest: a 2.7 install is taken through the upgrade (in a scratch copy of the plugin directory); the viewer and the grouped user are granted the realm, a user with another realm is not, an administrator's narrowing is not undone at the current version, and a run from 2.7 grants again.date.timezoneset toAmerica/New_Yorkand toUTC(513 passed, 1 skipped each) against MariaDB 11.8.9 in UTC. This PR adds no time handling, so the only interaction with Harden the slow log import and pages, and fix review findings #60's time zone fix is that its tests run on top of it.CI-order runs (plugin installed with
plugin_manage.php --install --enable, then Pest withSLOWLOG_E2E=1, then the patch gate):tests/binintactcacti.logerrorsThe 1.2.x tree is a local branch of that line, not a fresh clone, and Pest ran from the develop checkout's vendor directory. The skip-when-log-not-writable path was not exercised because the containers run as root.
Risk
user_auth_realmoutside Cacti) is not covered.slowlog_manage.php. No page has that name; Cacti only needs a name to list the realm.plugin_realmslookup on the list page and on the pages that check management. Not timed.Rollback
Revert the three commits (
5019a6f,27a3c99,c7fcc3e). The extra realm row stays inplugin_realmsand the grants stay inuser_auth_realmanduser_auth_group_realm; with the old code they have no effect and can be removed in User Management. Nothing in the data tables changes. If the recorded version is already 2.8, set it back to 2.7 on the Plugin Management page or the upgrade check will not run again.Types of changes
Checklist