Fix wireless_disable_interface remediations to work multiple interfaces - #15106
alanmcanonical wants to merge 1 commit into
Conversation
|
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 Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
This datastream diff is auto generated by the check Click here to see the full diffbash 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 |
|
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! |
|
The target scenario is interface being present more than one. |
macko1
left a comment
There was a problem hiding this comment.
Also please update the heading to something like.
Fix wireless_disable_interface remediations.
Thanks.
|
@alanmcanonical LGTM, thanks for the fix. Did you test this? How? |
Tested by dummy files instead of interface. |
For future updates, please provide the test scenarios before marking the PR as ready. This can also help for self-review (even if tested with the dummy files - that's how I found the bug). Please make the commit messages descriptive (you can probably rebase/squash these with a short commit msg) as we do merge commits and these will appear in the history. See https://complianceascode.readthedocs.io/en/latest/manual/developer/04_style_guide.html#commit-messages Otherwise LGTM |
5548329 to
e9ed5cb
Compare
Follow symlinks in ansible find task Fix find/xargs to properly handle paths with -print0 and one argument per line.
e9ed5cb to
ac0b4bc
Compare
Description:
Rationale: