delete-files

Allows you to specify a list of files you want deleted on hosts in your infrastructure. When this module is deployed as part of your policy set, every time CFEngine runs, it will check if those files exist, and delete them if they do.

Maintainer

Nick Anderson

Module stats

Total Downloads: 70
Updated: Jun 30, 2023

Installation version

Version
Released on Nov 1, 2022

Tags

Installation

                    
cfbs add delete-files@0.0.1
Description
Dependencies
Discussion

A simple module to delete specific files.

It allows you to specify a list of files you want deleted on hosts in your infrastructure. When this module is deployed as part of your policy set, every time CFEngine runs, it will check if those files exist, and delete them if they do.

Configuration

Variables

delete_files:delete_files.files

Array of dicts having path and why keys.

  • path must be a regular expression matching the fully qualified path to a file
  • why should explain why the file being absent is important
  {
    "variables": {
      "delete_files:delete_files.files": {
        "value": [
          {
            "path": "/etc/hosts.equiv",
            "why": "The file lists remote hosts and users that are trusted by the local system when using the rshd daemon and can allow unauthenticated access to the system. Reccomended by CIS  CCE-84145-2."
          },
         {
            "path": "/home/.*/.rhosts",
            "why": "The file lists remote hosts and users that are trusted by the local system when using the rshd daemon and can allow unauthenticated access to the system. Reccomended by CIS  CCE-84145-2."
          }
          {
            "path": "/root/.rhosts",
            "why": "The file lists remote hosts and users that are trusted by the local system when using the rshd daemon and can allow unauthenticated access to the system. Reccomended by CIS  CCE-84145-2."
          }
        ],
        "comment": "Files and their required permissions"
      }
    }
  }
Example Augments configuration

Dependencies

This module has no dependencies