Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update enable_fips_mode Ansible Remedation #11026

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# platform = Red Hat Enterprise Linux 8,multi_platform_fedora,Oracle Linux 8
# platform = multi_platform_all
# reboot = true
# strategy = restrict
# complexity = medium
# disruption = medium
{{{ ansible_instantiate_variables("var_system_crypto_policy") }}}

- name: Check to see the current status of FIPS mode
command: /usr/bin/fips-mode-setup --check
- name: "{{{ rule_title }}} - Check to See the Current Status of FIPS Mode"
ansible.builtin.command: /usr/bin/fips-mode-setup --check
register: is_fips_enabled
ignore_errors: yes
changed_when: false

- name: Enable FIPS mode
command: /usr/bin/fips-mode-setup --enable
- name: "{{{ rule_title }}} - Enable FIPS Mode"
ansible.builtin.command: /usr/bin/fips-mode-setup --enable
when:
- is_fips_enabled.stdout.find('FIPS mode is enabled.') == -1

- name: "{{{ rule_title }}}"
lineinfile:
- name: "{{{ rule_title }}} - Configure Crypto Policy"
ansible.builtin.lineinfile:
path: /etc/crypto-policies/config
regexp: '^(?!#)(\S+)$'
line: "{{ var_system_crypto_policy }}"
create: yes

- name: Verify that Crypto Policy is Set (runtime)
command: /usr/bin/update-crypto-policies --set {{ var_system_crypto_policy }}
- name: "{{{ rule_title }}} - Verify that Crypto Policy is Set (runtime)"
ansible.builtin.command: /usr/bin/update-crypto-policies --set {{ var_system_crypto_policy }}