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

Correction in oval part ensure_gpgcheck_globally_activated #11709

Conversation

rumch-se
Copy link
Contributor

Description:

  • Correction in OVAL part of the rule ensure_gpgcheck_globally_activated

Rationale:

  • According to DISA STIG for SUSE check should include that "gpgcheck" is not set to "0", "off", "no", or "false", because this is a finding.

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Mar 13, 2024
Copy link

openshift-ci bot commented Mar 13, 2024

Hi @rumch-se. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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

Copy link

github-actions bot commented Mar 14, 2024

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

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:11709

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

<ind:textfilecontent54_object id="object_ensure_gpgcheck_globally_activated" comment="gpgcheck set in {{{ pkg_manager_config_file }}}" version="1">
<ind:filepath>{{{ pkg_manager_config_file }}}</ind:filepath>
<ind:pattern operation="pattern match">^\s*gpgcheck\s*=\s*1\s*$</ind:pattern>
<ind:pattern operation="pattern match">^\s*gpgcheck\s*=\s*1s*$</ind:pattern>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This change looks wrong, there shouldn't be a literal s.

rumch-se and others added 2 commits March 14, 2024 10:47
Changes in the regular expression
@rumch-se
Copy link
Contributor Author

Hello @jan-cerny
I added 3 additional tests and fixed the issue with regexpr.
Have a nice day
Rumen

Copy link

codeclimate bot commented Mar 15, 2024

Code Climate has analyzed commit e5cff1f and detected 17 issues on this pull request.

Here's the issue category breakdown:

Category Count
Bug Risk 16
Style 1

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.5% change).

View more on Code Climate.

@jan-cerny
Copy link
Collaborator

/packit retest-failed

1 similar comment
@jan-cerny
Copy link
Collaborator

/packit retest-failed

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.

The fail of Automatus job is caused by the fact that we test a RHEL 8 data stream on a Fedora container but Fedora differs from RHEL in the path of the package manager config file (/ect/dnf/dnf.conf vs /etc/yum.conf). If we execute the test locally against a VM back end, everything passes:

jcerny@fedora:~/work/git/scap-security-guide (pr/11709)$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel9 ensure_gpgcheck_globally_activated
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-03-15-1025/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_ensure_gpgcheck_globally_activated
INFO - Script comment.fail.sh using profile (all) OK
INFO - Script correct_value.pass.sh using profile (all) OK
INFO - Script line_not_there.fail.sh using profile (all) OK
INFO - Script wrong_value.fail.sh using profile (all) OK
INFO - Script wrong_value_false.fail.sh using profile (all) OK
INFO - Script wrong_value_no.fail.sh using profile (all) OK
INFO - Script wrong_value_off.fail.sh using profile (all) OK
jcerny@fedora:~/work/git/scap-security-guide (pr/11709)$ python3 tests/automatus.py rule --libvirt qemu:///system ssgts_rhel9 --remediate-using ansible ensure_gpgcheck_globally_activated
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-03-15-1028/test_suite.log
INFO - xccdf_org.ssgproject.content_rule_ensure_gpgcheck_globally_activated
INFO - Script comment.fail.sh using profile (all) OK
INFO - Script correct_value.pass.sh using profile (all) OK
INFO - Script line_not_there.fail.sh using profile (all) OK
INFO - Script wrong_value.fail.sh using profile (all) OK
INFO - Script wrong_value_false.fail.sh using profile (all) OK
INFO - Script wrong_value_no.fail.sh using profile (all) OK
INFO - Script wrong_value_off.fail.sh using profile (all) OK

@jan-cerny jan-cerny merged commit a01892a into ComplianceAsCode:master Mar 15, 2024
35 of 39 checks passed
@jan-cerny jan-cerny self-assigned this Mar 15, 2024
@jan-cerny jan-cerny added this to the 0.1.73 milestone Mar 15, 2024
@jan-cerny jan-cerny added SLES SUSE Linux Enterprise Server product related. OVAL OVAL update. Related to the systems assessments. labels Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-ok-to-test Used by openshift-ci bot. OVAL OVAL update. Related to the systems assessments. SLES SUSE Linux Enterprise Server product related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants