Page MenuHomePhabricator

Add a query/policy layer on top of SSH keys for Almanac
ClosedPublic

Authored by epriestley on Nov 5 2014, 8:14 PM.
Tags
None
Referenced Files
F14034254: D10790.diff
Sat, Nov 9, 11:14 PM
F14028083: D10790.diff
Fri, Nov 8, 11:46 AM
F14011238: D10790.diff
Thu, Oct 31, 9:54 PM
F13991758: D10790.diff
Tue, Oct 22, 12:37 PM
F13981959: D10790.id.diff
Sat, Oct 19, 8:15 PM
Unknown Object (File)
Sep 20 2024, 1:03 AM
Unknown Object (File)
Sep 20 2024, 12:00 AM
Unknown Object (File)
Sep 17 2024, 4:27 PM
Subscribers

Details

Summary

Ref T5833. Currently, SSH keys are associated only with users, and are a bit un-modern. I want to let Almanac Devices have SSH keys so devices in a cluster can identify to one another.

For example, with hosted installs, initialization will go something like this:

  • A request comes in for company.phacility.com.
  • A SiteSource (from D10787) makes a Conduit call to Almanac on the master install to check if company is a valid install and pull config if it is.
  • This call can be signed with an SSH key which identifies a trusted Almanac Device.

In the cluster case, a web host can make an authenticated call to a repository host with similar key signing.

To move toward this, put a proper Query class on top of SSH key access (this diff). In following diffs, I'll:

  • Rename userPHID to objectPHID.
  • Move this to the auth database.
  • Provide UI for device/key association.

An alternative approach would be to build some kind of special token layer in Conduit, but I think that would be a lot harder to manage in the hosting case. This gives us a more direct attack on trusting requests from machines and recognizing machines as first (well, sort of second-class) actors without needing things like fake user accounts.

Test Plan
  • Added and removed SSH keys.
  • Added and removed SSH keys from a bot account.
  • Tried to edit an unonwned SSH key (denied).
  • Ran bin/ssh-auth, got sensible output.
  • Ran bin/ssh-auth-key, got sensible output.

Diff Detail

Repository
rP Phabricator
Branch
almanac4
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/applications/auth/query/PhabricatorAuthSSHKeyQuery.php:81XHP16TODO Comment
Unit
Tests Passed
Build Status
Buildable 2953
Build 2957: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to Add a query/policy layer on top of SSH keys for Almanac.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
btrahan edited edge metadata.
This revision is now accepted and ready to land.Nov 5 2014, 10:05 PM
This revision was automatically updated to reflect the committed changes.