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

added checks to ensure some kernel modules are properly configured to be blacklisted #44

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kemley76
Copy link
Contributor

Fix to issue #40

… be blacklisted

Signed-off-by: kemley76 <kemley@mitre.org>
@kemley76 kemley76 requested review from Amndeep7 and wdower May 23, 2024 19:09
@@ -32,4 +32,17 @@
it { should be_disabled }
it { should be_blacklisted }
end

config_files = command('find /etc/modprobe.conf /etc/modprobe.d/* -print0').stdout.split("\0")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this one a slightly different pattern compared to the rest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure why I wrote it that way. It should be fixed now.

Signed-off-by: kemley76 <kemley@mitre.org>
Signed-off-by: kemley76 <kemley@mitre.org>
@@ -32,4 +32,17 @@
it { should be_disabled }
it { should be_blacklisted }
end

config_files = command('find /etc/modprobe.conf /etc/modprobe.d/* -print0').stdout.split("\0")
Copy link
Member

Choose a reason for hiding this comment

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

Does the kernel_module resource not do this for you already?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It appears so. I was under the impression that kernel_module was testing the results of the configuration being loaded (maybe using something lsmod or modprobe command itself) rather than directly looking at how it was configured. In this case, this means that this whole PR is redundant, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants