From: Matt S Trout Date: Sat, 22 Feb 2014 21:37:38 +0000 (+0000) Subject: key manager example X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7a668ea44ae8158c26d712194213bb24bbadef4d;p=scpubgit%2FDKit.git key manager example --- diff --git a/examples/keyman b/examples/keyman new file mode 100644 index 0000000..88c9702 --- /dev/null +++ b/examples/keyman @@ -0,0 +1,35 @@ +rule dot_ssh_on { A D } { + home_dir_on A H + directory_in H '.ssh' D + mode D '0700' +} + +rule authorized_keys_on { A F } { + dot_ssh_on A D + file_in D 'authorized_keys' F + mode F '0600' +} + +rule key_installed_on { A K } { + authorized_keys_on A F + contains_line F K +} + +rule my_config_dir D { + home_dir_on '' H + directory_in H '.keymangler' D +} + +rule config_contains_line { C L } { + my_config_dir D + file_in D C F + contains_line F L +} + +rule known_account A { config_contains_line 'accounts' A } +rule known_key K { config_contains_line 'keys' K } +rule known_dead D { config_contains_line 'keys.dead' D } + +rule sync_account A { + foreach K { known_key K } { key_installed_on A K } +}