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
796a2293
Commit
796a2293
authored
Dec 07, 2018
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark options connected with CONFIG_LOCK_DOWN_KERNEL (and add some new)
parent
57b1cb15
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
17 deletions
+27
-17
README.md
README.md
+8
-3
kconfig-hardened-check.py
kconfig-hardened-check.py
+19
-14
No files found.
README.md
View file @
796a2293
...
...
@@ -55,6 +55,7 @@ optional arguments:
CONFIG_SLAB_FREELIST_RANDOM | y | ubuntu18 | self_protection || OK
CONFIG_HARDENED_USERCOPY | y | ubuntu18 | self_protection || OK
CONFIG_FORTIFY_SOURCE | y | ubuntu18 | self_protection || OK
CONFIG_LOCK_DOWN_KERNEL | y | ubuntu18 | self_protection || OK
CONFIG_STRICT_MODULE_RWX | y | ubuntu18 | self_protection || OK
CONFIG_MODULE_SIG | y | ubuntu18 | self_protection || OK
CONFIG_MODULE_SIG_ALL | y | ubuntu18 | self_protection || OK
...
...
@@ -96,6 +97,7 @@ optional arguments:
CONFIG_PAGE_OWNER | is not set | ubuntu18 | cut_attack_surface || OK
CONFIG_DEBUG_KMEMLEAK | is not set | ubuntu18 | cut_attack_surface || OK
CONFIG_BINFMT_AOUT | is not set | ubuntu18 | cut_attack_surface || OK: not found
CONFIG_MMIOTRACE_TEST | is not set | ubuntu18 | cut_attack_surface || OK
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_BINFMT_MISC | is not set | kspp | cut_attack_surface || FAIL: "m"
...
...
@@ -120,18 +122,21 @@ optional arguments:
CONFIG_DEVPORT | is not set |grsecurity| cut_attack_surface || FAIL: "y"
CONFIG_DEBUG_FS | is not set |grsecurity| cut_attack_surface || FAIL: "y"
CONFIG_NOTIFIER_ERROR_INJECTION | is not set |grsecurity| cut_attack_surface || FAIL: "m"
CONFIG_ACPI_TABLE_UPGRADE | is not set | lockdown | cut_attack_surface || FAIL: "y"
CONFIG_ACPI_APEI_EINJ | is not set | lockdown | cut_attack_surface || FAIL: "m"
CONFIG_PROFILING | is not set | lockdown | cut_attack_surface || FAIL: "y"
CONFIG_BPF_SYSCALL | is not set | lockdown | cut_attack_surface || FAIL: "y"
CONFIG_MMIOTRACE | is not set | my | cut_attack_surface || FAIL: "y"
CONFIG_KEXEC_FILE | is not set | my | cut_attack_surface || FAIL: "y"
CONFIG_LIVEPATCH | is not set | my | cut_attack_surface || FAIL: "y"
CONFIG_USER_NS | is not set | my | cut_attack_surface || FAIL: "y"
CONFIG_IP_DCCP | is not set | my | cut_attack_surface || FAIL: "m"
CONFIG_IP_SCTP | is not set | my | cut_attack_surface || FAIL: "m"
CONFIG_FTRACE | is not set | my | cut_attack_surface || FAIL: "y"
CONFIG_PROFILING | is not set | my | cut_attack_surface || FAIL: "y"
CONFIG_BPF_JIT | is not set | my | cut_attack_surface || FAIL: "y"
CONFIG_BPF_SYSCALL | is not set | my | cut_attack_surface || FAIL: "y"
CONFIG_ARCH_MMAP_RND_BITS | 32 | my |userspace_protection|| FAIL: "28"
[-] config check is NOT PASSED: 5
1
errors
[-] config check is NOT PASSED: 5
4
errors
```
...
...
kconfig-hardened-check.py
View file @
796a2293
...
...
@@ -98,7 +98,7 @@ class OR:
def
construct_checklist
():
modules_not_set
=
OptCheck
(
'MODULES'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
)
devmem_not_set
=
OptCheck
(
'DEVMEM'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
)
devmem_not_set
=
OptCheck
(
'DEVMEM'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
)
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'BUG'
,
'y'
,
'ubuntu18'
,
'self_protection'
))
checklist
.
append
(
OptCheck
(
'PAGE_TABLE_ISOLATION'
,
'y'
,
'ubuntu18'
,
'self_protection'
))
...
...
@@ -144,7 +144,7 @@ def construct_checklist():
checklist
.
append
(
OptCheck
(
'DEBUG_SG'
,
'y'
,
'kspp'
,
'self_protection'
))
checklist
.
append
(
OptCheck
(
'DEBUG_CREDENTIALS'
,
'y'
,
'kspp'
,
'self_protection'
))
checklist
.
append
(
OptCheck
(
'DEBUG_NOTIFIERS'
,
'y'
,
'kspp'
,
'self_protection'
))
checklist
.
append
(
OptCheck
(
'MODULE_SIG_FORCE'
,
'y'
,
'kspp'
,
'self_protection'
))
checklist
.
append
(
OptCheck
(
'MODULE_SIG_FORCE'
,
'y'
,
'kspp'
,
'self_protection'
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'HARDENED_USERCOPY_FALLBACK'
,
'is not set'
,
'kspp'
,
'self_protection'
))
checklist
.
append
(
OptCheck
(
'GCC_PLUGIN_STACKLEAK'
,
'y'
,
'my'
,
'self_protection'
))
...
...
@@ -161,8 +161,8 @@ def construct_checklist():
checklist
.
append
(
OptCheck
(
'SECCOMP'
,
'y'
,
'ubuntu18'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'SECCOMP_FILTER'
,
'y'
,
'ubuntu18'
,
'cut_attack_surface'
))
checklist
.
append
(
OR
(
OptCheck
(
'STRICT_DEVMEM'
,
'y'
,
'ubuntu18'
,
'cut_attack_surface'
),
\
devmem_not_set
))
checklist
.
append
(
OptCheck
(
'ACPI_CUSTOM_METHOD'
,
'is not set'
,
'ubuntu18'
,
'cut_attack_surface'
))
devmem_not_set
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'ACPI_CUSTOM_METHOD'
,
'is not set'
,
'ubuntu18'
,
'cut_attack_surface'
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'COMPAT_BRK'
,
'is not set'
,
'ubuntu18'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'DEVKMEM'
,
'is not set'
,
'ubuntu18'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'COMPAT_VDSO'
,
'is not set'
,
'ubuntu18'
,
'cut_attack_surface'
))
...
...
@@ -171,21 +171,22 @@ def construct_checklist():
checklist
.
append
(
OptCheck
(
'PAGE_OWNER'
,
'is not set'
,
'ubuntu18'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'DEBUG_KMEMLEAK'
,
'is not set'
,
'ubuntu18'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'BINFMT_AOUT'
,
'is not set'
,
'ubuntu18'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'MMIOTRACE_TEST'
,
'is not set'
,
'ubuntu18'
,
'cut_attack_surface'
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OR
(
OptCheck
(
'IO_STRICT_DEVMEM'
,
'y'
,
'kspp'
,
'cut_attack_surface'
),
\
devmem_not_set
))
devmem_not_set
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'LEGACY_VSYSCALL_NONE'
,
'y'
,
'kspp'
,
'cut_attack_surface'
))
# 'vsyscall=none'
checklist
.
append
(
OptCheck
(
'BINFMT_MISC'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'INET_DIAG'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'KEXEC'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'PROC_KCORE'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'KEXEC'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'PROC_KCORE'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'LEGACY_PTYS'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'IA32_EMULATION'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'X86_X32'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'MODIFY_LDT_SYSCALL'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'HIBERNATION'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'HIBERNATION'
,
'is not set'
,
'kspp'
,
'cut_attack_surface'
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'KPROBES'
,
'is not set'
,
'grsecurity'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'KPROBES'
,
'is not set'
,
'grsecurity'
,
'cut_attack_surface'
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'UPROBES'
,
'is not set'
,
'grsecurity'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'GENERIC_TRACER'
,
'is not set'
,
'grsecurity'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'PROC_VMCORE'
,
'is not set'
,
'grsecurity'
,
'cut_attack_surface'
))
...
...
@@ -195,19 +196,23 @@ def construct_checklist():
checklist
.
append
(
OptCheck
(
'USERFAULTFD'
,
'is not set'
,
'grsecurity'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'HWPOISON_INJECT'
,
'is not set'
,
'grsecurity'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'MEM_SOFT_DIRTY'
,
'is not set'
,
'grsecurity'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'DEVPORT'
,
'is not set'
,
'grsecurity'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'DEBUG_FS'
,
'is not set'
,
'grsecurity'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'DEVPORT'
,
'is not set'
,
'grsecurity'
,
'cut_attack_surface'
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'DEBUG_FS'
,
'is not set'
,
'grsecurity'
,
'cut_attack_surface'
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'NOTIFIER_ERROR_INJECTION'
,
'is not set'
,
'grsecurity'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'KEXEC_FILE'
,
'is not set'
,
'my'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'ACPI_TABLE_UPGRADE'
,
'is not set'
,
'lockdown'
,
'cut_attack_surface'
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'ACPI_APEI_EINJ'
,
'is not set'
,
'lockdown'
,
'cut_attack_surface'
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'PROFILING'
,
'is not set'
,
'lockdown'
,
'cut_attack_surface'
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'BPF_SYSCALL'
,
'is not set'
,
'lockdown'
,
'cut_attack_surface'
))
# refers to LOCK_DOWN_KERNEL
checklist
.
append
(
OptCheck
(
'MMIOTRACE'
,
'is not set'
,
'my'
,
'cut_attack_surface'
))
# refers to LOCK_DOWN_KERNEL (permissive)
checklist
.
append
(
OptCheck
(
'KEXEC_FILE'
,
'is not set'
,
'my'
,
'cut_attack_surface'
))
# refers to LOCK_DOWN_KERNEL (permissive)
checklist
.
append
(
OptCheck
(
'LIVEPATCH'
,
'is not set'
,
'my'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'USER_NS'
,
'is not set'
,
'my'
,
'cut_attack_surface'
))
# user.max_user_namespaces=0
checklist
.
append
(
OptCheck
(
'IP_DCCP'
,
'is not set'
,
'my'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'IP_SCTP'
,
'is not set'
,
'my'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'FTRACE'
,
'is not set'
,
'my'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'PROFILING'
,
'is not set'
,
'my'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'BPF_JIT'
,
'is not set'
,
'my'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'BPF_SYSCALL'
,
'is not set'
,
'my'
,
'cut_attack_surface'
))
checklist
.
append
(
OptCheck
(
'ARCH_MMAP_RND_BITS'
,
'32'
,
'my'
,
'userspace_protection'
))
...
...
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