Linux-audit Archive mirror
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: Linux-audit@redhat.com, linux-audit@redhat.com
Cc: avtanshgupta1995@gmail.com
Subject: Re: Identify whether the kernel version supports Path based exclusion
Date: Tue, 10 Jan 2023 10:15:58 -0500	[thread overview]
Message-ID: <5902815.lOV4Wx5bFT@x2> (raw)
In-Reply-To: <CAPoNrttQd+ieQ+B93SbrbiPjppRoiyT_a+7FpiRdQNGQ2ApiXQ@mail.gmail.com>

Hello,

On Tuesday, January 10, 2023 7:08:12 AM EST Anurag Aggarwal wrote:
> I need a method to identify whether the audid version a kernel is running
> supports path based exclusions.

It's not dependant on auditd. The kernel itself decides if a rule is valid.
 
> One option would be to use audit_add_rule_data to add a temporary path
> based rule and check if it is successful, but this won't work when auditd
> is running in immutable mode.
> 
> Any other way which does not require checking versions of Kernel or
> Distribution?

If you are looking to see if this is supported

-a always,exclude  -F exec=/usr/bin/ls

then it can be detected by:

uint32_t features = audit_get_features();
if ((features & AUDIT_FEATURE_BITMAP_EXCLUDE_EXTEND) == 0)
    puts("not supported");
else
    puts("supported");

-Steve


--
Linux-audit mailing list
Linux-audit@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-audit


      parent reply	other threads:[~2023-01-10 15:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 12:08 Identify whether the kernel version supports Path based exclusion Anurag Aggarwal
2023-01-10 14:55 ` Casey Schaufler
2023-01-10 15:15 ` Steve Grubb [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5902815.lOV4Wx5bFT@x2 \
    --to=sgrubb@redhat.com \
    --cc=Linux-audit@redhat.com \
    --cc=avtanshgupta1995@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).