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 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 18B6FC7EE2A for ; Tue, 6 Jun 2023 19:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686078541; 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=9t+IbNlS4g540UNQ6/7+6WbegR3cfeUQt6dk+E1O6to=; b=FAr474YUhw/wNjhea89qttgrwr2dSRRW5DEs/2/c8Pme5oQV5wvI8El0UBM1KEqGfGPI54 nLW9Q3P8TPu8RsE924yyWjO0objWDcRfjh7ljHnS514330yDaO3d5DjbmCYAPrRLJk4AKr /egOf9XosNswvcKNJ3UQINZlDrQ3Z2Q= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-205-hfUZne6PNW2wlsiz3RtjIA-1; Tue, 06 Jun 2023 15:08:58 -0400 X-MC-Unique: hfUZne6PNW2wlsiz3RtjIA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 081E2101A53A; Tue, 6 Jun 2023 19:08:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF253140E954; Tue, 6 Jun 2023 19:08:54 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7CAF31946A45; Tue, 6 Jun 2023 19:08:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B988E19465BD for ; Tue, 6 Jun 2023 19:08:48 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A1B44140E958; Tue, 6 Jun 2023 19:08:48 +0000 (UTC) Received: from x2.localnet (unknown [10.22.33.211]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6AEBA140E954; Tue, 6 Jun 2023 19:08:48 +0000 (UTC) From: Steve Grubb To: Richard Guy Briggs , linux-audit@redhat.com Subject: Re: Comprehensive Documentation on the Linux Audit Framework Date: Tue, 06 Jun 2023 15:08:47 -0400 Message-ID: <10292049.nUPlyArG6x@x2> Organization: Red Hat In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-BeenThere: linux-audit@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Audit Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vincent Abraham Errors-To: linux-audit-bounces@redhat.com Sender: "Linux-audit" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Tuesday, June 6, 2023 6:31:55 PM EDT Vincent Abraham wrote: > Thanks. Could you also point to portions in the codebase where these > functions are called for monitoring file access? I'll let Richard or Paul point to the place in the kernel if that's necessary. I think there's a fundamental mismatch and it might not matter. > The reason I'm asking for this is that I'm trying to provide auditing for > files of a specific type and I'm trying to understand how would that work. The way the audit system works is there is a rule engine in the kernel. User space loads the rules and and listens for events. The kernel does all the work. This rule matching can be done by a limited set of attributes which for a file would be path, kind of access, who is accessing it, program accessing it, portions of se linux labeling, and a few other things. You cannot match by type or anything that looks like a glob. You can arrange them in a directory and watch the whole directory. You can create a script that looks for files of a certain type and load rules specifically for them into the kernel (with a specific key so you can find them later). Or you can plug into auditd as a plugin and filter the events and write them to your own log. There might be some other approaches such as using fanotify and filtering those events yourself. -Steve -- Linux-audit mailing list Linux-audit@redhat.com https://listman.redhat.com/mailman/listinfo/linux-audit