<commit_before>---
  # The authd ossec process automatically adds the app server ossec agent.
  # This addition is not an authenticated process. There is an option
  # we could add to create and  verify the server/agents ssl keys with
  # the root CA cert, see:
  # http://ossec-docs.readthedocs.org/en/latest/programs/ossec-authd.html
- name: check to see if app agent already exists
  shell: /var/ossec/bin/list_agents -a
  register: list_agents
  tags:
    - ossec_auth

- name: create authd SSL keys
  shell: openssl genrsa -out /var/ossec/etc/sslmanager.key 4096
  args:
    creates: /var/ossec/etc/sslmanager.key
  when: list_agents != "{{ app_hostname }}-{{ app_ip }} is available."
  tags:
    - ossec_auth

- name: create ssl cert
  shell: openssl req -new -x509 -batch -subj "/CA=AU/ST=Some-State/locality=city/O=Internet Widgits Pty Ltd/commonName=mon/organizationUnitName=section/emailAddress=admin@localhost" -key /var/ossec/etc/sslmanager.key -out /var/ossec/etc/sslmanager.cert -days 365
  args:
    creates: /var/ossec/etc/sslmanager.cert
  when: list_agents != "{{ app_hostname }}-{{ app_ip }} is available."
  tags:
    - ossec_auth

- stat:
    path: /etc/network/iptables/rules_v4
  register: iptables_rules
  notify: add firewall rule exemption for authd
  notify: reload authd iptables
  when: list_agents.stdout != "{{ app_hostname }}-{{ app_ip }} is available."
  tags:
    - ossec_auth<commit_msg>removes comment about cert generation for ossec authd<commit_after>---
- name: check to see if app agent already exists
  shell: /var/ossec/bin/list_agents -a
  register: list_agents
  tags:
    - ossec_auth

- name: create authd SSL keys
  shell: openssl genrsa -out /var/ossec/etc/sslmanager.key 4096
  args:
    creates: /var/ossec/etc/sslmanager.key
  when: list_agents != "{{ app_hostname }}-{{ app_ip }} is available."
  tags:
    - ossec_auth

- name: create ssl cert
  shell: openssl req -new -x509 -batch -subj "/CA=AU/ST=Some-State/locality=city/O=Internet Widgits Pty Ltd/commonName=mon/organizationUnitName=section/emailAddress=admin@localhost" -key /var/ossec/etc/sslmanager.key -out /var/ossec/etc/sslmanager.cert -days 365
  args:
    creates: /var/ossec/etc/sslmanager.cert
  when: list_agents != "{{ app_hostname }}-{{ app_ip }} is available."
  tags:
    - ossec_auth

- stat:
    path: /etc/network/iptables/rules_v4
  register: iptables_rules
  notify: add firewall rule exemption for authd
  notify: reload authd iptables
  when: list_agents.stdout != "{{ app_hostname }}-{{ app_ip }} is available."
  tags:
    - ossec_auth
{'fraction_non_alphanumeric': 0.11764705882352941, 'fraction_numerical': 0.008570315543435918, 'mean_word_length': 3.5211267605633805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3833299', 'n_tokens_mistral': 920, 'n_tokens_neox': 888, 'n_words': 236}