r/linux • • 9d ago

Kernel Locking down unnecessary kernel mods

how do admins deal with the flood of ai-malware now thats loading custom mods?

I tried a tool called modulejail, it basically generates a blacklist of mods that arent actively used by running OS

https://modulejail.com/#install

its helpful, but any attacker can still bypass this by running modprobe -i

ie here, I ran mdulejail, it created blacklist txt file, running lsmod <mod> doesnt load it now, but running lsmod -i <mod> still loads

there is no concrete way to ban a module from loading short of running kernel.modules_disabled=1 , which doesnt survive a reboot

is there a way to block a mod from loading regardless of context? This is a huge attck vector now, and I wanted to audit our servers and lock down anything unecessary , like the copyfail exploit few months ago using alg mod

0 Upvotes

42 comments sorted by

View all comments

6

u/SurreptitiousSophist 9d ago

If you'd like to disable kennel module loading at every boot, just put modules_disabled=1 into your grub config file. Or am I missing something? 

-1

u/Beneficial-Sock-5130 9d ago

its a runtime setting /proc/sys/kernel/modules_disabled , doesnt do anything if placed into grub

8

u/alpha417 9d ago

If they have access to your system, to the point where they can get into grub, you're f***** anyway.

something something deckchairs on the titanic something something...