Created
July 2, 2024 18:16
-
-
Save chofstede/67641b45f7b2379bab5832b70c0b8351 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - name: Enable temporary mitigation for CVE-2024-6387 "regreSSHion" | |
| hosts: foreman_rhel9hosts | |
| become: true | |
| gather_facts: true | |
| tasks: | |
| - name: Change LoginGraceTime to 0 in sshd_config | |
| ansible.builtin.lineinfile: | |
| path: /etc/ssh/sshd_config | |
| regex: "^(#)?LoginGraceTime" | |
| line: "LoginGraceTime 0" | |
| state: present | |
| notify: Restart sshd | |
| when: ansible_facts['distribution'] == "RedHat" and ansible_facts['distribution_major_version'] == "9" | |
| handlers: | |
| - name: Restart sshd | |
| ansible.builtin.systemd_service: | |
| name: sshd | |
| state: restarted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment