Giter Club home page Giter Club logo

ansible-aide's Introduction

Ansible Role

ahuffman.aide

Description

An Ansible role to install, configure, and schedule AIDE.

Please Note
The default settings will deploy the configuration options that come with a default aide.conf after installing the tool.
This has only been thoroughly tested on Fedora and RHEL7 Operating Systems. Please open issues if you have a problem on your platform.

Role Variables

Variable Name Description Required Default Value Type
aide_pkg Name of the aide package to install. Override with a specific version if required. Yes "aide" string
aide_conf_path Path to the aide configuration file Yes "/etc/aide.conf" string
aide_update_db Whether or not to force an update of the aide database on this Role invocation Yes False boolean
aide_dbdir Directory to create the aide database Yes "/var/lib/aide" string
aide_logdir Directory to create aide logs Yes "/var/log/aide" string
aide_database_filename Filename to create the aide database as. Yes "aide.db.gz" string
aide_database_out_filename Filename to create the updated aide database as Yes "aide.db.new.gz" string
aide_gzip_dbout Whether or not to compress the database output file Yes True boolean
aide_verbose Aide's verbosity level. Valid values are 0-255. Yes 5 integer
aide_report_url List of report URLs No ["file:@@{LOGDIR}/aide.log", "stdout"] list
aide_acl_no_symlink_follow Whether to check ACLs for symlinks or not. Yes True boolean
aide_warn_dead_symlinks Whether to warn about dead symlinks or not. Yes False boolean
aide_summarize_changes Whether to summarize changes in the added, removed and changed files sections of the report or not Yes False boolean
aide_report_attributes list of default rules to report No Undefined list
aide_grouped Whether to group the files in the report by added, removed and changed files or not. Yes False boolean
aide_ignore_list (DEPRECATED, will be removed in a future release). Special group definition that lists attributes whose change is to be ignored in the final report. No [] list
aide_config_version The value of config_version is printed in the report and also printed to the database. This is for informational purposes only. It has no other functionality. No "1" string
aide_cron_schedule_check Whether or not to setup a cron job for running an aide check Yes True boolean
aide_cron_email_notify_recipients List of email recipients to get an email notification after a cronjob. Leave list empty if you do not want this functionality. Yes [] list
aide_cronjob_name Comment to insert prior to the cronjob in the crontab Yes "aide scheduled database checkup" string
aide_cron_sched_min Minute to schedule the start of the cronjob at No "0" string
aide_cron_sched_hr Hour to schedule the start of the cronjob at No "1" string
aide_cron_sched_day Day to schedule the start of the cronjob at No "*" string
aide_cron_sched_mon Month to schedule the start of the cronjob at No "*" string
aide_cron_sched_wkd Weekday to schedule the start of the cronjob at No "*" string

Defining and Undefining aide.conf Variables

aide_macros:   
  define:   
     - name: "Give it a name"
       variable: "Name_of_Variable"
       value: "Value of the variable"
     - name: "DBDIR var"
       variable: "DBDIR"
       value: "/var/lib/aide"
  undefine:   
     - name: "Some var to undefine"
       variable: "Name_of_Variable"  #This would effectively undefine the variable we defined above
     - name: "Undefining DBDIR var"
       variable: "DBDIR"

Defining Rules/Groups, Selection paths, and Ignore/Negative Selection Paths

A YAML spec was built to handle all of these items in a relatively organized way.

Attributes available to a rule

aide_rules:   
  - name: "My first rule"                                                #Required   
    rule: "FIPSR"                                                        #Required   
    comment: "Comment to put above this rule declaration"                #Optional   
    attributes: []  #List made up of default rules or defined rules      #Required except on special negative rule   
    paths:                                                               #Optional   
       - "/my/include/path/1"  #Cannot start with '!' see Ignore/Negative Selection Paths   
       - "/my/include/path/2"

A Special Rule to handle Ignore/Negative Selection Paths is available

Add a rule to your aide_rules: definition with rule: negative
Here's an example, and you can also find an example in this Role's defaults/main.yml:

aide_rules:   
  - name: "My negative/ignore selections"                                #Required   
    rule: "negative"                                                     #Required   
    paths:                                                             #Required   
       - "/my/ignore/path/1"
       - "/my/ignore/path/2"

Do not include an '!' in front of the paths, the template logic will automatically do this for you.

Scheduled Cron Aide Checks

The default is to setup an 'aide --check' in crontab. Should you wish to change this after already allowing this role to create the cron job, simply switch the variable aide_cron_schedule_check to False. This will remove the cron job from your system's crontab on the next playbook run. One caveat to be aware of is that the aide_cronjob_name variable must match what's currently in the crontab to be removed properly.

Example Playbook

- name: "Install and configure aide"
  hosts: "servers"
  roles:
     - "ahuffman.aide"

License

MIT

Author Information

Andrew J. Huffman

ansible-aide's People

Contributors

ahuffman avatar bodsch avatar ikuwow avatar kmonticolo avatar sean797 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.