From 19bb6799e7b70d8ad7f63baef4cdd337f48a6861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iwan=20Cl=C3=A9ment?= Date: Tue, 19 Feb 2019 18:48:14 +0100 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9ation=20du=20fichier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- linux/RemoveBadSSHKeys.sls | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 linux/RemoveBadSSHKeys.sls diff --git a/linux/RemoveBadSSHKeys.sls b/linux/RemoveBadSSHKeys.sls new file mode 100644 index 0000000..6c7b73c --- /dev/null +++ b/linux/RemoveBadSSHKeys.sls @@ -0,0 +1,12 @@ +{% if grains['kernel'] == 'Linux' %} + {% set COMPTEUR=0 %}} + {% for BADKEY in pillar.get('BadSSHKeys',{}) %} +suppression des mauvaises cles {{COMPTEUR}}: + file.line: + - name: /root/.ssh/authorized_keys + - mode: delete + - content: {{BADKEY}} + {% set COMPTEUR = COMPTEUR + 1 %} + {% endfor %} + +{% endif %}