Project

General

Profile

Actions

Bug #11265

closed

Should foreman_hooks be able to deal with Audits?

Added by Martin Jackson over 8 years ago. Updated over 8 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

We have a use case (for compliance, with PCI specifically) where we want to forward Audits from our foreman hosts to an external syslog receiver.

It occurred to us to use foreman_hooks for this, but it appears that foreman_hooks do not get executed on the Audit model (either for before_create or after_create Rails events).

To reproduce:
1) Install foreman and the foreman_hooks plugin (v0.3.7); we use RHEL 6 on our foreman hosts
2) Create /usr/local/bin/log.sh as a straightforward shell script (e.g. logger -t HOOK "$0 $@")
3) Create ~foreman/config/hooks/audit/before_create/01_log.sh -> /usr/local/bin/log.sh

Observe that hooks are registered but that the hooks never fire:
2015-07-30 20:15:40 [D] Found hook to Audit#before_create, filename 01_log.sh
2015-07-30 20:15:40 [I] Finished registering 1 hooks for Audit#before_create
..

There might be a more straightforward way to do this; I'm not sure what would be involved in allowing this in the plugin.

Actions

Also available in: Atom PDF