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

Add ubuntu ansible remediation for dconf_gnome_banner_enabled #12292

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yunimoo
Copy link
Contributor

@yunimoo yunimoo commented Aug 11, 2024

Description:

  • The remediation was modified to enable the banner also in greeter.dconf-defaults and not only in the dconf database, specifically for Ubuntu products.
  • This is to be consistent with the remediation in related rule dconf_gnome_login_banner_text and be better aligned with STIG V1R1.
  • I will slowly start reopening UBTU20 PRs under new account

Original PR: #11089
Present Bash Remediation: #12042

Rationale:

  • Missing ansible remediation
  • Align existing ansible remediation tasks to proper format
  • Part of Ubuntu 2004 STIG v1r12 profile upgrade

Review Hints:

Build the product:

./build_product ubuntu2004

To test these changes with Ansible:

ansible-playbook build/ansible/ubuntu2004-playbook-stig.yml --tags "DISA-STIG-UBTU-20-010002"

Checkout Manual STIG OVAL definitions, and use software like DISA STIG Viewer to view definitions.

git checkout yunimoo:update-manual-stig-ubtu-20-v1r12

For reference, please review the latest artifacts: https://public.cyber.mil/stigs/downloads/

Copy link

openshift-ci bot commented Aug 11, 2024

Hi @yunimoo. 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-sigs/prow repository.

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Aug 11, 2024
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

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_dconf_gnome_banner_enabled' differs.
--- xccdf_org.ssgproject.content_rule_dconf_gnome_banner_enabled
+++ xccdf_org.ssgproject.content_rule_dconf_gnome_banner_enabled
@@ -15,7 +15,7 @@
   - no_reboot_needed
   - unknown_strategy
 
-- name: Enable GNOME3 Login Warning Banner
+- name: Enable GNOME3 Login Warning Banner - Enable GNOME3 Login Warning Banner
   ini_file:
     dest: /etc/dconf/db/gdm.d/00-security-settings
     section: org/gnome/login-screen
@@ -38,7 +38,7 @@
   - no_reboot_needed
   - unknown_strategy
 
-- name: Prevent user modification of GNOME banner-message-enabled
+- name: Enable GNOME3 Login Warning Banner - Prevent user modification of GNOME banner-message-enabled
   lineinfile:
     path: /etc/dconf/db/gdm.d/locks/00-security-settings-lock
     regexp: ^/org/gnome/login-screen/banner-message-enable$
@@ -59,7 +59,7 @@
   - no_reboot_needed
   - unknown_strategy
 
-- name: Dconf Update
+- name: Enable GNOME3 Login Warning Banner - Dconf Update
   command: dconf update
   when: '"gdm" in ansible_facts.packages'
   tags:

Copy link

github-actions bot commented Aug 12, 2024

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

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

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

@dodys dodys added Ubuntu Ubuntu product related. Ansible Ansible remediation update. STIG STIG Benchmark related. ok-to-test Used by openshift-ci bot. and removed needs-ok-to-test Used by openshift-ci bot. labels Aug 12, 2024
@dodys dodys self-assigned this Aug 12, 2024
@dodys dodys requested a review from a team August 12, 2024 08:16
Copy link
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.

Hi @yunimoo could you please rebase your PR based on latest master? That way we will get the Ubuntu tests running.

@yunimoo yunimoo force-pushed the add-ansible-ubtu-20-010002-gui-banner branch from 8239d0d to eb0beee Compare August 13, 2024 14:31
@dodys dodys added this to the 0.1.75 milestone Aug 13, 2024
@dodys
Copy link
Contributor

dodys commented Aug 13, 2024

@yunimoo the ansible remediation is not passing the tests, could you take a look?

@yunimoo
Copy link
Contributor Author

yunimoo commented Aug 15, 2024

@yunimoo the ansible remediation is not passing the tests, could you take a look?

Sure. I haven't had much bandwidth these past days but I'm noticing these errors are not the same as ones noted #12296. I'm able to spin up my containers for ubuntu 22.04 so will slowly start fixing any potential problems with tests.

@yunimoo yunimoo force-pushed the add-ansible-ubtu-20-010002-gui-banner branch 2 times, most recently from 4edd9ac to d0c395e Compare August 17, 2024 03:14
The remediation was modified to enable the banner also
in `greeter.dconf-defaults` and not only in the dconf database.

This is to be consistent with the remediation in related rule
`dconf_gnome_login_banner_text` and be better aligned with STIG V1R1.
@yunimoo yunimoo force-pushed the add-ansible-ubtu-20-010002-gui-banner branch from d0c395e to 01c96c4 Compare August 17, 2024 03:36
@yunimoo
Copy link
Contributor Author

yunimoo commented Aug 17, 2024

Rebased this branch and removed content_profile_ncp which seemed to be giving some warnings. All ubuntu22 tests are passing for me locally

Copy link

codeclimate bot commented Aug 20, 2024

Code Climate has analyzed commit 01c96c4 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
Contributor

dodys commented Aug 20, 2024

Rebased this branch and removed content_profile_ncp which seemed to be giving some warnings. All ubuntu22 tests are passing for me locally

@yunimoo no need to remove the content_profile_ncp unless you think that the test is worth to all platforms and there aren't any similar already. But the tests are still failing for the ansible remediation.

@yunimoo
Copy link
Contributor Author

yunimoo commented Aug 20, 2024

Rebased this branch and removed content_profile_ncp which seemed to be giving some warnings. All ubuntu22 tests are passing for me locally

@yunimoo no need to remove the content_profile_ncp unless you think that the test is worth to all platforms and there aren't any similar already. But the tests are still failing for the ansible remediation.

Ah, thank you. I was going about this incorrectly. Let me fix up the remediation script.

ERROR - Ansible playbook remediation run has exited with return code 2 instead of expected 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ansible Ansible remediation update. ok-to-test Used by openshift-ci bot. STIG STIG Benchmark related. Ubuntu Ubuntu product related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants