Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1807919ima; Thu, 25 Oct 2018 05:24:46 -0700 (PDT) X-Google-Smtp-Source: AJdET5d2ruM0L9RS2Om9KmKZxYBbwXyvJp01KNqnF7KWN47ZlZ1y+2PlwInnMlsZZLuDTZuFQ8vT X-Received: by 2002:a17:902:850b:: with SMTP id bj11-v6mr1346408plb.107.1540470286663; Thu, 25 Oct 2018 05:24:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540470286; cv=none; d=google.com; s=arc-20160816; b=nck5aKi6MVJvQR6bmiZZx728ja4pyI7CYcd1lBOe7TjHg848eRaUGRDmIhVl2a36tU cVrSNpdibhv5KcEDGXV1e1lYWTauOUvmywr292/TZ7px3Zy2zor4AcUgXF/9tCimG2+y RcGGH3SIpoKL0vQmlCksfPTHxe/v/K8lS5O8YY/nX9MS7tQxCb/oTlCqsRHu5I1ByZFr z5yJYeblT324ure/bnh01C03PSxaE/pw1zwatChF8brvghrQPU6llMV8hlc7+qXC5SZ3 vEb6Yd5eKL3riQHcK6MG0knRM1RzmMaYekucLqDvyNuBYsA2ZR9dSaY381RO/p2sid86 X2BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=B/NE5L1rxYsbsoOkKO9nqaf6tW/j9pBkZgvWXuIm0VM=; b=EPqaAQpDR3WL8OMMWdz2leqKj96a1Al6I1NM7tyiQA/SW4XbNkLLgyJapu/EUpKiL8 PmqgPF4b612MJKGQZUoB1cHAyUthscwOLBwXoX0vsJj0i7NAeVNi/pdqDf/OzV/6/56v JF8dEcA4z18zyChv1aTVsdaI8zVQNmXu+wItFi+JMJuZLqBaJIhUCuEfdaOQc3cwqV5o Pq5hrEjutIVQrBy6wMAACwY6sQPV4dCAN+NMEilVBIotOrA04mJiw62czrG1P8DiJEbe eEoAyv+OwTRCPsAACNGRhDVpl5HaIF40VFBT5iMjz6RDP5vvRUzQLCcI0LoXiNz8pQwv G50Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a17-v6si2941499pgf.443.2018.10.25.05.24.29; Thu, 25 Oct 2018 05:24:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727408AbeJYUzm (ORCPT + 99 others); Thu, 25 Oct 2018 16:55:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56805 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727228AbeJYUzl (ORCPT ); Thu, 25 Oct 2018 16:55:41 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id 63E4785362; Thu, 25 Oct 2018 12:23:09 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-24.phx2.redhat.com [10.3.112.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D188D5C1B5; Thu, 25 Oct 2018 12:22:55 +0000 (UTC) Date: Thu, 25 Oct 2018 08:22:52 -0400 From: Richard Guy Briggs To: Paul Moore Cc: containers@lists.linux-foundation.org, linux-api@vger.kernel.org, linux-audit@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, netfilter-devel@vger.kernel.org, ebiederm@xmission.com, luto@kernel.org, carlos@redhat.com, dhowells@redhat.com, viro@zeniv.linux.org.uk, simo@redhat.com, Eric Paris , Serge Hallyn Subject: Re: [PATCH ghak90 (was ghak32) V4 03/10] audit: log container info of syscalls Message-ID: <20181025122252.dsqcmkguuro3krzg@madcap2.tricolour.ca> References: <34017c395d03a213d6b0d49b9964429bd32b283d.1533065887.git.rgb@redhat.com> <20181024151439.lavhanabsyxdrdvo@madcap2.tricolour.ca> <20181025004255.zl7p7j6gztouh2hh@madcap2.tricolour.ca> <166a9dae538.280e.85c95baa4474aabc7814e68940a78392@paul-moore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <166a9dae538.280e.85c95baa4474aabc7814e68940a78392@paul-moore.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 25 Oct 2018 12:23:09 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-10-25 07:13, Paul Moore wrote: > On October 25, 2018 1:43:16 AM Richard Guy Briggs wrote: > > On 2018-10-24 16:55, Paul Moore wrote: > >> On Wed, Oct 24, 2018 at 11:15 AM Richard Guy Briggs wrote: > >>> On 2018-10-19 19:16, Paul Moore wrote: > >>>> On Sun, Aug 5, 2018 at 4:32 AM Richard Guy Briggs wrote: > > > > ... > > > > >>>> However, I do care about the "op" field in this record. It just > >>>> doesn't make any sense; the way you are using it it is more of a > >>>> context field than an operations field, and even then why is the > >>>> context important from a logging and/or security perspective? Drop it > >>>> please. > >>> > >>> I'll rename it to whatever you like. I'd suggest "ref=". The reason I > >>> think it is important is there are multiple sources that aren't always > >>> obvious from the other records to which it is associated. In the case > >>> of ptrace and signals, there can be many target tasks listed (OBJ_PID) > >>> with no other way to distinguish the matching audit container identifier > >>> records all for one event. This is in addition to the default syscall > >>> container identifier record. I'm not currently happy with the text > >>> content to link the two, but that should be solvable (most obvious is > >>> taret PID). Throwing away this information seems shortsighted. > >> > >> It would be helpful if you could generate real audit events > >> demonstrating the problems you are describing, as well as a more > >> standard syscall event, so we can discuss some possible solutions. > > > > If the auditted process is in a container and it ptraces or signals > > another process in a container, there will be two AUDIT_CONTAINER > > records for the same event that won't be identified as to which record > > belongs to which process or other record (SYSCALL vs 1+ OBJ_PID > > records). There could be many signals recorded, each with their own > > OBJ_PID record. The first is stored in the audit context and additional > > ones are stored in a chained struct that can accommodate 16 entries each. > > > > (See audit_signal_info(), __audit_ptrace().) > > > > (As a side note, on code inspection it appears that a signal target > > would get overwritten by a ptrace action if they were to happen in that > > order.) > > As requested above, please respond with real audit events generated by > this patchset so that we can discuss possible solutions. Ok, then we should be developping a test to test ptrace and signal auditting in general since we don't have current experience/evidence that those even work (or rip them out if not). > paul moore - RGB -- Richard Guy Briggs Sr. S/W Engineer, Kernel Security, Base Operating Systems Remote, Ottawa, Red Hat Canada IRC: rgb, SunRaycer Voice: +1.647.777.2635, Internal: (81) 32635