1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 17:52:43 +01:00
phorge-phorge/src/applications/almanac/storage
epriestley 944539a786 Simplify locking of Almanac cluster services
Summary:
Fixes T6741. Ref T10246. Broadly, we want to protect Almanac cluster services:

  - Today, against users in the Phacility cluster accidentally breaking their own instances.
  - In the future, against attackers compromising administrative accounts and adding a new "cluster database" which points at hardware they control.

The way this works right now is really complicated: there's a global "can create cluster services" setting, and then separate per-service and per-device locks.

Instead, change "Can Create Cluster Services" into "Can Manage Cluster Services". Require this permission (in addition to normal permissions) to edit or create any cluster service.

This permission can be locked to "No One" via config (as we do in the Phacility cluster) so we only need this one simple setting.

There's also zero reason to individually lock //some// of the cluster services.

Also improve extended policy errors.

The UI here is still a little heavy-handed, but should be good enough for the moment.

Test Plan:
  - Ran migrations.
  - Verified that cluster services and bindings reported that they belonged to the cluster.
  - Edited a cluster binding.
  - Verified that the bound device was marked as a cluster device
  - Moved a cluster binding, verified the old device was unmarked as a cluster device.
  - Tried to edit a cluster device as an unprivileged user, got a sensible error.

{F1126552}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T6741, T10246

Differential Revision: https://secure.phabricator.com/D15339
2016-02-25 03:38:39 -08:00
..
AlmanacBinding.php Simplify locking of Almanac cluster services 2016-02-25 03:38:39 -08:00
AlmanacBindingTransaction.php Allow Almanac properties to be deleted, use EditEngine instead of CustomField 2016-02-22 11:28:26 -08:00
AlmanacDAO.php Implement storage of a host ID and a public key for authorizing Conduit between servers 2014-10-03 22:52:41 +10:00
AlmanacDevice.php Simplify locking of Almanac cluster services 2016-02-25 03:38:39 -08:00
AlmanacDeviceNameNgrams.php Allow Almanac devices to be queried and sorted by name 2016-02-21 10:44:46 -08:00
AlmanacDeviceTransaction.php Allow Almanac properties to be deleted, use EditEngine instead of CustomField 2016-02-22 11:28:26 -08:00
AlmanacInterface.php Simplify locking of Almanac cluster services 2016-02-25 03:38:39 -08:00
AlmanacNamespace.php Allow Almanac properties to be deleted, use EditEngine instead of CustomField 2016-02-22 11:28:26 -08:00
AlmanacNamespaceNameNgrams.php Rough-in Almanac namespaces 2016-02-22 04:58:35 -08:00
AlmanacNamespaceTransaction.php Rough-in Almanac namespaces 2016-02-22 04:58:35 -08:00
AlmanacNetwork.php Allow Almanac namespaces to be searched by ngram index 2016-02-22 04:58:18 -08:00
AlmanacNetworkNameNgrams.php Allow Almanac namespaces to be searched by ngram index 2016-02-22 04:58:18 -08:00
AlmanacNetworkTransaction.php Use EditEngine for Almanac Services, Devices, and Networks 2016-02-22 11:28:38 -08:00
AlmanacProperty.php Allow Almanac properties to be deleted, use EditEngine instead of CustomField 2016-02-22 11:28:26 -08:00
AlmanacSchemaSpec.php Implement PhabricatorProjectInterface on Almanac Services and Devices 2014-11-05 15:30:00 -08:00
AlmanacService.php Simplify locking of Almanac cluster services 2016-02-25 03:38:39 -08:00
AlmanacServiceNameNgrams.php Allow Almanac services to be searched by substring 2016-02-22 04:58:03 -08:00
AlmanacServiceTransaction.php Allow Almanac properties to be deleted, use EditEngine instead of CustomField 2016-02-22 11:28:26 -08:00
AlmanacTransaction.php Allow Almanac properties to be deleted, use EditEngine instead of CustomField 2016-02-22 11:28:26 -08:00