O'Reilly logo

CFEngine 3 Beginner's Guide by Rajneesh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - auditing the system with CFEngine and OSSEC

  1. Let's see how this can be done for the second scenario using CFEngine. You may copy the following code snippet in a file web_blacklist:
    body common control { bundlesequence => { "web_blacklist", "web_restart" }; } bundle agent web_blacklist { files: "/etc/httpd/conf/httpd.conf" create => "true", edit_line => AppendIfNoLine("Deny","from "); } bundle edit_line AppendIfNoLine(parameter,two) { vars: "list" slist => { "192.168.2.1", "192.168.2.2", "192.168.2.3"}; insert_lines: "$(parameter) $(two) $(list)" select_region => MySection("New Section"); "# New IP added to deny list" select_region => MySection("New section"); select_region => MySection("New section"); } body select_region MySection(x) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required