diff --git a/group_vars/all/users.yml b/group_vars/all/users.yml index a2f125f7950a39bcee0a185c18147470c19216b3..6710fa8a9f643f3fce02f2dce37af1253799d7ea 100644 --- a/group_vars/all/users.yml +++ b/group_vars/all/users.yml @@ -28,13 +28,13 @@ THEHIVE_KIBANA_USER: THEHIVE_USERS: - - kiril: - username: "kiril" - name: "Kiril" - surname: "Kiroski" + - user1: + username: "user1" + name: "User1" + surname: "SOC" roles: '["read", "write", "admin"]' - - temur: - username: "temur" - name: "Temur" - surname: "Maisuradze" + - user2: + username: "user2" + name: "User2" + surname: "SOC" roles: '["read", "write", "admin"]' diff --git a/roles/thehive/tasks/adminuser.yml b/roles/thehive/tasks/adminuser.yml index 7b29bd0d7b6214579be9106fef5634fc9a5aaa89..6bc110ae6c890d0119d6efce7119fbd4b03c6b57 100644 --- a/roles/thehive/tasks/adminuser.yml +++ b/roles/thehive/tasks/adminuser.yml @@ -28,3 +28,13 @@ - name: copy API key to local file local_action: copy content="{{adminuserapikey}}" dest=secrets/tokens/thehive_secret_key +- name: copy json file for admin pass + remote_user: root + template: + src: adminpass.json + dest: /tmp/adminpass.json + +- name: change password for admin user + shell: "curl -X POST http://127.0.0.1:9000/api/v1/user/{{ adminuserid }}/password/set -b /tmp/cookie.txt -c /tmp/cookie.txt -H 'Content-Type: application/json' -d @/tmp/adminpass.json" + args: + warn: false diff --git a/roles/thehive/templates/adminpass.json b/roles/thehive/templates/adminpass.json new file mode 100644 index 0000000000000000000000000000000000000000..96292dbc219846f77c437dbd7f92fee4fd4e949a --- /dev/null +++ b/roles/thehive/templates/adminpass.json @@ -0,0 +1 @@ +{"password":"{{lookup('password', '{{playbook_dir}}/secrets/passwords/thehive_adminpass')}}"}