Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kernel-hardening-checker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
kernel-hardening-checker
Commits
8510fc06
Commit
8510fc06
authored
Jan 22, 2019
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the README after adding X86_32 support
And improve the style by the way.
parent
819cebdf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
README.md
README.md
+15
-14
No files found.
README.md
View file @
8510fc06
...
@@ -22,13 +22,14 @@ __TODO:__ add hardening preferences for ARM.
...
@@ -22,13 +22,14 @@ __TODO:__ add hardening preferences for ARM.
### Usage
### Usage
```
```
#./kconfig-hardened-check.py
#./kconfig-hardened-check.py
usage: kconfig-hardened-check.py [-h] [-p {X86_64}] [-c CONFIG] [--debug]
usage: kconfig-hardened-check.py [-h] [-p {X86_64,X86_32}] [-c CONFIG]
[--debug]
Checks the hardening options in the Linux kernel config
Checks the hardening options in the Linux kernel config
optional arguments:
optional arguments:
-h, --help show this help message and exit
-h, --help show this help message and exit
-p {X86_64
}, --print {X86_64
}
-p {X86_64
,X86_32}, --print {X86_64,X86_32
}
print hardening preferences for selected architecture
print hardening preferences for selected architecture
-c CONFIG, --config CONFIG
-c CONFIG, --config CONFIG
check the config_file against these preferences
check the config_file against these preferences
...
@@ -37,26 +38,26 @@ optional arguments:
...
@@ -37,26 +38,26 @@ optional arguments:
### Script output for `Ubuntu 18.04 (Bionic Beaver)` kernel config
### Script output for `Ubuntu 18.04 (Bionic Beaver)` kernel config
```
```
#./kconfig-hardened-check.py
-c config_file
s/ubuntu-bionic-generic.config
#./kconfig-hardened-check.py
-c config_files/distro
s/ubuntu-bionic-generic.config
[+] Trying to detect architecture in "config_files/ubuntu-bionic-generic.config"...
[+] Trying to detect architecture in "config_files/
distros/
ubuntu-bionic-generic.config"...
[+] Detected architecture: X86_64
[+] Detected architecture: X86_64
[+] Checking "config_files/ubuntu-bionic-generic.config" against hardening preferences...
[+] Checking "config_files/
distros/
ubuntu-bionic-generic.config" against hardening preferences...
option name | desired val | decision | reason || check result
option name | desired val | decision | reason || check result
===================================================================================================================
===================================================================================================================
CONFIG_BUG | y |defconfig | self_protection || OK
CONFIG_BUG | y |defconfig | self_protection || OK
CONFIG_PAGE_TABLE_ISOLATION | y |defconfig | self_protection || OK
CONFIG_RETPOLINE | y |defconfig | self_protection || OK
CONFIG_RETPOLINE | y |defconfig | self_protection || OK
CONFIG_X86_SMAP | y |defconfig | self_protection || OK
CONFIG_X86_SMAP | y |defconfig | self_protection || OK
CONFIG_X86_INTEL_UMIP | y |defconfig | self_protection || OK
CONFIG_X86_INTEL_UMIP | y |defconfig | self_protection || OK
CONFIG_STRICT_KERNEL_RWX | y |defconfig | self_protection || OK
CONFIG_STRICT_KERNEL_RWX | y |defconfig | self_protection || OK
CONFIG_RANDOMIZE_BASE | y |defconfig | self_protection || OK
CONFIG_RANDOMIZE_BASE | y |defconfig | self_protection || OK
CONFIG_RANDOMIZE_MEMORY | y |defconfig | self_protection || OK
CONFIG_STACKPROTECTOR_STRONG | y |defconfig | self_protection ||CONFIG_CC_STACKPROTECTOR_STRONG: OK ("y")
CONFIG_STACKPROTECTOR_STRONG | y |defconfig | self_protection ||CONFIG_CC_STACKPROTECTOR_STRONG: OK ("y")
CONFIG_VMAP_STACK | y |defconfig | self_protection || OK
CONFIG_THREAD_INFO_IN_TASK | y |defconfig | self_protection || OK
CONFIG_THREAD_INFO_IN_TASK | y |defconfig | self_protection || OK
CONFIG_SLUB_DEBUG | y |defconfig | self_protection || OK
CONFIG_SLUB_DEBUG | y |defconfig | self_protection || OK
CONFIG_STRICT_MODULE_RWX | y |defconfig | self_protection || OK
CONFIG_STRICT_MODULE_RWX | y |defconfig | self_protection || OK
CONFIG_SYN_COOKIES | y |defconfig | self_protection || OK
CONFIG_SYN_COOKIES | y |defconfig | self_protection || OK
CONFIG_PAGE_TABLE_ISOLATION | y |defconfig | self_protection || OK
CONFIG_RANDOMIZE_MEMORY | y |defconfig | self_protection || OK
CONFIG_VMAP_STACK | y |defconfig | self_protection || OK
CONFIG_BUG_ON_DATA_CORRUPTION | y | kspp | self_protection || FAIL: "is not set"
CONFIG_BUG_ON_DATA_CORRUPTION | y | kspp | self_protection || FAIL: "is not set"
CONFIG_DEBUG_WX | y | kspp | self_protection || OK
CONFIG_DEBUG_WX | y | kspp | self_protection || OK
CONFIG_SCHED_STACK_END_CHECK | y | kspp | self_protection || OK
CONFIG_SCHED_STACK_END_CHECK | y | kspp | self_protection || OK
...
@@ -97,7 +98,6 @@ optional arguments:
...
@@ -97,7 +98,6 @@ optional arguments:
CONFIG_SECCOMP_FILTER | y |defconfig | cut_attack_surface || OK
CONFIG_SECCOMP_FILTER | y |defconfig | cut_attack_surface || OK
CONFIG_STRICT_DEVMEM | y |defconfig | cut_attack_surface || OK
CONFIG_STRICT_DEVMEM | y |defconfig | cut_attack_surface || OK
CONFIG_IO_STRICT_DEVMEM | y | kspp | cut_attack_surface || FAIL: "is not set"
CONFIG_IO_STRICT_DEVMEM | y | kspp | cut_attack_surface || FAIL: "is not set"
CONFIG_LEGACY_VSYSCALL_NONE | y | kspp | cut_attack_surface || FAIL: "is not set"
CONFIG_ACPI_CUSTOM_METHOD | is not set | kspp | cut_attack_surface || OK
CONFIG_ACPI_CUSTOM_METHOD | is not set | kspp | cut_attack_surface || OK
CONFIG_COMPAT_BRK | is not set | kspp | cut_attack_surface || OK
CONFIG_COMPAT_BRK | is not set | kspp | cut_attack_surface || OK
CONFIG_DEVKMEM | is not set | kspp | cut_attack_surface || OK
CONFIG_DEVKMEM | is not set | kspp | cut_attack_surface || OK
...
@@ -107,10 +107,11 @@ optional arguments:
...
@@ -107,10 +107,11 @@ optional arguments:
CONFIG_KEXEC | is not set | kspp | cut_attack_surface || FAIL: "y"
CONFIG_KEXEC | is not set | kspp | cut_attack_surface || FAIL: "y"
CONFIG_PROC_KCORE | is not set | kspp | cut_attack_surface || FAIL: "y"
CONFIG_PROC_KCORE | is not set | kspp | cut_attack_surface || FAIL: "y"
CONFIG_LEGACY_PTYS | is not set | kspp | cut_attack_surface || FAIL: "y"
CONFIG_LEGACY_PTYS | is not set | kspp | cut_attack_surface || FAIL: "y"
CONFIG_HIBERNATION | is not set | kspp | cut_attack_surface || FAIL: "y"
CONFIG_LEGACY_VSYSCALL_NONE | y | kspp | cut_attack_surface || FAIL: "is not set"
CONFIG_IA32_EMULATION | is not set | kspp | cut_attack_surface || FAIL: "y"
CONFIG_IA32_EMULATION | is not set | kspp | cut_attack_surface || FAIL: "y"
CONFIG_X86_X32 | is not set | kspp | cut_attack_surface || FAIL: "y"
CONFIG_X86_X32 | is not set | kspp | cut_attack_surface || FAIL: "y"
CONFIG_MODIFY_LDT_SYSCALL | is not set | kspp | cut_attack_surface || FAIL: "y"
CONFIG_MODIFY_LDT_SYSCALL | is not set | kspp | cut_attack_surface || FAIL: "y"
CONFIG_HIBERNATION | is not set | kspp | cut_attack_surface || FAIL: "y"
CONFIG_X86_PTDUMP | is not set |grsecurity| cut_attack_surface || OK
CONFIG_X86_PTDUMP | is not set |grsecurity| cut_attack_surface || OK
CONFIG_ZSMALLOC_STAT | is not set |grsecurity| cut_attack_surface || OK
CONFIG_ZSMALLOC_STAT | is not set |grsecurity| cut_attack_surface || OK
CONFIG_PAGE_OWNER | is not set |grsecurity| cut_attack_surface || OK
CONFIG_PAGE_OWNER | is not set |grsecurity| cut_attack_surface || OK
...
@@ -147,13 +148,13 @@ optional arguments:
...
@@ -147,13 +148,13 @@ optional arguments:
[-] config check is NOT PASSED: 56 errors
[-] config check is NOT PASSED: 56 errors
```
```
__Go and fix them all!__
N.B. If
`CONFIG_GCC_PLUGIN*`
options are automatically disabled during your kernel compilation,
that means that your gcc doesn't support plugins. For example, if you have
`gcc-7`
on Ubuntu,
try to install
`gcc-7-plugin-dev`
package, it should help.
N.B. If
`CONFIG_GCC_PLUGIN*`
options are automatically disabled during your kernel compilation,
then your gcc doesn't support plugins. For example, if you have
`gcc-7`
on Ubuntu, try to install
`gcc-7-plugin-dev`
package, it should help.
__Go and fix them all!__
[
1
]:
http://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings
[
1
]:
http://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings
[
2
]:
https://grsecurity.net/
[
2
]:
https://grsecurity.net/
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment