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

Conversation

Mab879
Copy link
Member

@Mab879 Mab879 commented Aug 24, 2023

Description:

  • Update enable_fips_mode Remedation to follow the style guide
  • Move Ansible remedation to multi_platform_all

Rationale:

  • Style guide
  • Ansible partiy

@Mab879 Mab879 added the Ansible Ansible remediation update. label Aug 24, 2023
@Mab879 Mab879 added this to the 0.1.70 milestone Aug 24, 2023
@github-actions
Copy link

Start a new ephemeral environment with changes proposed in this pull request:

rhel8 (from CTF) Environment (using Fedora as testing environment)
Open in Gitpod

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@github-actions
Copy link

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_enable_fips_mode' differs.
--- xccdf_org.ssgproject.content_rule_enable_fips_mode
+++ xccdf_org.ssgproject.content_rule_enable_fips_mode
@@ -4,8 +4,8 @@
   tags:
     - always
 
-- name: Check to see the current status of FIPS mode
-  command: /usr/bin/fips-mode-setup --check
+- name: Enable FIPS Mode - Check to See the Current Status of FIPS Mode
+  ansible.builtin.command: /usr/bin/fips-mode-setup --check
   register: is_fips_enabled
   ignore_errors: true
   changed_when: false
@@ -30,8 +30,8 @@
   - reboot_required
   - restrict_strategy
 
-- name: Enable FIPS mode
-  command: /usr/bin/fips-mode-setup --enable
+- name: Enable FIPS Mode - Enable FIPS Mode
+  ansible.builtin.command: /usr/bin/fips-mode-setup --enable
   when:
   - ( ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
     and not ( lookup("env", "container") == "bwrap-osbuild" ) )
@@ -54,8 +54,8 @@
   - reboot_required
   - restrict_strategy
 
-- name: Enable FIPS Mode
-  lineinfile:
+- name: Enable FIPS Mode - Configure Crypto Policy
+  ansible.builtin.lineinfile:
     path: /etc/crypto-policies/config
     regexp: ^(?!#)(\S+)$
     line: '{{ var_system_crypto_policy }}'
@@ -81,8 +81,9 @@
   - reboot_required
   - restrict_strategy
 
-- name: Verify that Crypto Policy is Set (runtime)
-  command: /usr/bin/update-crypto-policies --set {{ var_system_crypto_policy }}
+- name: Enable FIPS Mode - Verify that Crypto Policy is Set (runtime)
+  ansible.builtin.command: /usr/bin/update-crypto-policies --set {{ var_system_crypto_policy
+    }}
   when:
   - ( ansible_virtualization_type not in ["docker", "lxc", "openvz", "podman", "container"]
     and not ( lookup("env", "container") == "bwrap-osbuild" ) )

@codeclimate
Copy link

codeclimate bot commented Aug 24, 2023

Code Climate has analyzed commit 4498569 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 53.3% (0.0% change).

View more on Code Climate.

@marcusburghardt marcusburghardt self-assigned this Aug 25, 2023
@marcusburghardt marcusburghardt merged commit bae434e into ComplianceAsCode:master Aug 25, 2023
36 of 38 checks passed
@Mab879 Mab879 deleted the fix_enable_fips_mode_ansible branch August 25, 2023 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ansible Ansible remediation update.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants