summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--services/main.cf2
-rw-r--r--services/sshd.cf33
-rw-r--r--templates/sshd/authorized_keys3
3 files changed, 38 insertions, 0 deletions
diff --git a/services/main.cf b/services/main.cf
index 4c2b022..5d994b3 100644
--- a/services/main.cf
+++ b/services/main.cf
@@ -7,12 +7,14 @@ bundle common classify
"check_mk",
"flavour",
"julien",
+ "sshd",
};
"inputs" slist => {
"services/check_mk.cf",
"services/common.cf",
"services/$(flavour).cf",
"services/julien.cf",
+ "services/sshd.cf",
};
debian::
"flavour" string => "debian";
diff --git a/services/sshd.cf b/services/sshd.cf
new file mode 100644
index 0000000..da602a1
--- /dev/null
+++ b/services/sshd.cf
@@ -0,0 +1,33 @@
+bundle agent sshd
+{
+ files:
+ freebsd::
+ "/etc/rc.conf"
+ create => "true",
+ edit_defaults => std_defs,
+ perms => system_owned("444"),
+ edit_line => append_if_no_line("sshd_enable=\"YES\""),
+ classes => if_repaired("sshd_rc_conf_file_repaired");
+ "/root/.ssh/."
+ create => "true",
+ perms => system_owned("700"),
+ classes => if_repaired("sshd_ssh_dir_repaired");
+ "/root/.ssh/authorized_keys"
+ create => "true",
+ edit_defaults => empty,
+ perms => system_owned("444"),
+ edit_template => "$(sys.inputdir)/templates/sshd/authorized_keys",
+ classes => if_repaired("sshd_authorized_keys_files_repaired");
+ classes:
+ freebsd::
+ "sshd_service_running" expression => returnszero("/usr/sbin/service sshd status", "noshell");
+ commands:
+ freebsd.!sshd_service_running::
+ "/usr/sbin/service sshd start" classes => if_repaired("sshd_service_repaired");
+ reports:
+ any::
+ "$(this.bundle): /etc/rc.conf repaired" ifvarclass => "sshd_rc_conf_file_repaired";
+ "$(this.bundle): /root/.ssh directory repaired" ifvarclass => "sshd_ssh_dir_repaired";
+ "$(this.bundle): /root/.ssh/authorized_keys repaired" ifvarclass => "sshd_rc_conf_file_repaired";
+ "$(this.bundle): sshd service repaired" ifvarclass => "sshd_service_repaired";
+}
diff --git a/templates/sshd/authorized_keys b/templates/sshd/authorized_keys
new file mode 100644
index 0000000..d3f7f5a
--- /dev/null
+++ b/templates/sshd/authorized_keys
@@ -0,0 +1,3 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDN1ha6PFKgxF3MSWUlDaruVVpj3UzoiN4IJEvDrCnDbIW8xu+TclbeGJSRXXBbqRKeUfhX0GDA7cvSUIAz2U7AGK7wq5tbzJKagVYtxcSHBSi6dZR9KGb3eoshnrCeFzem1jWXG02PZJGvjB+ml3QhUguyAqm9q0n/NL6zzKhGoKiELO+tQghGIY8jafRv4rE4yyXZnwuCu8JI9P8ldGhKgOPeOdKIVTIVezUmKILWgAF+Hg7O72rQqUua9sdoK1mEYme/wgu0bQbvN26owGgBAgS3uc2nngLD01TZToG/wC1wH9A3KxT6+3akjRlPfLOY0BuK4OBGEGm6e0KZrIMhUr8fHQ8nmTmBqw7puI0gIXYB2EjhpsQ7TijYVqLYXbyxaXYyqisgY0QRWC7Te5Io6TSgorfXzi7zrcQGgWByHkhxTylf36LYSKWEheIQIRqytOdGqeXagFMz2ptLFKk4dA61LS5fPXIJucdghvnmLPml8cO9/9VHQ7gq7DxQu7sIwt/W13yTTUyI9DSHwxeHUwECzxAb5pOVL6pRjTMH8q1/eAMl35TFSh6s5tGvvHGz9+gMlE9A2Pv8CyXDBmXV6srrwxTSlglnmgdq6c9w3VtBKu572/z0cS6vqZMgEno4rIiwyhqNWdjbMXYw/U0q/w5XC9zCcSuluxvaY14qqQ== perso
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDCMgVz9WSgj4sWL4NjWEY3Mhb/D3Uw5JGUMHVqRd4SBqpP+SAw9i9AWtQSInsae0izx1NOEOOhSG7LQ3ocByXp+37opqo3xFibwWLoLimOXX2F9mnbR+AIhoFuojni0Wi7OlGVtq9rk5Di6VbrCeOG0zLMtBOn3X876f6bbdlGOm99yBVJi7bpU38Btiln+HkCwkoeFr0cOiIZ7LUFe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