Merge pull request #741 from wazuh/738-certs_permissions

Certificates permissions updated
This commit is contained in:
Alberto Rodríguez 2022-03-31 20:00:20 +02:00 committed by GitHub
commit c51e000e71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 5 deletions

View File

@ -6,7 +6,7 @@
state: directory state: directory
owner: root owner: root
group: root group: root
mode: 0774 mode: 500
- name: Copy the certificates from local to the Manager instance - name: Copy the certificates from local to the Manager instance
copy: copy:
@ -14,7 +14,7 @@
dest: "{{ filebeat_ssl_dir }}" dest: "{{ filebeat_ssl_dir }}"
owner: root owner: root
group: root group: root
mode: 0644 mode: 400
with_items: with_items:
- "{{ filebeat_node_name }}-key.pem" - "{{ filebeat_node_name }}-key.pem"
- "{{ filebeat_node_name }}.pem" - "{{ filebeat_node_name }}.pem"

View File

@ -1,10 +1,20 @@
- block: - block:
- name: Ensure Dashboard certificates directory permissions.
file:
path: "/etc/wazuh-dashboard/certs/"
state: directory
owner: wazuh-dashboard
group: wazuh-dashboard
mode: 500
- name: Copy the certificates from local to the Wazuh dashboard instance - name: Copy the certificates from local to the Wazuh dashboard instance
copy: copy:
src: "{{ local_certs_path }}/wazuh-certificates/{{ item }}" src: "{{ local_certs_path }}/wazuh-certificates/{{ item }}"
dest: /etc/wazuh-dashboard/certs/ dest: /etc/wazuh-dashboard/certs/
mode: 0644 owner: wazuh-dashboard
group: wazuh-dashboard
mode: 0400
with_items: with_items:
- "root-ca.pem" - "root-ca.pem"
- "{{ dashboard_node_name }}-key.pem" - "{{ dashboard_node_name }}-key.pem"

View File

@ -19,13 +19,21 @@
when: when:
- hostvars[inventory_hostname]['private_ip'] is not defined - hostvars[inventory_hostname]['private_ip'] is not defined
- name: Ensure Indexer certificates directory permissions.
file:
path: "{{ indexer_conf_path }}/certs/"
state: directory
owner: wazuh-indexer
group: wazuh-indexer
mode: 500
- name: Copy the node & admin certificates to Wazuh indexer cluster - name: Copy the node & admin certificates to Wazuh indexer cluster
copy: copy:
src: "{{ local_certs_path }}/wazuh-certificates/{{ item }}" src: "{{ local_certs_path }}/wazuh-certificates/{{ item }}"
dest: "{{ indexer_conf_path }}/certs/" dest: "{{ indexer_conf_path }}/certs/"
mode: 0644 owner: wazuh-indexer
become: yes group: wazuh-indexer
mode: 0400
with_items: with_items:
- root-ca.pem - root-ca.pem
- root-ca.key - root-ca.key