From f5add27aaa92c00cb057a763b0dc0b75f453713e Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 28 Apr 2019 16:24:18 +0200 Subject: [PATCH] rename 'netdomain' log events to 'network' to match rule name --- utils/apparmor/aa.py | 8 ++++---- utils/apparmor/logparser.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/apparmor/aa.py b/utils/apparmor/aa.py index 566746aed..ce2ff9bed 100644 --- a/utils/apparmor/aa.py +++ b/utils/apparmor/aa.py @@ -1277,8 +1277,8 @@ def handle_children(profile, hat, root): if domainchange == 'change': return None - elif typ == 'netdomain': - # If netdomain we (should) have pid, profile, hat, program, mode, network family, socket type and protocol + elif typ == 'network': + # If network we (should) have pid, profile, hat, program, mode, network family, socket type and protocol pid, p, h, prog, aamode, family, sock_type, protocol = entry[:8] if not regex_nullcomplain.search(p) and not regex_nullcomplain.search(h): @@ -1287,7 +1287,7 @@ def handle_children(profile, hat, root): if not hat or not profile: continue if family and sock_type: - prelog[aamode][profile][hat]['netdomain'][family][sock_type] = True + prelog[aamode][profile][hat]['network'][family][sock_type] = True return None @@ -1992,7 +1992,7 @@ def collapse_log(): log_dict[aamode][profile][hat]['dbus'].add(dbus_event) - nd = prelog[aamode][profile][hat]['netdomain'] + nd = prelog[aamode][profile][hat]['network'] for family in nd.keys(): for sock_type in nd[family].keys(): net_event = NetworkRule(family, sock_type, log_event=True) diff --git a/utils/apparmor/logparser.py b/utils/apparmor/logparser.py index 20b82b9ec..5676dacf3 100644 --- a/utils/apparmor/logparser.py +++ b/utils/apparmor/logparser.py @@ -295,7 +295,7 @@ class ReadLog: arrayref.append(ia) elif self.op_type(e) == 'net': - return(e['pid'], e['parent'], 'netdomain', + return(e['pid'], e['parent'], 'network', [profile, hat, prog, aamode, e['family'], e['sock_type'], e['protocol']]) elif e['operation'] == 'change_hat': return(e['pid'], e['parent'], 'unknown_hat',