@@ -34,7 +34,7 @@ License: GPL-3.0.
34
34
` kernel-hardening-checker ` supports checking:
35
35
36
36
- Kconfig options (compile-time)
37
- - Kernel cmdline arguments (boot-time)
37
+ - Kernel command line arguments (boot-time)
38
38
- Sysctl parameters (runtime)
39
39
40
40
Supported architectures:
@@ -60,10 +60,9 @@ or exploitation techniques.
60
60
61
61
## Attention!
62
62
63
- Changing Linux kernel security parameters may also affect system performance
64
- and functionality of userspace software. So for choosing these parameters, consider
65
- the threat model of your Linux-based information system and perform thorough testing
66
- of its typical workload.
63
+ Please note that changing the Linux kernel security parameters may also affect system performance
64
+ and functionality of userspace software. Therefore, when setting these parameters, consider
65
+ the threat model of your Linux-based information system and thoroughly test its typical workload.
67
66
68
67
## Installation
69
68
@@ -82,9 +81,11 @@ There are multiple options:
82
81
## Usage
83
82
```
84
83
$ ./bin/kernel-hardening-checker -h
85
- usage: kernel-hardening-checker [ -h] [ --version] [ -m {verbose,json,show_ok,show_fail}]
86
- [ -a] [ -c CONFIG] [ -v KERNEL_VERSION] [ -l CMDLINE]
87
- [ -s SYSCTL] [ -p {X86_64,X86_32,ARM64,ARM,RISCV}]
84
+ usage: kernel-hardening-checker [ -h] [ --version]
85
+ [ -m {verbose,json,show_ok,show_fail}] [ -a]
86
+ [ -c CONFIG] [ -v KERNEL_VERSION] [ -l CMDLINE]
87
+ [ -s SYSCTL]
88
+ [ -p {X86_64,X86_32,ARM64,ARM,RISCV}]
88
89
[ -g {X86_64,X86_32,ARM64,ARM,RISCV}]
89
90
90
91
A tool for checking the security hardening options of the Linux kernel
@@ -93,43 +94,44 @@ options:
93
94
-h, --help show this help message and exit
94
95
--version show program's version number and exit
95
96
-m, --mode {verbose,json,show_ok,show_fail}
96
- choose the report mode
97
- -a, --autodetect autodetect and check the security hardening options of the
98
- running kernel
99
- -c, --config CONFIG check the security hardening options in the Kconfig file (also
100
- supports * .gz files)
97
+ select a special output mode instead of the default
98
+ one
99
+ -a, --autodetect autodetect and check the security hardening options of
100
+ the running kernel
101
+ -c, --config CONFIG check the security hardening options in a Kconfig file
102
+ (also supports * .gz files)
101
103
-v, --kernel-version KERNEL_VERSION
102
- extract version from the kernel version file (contents of
103
- /proc/version) instead of Kconfig file
104
+ extract the kernel version from a version file (such
105
+ as /proc/version) instead of using a Kconfig file
104
106
-l, --cmdline CMDLINE
105
- check the security hardening options in the kernel cmdline file
106
- (contents of /proc/cmdline)
107
- -s, --sysctl SYSCTL check the security hardening options in the sysctl output file
108
- ( ` sudo sysctl -a > file ` )
107
+ check the security hardening options in a kernel
108
+ command line file (such as /proc/cmdline)
109
+ -s, --sysctl SYSCTL check the security hardening options in a sysctl
110
+ output file (the result of " sudo sysctl -a > file" )
109
111
-p, --print {X86_64,X86_32,ARM64,ARM,RISCV}
110
- print the security hardening recommendations for the selected
111
- architecture
112
+ print security hardening recommendations for the
113
+ selected architecture
112
114
-g, --generate {X86_64,X86_32,ARM64,ARM,RISCV}
113
- generate a Kconfig fragment with the security hardening options
114
- for the selected architecture
115
+ generate a Kconfig fragment containing the security
116
+ hardening options for the selected architecture
115
117
```
116
118
117
119
## Output modes
118
120
119
121
- no `-m` argument for the default output mode (see the example below)
120
122
- `-m verbose` for printing additional info:
121
- - config options without a corresponding check
122
- - internals of complex checks with AND/OR, like this:
123
- ```
124
- -------------------------------------------------------------------------------------------
125
- <<< OR >>>
126
- CONFIG_STRICT_DEVMEM |kconfig|cut_attack_surface|defconfig | y
127
- CONFIG_DEVMEM |kconfig|cut_attack_surface| kspp | is not set
128
- -------------------------------------------------------------------------------------------
129
- ```
130
- - `-m show_fail` for showing only the failed checks
131
- - `-m show_ok` for showing only the successful checks
123
+ - the configuration options without a corresponding check
124
+ - the internals of complex checks with AND/OR, like this:
125
+ ```
126
+ -------------------------------------------------------------------------------------------
127
+ <<< OR >>>
128
+ CONFIG_STRICT_DEVMEM |kconfig|cut_attack_surface|defconfig | y
129
+ CONFIG_DEVMEM |kconfig|cut_attack_surface| kspp | is not set
130
+ -------------------------------------------------------------------------------------------
131
+ ```
132
132
- `-m json` for printing the results in JSON format (for combining `kernel-hardening-checker` with other tools)
133
+ - `-m show_ok` for showing only successful checks
134
+ - `-m show_fail` for showing only failed checks
133
135
134
136
## Example output
135
137
```
0 commit comments