File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ def __init__(self, parameters):
2525 self .kconfig = str (self .KCONFIG_BIN )
2626
2727 self .context .subscribe ('filesystem_new_file_mime' , self .check_file )
28+ self .context .subscribe ('filesystem_new_file' , self .kconfig_check )
2829
2930 def check_file (self , event ):
3031 filepath = event .filepath
@@ -51,3 +52,11 @@ def str2bool(string):
5152 inode .fortify_source = str2bool (profile ['fortify_source' ])
5253 inode .fortified = profile ['fortified' ]
5354 inode .fortifyable = profile ['fortify-able' ]
55+
56+ def kconfig_check (self , event ):
57+ filepath = event .guest_filepath
58+ inode = event .inode
59+ if re .match (r'/boot/config-.*' , filepath ):
60+ # run kconfig-hardened-check
61+ cmdline = [self .kconfig , '--config' , filepath , '--json' ]
62+ kconfig_data = json .loads (subprocess .check_output (cmdline ).decode ())
You can’t perform that action at this time.
0 commit comments