another kconfig target for building monolithic kernel (for security) ?
Hello !
i want to harden a linux system (dedicated root server on the internet) by recompiling the kernel without support for lkm (to prevent installation of lkm based rootkits etc)
since the "minimalistic" approach (removing complexity) is always a good strategy for security , it seems that it generally isn`t a trivial task to "strip down" the running kernel with xconfig/menuconfig, i.e. to turn the running kernel into an minimalistic monolithic version which "just fits" to the current hardware and contains the absolutely necessary.
especially when you have no physical access to the machine, there is some danger that the system doesn`t boot and needs some operator resetting it and boot into working configuration again.
what i assume what could be needed is something like a build-target "make hardened-config-based-on-running-kernel" which does the following
- look at the running kernel which components/modules are loaded/used/active
- make a .config based on that information (i.e. remove all unneded and turn this into monolithic version)
- probably tell the user what will be disabled in the monolitic kernel
if this doesn`t sound too dumb (comments?) - maybe there is some sort of "receipe" or project how to do this in a more comfortable way (i.e. without working through the whole .config and without in-depth knowledge of all .config params) ?
regards
roland k.
systems engineer
_______________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
Quoted 1 line · On Sat, Apr 29, 2006 at 03:03:55PM +0200, [email protected] wrote:
i want to harden a linux system (dedicated root server on the internet) by recompiling the kernel without support for lkm (to prevent installation of lkm based rootkits etc)
Loading modules via /dev/kmem is trivial thanks to a bunch of tutorials and examples on the web, so this alone doesn't make life that much more difficult for attackers.
Dave
Signature · 1 line
http://www.codemonkey.org.uk
Quoted 6 lines · Dave Jones
Quoted 1 line · On Sat, Apr 29, 2006 at 03:03:55PM +0200, [email protected] wrote:
i want to harden a linux system (dedicated root server on the internet) by recompiling the kernel without support for lkm (to prevent installation of lkm based rootkits etc)
Loading modules via
/dev/kmemis trivial thanks to a bunch of tutorials and examples on the web, so this alone doesn't make life that much more difficult for attackers.
/dev/kmem should be a config option too though
(and /dev/mem should get the filter patch that fedora has ;-)
On 29 Apr 2006, Arjan van de Ven prattled cheerily:
Quoted 9 lines · Dave Jones
Quoted 6 lines · On Sat, Apr 29, 2006 at 03:03:55PM +0200, [email protected] wrote:
Quoted 2 lines
i want to harden a linux system (dedicated root server on the internet) by recompiling the kernel without support for lkm (to prevent installation of lkm based rootkits etc)
Loading modules via
/dev/kmemis trivial thanks to a bunch of tutorials and examples on the web, so this alone doesn't make life that much more difficult for attackers.
/dev/kmemshould be a config option too though
Yeah, but in practice this should work (somewhat old patch, should still apply):
include/linux/capability.h +1 -1
@@ -311,7 +311,7 @@#define CAP_EMPTY_SET to_cap_t(0)#define CAP_FULL_SET to_cap_t(~0) -#define CAP_INIT_EFF_SET to_cap_t(~0 & ~CAP_TO_MASK(CAP_SETPCAP)) +#define CAP_INIT_EFF_SET to_cap_t(~0 & ~CAP_TO_MASK(CAP_SETPCAP) & ~CAP_TO_MASK(CAP_SYS_RAWIO))#define CAP_INIT_INH_SET to_cap_t(0)#define CAP_TO_MASK (x) (1 << (x))
Quoted 1 line
(and
/dev/memshould get the filter patch that fedora has ;-)
Agreed.
Signature · 3 lines
`On a scale of 1-10, X's "brokenness rating" is 1.1, but that's only because bringing Windows into the picture rescaled "brokenness" by a factor of 10.' --- Peter da Silva