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
60a83b77
Commit
60a83b77
authored
Jan 24, 2019
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the README and comments after adding ARM support
parent
53c4c513
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
README.md
README.md
+12
-7
kconfig-hardened-check.py
kconfig-hardened-check.py
+2
-4
No files found.
README.md
View file @
60a83b77
...
@@ -9,31 +9,36 @@ make our systems more secure.
...
@@ -9,31 +9,36 @@ make our systems more secure.
But nobody likes checking configs manually. So let the computers do their job!
But nobody likes checking configs manually. So let the computers do their job!
__kconfig-hardened-check.py__
helps me to check the Linux kernel Kconfig option list
__kconfig-hardened-check.py__
helps me to check the Linux kernel Kconfig option list
against my hardening preferences
for
`x86_64`
, which are based on the
against my hardening preferences, which are based on the
[
KSPP recommended settings
][
1
]
and last public
[
grsecurity
][
2
]
patch (options
[
KSPP recommended settings
][
1
]
and last public
[
grsecurity
][
2
]
patch (options
which they disable).
which they disable).
Please don't cry if my Python code looks like C. I'm just a kernel developer.
Please don't cry if my Python code looks like C. I'm just a kernel developer.
__TODO:__
add hardening preferences for ARM.
## Supported microarchitectures
-
X86_64
-
X86_32
-
ARM64
-
ARM
## Script output examples
## Script output examples
### Usage
### Usage
```
```
#./kconfig-hardened-check.py
#usage: kconfig-hardened-check.py [-h] [-p {X86_64,X86_32,ARM64,ARM}]
usage: kconfig-hardened-check.py [-h] [-p {X86_64,X86_32,ARM64}] [-c CONFIG]
[-c CONFIG] [--debug]
[--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,X86_32,ARM64
}, --print {X86_64,X86_32,ARM64
}
-p {X86_64,X86_32,ARM64
,ARM}, --print {X86_64,X86_32,ARM64,ARM
}
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
--debug enable internal debug mode
--debug enable internal debug mode
```
```
### Script output for `Ubuntu 18.04 (Bionic Beaver)` kernel config
### Script output for `Ubuntu 18.04 (Bionic Beaver)` kernel config
...
@@ -47,7 +52,6 @@ optional arguments:
...
@@ -47,7 +52,6 @@ optional arguments:
CONFIG_BUG | y |defconfig | self_protection || OK
CONFIG_BUG | y |defconfig | self_protection || OK
CONFIG_STRICT_KERNEL_RWX | y |defconfig | self_protection || OK
CONFIG_STRICT_KERNEL_RWX | 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_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_PAGE_TABLE_ISOLATION | y |defconfig | self_protection || OK
CONFIG_PAGE_TABLE_ISOLATION | y |defconfig | self_protection || OK
...
@@ -58,6 +62,7 @@ optional arguments:
...
@@ -58,6 +62,7 @@ optional arguments:
CONFIG_X86_INTEL_UMIP | y |defconfig | self_protection || OK
CONFIG_X86_INTEL_UMIP | y |defconfig | self_protection || OK
CONFIG_SYN_COOKIES | y |defconfig | self_protection || OK
CONFIG_SYN_COOKIES | y |defconfig | self_protection || OK
CONFIG_VMAP_STACK | y |defconfig | self_protection || OK
CONFIG_VMAP_STACK | y |defconfig | self_protection || OK
CONFIG_THREAD_INFO_IN_TASK | 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
...
...
kconfig-hardened-check.py
View file @
60a83b77
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
#
#
# This script helps me to check the Linux kernel Kconfig option list
# This script helps me to check the Linux kernel Kconfig option list
# against my hardening preferences for x86_64. Let the computers do their job!
# against my hardening preferences for X86_64, ARM64, X86_32, and ARM.
# Let the computers do their job!
#
#
# Author: Alexander Popov <alex.popov@linux.com>
# Author: Alexander Popov <alex.popov@linux.com>
#
#
...
@@ -25,9 +26,6 @@
...
@@ -25,9 +26,6 @@
#
#
# N.B. Hardening sysctl's:
# N.B. Hardening sysctl's:
# net.core.bpf_jit_harden
# net.core.bpf_jit_harden
#
#
# TODO: add hardening preferences for ARM
import
sys
import
sys
from
argparse
import
ArgumentParser
from
argparse
import
ArgumentParser
...
...
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