<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><br>Hi Steve (and others),<br><br>Many thanks for the presentation, it has been very helpful. I have started to work on a simple plugin in Python, but I got a bit stuck again.<br>At the moment it just logs all data on STDIN to a file in /tmp.<br><br>Right now the system is set up such that on the client server the audit data gets sent to my central server using audisp + audisp-remote.<br>The central server receives the data using auditd, logs it /var/log/audit/audit.log and sends it to audisp, which in turn sends it to my plugin.<br>I can see  audit events from both my client and central server being written in /var/log/audit/audit.log, as expected. The two are easily extinguished by the node names. <br><br>However, in my plugin I only  seems to receive data from the central (i.e. local) server... I draw this conclusion both because I see only one node name, and also because I generate TTY events on the client server only (and they show in /var/log/audit/audit.log as expected), and these do not show in the output from my plugin.<br>Is this the expected behaviour? Are plugins only supposed to receive the locally generated audit events?<br>If it is, is there a way to forward the remotely generated data to a plugin on the central server?<br><br>Any help would be much appreciated.<br><br><br>Many thanks,<br><br>Wouter <br><br><div><hr id="stopSpelling">From: woutervanverre@outlook.com<br>To: sgrubb@redhat.com; linux-audit@redhat.com<br>Subject: RE: Remote logging with autitd<br>Date: Sun, 2 Nov 2014 22:16:31 +0100<br><br>

<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}

.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}

--></style>
<div dir="ltr">Hi Steve,<br><br>Many thanks for your response.<br>I will be reading the presentation and the examples in the tarball and go from there for implementing my processing plugin.<br><br>Regarding the logging to disk on the central server: <br>I have node names set up for both servers now and am now getting the following behaviour:<br>   On the client server I can see the events being prefixed with node=Elephant in the log on that server. <br>   On the central server I can see that local events are being prefixed with node=Mongoose.<br>   However, events that were sent to the central server by the client server show up in the central server's log with <br>   node=localhost.localdomain. So it seems that the node information gets lost between the client and central server?<br><br>Would you have any idea why the node information is lost?<br><br><br>Many thanks,<br><br>Wouter<br><br><div>> From: sgrubb@redhat.com<br>> To: linux-audit@redhat.com<br>> CC: woutervanverre@outlook.com<br>> Subject: Re: Remote logging with autitd<br>> Date: Sun, 2 Nov 2014 13:12:53 -0500<br>> <br>> On Saturday, November 01, 2014 10:49:24 PM Wouter van Verre wrote:<br>> > Hi all,<br>> > <br>> > I am trying to set up logging using the audit framework, but I have some<br>> > questions about how the system works and how the components fit together.<br>> <br>> This presentation is a pretty good overview, see slide 5:<br>> http://people.redhat.com/sgrubb/audit/audit_ids_2011.pdf<br>> <br>> <br>> > My use case is as follows:<br>> > * I would like to have one or more servers on my network capturing data,<br>> > including TTY sessions.<br>> > * I would then like to have these servers (the 'client servers') submit the<br>> > data to another server on the network (the 'central server').<br>> > * This central server would then write the incoming data to disk, and do<br>> > some processing on the data as well.<br>> > <br>> > My current idea on how to implement this is to:<br>> > * Run auditd + audisp + audisp-remote on every client server.<br>> > * Use pam_tty_audit.so on every client server for the TTY logging.<br>> > * Run auditd on the central server to receive the data and write it to disk.<br>> > * Either implement my processing tool such that it can be used instead of<br>> > the dispatcher, or implement it as a plugin for audisp?<br>> <br>> Sure. If necessary in realtime. That same presentation referenced about also <br>> gives an introduction to the auparse library.<br>> <br>>  <br>> > I'd love some feedback on whether this set up makes sense. In particular on<br>> > whether receiving the data with auditd on the central server is the best<br>> > way to go? And on which option is recommended for implementing the<br>> > processing tool? I would think that a custom plugin for audisp would be<br>> > best? If so, is there any documentation on how to go about implementing a<br>> > plugin for audisp that I could read?<br>> > <br>> > I have already experimented with this set up a bit, and have come to the<br>> > conclusion that I am not sure how things work... I have implemented a<br>> > single client running auditd + audisp + audisp-remote with logging of TTY<br>> > session (using pam_tty_audit.so), and a central server running auditd (with<br>> > auditd configured to listen to port 60).<br>> > <br>> > This seems to work to an extent:<br>> > * On the client server all the data is logged to /var/log/audit/audit.log<br>> > and I can see it there.<br>> > * On the client server I can run "aureport --tty" and I will see the TTY<br>> > session data represented more easily. <br>> > * When I am on the central server I can run "aureport --tty" and see the TTY<br>> > session data for session on the client server. My conclusion based on this<br>> > is that the central server must be receiving and storing data properly?<br>> <br>> Yes, that sounds right. I'd also mention that if you are doing central <br>> logging, you need to tell audispd or auditd that you want the node name <br>> prepended to the event so that at the aggregating server you can tell the <br>> difference.<br>> <br>> <br>> > * However, when I look at /var/log/audit/audit.log on the central server I<br>> > can only see audit data for that server.<br>> <br>> My first guess is that you don't have the client adding node information. That <br>> makes it a lot clearer. You should able to search using --node to locate the <br>> records from the client.<br>> <br>> <br>> > So my question is, where does the audit data from the client server get <br>> stored?<br>> <br>> In the aggregating server's directory.<br>> <br>> > * When I connect a very simple program to the auditd daemon (instead of the<br>> > default dispatcher) it doesn't seem to receive any input at the moment, even<br>> > though "aureport --tty" is showing that the daemon has been receiving data<br>> > in the mean time...<br>> <br>> The preferred way of adding analytical applications to make it am auditspd <br>> plugin. You could make it a dispatcher if you want, but the interface is a bit <br>> different. The audit tar ball should have an example program of both kinds.<br>> <br>> -Steve<br></div>                                           </div>
<br>--
Linux-audit mailing list
Linux-audit@redhat.com
https://www.redhat.com/mailman/listinfo/linux-audit</div>                                           </div></body>
</html>