Skip to content

Fix grub2_audit_argument#14631

Merged
jan-cerny merged 2 commits intoComplianceAsCode:masterfrom
alanmcanonical:grub2
Apr 9, 2026
Merged

Fix grub2_audit_argument#14631
jan-cerny merged 2 commits intoComplianceAsCode:masterfrom
alanmcanonical:grub2

Conversation

@alanmcanonical
Copy link
Copy Markdown
Contributor

Description:

  • Allow both variables to be fixed

Rationale:

  • STIG expects the "audit=1" in both GRUB_CMDLINE_LINUX_DEFAULT and GRUB_CMDLINE_LINUX

@openshift-ci openshift-ci bot added the needs-ok-to-test Used by openshift-ci bot. label Apr 8, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 8, 2026

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

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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

…B_CMDLINE_LINUX

Signed-off-by: Alan Moore <alan.moore@canonical.com>
@jan-cerny jan-cerny self-assigned this Apr 9, 2026
@jan-cerny jan-cerny added this to the 0.1.81 milestone Apr 9, 2026
else
echo "GRUB_CMDLINE_LINUX=\"{{{ arg_name_value }}}\"" >> '/etc/default/grub'
fi
for grub_var in {{{ grub_vars }}}; do
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The CI fail seems to be legit:

In /__w/content/content/build/ol7/fixes/bash/grub2_audit_argument.sh line 16:
    for grub_var in GRUB_CMDLINE_LINUX; do
                    ^----------------^ SC2043 (warning): This loop will only ever run once. Bad quoting or missing glob/expansion?

I suggest fixing this by replacing the Bash for loop by a Jinja for loop. That way the code on Ubuntu will unroll to two code blocks and on other products it will unroll to a single code block, which hopefully will satisfy shellcheck.

 {{%- for grub_var in grub_vars %}}

Signed-off-by: Alan Moore <alan.moore@canonical.com>
Copy link
Copy Markdown
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.

I have run the tests locally on RHEL 9 and they passed for both Ansible and Bash

@jan-cerny jan-cerny merged commit af93f70 into ComplianceAsCode:master Apr 9, 2026
52 of 53 checks passed
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants