Skip to content

Fix wireless_disable_interface remediations to work multiple interfaces - #15106

Open
alanmcanonical wants to merge 4 commits into
ComplianceAsCode:masterfrom
alanmcanonical:wireless_fix
Open

alanmcanonical wants to merge 4 commits into
ComplianceAsCode:masterfrom
alanmcanonical:wireless_fix

Conversation

@alanmcanonical

@alanmcanonical alanmcanonical commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description:

  • Fix find to work with xargs -0
  • Follow symlink in ansible

Rationale:

  • The bash remediation mis-parses the interface list when more than one wireless interface is present, because it pipes newline-separated find output into xargs -0.
  • The paths defined there are symlinks

Signed-off-by: Alan Moore <alan.moore@canonical.com>
@openshift-ci

openshift-ci Bot commented Sep 9, 2026

Copy link
Copy Markdown

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.

@openshift-ci openshift-ci Bot added the needs-ok-to-test Used by openshift-ci bot. label Sep 9, 2026
Signed-off-by: Alan Moore <alan.moore@canonical.com>
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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

Click here to see the full diff
bash remediation for rule 'xccdf_org.ssgproject.content_rule_wireless_disable_interfaces' differs.
--- xccdf_org.ssgproject.content_rule_wireless_disable_interfaces
+++ xccdf_org.ssgproject.content_rule_wireless_disable_interfaces
@@ -11,7 +11,7 @@
 
 if command -v wicked >/dev/null 2>&1 && systemctl is-active wickedd >/dev/null 2>&1; then
   if [ -n "$(find /sys/class/net/*/ -type d -name wireless)" ]; then
-    interfaces=$(find /sys/class/net/*/wireless -type d -name wireless | xargs -0 dirname | xargs basename)
+    interfaces=$(find /sys/class/net/*/wireless -type d -name wireless -print0 | xargs -0 -n1 dirname | xargs -n1 basename)
     for iface in $interfaces; do
       wicked ifdown $iface
       sed -i 's/STARTMODE=.*/STARTMODE=off/' /etc/sysconfig/network/ifcfg-$iface

Signed-off-by: Alan Moore <alan.moore@canonical.com>
@dodys dodys added this to the 0.1.83 milestone Sep 14, 2026
@macko1

macko1 commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Hi @alanmcanonical, could you please update the PR title and description to follow the template, and explain the scenario being fixed and the test scenarios?

It will help speed up the review a lot. Thanks!

@alanmcanonical alanmcanonical changed the title Fix find to work with xargs -0 Fix wireless_disable_interfaces to work multiple interfaces Sep 15, 2026
@alanmcanonical

Copy link
Copy Markdown
Contributor Author

The target scenario is interface being present more than one.

@macko1 macko1 self-assigned this Sep 18, 2026

@macko1 macko1 left a comment

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.

Also please update the heading to something like.

Fix wireless_disable_interface remediations.

Thanks.

@alanmcanonical alanmcanonical changed the title Fix wireless_disable_interfaces to work multiple interfaces Fix wireless_disable_interface remediations to work multiple interfaces Sep 19, 2026
Signed-off-by: Alan Moore <alan.moore@canonical.com>
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.

4 participants