From: Steve Grubb <sgrubb@redhat.com>
To: linux-audit@redhat.com
Subject: Re: Interface between the plugin and auditdispacher
Date: Wed, 16 Dec 2009 11:31:08 -0500 [thread overview]
Message-ID: <200912161131.09121.sgrubb@redhat.com> (raw)
In-Reply-To: <246d04460912160645y3ce3e814k94fa692d9c11295a@mail.gmail.com>
On Wednesday 16 December 2009 09:45:07 am 陈洁丹 wrote:
> I want to write some plugin to do something , but I still do not have a
> clear view of the interface between the plugin and dispacher.
The source code tarball ships with a sample plugin and you can also read it
online:
https://fedorahosted.org/audit/browser/trunk/contrib/plugin
The events are written to stdin of the plugin by the dispatcher. Each plugin
has a configuration file that should be installed to /etc/audisp/plugins.d/ with
a defined format.
One of the items tells audispd whether to send the event in binary format as
the dispatcher itself received it or if it should be changed to string format.
If you chose binary, then you are responsible to check the version number of
the event to make sure that you handle future versions of the event format.
So, I would recommend to people to write plugins that expect string format
since that is most portable.
If you choose string format, then you get the benefit of being able to use the
audit parsing library. And you can debug your plugin by creating a raw audit
event log and cat'ing it to the plugin's stdin. For example if your plugin
does something when someone accesses passwd, you can make a raw log like this:
ausearch --start today -f passwd --raw > test.log
then debug like:
cat test.log | ./my-app
Hope this helps...
-Steve
prev parent reply other threads:[~2009-12-16 16:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-16 14:45 Interface between the plugin and auditdispacher 陈洁丹
2009-12-16 16:31 ` 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=200912161131.09121.sgrubb@redhat.com \
--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.