mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-01 06:45:38 +00:00
Merge logparser.py hashlog: rename 'path' to 'file'
... which is the name we use everywhere else. With this, we can drop the special casing for 'path' in aa.py collapse_hashlog. MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1296 Approved-by: John Johansen <john@jjmx.net> Merged-by: John Johansen <john@jjmx.net>
This commit is contained in:
@@ -1600,11 +1600,7 @@ def collapse_log(hashlog, ignore_null_profiles=True):
|
|||||||
log_dict[aamode][final_name] = ProfileStorage(profile, hat, 'collapse_log()')
|
log_dict[aamode][final_name] = ProfileStorage(profile, hat, 'collapse_log()')
|
||||||
|
|
||||||
for ev_type, ev_class in ReadLog.ruletypes.items():
|
for ev_type, ev_class in ReadLog.ruletypes.items():
|
||||||
if ev_class == FileRule: # TODO: fix the name in the hashlog for FileRule
|
for event in ev_class.from_hashlog(hashlog[aamode][full_profile][ev_type]):
|
||||||
ev_type_hashlog = 'path'
|
|
||||||
else:
|
|
||||||
ev_type_hashlog = ev_type
|
|
||||||
for event in ev_class.from_hashlog(hashlog[aamode][full_profile][ev_type_hashlog]):
|
|
||||||
if not hat_exists or not is_known_rule(aa[profile][hat], ev_type, event):
|
if not hat_exists or not is_known_rule(aa[profile][hat], ev_type, event):
|
||||||
log_dict[aamode][final_name][ev_type].add(event)
|
log_dict[aamode][final_name][ev_type].add(event)
|
||||||
|
|
||||||
|
@@ -82,8 +82,8 @@ class ReadLog:
|
|||||||
'change_profile': {}, # flat, no hasher needed (at least in logparser which doesn't support EXEC MODE and EXEC COND)
|
'change_profile': {}, # flat, no hasher needed (at least in logparser which doesn't support EXEC MODE and EXEC COND)
|
||||||
'dbus': hasher(),
|
'dbus': hasher(),
|
||||||
'exec': hasher(),
|
'exec': hasher(),
|
||||||
|
'file': hasher(),
|
||||||
'network': hasher(),
|
'network': hasher(),
|
||||||
'path': hasher(),
|
|
||||||
'pivot_root': hasher(),
|
'pivot_root': hasher(),
|
||||||
'ptrace': hasher(),
|
'ptrace': hasher(),
|
||||||
'signal': hasher(),
|
'signal': hasher(),
|
||||||
@@ -339,7 +339,7 @@ class ReadLog:
|
|||||||
return
|
return
|
||||||
|
|
||||||
elif self.op_type(e) == 'file':
|
elif self.op_type(e) == 'file':
|
||||||
FileRule.hashlog_from_event(self.hashlog[aamode][full_profile]['path'], e)
|
FileRule.hashlog_from_event(self.hashlog[aamode][full_profile]['file'], e)
|
||||||
|
|
||||||
elif e['operation'] == 'capable':
|
elif e['operation'] == 'capable':
|
||||||
CapabilityRule.hashlog_from_event(self.hashlog[aamode][full_profile]['capability'], e)
|
CapabilityRule.hashlog_from_event(self.hashlog[aamode][full_profile]['capability'], e)
|
||||||
|
Reference in New Issue
Block a user