Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4314091pxu; Mon, 21 Dec 2020 09:17:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzDC3FMO7kjGItQrNh3SkAZ2038ZD0bZ0K44rTvhzEOnqYwTxO87m/gDhgKDSs09dhqAEWQ X-Received: by 2002:a17:906:f1c8:: with SMTP id gx8mr16590334ejb.524.1608571060229; Mon, 21 Dec 2020 09:17:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608571060; cv=none; d=google.com; s=arc-20160816; b=EEDC7Sp0sx6bQhbsHs00JNnm1iLccui8dUVBW0+0/sMNtq7rveMLitLup0nzgsnh7a 7TMaWPcwhXF+PeRcZbDLRqCtecmcfjUOxCFbdspC7cpUoE8IRw/EYJzQlXlJoaAOJYwh 9z+mKecUCqGwnptymc6Uf9DiP8Xip0Q7PbiEFLpa2hm/z8hH2B/HecF6qxJUkQaYIuMd 7dltlid7QityP0KJiin4ywH2fM7JrdrtRlr3D5VgtamiwsBIH89bACRuZnQ+mD3yLob+ fQLlI5r4yAYWhaSQwWQqtRAxMhKLxX6DR46BdfhcYLjkLhov1K66ULDaclyp6s6gsVVg UBJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=pBUIaD5ZX3HjlBttwF30XgsY+rebNFqJvFLW0AAzsQM=; b=QYR9nekzymIlxGf5rLXtQ3JAp9VJtDG3+w2f334kmc9RKCdHQ3uhQWWiiKgAxBMk2k jnQxlBNrbOgVOrfvVshHE7X24V/dYxDA/gssGbbmube4g6EqegQWsOYn57Wgp8YL+7eX G6VMaaJSe1S5X/GAUTLhl1qWc7kC10swCEhIEAqg5cufuigWe3bUhqhRvzjfTvd3EH+H /hrAlZkyI5BRmhxmLXm1/fZZ6hvb+BG+E3QRKwD8vPd1rLdqcTXVHI5CmujuZpaOOII3 kDvLSgfCAtWpEJBHG0wmgFDskPuPSEUyB8YHkQuXXEl+i2LoslBqNU8yayRF3AL92PSl Fciw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U5ENR9pI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i24si10900020edg.295.2020.12.21.09.17.17; Mon, 21 Dec 2020 09:17:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=U5ENR9pI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726024AbgLURP1 (ORCPT + 99 others); Mon, 21 Dec 2020 12:15:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20872 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbgLURP1 (ORCPT ); Mon, 21 Dec 2020 12:15:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608570841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=pBUIaD5ZX3HjlBttwF30XgsY+rebNFqJvFLW0AAzsQM=; b=U5ENR9pIhAcFYgsZj85kDl3RtlDJsYnw8QBF8qoYoj2PLpc9r14zHc/DKH++FrI1q9IV7l WWcQmZeWsD+Q6ipm9OIaPxr62i7TLPrScUOtPjOezLJJXsd6FptH13OfEzaxQRY9pKBf7G Dudy5uMI8pYOyK6xJIiUHyboS6K3Frk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-441-dz2drgCNMIiCnn1yVQftDA-1; Mon, 21 Dec 2020 12:13:54 -0500 X-MC-Unique: dz2drgCNMIiCnn1yVQftDA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ADABD59; Mon, 21 Dec 2020 17:13:52 +0000 (UTC) Received: from madcap2.tricolour.ca (unknown [10.10.110.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 36AE05D9CA; Mon, 21 Dec 2020 17:13:48 +0000 (UTC) From: Richard Guy Briggs To: Linux Containers List , Linux-Audit Mailing List , LKML Cc: Neil Horman , Eric Paris , mpatel@redhat.com, Richard Guy Briggs Subject: [PATCH ghau51/ghau40 v10 05/11] start normalization containerid support Date: Mon, 21 Dec 2020 12:12:45 -0500 Message-Id: <20201221171251.2610890-6-rgb@redhat.com> In-Reply-To: <20201221171251.2610890-1-rgb@redhat.com> References: <20201221171251.2610890-1-rgb@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Richard Guy Briggs --- auparse/auparse-defs.h | 3 ++- auparse/interpret.c | 10 ++++++++++ auparse/normalize_record_map.h | 2 ++ auparse/typetab.h | 2 ++ bindings/python/auparse_python.c | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/auparse/auparse-defs.h b/auparse/auparse-defs.h index 27bfa943612c..a9b144df3462 100644 --- a/auparse/auparse-defs.h +++ b/auparse/auparse-defs.h @@ -87,7 +87,8 @@ typedef enum { AUPARSE_TYPE_UNCLASSIFIED, AUPARSE_TYPE_UID, AUPARSE_TYPE_GID, AUPARSE_TYPE_PROCTITLE, AUPARSE_TYPE_HOOK, AUPARSE_TYPE_NETACTION, AUPARSE_TYPE_MACPROTO, AUPARSE_TYPE_IOCTL_REQ, AUPARSE_TYPE_ESCAPED_KEY, - AUPARSE_TYPE_ESCAPED_FILE, AUPARSE_TYPE_FANOTIFY } auparse_type_t; + AUPARSE_TYPE_ESCAPED_FILE, AUPARSE_TYPE_FANOTIFY, AUPARSE_TYPE_CONTID +} auparse_type_t; /* This type determines what escaping if any gets applied to interpreted fields */ typedef enum { AUPARSE_ESC_RAW, AUPARSE_ESC_TTY, AUPARSE_ESC_SHELL, diff --git a/auparse/interpret.c b/auparse/interpret.c index e23c3533877b..14fcc72148c8 100644 --- a/auparse/interpret.c +++ b/auparse/interpret.c @@ -2843,6 +2843,13 @@ static const char *print_seccomp_code(const char *val) return out; } +static const char *print_contid(const char *val) +{ + if (strcmp(val, "18446744073709551615") == 0 || strcmp(val, "-1") == 0) + return strdup("unset"); + return strdup(val); +} + int lookup_type(const char *name) { int i; @@ -3083,6 +3090,9 @@ unknown: case AUPARSE_TYPE_FANOTIFY: out = print_fanotify(id->val); break; + case AUPARSE_TYPE_CONTID: + out = print_contid(id->val); + break; case AUPARSE_TYPE_MAC_LABEL: case AUPARSE_TYPE_UNCLASSIFIED: default: diff --git a/auparse/normalize_record_map.h b/auparse/normalize_record_map.h index c2d76e406b0f..1bb4c9ac6a95 100644 --- a/auparse/normalize_record_map.h +++ b/auparse/normalize_record_map.h @@ -25,6 +25,7 @@ _S(AUDIT_USER, "sent-message") _S(AUDIT_LOGIN, "changed-login-id-to") +_S(AUDIT_CONTAINER_OP, "changed-container-id-to") _S(AUDIT_USER_AUTH, "authenticated") _S(AUDIT_USER_ACCT, "was-authorized") _S(AUDIT_USER_MGMT, "modified-user-account") @@ -84,6 +85,7 @@ _S(AUDIT_FEATURE_CHANGE, "changed-audit-feature") //_S(AUDIT_REPLACE,"") _S(AUDIT_KERN_MODULE, "loaded-kernel-module") _S(AUDIT_FANOTIFY, "accessed-policy-controlled-file") +_S(AUDIT_CONTAINER_ID, "has-container-id") _S(AUDIT_AVC, "accessed-mac-policy-controlled-object") _S(AUDIT_MAC_POLICY_LOAD, "loaded-selinux-policy") _S(AUDIT_MAC_STATUS, "changed-selinux-enforcement-to") diff --git a/auparse/typetab.h b/auparse/typetab.h index 0391e87f731c..0c160bb56c3b 100644 --- a/auparse/typetab.h +++ b/auparse/typetab.h @@ -142,3 +142,5 @@ _S(AUPARSE_TYPE_IOCTL_REQ, "ioctlcmd" ) _S(AUPARSE_TYPE_FANOTIFY, "resp" ) _S(AUPARSE_TYPE_ESCAPED, "sw" ) _S(AUPARSE_TYPE_ESCAPED, "root_dir" ) +_S(AUPARSE_TYPE_CONTID, "contid" ) +_S(AUPARSE_TYPE_CONTID, "old-contid" ) diff --git a/bindings/python/auparse_python.c b/bindings/python/auparse_python.c index 1ba59cf78527..947d018cf594 100644 --- a/bindings/python/auparse_python.c +++ b/bindings/python/auparse_python.c @@ -2376,6 +2376,7 @@ initauparse(void) PyModule_AddIntConstant(m, "AUPARSE_ESC_TTY", AUPARSE_ESC_TTY); PyModule_AddIntConstant(m, "AUPARSE_ESC_SHELL", AUPARSE_ESC_SHELL); PyModule_AddIntConstant(m, "AUPARSE_ESC_SHELL_QUOTE", AUPARSE_ESC_SHELL_QUOTE); + PyModule_AddIntConstant(m, "AUPARSE_TYPE_CONTID", AUPARSE_TYPE_CONTID); #ifdef IS_PY3K return m; -- 2.18.4