Skip to content

Fix OVAL for rule apt_conf_disallow_unauthenticated#11863

Merged
dodys merged 2 commits into
ComplianceAsCode:masterfrom
mpurg:ubuntu_2204_stig_214010
Apr 30, 2024
Merged

Fix OVAL for rule apt_conf_disallow_unauthenticated#11863
dodys merged 2 commits into
ComplianceAsCode:masterfrom
mpurg:ubuntu_2204_stig_214010

Conversation

@mpurg
Copy link
Copy Markdown
Contributor

@mpurg mpurg commented Apr 22, 2024

Description:

Reversed the logic in apt_conf_disallow_unauthenticated OVAL to pass when good values of the parameter AllowUnauthenticated are present or the parameter is undefined, instead of checking that the wrong values are not present. This also better aligns the rule with STIG UBTU-22-214010.

Rationale:

The previous oval was checking for existence of unwanted values (yes,true,True) in the parameter, failing to catch others, like:

  • value = 1
  • quoted values ("yes", "true", "True", "1")
  • case permutations of values yes or true
  • case permutations of keyword APT::Get::AllowUnauthenticated
  • different usage of keyword (see tests wrong_value2.fail.sh)

The new version checks for the existence of case-insensitive AllowUnauthenticated keyword. It passes if it either doesn't
exist, or is well-defined to "false".

@github-actions
Copy link
Copy Markdown

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

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

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 22, 2024

Hi @mpurg. 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.

Details

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.

@openshift-ci openshift-ci Bot added the needs-ok-to-test Used by openshift-ci bot. label Apr 22, 2024
@github-actions
Copy link
Copy Markdown

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

Click here to see the full diff
OVAL for rule 'xccdf_org.ssgproject.content_rule_apt_conf_disallow_unauthenticated' differs.
--- oval:ssg-apt_conf_disallow_unauthenticated:def:1
+++ oval:ssg-apt_conf_disallow_unauthenticated:def:1
@@ -1,3 +1,2 @@
-criteria OR
-criterion oval:ssg-test_unauthenticated_apt_conf:tst:1
-criterion oval:ssg-test_unauthenticated_apt_conf_d:tst:1
+criteria AND
+criterion oval:ssg-test_apt_conf_disallow_unauthenticated:tst:1

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2024

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

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

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

@marcusburghardt marcusburghardt added Debian Debian product related. Ubuntu Ubuntu product related. labels Apr 22, 2024
@marcusburghardt marcusburghardt requested a review from dodys April 22, 2024 10:47
@mpurg mpurg force-pushed the ubuntu_2204_stig_214010 branch from 7d3b4f2 to a7dae0f Compare April 22, 2024 11:51
@marcusburghardt marcusburghardt added the STIG STIG Benchmark related. label Apr 22, 2024
@dodys dodys self-assigned this Apr 26, 2024
@dodys dodys added ok-to-test Used by openshift-ci bot. and removed needs-ok-to-test Used by openshift-ci bot. labels Apr 26, 2024
mpurg added 2 commits April 29, 2024 10:00
The previous oval was checking for existence of unwanted values
(yes,true,True) in a parameter and failed to catch others:
- value=1
- quoted values ("yes", "true", "True")
- case permutations of values yes or true
- case permutations of keyword APT::Get::AllowUnauthenticated
- different usage of keyword (see tests wrong_value2.fail.sh)

The new version checks for the existence of case-insensitive
AllowUnauthenticated keyword. It passes if it either doesn't
exist, or is well-defined to "false".
@mpurg mpurg force-pushed the ubuntu_2204_stig_214010 branch from a7dae0f to 0cce7d7 Compare April 29, 2024 08:00
@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit 0cce7d7 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.4% (0.0% change).

View more on Code Climate.

@dodys
Copy link
Copy Markdown
Contributor

dodys commented Apr 30, 2024

/packit build

Copy link
Copy Markdown
Contributor

@dodys dodys left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@dodys dodys merged commit f583aef into ComplianceAsCode:master Apr 30, 2024
@Mab879 Mab879 added this to the 0.1.74 milestone Apr 30, 2024
@Mab879 Mab879 added the OVAL OVAL update. Related to the systems assessments. label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Debian Debian product related. ok-to-test Used by openshift-ci bot. OVAL OVAL update. Related to the systems assessments. STIG STIG Benchmark related. Ubuntu Ubuntu product related.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants