Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pawelchcki/amyssh


https://github.com/pawelchcki/amyssh

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

AmySSH
============

A deamonizable command line utility to handle distribution of ssh keys.

In short this 'simple' program does following:
- using configured list of host assigned tags and per user account assigned tags asks mysql for all SSH keys assigned to those host.user tag pairs.
- combines received list with locally configured ssh keys
- checks if current authorized_keys contains all required ssh keys
- if check fails it recreates authorized_keys file
- sleeps for some time

Currently only MySQL tag source is supported but other sources are planned

Performance
================

Shortcomings:

- Currently each AmySSH instance opens and holds connection to db server.
- On each iteration potentially expensive query is performed (hey, I'm not a DB person)

Somewhat OK:

- AmySSH can detect if operation is taking longer than 'usual' and increase wait time between successive SQL operations
- It caches information about file contents so that we don't have to reread authorized_keys file on every iteration
- SSH keys redistribution is not exactly something that needs to be real-time so iteration intervals of minutes are entirely acceptable

With this it seems that even shared mysql server can easily serve thousands of AmySSH clients with minimum intervals of 500ms

TODO
======

- Add 'single shot' option so that AmySSH can by run via cron
- Add signature verification to fetched keys
- Implement dropping db connection on iterations when interval is greater than certain amount
- Write sample config
- Daemon mode so that using old init.d is cleaner

Trivia
========

AmySSH name has dual origin.

1. as a 'portmanteau' of MySQL and SSH. 'a MySSH'
2. similarly to MySQL its named after its creator daughter :)

BTW both pronunciations 'Amish' and Amy-SSH are supported