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
7425f0e2
Commit
7425f0e2
authored
Mar 27, 2022
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add '--cmdline' argument for the tool
parent
5fbc06fa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
__init__.py
kconfig_hardened_check/__init__.py
+6
-0
No files found.
kconfig_hardened_check/__init__.py
View file @
7425f0e2
...
@@ -817,6 +817,8 @@ def main():
...
@@ -817,6 +817,8 @@ def main():
help
=
'print security hardening preferences for the selected architecture'
)
help
=
'print security hardening preferences for the selected architecture'
)
parser
.
add_argument
(
'-c'
,
'--config'
,
parser
.
add_argument
(
'-c'
,
'--config'
,
help
=
'check the kernel kconfig file against these preferences'
)
help
=
'check the kernel kconfig file against these preferences'
)
parser
.
add_argument
(
'-l'
,
'--cmdline'
,
help
=
'check the kernel cmdline file against these preferences'
)
parser
.
add_argument
(
'-m'
,
'--mode'
,
choices
=
report_modes
,
parser
.
add_argument
(
'-m'
,
'--mode'
,
choices
=
report_modes
,
help
=
'choose the report mode'
)
help
=
'choose the report mode'
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
...
@@ -832,6 +834,8 @@ def main():
...
@@ -832,6 +834,8 @@ def main():
if
args
.
config
:
if
args
.
config
:
if
mode
!=
'json'
:
if
mode
!=
'json'
:
print
(
'[+] Kconfig file to check: {}'
.
format
(
args
.
config
))
print
(
'[+] Kconfig file to check: {}'
.
format
(
args
.
config
))
if
args
.
cmdline
:
print
(
'[+] Kernel cmdline file to check: {}'
.
format
(
args
.
cmdline
))
arch
,
msg
=
detect_arch
(
args
.
config
,
supported_archs
)
arch
,
msg
=
detect_arch
(
args
.
config
,
supported_archs
)
if
not
arch
:
if
not
arch
:
...
@@ -863,6 +867,8 @@ def main():
...
@@ -863,6 +867,8 @@ def main():
print_checklist
(
mode
,
config_checklist
,
True
)
print_checklist
(
mode
,
config_checklist
,
True
)
sys
.
exit
(
0
)
sys
.
exit
(
0
)
elif
args
.
cmdline
:
sys
.
exit
(
'[!] ERROR: checking cmdline doesn
\'
t work without checking kconfig'
)
if
args
.
print
:
if
args
.
print
:
if
mode
in
(
'show_ok'
,
'show_fail'
):
if
mode
in
(
'show_ok'
,
'show_fail'
):
...
...
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