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
4fdae670
Commit
4fdae670
authored
Jun 24, 2019
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
json: Fix minor things and update the README
parent
20a23af2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
README.md
README.md
+3
-2
kconfig-hardened-check.py
kconfig-hardened-check.py
+2
-3
No files found.
README.md
View file @
4fdae670
...
@@ -28,8 +28,8 @@ Please don't cry if my Python code looks like C. I'm just a kernel developer.
...
@@ -28,8 +28,8 @@ Please don't cry if my Python code looks like C. I'm just a kernel developer.
### Usage
### Usage
```
```
#
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,ARM}]
[-c CONFIG] [--debug]
[-c CONFIG] [--debug]
[--json]
Checks the hardening options in the Linux kernel config
Checks the hardening options in the Linux kernel config
...
@@ -40,6 +40,7 @@ optional arguments:
...
@@ -40,6 +40,7 @@ optional arguments:
-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
--json print results in JSON format
```
```
...
...
kconfig-hardened-check.py
View file @
4fdae670
...
@@ -451,13 +451,12 @@ def check_config_file(fname):
...
@@ -451,13 +451,12 @@ def check_config_file(fname):
if
debug_mode
:
if
debug_mode
:
known_options
=
[
opt
.
name
for
opt
in
checklist
]
known_options
=
[
opt
.
name
for
opt
in
checklist
]
for
option
,
value
in
parsed_options
.
items
():
for
option
,
value
in
parsed_options
.
items
():
if
option
not
in
known_options
and
not
json_mode
:
if
option
not
in
known_options
:
print
(
"DEBUG: dunno about option {} ({})"
.
format
(
option
,
value
))
print
(
"DEBUG: dunno about option {} ({})"
.
format
(
option
,
value
))
print_checks
()
print_checks
()
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
parser
=
ArgumentParser
(
description
=
'Checks the hardening options in the Linux kernel config'
)
parser
=
ArgumentParser
(
description
=
'Checks the hardening options in the Linux kernel config'
)
parser
.
add_argument
(
'-p'
,
'--print'
,
choices
=
supported_archs
,
parser
.
add_argument
(
'-p'
,
'--print'
,
choices
=
supported_archs
,
...
@@ -467,7 +466,7 @@ if __name__ == '__main__':
...
@@ -467,7 +466,7 @@ if __name__ == '__main__':
parser
.
add_argument
(
'--debug'
,
action
=
'store_true'
,
parser
.
add_argument
(
'--debug'
,
action
=
'store_true'
,
help
=
'enable internal debug mode'
)
help
=
'enable internal debug mode'
)
parser
.
add_argument
(
'--json'
,
action
=
'store_true'
,
parser
.
add_argument
(
'--json'
,
action
=
'store_true'
,
help
=
'print results in
json
format'
)
help
=
'print results in
JSON
format'
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
if
args
.
debug
:
if
args
.
debug
:
...
...
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