Book Image

Learning Puppet Security

Book Image

Learning Puppet Security

Overview of this book

Table of Contents (17 chapters)
Learning Puppet Security
About the Author
About the Reviewers

Auditing the password file

Now that we've seen how the audit resource works on files, it's time to perform an example. Building on our last exercise, we will audit the password file and see the results.


The following steps need to be performed to audit the password file:

  1. If you're following along from the last example, go ahead and start the virtual machine with the following command:

    vagrant up
  2. Once the system is up, go ahead and SSH into it using the following command:

    vagrant ssh

You should now be logged in to the system.

Creating the manifest

Unlike the last chapter, we are going to build this manifest straight into the /etc/puppet/manifests/site.pp file. Since the example is short and for demonstration purposes, it does not make sense to create an entire module to hold it.


As previously mentioned, it is considered bad form to add Puppet resources directly to the main manifest in most cases. We do so here to keep the length of the examples to a minimum since we'll have plenty...