From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2EEBC433DB for ; Mon, 21 Dec 2020 17:14:13 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4F329207CF for ; Mon, 21 Dec 2020 17:14:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F329207CF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=containers-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1E24422794; Mon, 21 Dec 2020 17:14:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r-ggVIi5uD4e; Mon, 21 Dec 2020 17:14:12 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 5963C2035D; Mon, 21 Dec 2020 17:14:12 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 476FFC1825; Mon, 21 Dec 2020 17:14:12 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8B2FBC0893 for ; Mon, 21 Dec 2020 17:14:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 7ADF6862CA for ; Mon, 21 Dec 2020 17:14:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tXM9Eq6jdK3v for ; Mon, 21 Dec 2020 17:14:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 40E9B86356 for ; Mon, 21 Dec 2020 17:14:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608570848; 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=CczDjTnNPX7GnlWUkmAMHUN5Cnid8AKHMRcnNJiF8RtnAIvKwqAJ0ejYyxB5rFzLpNXoF0 LJUZhP8kD4Y2y5hFO4xsTLi+5IPmhHXDJ9wHTf7y7WjXow0k4zNC/zIO/T5RQzANQKCBPp mIkuBMPwkRe5jUOsQRtSpgQDHtQ9gDU= 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 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 Cc: Richard Guy Briggs , Eric Paris , mpatel@redhat.com, Neil Horman X-BeenThere: containers@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux Containers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: containers-bounces@lists.linux-foundation.org Sender: "Containers" 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 _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/containers From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1847EC433E6 for ; Mon, 21 Dec 2020 17:15:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D905722CAF for ; Mon, 21 Dec 2020 17:15:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726033AbgLURP2 (ORCPT ); Mon, 21 Dec 2020 12:15:28 -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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BDA8C433E0 for ; Mon, 21 Dec 2020 17:14:00 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AD06A207CF for ; Mon, 21 Dec 2020 17:13:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD06A207CF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=tempfail smtp.mailfrom=linux-audit-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608570838; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=tkh0gsSYo1k/Im9/m+6Q3mHxYXGUC2Rbm1nNBk1KhWE=; b=GJ6jEwrWnfIxc7mcVkhSOdq2oOqzvO/FbBchdpQvLSV7ljzuxKZPKJbMsfFZWUIg3cE2EF qf3ypoiMQRVf+Lck4K62LCPLki7NnuerimkK+OFSzutax/v3/UXJA0QbjlFeDOSRVcn0F3 FF56XoxtpCUmRwQKqf2GOLB54Bgf9nk= 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-385-PrG6ACwHO1OFu7_tAexm6g-1; Mon, 21 Dec 2020 12:13:56 -0500 X-MC-Unique: PrG6ACwHO1OFu7_tAexm6g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C1AE1100558A; Mon, 21 Dec 2020 17:13:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ADFE15C1D1; Mon, 21 Dec 2020 17:13:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8ED274A7C6; Mon, 21 Dec 2020 17:13:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0BLHDqEf019052 for ; Mon, 21 Dec 2020 12:13:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id AC4CA5D9DB; 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 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 X-loop: linux-audit@redhat.com Cc: Richard Guy Briggs , Eric Paris , mpatel@redhat.com, Neil Horman X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=linux-audit-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 -- Linux-audit mailing list Linux-audit@redhat.com https://www.redhat.com/mailman/listinfo/linux-audit