- Module Description
- Usage - Configuration options and additional functionality
- Audispd
- Reference
- Limitations
- Copyright
This module installs, and configures the auditd service and ruleset. The currently supported platforms are:
- RHEL 6/7
- CentOS 6/7
- Ubuntu 16.04
By default, the only rules that are applied are the buffer size, and action to take on failure.
include ::auditd
Rules can be specified via four parameters:
- auditd::base_rules
- auditd::main_rules
- auditd::server_rules
- auditd::finalize_rules
Each location takes a yaml list of rules like so:
auditd::main_rules:
- '-a always,exit -F path=/etc/passwd -F perm=wa -F key=accounts'
- '-a always,exit -F path=/etc/gshadow -F perm=wa -F key=accounts'
The purpose of each location is as follows:
- auditd::base_rules is loaded before any other rules are processed
- auditd::main_rules is the primary set of rules to use
- auditd::server_rules are any rules specific to a given node, that should load after the primary rules
- auditd::finalize_rules are any rules that should load after all other rules. The common use for this is to lock the rules from changing without a reboot.
Currently, this module depends on the auditctl
and augenrules
binaries to load rules. While there is a parameter to not use augenrules
, there currently isn't any alternative that is tried.
Due to some implementations of auditd not being able to be fully restarted, configuration changes for the service its self trigger a service reload. Because Puppet doesn't provide an easy way to trigger service reloads instead of restarts, this is handled by a case statement and exec. Currently, the following service providers should work when sepecified:
- redhat
- systemd
Additional service providers may be added in the future.
This module also allows for some basic audispd (audit event multiplexor) configuration.
By default, this module will attempt to manage a file at /etc/audisp/audispd.conf
, and install additional audispd plugins. You can prevent management of audispd by setting the auditd::audisp::manage
parameter to false
.
auditd::audisp::plugin
is a resource type which can be used to create plugin configuration files. If the auditd::audisp::plugins
parameter is not empty, this module will attempt to create a configuration file for the plugin(s) specified in the parameter.
- auditd: Main class, includes all other classes.
- auditd::audisp::plugins: Class to set up specified audispd plugins.
- auditd::install: Handles package installation.
- auditd::config: Handles auditd configuration.
- auditd::rules: Handles auditd rules.
- auditd::service: Handles auditd service and rule loading.
- auditd::audisp: Handles management of audispd
- auditd::audisp::install: Handles installation of audispd plugins
- auditd::audisp::config: Handles configuration of audispd
This type creates a configuration file for a audispd plugin. It accepts the following parameters:
- 'active' - Whether or not the plugin should be activated. Valid options: Boolean. Default value: true
- 'direction' - Which direction events flow to the plugin. Valid options: 'in' or 'out'. Default value: 'out'
- 'path' - The absolute path to the plugin executable. Valid options: String . Default value: undef
- 'type' - How the plugin wants to run. Valid options: 'builtin' or 'always'. Default value: 'always'
- 'args' - Maximum of 2 arguments to pass to the child program. Valid options: Array containing strings. Default value: []
- 'format' - The format to send events as. Valid options: 'binary' or 'string'. Default value: 'string'
It uses the title of the resource to create a file called "${title}.conf", under the directory specified in auditd::audisp::plugindir
.
The below parameters are available in the ::auditd
class. The man page for auditd.conf can be referenced for more detailed description of each option.
The fullpath of the main auditd configuration file. Valid options: string containing fullpath. Default value: '/etc/audit/auditd.conf'
The file to use for audit logging. Valid options: string containing fullpath. Default value: '/var/log/audit/audit.log'
The log format describes how the information should be stored on disk. Valid options: string containing log format. Default value: 'RAW'
The group that is applied to the log file's permissions. Valid options: string containing group. Default value: 'root'
Tells the audit daemon how much of a priority boost it should take. Valid options: 0 or positive integer. Default value: 4
Tells the audit daemon how to handle flushing audit records to disk. Valid options: string containing flush method. Default value: 'INCREMENTAL'
Configures how often an explicit flush to disk is issued. Valid options: positive ingeger. Default value: 20
The number of log files to keep if rotate is given as the max_log_file_action. Valid options: integer between 0 and 99. Default value: 5
Controls whether you want blocking/lossless or non-blocking/lossy communication between the audit daemon and the dispatcher. Valid options: string containing communication type. Default value: 'lossy'
Application that all events are passed to. Valid options: string containing the path to a program. Default value: '/sbin/audispd'
How node names are inserted into event stream. Valid options: string containing the node name format. Default value: 'NONE'
Machine name if auditd::name_format
is set to user
. Valid options: string containing the machine name. Default value: undef
Maximum log file size in MB. Valid options: positive numeric. Default value: 6
Action to take when auditd::max_log_file
size is reached. Valid options: string containing action to take. Default value: 'ROTATE'
When the machine reaches auditd::space_left
diskspace (in MB) remaining, take an action. Valid options: positive numeric. Default value: 75
Action to take when the auditd daemon detects low disk space. Valid options: string containing the action to take. Default value: 'SYSLOG'
Email alert is sent to when auditd::space_left_action
is set to 'email'. Valid options: string containing email. Default value: 'root'
'Last chance' threshold in MB to take action when machine is low on disk space. Valid options: positive numeric. Default value: 50
See auditd::space_left_action
.
Action to take when partition used for logs is full. Valid options: string containing action. Default value: 'SUSPEND'
Action to take when disk error is occured when writing or rotating logs. Valid options: string containing action. Default value: 'SUSPEND'
TCP port to listen for events from other machines on. Valid options: integer between 1 and 65535. Default value: undef
How many pending connections to allow. Valid options: positive integer. Default value: 5
How many connections per-host are allowed. Valid options: integer between 1 and 1024. Default value: 1
Whether or not to use tcp_wrappers to restrict connections. Valid options: boolean. Default value: true
Specifies which incoming ports are allowed for client connections. Valid options: integer between 1 and 65535, or two integers seperated with a '-'. Default value: undef
Number of seconds a client is allowed to remain idle. Valid options: positive integer. Default value: 0
If enabled, Kerberos 5 will be used for authentication. Valid options: boolean. Default value: false
The principal for the server. Valid options: string containing the principal. Default value: 'auditd'
The key for the server's principal. Valid options: string containing path to key. Default value: undef
Whether to manage the service with this module. Valid options: boolean. Default value: true
Whether to enable the the service on system start. Valid options: boolean. Default value: true
The name of the auditd serivce. Valid options: string containing the service name. Default value: 'auditd'
The service provider that would normally be used with the service type. Valid options: string containing the service provider. Default value: 'systemd'
Note that this is normally determined automatically by Puppet. Due to how service reloads are managed, we have to manually specify it to trigger a service reload instead of a restart.
Whether to manage the package with this module. Valid options: boolean. Default value: true
Name of the auditd package. Valid options: string containing package name. Default value: 'audit'
State to use for package type. Valid options: string containing package state. Default value: 'present'
Whether to use augenrules
format for rule creation (i.g. 'rules.d' format; not monolithic file). Valid options: boolean. Default value: true
Note, that currently if set to false
, then no rules will be applied or loaded by the module.
Directory to use for 'rules.d' format. Valid options: string containing path to directory. Default value: '/etc/audit/rules.d'
Whether to remove any files Puppet doesn't manage from the directory specified by auditd::rulesd_dir
. Valid options: boolean. Default value: true
Rules to load before any other, after the buffer and failure options. Valid options: list containing strings of rules. Default value: undef
Rules to be loaded as the 'core' set. Valid options: list containing strings of rules. Default value: undef
Rules to be loaded after the main rules, to be used for node-specific configuration. Valid options: list containing strings of rules. Default value: undef
Rules to be loaded after any other rule specified. Mainly used if you wanted to lock rules from changing without a reboot. Valid options: list containing strings of rules. Default value: undef
Whether to manage audispd with this module or not. Valid options: Boolean. Default value: true
The configuration file to use for audispd. Vaild options: String. Default value: '/etc/audisp/audispd.conf'
The path to the 'plugins.d' directory for audispd. Valid options: String. Default value: '/etc/audisp/plugins.d'
How large the internal queue should be for audispd. Valid options: Numeric. Default value: 80
How audispd should react when its internal queue overflows. Valid options: String. Default value: 'syslog'
How much of a priority boost audispd should have. Valid options: Postitive Integer. Default value: 4
How many attempts audispd will make to restart crashed plugins. Valid options: Positive Integer. Default value: 10
How node names are inserted into event stream. Valid options: String. Default value: hostname
String identifying the machine when using the 'user' name_format. Valid options: String. Default value: undef
Whether to install additional audispd plugins. Valid options: Boolean. Default value: true
The name of the package containing the audispd plugins. Valid options: String. Default value: 'audispd-plugins'
A list of plugins to configure on a server. Vaild options: Hash of plugins and parameters. Default value: undef
Currently the module is only really useful on systems that have augenrules
and use the rules.d directory. While the option is there to disable augenrules, there currently isn't any alternative method implemented.
Copyright 2016 Nexcess.net
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.