Falco
repository·master·Indexed 11 days ago
https://github.com/falcosecurity/falcoA CNCF-graduated, cloud-native runtime security tool for Linux that monitors syscalls and system events to detect abnormal behavior and security threats in real-time. It supports multiple drivers, including a Modern eBPF Probe and Kernel Modules, and can be deployed in Kubernetes via Helm as a DaemonSet or Deployment. Falco utilizes plugins like k8smeta and k8saudit for extended metadata and audit log monitoring, and manages rules and artifacts using the falcoctl tool.
What's inside Falco
- Falco is a cloud-native runtime security tool for Linux operating systems. It acts as a kernel monitoring and detection agent that observes system events (such as syscalls) in real-time based on custom rules. It can integrate metadata from container runtimes and Kubernetes to provide enriched security context. Collected events can be exported to SIEM or data lake systems for analysis.
Identify official Falco artifacts and distribution channels
masterFalcosecurity publishes several types of official artifacts, which are intended for General Availability (GA) unless otherwise specified in release notes.
Official Artifact Types:
- Installation packages
- Helm charts
- Drivers (e.g.,
kmod,eBPF) - Rule files
- Plugins
Official Distribution Channels: To ensure you are using authentic artifacts, verify the channel against the official list at falco.org.
HTTP Distribution (Best for humans, simple scripts, or legacy clients):
https://download.falco.org/(Primary location for most file artifacts)- GitHub endpoints under the
Falcosecurityorganization (e.g., release downloads, GitHub Pages).
OCI Distribution (Best for automated consumers like
falcoctland compatible container runtimes):docker.io(Docker Hub): Reserved primarily for container images.ghcr.io(GitHub Packages): Used for container images and other artifacts like plugins or rules.
Note: If you are downloading files via HTTP, ensure the versioning and architecture in the filename match your requirements (e.g.,
falco-0.33.0-x86_64.tar.gz).Overview of the Falco Plugin System
masterThe Falco plugin system is an infrastructure designed to extend the functionality of the Falco libraries (
libscapandlibsinsp). It allows users to extend the capabilities of Falco and other tools built on these libraries without requiring recompilation or relinking. The system is designed to be modular, efficient, and language-agnostic (with primary support for Go, C, and C++), enabling support for multiple platforms including Linux, MacOS, and Windows.Currently, the proposal focuses on two primary plugin types:
- Source Plugins: Used to introduce new types of input data (e.g., cloud logs) to the libraries, extending beyond the traditional system call focus.
- Extractor Plugins: Used to extend how data is processed or extracted from the captured streams.
Overview of the Falco API architecture
masterThe Falco API is a set of gRPC-based contracts designed to decouple Falco from its input sources and make it more extensible. It allows third-party clients to interface with Falco's outputs, inputs, rules, and configurations. The architecture consists of a single gRPC server that groups several services together, defined via
.protofiles.The API is categorized into three types of service patterns:
- Unary services: For discrete requests/responses (e.g., Version, Rules, Configs).
- Streaming services (Server or Client): For continuous data flows (e.g., Outputs, Drops).
- Bidirectional streaming services: For two-way communication (e.g., Inputs).
Distinguish between Feature, Behavior, and User-Facing changes
masterTo understand the impact of a Falco update, distinguish between these three types of changes:
- Feature Changes: The addition of new functionality or modifications to existing functionality that provides new value (e.g., a new command-line flag or a new rule field).
- Behavior Changes: Alterations in how an existing feature operates or responds under certain conditions, often involving tweaks to underlying logic or default configurations.
- User-Facing Changes: Any modification (feature or behavior) that is directly noticeable or interactable by the end user, potentially causing disruption to existing workflows or integrations.
Manage Falco rules with falcoctl
masterFalco rules (such as the ruleset for thesyscalldata source) can now be managed as separate artifacts usingfalcoctl. This allows for dedicated versioning and independent updates of rulesets without requiring a full Falco binary release. This mechanism is consistent with how plugin rules are consumed.Use falcoctl artifact follow as a sidecar
masterThe
falcoctl.artifact.followconfiguration runs a sidecar container that automatically checks for updates to Falco artifacts (like rules). If an update is found, it downloads and installs it into a sharedemptyDirvolume accessible by the main Falco container. The tool ensures compatibility with the running Falco version before applying updates.Configuration options for the sidecar:
falcoctl.artifact.follow.args: Arguments passed to the sidecar (e.g.,["--log-format=json"]).falcoctl.artifact.follow.env: Extra environment variables.falcoctl.artifact.follow.mounts: Volume mounts for the sidecar.falcoctl.artifact.follow.resources: CPU/Memory requests and limits for the sidecar.falcoctl.artifact.follow.securityContext: Security context for the sidecar.
falcoctl: artifact: follow: enabled: true args: ["--log-format=json"]How Falco artifacts are managed with falcoctl
masterStarting from chart version
v0.3.0, Falco uses thefalcoctltool to manage artifacts (rules files and plugins) instead of shipping them inside the Docker image.The chart deploys two helper containers to manage this:
falcoctl-artifact-install: An init container that installs configured artifacts before the main Falco container starts.falcoctl-artifact-follow: A sidecar container that periodically checks for and downloads new artifacts (likefalco-rules).
Identify deprecated features and behaviors
masterWhen a feature or behavior is deprecated, Falco provides several signals to help you migrate:
- Documentation: Deprecated items are explicitly labeled
DEPRECATEDin all relevant documentation. - CLI/Config: For deprecated configurations or CLI elements, Falco will emit a warning when the feature is being enabled or used.
- APIs: When technically feasible, deprecated APIs will signal their deprecation status.
- Behaviors: For deprecated behaviors, documentation will highlight the before and after behavior alongside a prominent deprecation notice.
Note that Sandbox features do not follow these deprecation rules and can be removed without notice.
- Documentation: Deprecated items are explicitly labeled
Define structured exceptions in Falco rules
masterStructured exceptions allow you to define specific sets of field values that, when matched, prevent a rule from triggering. Instead of manually appending
and not macroto a rule's condition, you define anexceptionskey within the rule. This provides a cleaner, more controlled way to manage allowed behaviors.1. Define the Exception Schema in the Rule
In the rule definition, use the
exceptionskey to specify which fields constitute a valid exception. Each exception needs aname(an arbitrary identifier) and a set offields. You can also specify custom comparison operators using thecompskey.fields: A list of field names used to identify the exception.comps: (Optional) A list of comparison operators corresponding to the fields (e.g.,[=, startswith]). If omitted, the=operator is used by default.
2. Provide Exception Values
To apply the exceptions, use
append: truein your user rules to provide the actual values for the named exceptions defined in the rule.- Multi-field exceptions: If the rule defines multiple fields (e.g.,
[proc.name, fd.directory]), thevalueslist must contain lists of values (tuples) matching those fields. - Single-field exceptions: If the rule defines only one field, the
valueslist contains the values directly.
An exception triggers (and prevents the rule from firing) if all fields in an exception item match the values provided.
# 1. The Rule Definition - rule: Write below binary dir condition: > bin_dir and evt.dir = < and open_write exceptions: - name: proc_writer fields: [proc.name, fd.directory] - name: container_writer fields: [container.image.repository, fd.directory] comps: [=, startswith] - name: proc_filenames fields: [proc.name, fd.name] comps: [=, in] - name: filenames fields: fd.filename comps: in # 2. Providing the Values (in user rules) - rule: Write below binary dir exceptions: - name: proc_writer values: - [apk, /usr/lib/alpine] - [npm, /usr/node/bin] - name: container_writer values: - [docker.io/alpine, /usr/libexec/alpine] - name: proc_filenames values: - [apt, apt_files] # 'apt_files' can be an existing list name - [rpm, [/bin/cp, /bin/pwd]] - name: filenames values: [python, go]How Falco roadmap planning and milestones work
masterThe Falco roadmap is managed using a GitHub Project (the Falco Roadmap project) to track progress across release cycles.
Key components of the planning process include:
- GitHub Milestones: For every release, a GitHub Milestone is created with a due date matching the targeted release date. This milestone collects all items intended for completion within that release.
- Planning Sessions: Core Maintainers hold planning sessions during the first week of each calendar month. During these sessions, tasks are allocated to specific iterations or postponed. The first session of a new release cycle is used to define the top priorities for that release.
- Component Alignment: Because Falco depends on other components (like
falcosecurity/libs), their release schedules must be synchronized. For example, alibsrelease may be required at least one week before the end of a Falco iteration to ensure compatibility.
Use libsinsp and libscap as external dependencies
masterIn recent versions of Falco,
libscapandlibsinspare no longer compiled directly into the Falco binary. Instead, they are distributed as standalone artifacts. When installing Falco via package managers (likedeborrpm), these libraries are now treated as install dependencies.To ensure compatibility when building or running Falco, ensure that the corresponding
libsinspandlibscappackages are installed on your system.