From: Steve Grubb <sgrubb@redhat.com>
To: "linux-audit@redhat.com" <linux-audit@redhat.com>
Subject: Re: Query regarding the lib audit-userspace
Date: Tue, 13 Sep 2022 13:25:44 -0400 [thread overview]
Message-ID: <4750802.GXAFRqVoOG@x2> (raw)
In-Reply-To: <PU4P216MB1072AC37DE4DE0C9E285F6BDFB479@PU4P216MB1072.KORP216.PROD.OUTLOOK.COM>
Hello,
On Tuesday, September 13, 2022 12:53:32 PM EDT Manojkiran Eda wrote:
> I was working on leveraging the libaudit shared library to generate audit
> events from a user space daemon. I have been using the audit_open as well
> as audit_log_acct_message() API’s to send message to the kernel audit
> subsystem.
audit_log_acct_message() is meant to send events related to a user's
account. For example, pam and shadow-utils uses it.
> From the man pages I understand that every message to the
> kernel audit subsystem would get an ACK back.
Yes. This is to let you know if there was a problem such as lack of
permissions.
> Now my question is does the daemon[single threaded] consuming this libaudit
> for sending events using audit_log_acct_message() API be blocked until it
> gets an ACK back from the kernel ?
Yes. In general, sending audit events should be rare.
> If yes , is there a way to not have the application blocked during this
> period ?
The requirements that we normally need to adhere to is that if the audit
event fails, then whatever the user was going to do needs to be prevented. If
you really need to keep moving, send the event on it's own thread so that
your application is not waiting. For example, sshd forks the user session so
that it can keep processing other logins. But on that fork, it waits for the
responses to make it easier to tear down the session if sending an audit
event fails.
Or, another approach would be to write the whole thing down to calling sendto
and then you can wait however you want. I think putting on it's own thread is
simplest. But as I said in the beginning, should there be a problem logging
the event, can you undo whatever the event was for if you keep going?
-Steve
--
Linux-audit mailing list
Linux-audit@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-audit
next prev parent reply other threads:[~2022-09-13 17:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-13 16:53 Query regarding the lib audit-userspace Manojkiran Eda
2022-09-13 17:25 ` Steve Grubb [this message]
2022-09-14 8:40 ` Manojkiran Eda
2022-09-16 21:03 ` Burn Alting
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=4750802.GXAFRqVoOG@x2 \
--to=sgrubb@redhat.com \
--cc=linux-audit@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.