From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Grubb Subject: Re: Question about excluding rules Date: Fri, 21 Feb 2020 08:53:35 -0500 Message-ID: <2890955.nCKnN53pJf@x2> References: <3341724.7X2qyikPX2@x2> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: Moshe Rechtman Cc: linux-audit@redhat.com List-Id: linux-audit@redhat.com On Friday, February 21, 2020 2:32:58 AM EST Moshe Rechtman wrote: > Thanks so much for your help! I've included your suggested filter in > audit.rules as shown below: > > # cat audit.rules1 > > 1 # This file contains the auditctl rules that are loaded > 2 # whenever the audit daemon is started via the initscripts. > 3 # The rules are simply the parameters that would be passed > 4 # to auditctl. > 5 # First rule - delete all > 6 -D > 7 # Increase the buffers to survive stress events. > 8 # Make this bigger for busy systems > 9 -b 320 > 10 ### Feel free to add below this line. See auditctl man page > 11 -a exit,always -F arch=b64 -F euid=0 -S execve -k rootact > 12 -a exit,always -F arch=b32 -F euid=0 -S execve -k rootact > 13 -a exit,always -F arch=b64 -F euid>=500 -S execve -k useract > 14 -a exit,always -F arch=b32 -F euid>=500 -S execve -k useract > 15 -a exit,always -F arch=b64 -F euid=0 -F auid!=unset -S execve -k > rootact > 16 -a exit,always -F arch=b32 -F euid=0 -F auid!=unset -S execve -k > rootact It won't work this way. You now have 2 sets of rootact. The audit rule engine is a first match wins. So, this second set of rules will never trigger. The rule I mentioned was supposed to replace the rule in the list. > After restarting the auditd service following error received: > > # service auditd restart > Stopping auditd: [ OK ] > Starting auditd: [ OK ] > Unknown user: unset > -F unknown field: auid OK. I guess this is really old. Then make it auid=-1 -Steve 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=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 823ABC35656 for ; Fri, 21 Feb 2020 13:53:51 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3C661222C4 for ; Fri, 21 Feb 2020 13:53:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ThYXG8+A" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C661222C4 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=1582293230; 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=ijE/f7/X3Oe+jlg4CTpJFG1dZSNO6aXkx0UEiKlPMQg=; b=ThYXG8+AZgT1tTE3WU07TvZv3RbdHpBR3YJyT4J18movomy6IwdpqTUuDzyonbWDhHe4WA IJkb2J1mWmI5I4Qv7wIpL7Y0c2RH1RhAB7Aj6h1bXh+s8IdU+FP+daXyCiizZl7CR+3hPE myJMhWdgjjeTtXBYrss9URMchjq5UtA= 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-205-nVKM2k--MBW8tWjf8-YMKA-1; Fri, 21 Feb 2020 08:53:48 -0500 X-MC-Unique: nVKM2k--MBW8tWjf8-YMKA-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 2EB888010F2; Fri, 21 Feb 2020 13:53:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 35F375C21B; Fri, 21 Feb 2020 13:53:42 +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 C39501832DA3; Fri, 21 Feb 2020 13:53:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 01LDrd53032751 for ; Fri, 21 Feb 2020 08:53:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id 86E4090F71; Fri, 21 Feb 2020 13:53:39 +0000 (UTC) Received: from x2.localnet (ovpn-117-45.phx2.redhat.com [10.3.117.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9467D90F69; Fri, 21 Feb 2020 13:53:36 +0000 (UTC) From: Steve Grubb To: Moshe Rechtman Subject: Re: Question about excluding rules Date: Fri, 21 Feb 2020 08:53:35 -0500 Message-ID: <2890955.nCKnN53pJf@x2> Organization: Red Hat In-Reply-To: References: <3341724.7X2qyikPX2@x2> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: linux-audit@redhat.com Cc: linux-audit@redhat.com 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.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-ID: <20200221135335.zGSShHZ02_TsAWbUkSJ-vMEkln3TmmxJZiQRDHXzi4I@z> On Friday, February 21, 2020 2:32:58 AM EST Moshe Rechtman wrote: > Thanks so much for your help! I've included your suggested filter in > audit.rules as shown below: > > # cat audit.rules1 > > 1 # This file contains the auditctl rules that are loaded > 2 # whenever the audit daemon is started via the initscripts. > 3 # The rules are simply the parameters that would be passed > 4 # to auditctl. > 5 # First rule - delete all > 6 -D > 7 # Increase the buffers to survive stress events. > 8 # Make this bigger for busy systems > 9 -b 320 > 10 ### Feel free to add below this line. See auditctl man page > 11 -a exit,always -F arch=b64 -F euid=0 -S execve -k rootact > 12 -a exit,always -F arch=b32 -F euid=0 -S execve -k rootact > 13 -a exit,always -F arch=b64 -F euid>=500 -S execve -k useract > 14 -a exit,always -F arch=b32 -F euid>=500 -S execve -k useract > 15 -a exit,always -F arch=b64 -F euid=0 -F auid!=unset -S execve -k > rootact > 16 -a exit,always -F arch=b32 -F euid=0 -F auid!=unset -S execve -k > rootact It won't work this way. You now have 2 sets of rootact. The audit rule engine is a first match wins. So, this second set of rules will never trigger. The rule I mentioned was supposed to replace the rule in the list. > After restarting the auditd service following error received: > > # service auditd restart > Stopping auditd: [ OK ] > Starting auditd: [ OK ] > Unknown user: unset > -F unknown field: auid OK. I guess this is really old. Then make it auid=-1 -Steve -- Linux-audit mailing list Linux-audit@redhat.com https://www.redhat.com/mailman/listinfo/linux-audit