Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
- Puppet >= 7.0.0 < 9.0.0
- , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'puppet-falco', '3.0.1'
Learn more about managing modules with a PuppetfileDocumentation
Falco
Falco is a behavioral activity monitor designed to detect anomalous activity in your applications. Powered by Falco libraries system call capture and inspection infrastructure, Falco lets you continuously monitor and detect container, application, host, and network activity... all in one place, from one source of data, with one set of rules.
What kind of behaviors can Falco detect?
Falco can detect and alert on any behavior that involves making Linux system calls. Thanks to the Falco drivers, libscap
and libsinsp
Falco libraries which capture, parse, enrich and filter collected system calls as a raw data source, Falco alerts can be triggered by the use of specific system calls, their arguments, and by properties of the calling process. For example, you can easily detect things like:
- A shell is run inside a container
- A container is running in privileged mode, or is mounting a sensitive path like
/proc
from the host. - A server process spawns a child process of an unexpected type
- Unexpected read of a sensitive file (like
/etc/shadow
) - A non-device file is written to
/dev
- A standard system binary (like
ls
) makes an outbound network connection
Module Description
This module configures Falco as a systemd service. You configure Falco to send its notifications to one or more output channels (syslog, files, programs).
Setup
Beginning with Falco
To have Puppet install Falco with the default parameters, declare the Falco class:
class { 'falco': }
When you declare this class with the default options, the module:
- Installs the appropriate Falco software package and installs the falco-probe kernel module for your operating system.
- Creates the required configuration file
/etc/falco/falco.yaml
. - Manages the local rules file
/etc/falco/falco_rules.local.yaml
. - Starts the Falco service.
Reference
This module is documented via bundle exec rake strings:generate:reference
. Please see REFERENCE.md for more info and example usage.
Limitations
The module works where Falco works as a daemonized service (generally, Linux only). Also, newer configuration options in falco.yaml
may not have been templated yet... PRs welcome if you find such a case.
Development
PRs are welcome!
History
This module is derrived from falcosecurity/evolution. That code came from falcosecurity/falco as part of resolving issue #1114. The old code is the basis for sysdig/falco. #2005 was submitted to request that module be depreciated since it appears to be abondoned.
Reference
Table of Contents
Classes
falco
: Guides the basic setup and installation of Falco on your system.falco::config
: Controls the contents of falco.yaml and sets up log rotate, if neededfalco::install
: Installs the falco packagefalco::repo
: Manages the repository falco is installed fromfalco::service
: Controls the state of the falco and falcoctl services
Classes
falco
When this class is declared with the default options, Puppet:
- Installs the appropriate Falco software package and installs the falco-probe kernel module for your operating system.
- Creates the required configuration file
/etc/Falco/falco.yaml
. By default only syslog output is enabled. - Starts the falco service.
Examples
Using defaults
include falco
Enabling file output
class { 'falco':
file_output => {
'enabled' => 'true',
'keep_alive' => 'false',
'filename' => '/var/log/falco-events.log',
},
}
Enabling program output
class { 'falco':
json_output => 'true',
program_output => {
'enabled' => 'true',
'keep_alive' => 'false',
'program' => 'curl http://some-webhook.com'
},
}
Create local rule
class { 'falco':
local_rules => [{
'rule' => 'The program "sudo" is run in a container',
'desc' => 'An event will trigger every time you run sudo in a container',
'condition' => 'evt.type = execve and evt.dir=< and container.id != host and proc.name = sudo',
'output' => 'Sudo run in container (user=%user.name %container.info parent=%proc.pname cmdline=%proc.cmdline)',
'priority' => 'ERROR',
'tags' => ['users', 'container'],
}],
}
Local rules, lists, and macro
class { 'falco':
local_rules => [
{
'rule' => 'The program "sudo" is run in a container',
'desc' => 'An event will trigger every time you run sudo in a container',
'condition' => 'evt.type = execve and evt.dir=< and container.id != host and proc.name = sudo',
'output' => 'Sudo run in container (user=%user.name %container.info parent=%proc.pname cmdline=%proc.cmdline)',
'priority' => 'ERROR',
'tags' => ['users', 'container'],
},
{
'rule' => 'rule 2',
'desc' => 'describing rule 2',
'condition' => 'evt.type = execve and evt.dir=< and container.id != host and proc.name = sudo',
'output' => 'Sudo run in container (user=%user.name %container.info parent=%proc.pname cmdline=%proc.cmdline)',
'priority' => 'ERROR',
'tags' => ['users'],
},
{
'list' => 'shell_binaries',
'items' => ['bash', 'csh', 'ksh', 'sh', 'tcsh', 'zsh', 'dash'],
},
{
'list' => 'userexec_binaries',
'items' => ['sudo', 'su'],
},
{
'list' => 'known_binaries',
'items' => ['shell_binaries', 'userexec_binaries'],
},
{
'macro' => 'safe_procs',
'condition' => 'proc.name in (known_binaries)',
}
],
}
Parameters
The following parameters are available in the falco
class:
rules_file
local_rules
watch_config_files
json_output
json_include_output_property
log_stderr
log_syslog
log_level
priority
buffered_outputs
outputs_rate
outputs_max_burst
syslog_output
file_output
stdout_output
webserver
program_output
http_output
driver
package_ensure
service_ensure
service_enable
service_restart
auto_ruleset_updates
manage_dependencies
manage_repo
rules_file
Data type: Array
File(s) or Directories containing Falco rules, loaded at startup. The name "rules_file" is only for backwards compatibility. If the entry is a file, it will be read directly. If the entry is a directory, every file in that directory will be read, in alphabetical order.
falco_rules.yaml ships with the falco package and is overridden with every new software version. falco_rules.local.yaml is only created if it doesn't exist. If you want to customize the set of rules, add your customizations to falco_rules.local.yaml.
The files will be read in the order presented here, so make sure if you have overrides they appear in later files.
Default value:
[
'/etc/falco/falco_rules.yaml',
'/etc/falco/falco_rules.local.yaml',
'/etc/falco/k8s_audit_rules.yaml',
'/etc/falco/rules.d',
]
local_rules
Data type: Array[Hash]
An array of hashes of rules to be added to /etc/falco/falco_rules.local.yaml
Default value: []
watch_config_files
Data type: Boolean
Whether to do a hot reload upon modification of the config file or any loaded rule file
Default value: true
json_output
Data type: Boolean
Whether to output events in json or text
Default value: false
json_include_output_property
Data type: Boolean
When using json output, whether or not to include the "output" property itself (e.g. "File below a known binary directory opened for writing (user=root ....") in the json output.
Default value: true
log_stderr
Data type: Boolean
Send information logs to stderr Note these are not security notification logs! These are just Falco lifecycle (and possibly error) logs.
Default value: true
log_syslog
Data type: Boolean
Send information logs to stderr Note these are not security notification logs! These are just Falco lifecycle (and possibly error) logs.
Default value: true
log_level
Data type: Enum['alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug']
Minimum log level to include in logs. Note: these levels are separate from the priority field of rules. This refers only to the log level of falco's internal logging. Can be one of "emergency", "alert", "critical", "error", "warning", "notice", "info", "debug".
Default value: 'info'
priority
Data type: Enum['emergency', 'alert', 'critical', 'error', 'warning', 'notice', 'informational', 'debug']
Minimum rule priority level to load and run. All rules having a priority more severe than this level will be loaded/run. Can be one of "emergency", "alert", "critical", "error", "warning", "notice", "informational", "debug".
Default value: 'debug'
buffered_outputs
Data type: Boolean
Whether or not output to any of the output channels below is buffered. Defaults to false
Default value: false
outputs_rate
Data type: Integer
The number of tokens (i.e. right to send a notification) gained per second.
Default value: 1
outputs_max_burst
Data type: Integer
The maximum number of tokens outstanding.
Default value: 1000
syslog_output
Data type: Hash
A hash to configure the syslog output. See the template for available keys.
Default value:
{
'enabled' => true,
}
file_output
Data type: Hash
A hash to configure the file output. See the template for available keys.
Default value:
{
'enabled' => false,
'keep_alive' => false,
'filename' => '/var/log/falco-events.log',
}
stdout_output
Data type: Hash
A hash to configure the stdout output. See the template for available keys.
Default value:
{
'enabled' => true,
}
webserver
Data type: Hash
A has to configure the webserver. See the template for available keys.
Default value:
{
'enabled' => false,
'listen_port' => 8765,
'k8s_audit_endpoint' => '/k8s-audit',
'k8s_healthz_endpoint' => '/healthz',
'ssl_enabled' => false,
'ssl_certificate' => '/etc/falco/falco.pem',
}
program_output
Data type: Hash
A hash to configure the program output. See the template for available keys.
Default value:
{
'enabled' => false,
'keep_alive' => false,
'program' => '"jq \'{text: .output}\' | curl -d @- -X POST https://hooks.slack.com/services/XXX"',
}
http_output
Data type: Hash
A hash to configure the http output. See the template for available keys.
Default value:
{
'enabled' => false,
'url' => 'http://some.url',
'user_agent' => '"falcosecurity/falco"',
}
driver
Data type: Enum['bpf', 'modern-bpf', 'kmod']
The desired Falco driver. Can be one of "bpf", "modern-bpf", "kmod". Defaults to "kmod"
Default value: 'kmod'
package_ensure
Data type: String[1]
A string to be passed to the package resource's ensure parameter
Default value: '>= 0.34'
service_ensure
Data type: Variant[Boolean, Enum['running', 'stopped']]
Desired state of the Falco service
Default value: 'running'
service_enable
Data type: Boolean
Start the Falco service on boot?
Default value: true
service_restart
Data type: Boolean
Does the service support restarting?
Default value: true
auto_ruleset_updates
Data type: Boolean
Enable automatic rule updates?
Default value: true
manage_dependencies
Data type: Boolean
Enable managing of dependencies?
Default value: true
manage_repo
Data type: Boolean
When true, let the module manage the repositories. Default is true.
Default value: true
falco::config
Controls the contents of falco.yaml and sets up log rotate, if needed
falco::install
Installs the falco package
falco::repo
Manages the repository falco is installed from
falco::service
Controls the state of the falco and falcoctl services
Changelog
All notable changes to this project will be documented in this file. Each new release typically also includes the latest modulesync defaults. These should not affect the functionality of the module.
v3.0.1 (2023-07-17)
Merged pull requests:
v3.0.0 (2023-07-06)
Breaking changes:
- Drop Puppet 6 support #27 (bastelfreak)
Implemented enhancements:
- Add feature flag to enable/disable managing of the falco repository #24 (jordyb6)
- Add watch_config _files parameter #23 (jordyb6)
Fixed bugs:
- Make falco file output really optional #28 (claviola)
- Fix falco-driver-loader bpf #26 (jordyb6)
- Fix: Add missing dependencies when building bpf probe #25 (jordyb6)
v2.0.0 (2023-04-13)
Breaking changes:
v1.2.0 (2023-04-11)
Implemented enhancements:
Fixed bugs:
v1.1.0 (2022-06-01)
Implemented enhancements:
v1.0.1 (2022-05-25)
Closed issues:
- release workflow has wrong owner listed #9
v1.0.0 (2022-05-24)
This is the first release as part of Vox Pupuli.
This module is derrived from falcosecurity/evolution. That code came from falcosecurity/falco as part of resolving issue https://github.com/falcosecurity/falco/issues/1114. The old code is the basis for sysdig/falco. https://github.com/falcosecurity/falco/issues/2005 was submitted to request that module be depreciated since it appears to be abandoned.
The v1.0.0 release includes an overhaul of the code to make everything work and bring it up to current coding standards. It also incorporates all the change needed as part of migrating a module to Vox Pupuli.
Breaking changes:
Fixed bugs:
Closed issues:
- Falco crashes due to formatting error in config file #7
- Update metadata.json to reflect transfer to Vox Pupuli #2
Merged pull requests:
v0.4.0 (2022-05-19)
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/apt (>= 6.1.0 < 9.0.0)
- puppet/epel (>= 3.0.0 < 5.0.0)
- puppet/logrotate (>= 3.4.0 < 7.0.0)
- puppet/zypprepo (>= 4.0.1 < 5.0.0)
- puppetlabs/stdlib (>= 8.2.0 < 10.0.0)
- stschulte/rpmkey (>= 1.0.3 < 2.0.0)
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] 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.