Foreman Plugin to Access Foreman Audit

I have a Foreman 1.9.0 system using postgres as the back end on RHEL 7.2.

A requirement has come up to be able to send the Foreman audit log to log
file for forwarding to a remote server.

I have been looking on the web and haven't been able to find out if this is
possible.

The ideal output solution would be XML but syslog message format would
suffice.

I could potentially create a plugin to do this and was wondering if this
has been done previously

and if it had could I be pointed to a repository where the code exists.

I am new to Ruby and anything existing would be a good starting point

There is none listed under Plugins on the Foreman website

Barry

Hi Barry,

AFAIK there is no similar plugin existing.
A good starting point would be the plugin template [1] which shows several
samples of extension points for plugins.
You can take a look at [2] for an example of how you can extend existing
models - I'm guessing that a good approach would be to add an after_save
callback on the Audit model that sends the audit to wherever you need it.
Good luck!

[1] https://github.com/theforeman/foreman_plugin_template
[2]
https://github.com/theforeman/foreman_plugin_template/blob/master/lib/foreman_plugin_template/engine.rb#L62

··· On Wed, Jun 8, 2016 at 2:28 PM, barry wrote:

I have a Foreman 1.9.0 system using postgres as the back end on RHEL 7.2.

A requirement has come up to be able to send the Foreman audit log to log
file for forwarding to a remote server.

I have been looking on the web and haven’t been able to find out if this
is possible.

The ideal output solution would be XML but syslog message format would
suffice.

I could potentially create a plugin to do this and was wondering if this
has been done previously

and if it had could I be pointed to a repository where the code exists.

I am new to Ruby and anything existing would be a good starting point

There is none listed under Plugins on the Foreman website

Barry


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


Have a nice day,
Tomer Brisker
Red Hat Engineering

The foreman_audited_notifications plugin does something similar, but
outputs the audits to chat rooms.

You might find the source code at
https://github.com/frimik/foreman_audited_notifications useful if you're
planning to develop something new.

··· On 08/06/16 12:28, barry wrote: > I have a Foreman 1.9.0 system using postgres as the back end on RHEL 7.2. > > > A requirement has come up to be able to send the Foreman audit log to > log file for forwarding to a remote server. > > > I have been looking on the web and haven't been able to find out if this > is possible. > > The ideal output solution would be XML but syslog message format would > suffice. > > > I could potentially create a plugin to do this and was wondering if this > has been done previously > > and if it had could I be pointed to a repository where the code exists.


Dominic Cleal
dominic@cleal.org