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

Fix ansible_ini_file_set #11775

Merged
merged 1 commit into from
Apr 2, 2024
Merged

Conversation

Mab879
Copy link
Member

@Mab879 Mab879 commented Mar 29, 2024

Description:

Remove ignore_spaces from ansible_ini_file_set

Rationale:

Since ignore_spaces is not valid on older installs, remove it.
Fixes #11771

@Mab879 Mab879 added the bugfix Fixes to reported bugs. label Mar 29, 2024
@Mab879 Mab879 added this to the 0.1.73 milestone Mar 29, 2024
Copy link

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

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

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Copy link

github-actions bot commented Mar 29, 2024

🤖 A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:11775
This image was built from commit: 6addee5

Click here to see how to deploy it

If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:11775

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:11775 make deploy-local

Since ignore_spaces is not valid, remove it
Fixes ComplianceAsCode#11771
Copy link

codeclimate bot commented Apr 1, 2024

Code Climate has analyzed commit 6addee5 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 59.3% (0.0% change).

View more on Code Climate.

@jan-cerny jan-cerny self-assigned this Apr 2, 2024
Copy link
Collaborator

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out that the ignore_spaces option isn't needed to fix the DISA misalignement, only the option no_extra_spaces that I suggested should be used. https://docs.ansible.com/ansible/latest/collections/community/general/ini_file_module.html#parameter-no_extra_spaces

The fail of Automatus is probably caused by using a container back end where services can't run. I have examined Ansible logs from the GitHub CI runs and I found this: "msg": "Service is in unknown state",

When I run the tests locally using a virtual machine back end, they pass:

jcerny@fedora:~/work/git/scap-security-guide (pr/11775)$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel9 --remediate-using ansible networkmanager_dns_mode
Setting console output to log level INFO
INFO - The base image option has not been specified, choosing libvirt-based test environment.
INFO - Logging into /home/jcerny/work/git/scap-security-guide/logs/rule-custom-2024-04-02-1050/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_networkmanager_dns_mode
INFO - Script correct.pass.sh using profile (all) OK
INFO - Script correct_default.pass.sh using profile (all) OK
INFO - Script missing.fail.sh using profile (all) OK
INFO - Script wrong_value.fail.sh using profile (all) OK
INFO - Script space.fail.sh using profile (all) OK

@jan-cerny jan-cerny merged commit 695c283 into ComplianceAsCode:master Apr 2, 2024
41 of 45 checks passed
@Mab879 Mab879 deleted the fix_11771 branch April 2, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes to reported bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

networkmanager_dns_mode Ansible Remedation is not valid
2 participants