From c8949cfe2b71b1471568ad740b0b600acd9e9804 Mon Sep 17 00:00:00 2001 From: Michael Sheinberg Date: Thu, 4 Oct 2018 16:37:11 -0700 Subject: [PATCH] ossec auth key gen. -> platform agnostic Previously pipe logic had issues specifically on Mac OSX which has a differently named md5 hashing cli util. Regardless, it'll be better long-term to get this into something ansible/jinja specific so we won't have to rely on local pkgs that might be OS dependent. --- install_files/ansible-base/roles/ossec/tasks/register.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_files/ansible-base/roles/ossec/tasks/register.yml b/install_files/ansible-base/roles/ossec/tasks/register.yml index 7733447c96..06f04a2bf1 100644 --- a/install_files/ansible-base/roles/ossec/tasks/register.yml +++ b/install_files/ansible-base/roles/ossec/tasks/register.yml @@ -67,7 +67,7 @@ # password file (see: https://github.com/ossec/ossec-hids/issues/1472) - name: Generate authd shared secret set_fact : - ossec_registration_secret: "{{ lookup('pipe', 'head -c 32 /dev/urandom | md5sum | tr -d \" -\" | sed \"$d\"') }}" + ossec_registration_secret: "{{ range(10000000,99999999999) | random | hash('md5') }}\n" delegate_to: localhost delegate_facts: True when: