body common control { bundlesequence => { "test:main", }; inputs => { "cfengine_stdlib.cf", }; } body file control { namespace => "test"; } bundle agent main { vars: "watch_dir" string => "/tmp/changes"; files: "$(watch_dir)/." create => "true", depth_search => default:recurse("1"), changes => default:detect_all_change, classes => generic("tripwire"), comment => "If any content changes happen, hashes are updated, if only stat changes promise is considered to be kept/not_repaired"; reports: tripwire_repaired:: "I repaired my tripwire by updating file hashes?", comment => "I am not really sure what constitutes a tripwire repair, I assume its updating file hashes"; tripwire_ok:: "My tripwire is ok"; tripwire_failed:: "My tripwire repair failed"; tripwire_denied:: "My tripwire repair was denied"; tripwire_timeout:: "My tripwire repair timed out"; tripwire_kept:: "My tripwire does not need repaired"; } body classes generic(x) # # Define x prefixed/suffixed with promise outcome { promise_repaired => { "promise_repaired_$(x)", "$(x)_repaired", "$(x)_ok" }; repair_failed => { "repair_failed_$(x)", "$(x)_failed", "$(x)_not_ok", "$(x)_not_kept", "$(x)_not_repaired" }; repair_denied => { "repair_denied_$(x)", "$(x)_denied", "$(x)_not_ok", "$(x)_not_kept", "$(x)_not_repaired" }; repair_timeout => { "repair_timeout_$(x)", "$(x)_timeout", "$(x)_not_ok", "$(x)_not_kept", "$(x)_not_repaired" }; promise_kept => { "promise_kept_$(x)", "$(x)_kept", "$(x)_ok", "$(x)_not_repaired" }; }