-
Notifications
You must be signed in to change notification settings - Fork 28
SSH Authentication
Currently pogo only does password authentication (see issue #4). It should support doing ssh agent authentication as well, so that we no longer have to echo plaintext passwords via expect. We can also take advantage of pam_ssh_agent_auth to do privilege escalation on remote nodes. If possible, this should be made modular, so that other authentication types could be plugged in later.
-
pogo-client /
Pogo::Client::Commandline::run_from_commandline()
prompts the user for a password, and encrypts the plaintext password with the public key used by pogo-worker. -
The base64-encoded encrypted password is POSTed as part of the JSON-encoded job hash object to the pogo dispatcher API.
-
The dispatcher removes the password from the job hash, stores it in memory, and writes the job hash (minus password) into zookeeper.
-
pogo-dispatcher /
Pogo::Dispatcher::WorkerConnection->queue_task()
is later invoked for each subtask, and retrieves job information and the encrypted password string from memory, sending the data over JSON-RPC to a connected worker for execution. -
pogo-worker .
Pogo::Worker::Connection->run_command()
and later->execute()
receive the job information from the hash and shells out topogo-rexec
, sending JSON-encoded task information to the process on STDIN. -
pogo-rexec
decodes the job information and decrypts the passwords, and sets upscp
andssh
commands to:-
scp
pogo-worker-stub
to the target node -
ssh
to the target node and execute the stub -
ssh
to the target node one last time torm
the stub
-
-
the
scp
andssh
commands are wrapped inpogo-pw
, which handles echoing the user password when appropriate
-
pogo-client
must be modified to take the user's SSH private key and passphrase, or decrypted ssh private key, and send that with the job instead of (or in addition to) the password.options for enabling and disabling ssh and password auth should be available in
.pogoconf
-
pogo-rexec
should be modified to either impersonate or spawn an ssh-agent (per task? per jobid?). access to the agent should be restricted as much as possible, and should not be available outside the local host. -
pogo-rexec
should callscp
/ssh
with the appropriate options when using ssh or password auth (or both) by enabling only the authentication methods valid for the job. authentication should fail gracefully and obviously, outputting crapola to the host log/ui. -
private key information must never be written to disk, nor can must it persist in memory for longer than necessary to all possible tasks for the job.
-
there's existing code that allows a 'run_as' user - ensure this works, write tests, etc. (has never been tested)