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=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,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 EDA8EC433E0 for ; Tue, 4 Aug 2020 13:20:48 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A81032067D for ; Tue, 4 Aug 2020 13:20:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZIROklcV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A81032067D Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-audit-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596547247; 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=DahIoSyN9OXkNOEIY+7dkhC4ziPAKwVyNT7IejSdia0=; b=ZIROklcV02zY1Tdj58nU86ZUUMtLuthD+pNHW/sMLhUIU8obfF8giZD2CXMrx2ZKMv3+H9 SBwekBBATV+QcPXNpj+g8MNFv2gEpjM6hMj7K5JGHH5PTKoF7hi2IQE6Po/AGoG81a1i1O fe/8bEwKoW7L18m7TUYerGJr8u4MIeQ= 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-344-PzlzmdgONAKGSStf0Y60kg-1; Tue, 04 Aug 2020 09:20:41 -0400 X-MC-Unique: PzlzmdgONAKGSStf0Y60kg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8EB9C192376D; Tue, 4 Aug 2020 13:20:37 +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 B74DF7190D; Tue, 4 Aug 2020 13:20:36 +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 F1700A35BB; Tue, 4 Aug 2020 13:20:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 074DKVnx032188 for ; Tue, 4 Aug 2020 09:20:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4987F19C4F; Tue, 4 Aug 2020 13:20:31 +0000 (UTC) Received: from x2.localnet (ovpn-112-192.phx2.redhat.com [10.3.112.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 104802857F; Tue, 4 Aug 2020 13:20:28 +0000 (UTC) From: Steve Grubb To: linux-audit@redhat.com Subject: Re: Adding audit support to dpkg Date: Tue, 04 Aug 2020 09:20:27 -0400 Message-ID: <2036494.irdbgypaU6@x2> Organization: Red Hat In-Reply-To: <20200803225049.GA511687@thunder.hadrons.org> References: <20200803225049.GA511687@thunder.hadrons.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 074DKVnx032188 X-loop: linux-audit@redhat.com Cc: Guillem Jover 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: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, On Monday, August 3, 2020 6:50:49 PM EDT Guillem Jover wrote: > We got a request to add audit support to dpkg [R], and as initially > mentioned on the bug report it seems the AUDIT_SOFTWARE_UPDATE format > does not appear to be documented, so while looking into all this, got > several questions. >=20 > [R] >=20 > >From the rpm implementation and auparse/normalize.c I gather that it > would contain the following fields, applied to dpkg: >=20 > * primary field would be "sw" which would contain something like > =AB"nginx_1.18.0-5_amd64"=BB, I assume that the format differing from > the one in rpm is fine as that would be keyed on the next field? sure > * secondary field would be "sw_type" which would be =ABdpkg=BB. yes > * field "op", which would contain entries different to rpm, such as > =ABunpack=BB, =ABconfigure=BB, =ABinstall=BB, =ABremove=BB, =ABpurge= =BB, not sure if > that might be a problem? >>From compliance perspective, only install, update, and remove are relevant= .=20 You want to know when something gets added or removed because they could ad= d=20 setuid programs or daemons that autostart. Secondly, you may be tracking=20 current versions to resolve CVE's. So, for that purpose, you also want to= =20 know when something gets updated. Nothing else matters. How does unpack differ from install? How does purge differ from remove? The= re=20 is another event type, AUDIT_USYS_CONFIG, that tracks user space configurat= ion=20 changes. However, this is rarely used. Instead, what is done is watches are= =20 placed on important configuration files to see if anything opens the file f= or=20 modiciation. So, would there be any need to have a configuration option for= =20 SOFTWARE_UPDATE? > * field "key_enforce", I take to denote whether a cryptographic > verification has been performed on the .deb archive? With values > =AB0=BB or =AB1=BB. (This would depend on whether debsig-verify(1) ha= s > been configured to be executed or not.) This denotes whether signature checks is being enforced. This is independen= t=20 from whether or not the signature is valid. IOW, if a signature (next field= )=20 is invalid, will the package be allowed in anyway? > * field "gpg_res", to denote whether the aforementioned verification > succeeded or not? With values =AB0=BB or =AB1=BB. And while dpkg can = indeed > use GnuPG to verify signatures from archives, the name feels too > implementation specific, perhaps it could be renamed so that it > would not be very confusing, in case someone implements a check > based on say x509 certificates? This field is whether or not the package passes its verification with a has= h,=20 gpg signature, x509 certificate, or any other integrity scheme. > * field "root_dir", to denote the installation root directory, which > would map to dpkg --instdir value, with a value such as =AB"/"=BB. Yes. Rpms can be relocatable to anywhere. So, this is to document what part= =20 of the system the package will affect. > Anything else I might have missed or might be worth taking into > account while adding the support? I think that's pretty much it. If you wanted to see an example of the code= ,=20 it is here: https://github.com/rpm-software-management/rpm/blob/master/plugins/ audit.c#L80 -Steve -- Linux-audit mailing list Linux-audit@redhat.com https://www.redhat.com/mailman/listinfo/linux-audit