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
cb0711d4
Commit
cb0711d4
authored
Jul 20, 2018
by
Alexander Popov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the check against multiple options in config file
parent
aaa3826a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
kconfig-hardened-check.py
kconfig-hardened-check.py
+8
-6
No files found.
kconfig-hardened-check.py
View file @
cb0711d4
...
...
@@ -198,19 +198,21 @@ def check_config_file(fname):
print
(
'[+] Checking "{}" against hardening preferences...'
.
format
(
fname
))
for
line
in
f
.
readlines
():
line
=
line
.
strip
()
option
=
None
value
=
None
if
opt_is_on
.
match
(
line
):
config
,
value
=
line
[
7
:]
.
split
(
'='
,
1
)
parsed_options
[
config
]
=
value
option
,
value
=
line
[
7
:]
.
split
(
'='
,
1
)
elif
opt_is_off
.
match
(
line
):
config
,
value
=
line
[
9
:]
.
split
(
' '
,
1
)
option
,
value
=
line
[
9
:]
.
split
(
' '
,
1
)
if
value
!=
'is not set'
:
sys
.
exit
(
'[!] BUG: bad disabled config option "{}"'
.
format
(
line
))
if
config
in
parsed_options
:
sys
.
exit
(
'[!] ERROR: config option "{}" exists multiple times'
.
format
(
line
))
if
option
in
parsed_options
:
sys
.
exit
(
'[!] ERROR: config option "{}" exists multiple times'
.
format
(
line
))
parsed_options
[
config
]
=
value
if
option
is
not
None
:
parsed_options
[
option
]
=
value
check_state
(
parsed_options
)
print_check_results
()
...
...
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