Skip to content

Latest commit

 

History

History
510 lines (403 loc) · 23 KB

configuration.md

File metadata and controls

510 lines (403 loc) · 23 KB

Configuration

How Configuration Works

The Falco Operator applies configuration at two levels:

  1. Base configuration — The operator generates a default falco.yaml ConfigMap based on the deployment mode (DaemonSet or Deployment). This provides sensible defaults for each mode.

  2. Configuration fragments — Config Custom Resources add or override specific settings on top of the base configuration. Fragments are applied in priority order (0–99) via the Artifact Operator sidecar.

This means you do not need to provide a complete Falco configuration. Only specify the settings you want to change.

Default Settings

These are the defaults of the operator-generated base falco.yaml. Optional functionality such as container metadata enrichment (container.*, k8s.* fields) is not part of the base config — load the container plugin via a Plugin CR to enable it.

DaemonSet Mode

When a Falco CR uses type: DaemonSet (or omits type), the operator applies these defaults:

Category Setting Default Value
Engine engine.kind modern_ebpf
Outputs stdout_output.enabled true
syslog_output.enabled true
Webserver webserver.enabled true
webserver.listen_port 8765
webserver.prometheus_metrics_enabled true
Security Security context Privileged
Host mounts Paths /proc, /sys, /dev, /etc, container runtime sockets
Resources CPU request 100m
Memory request 512Mi
CPU limit 1000m
Memory limit 1024Mi
Probes Startup HTTP /healthz, delay 3s, period 5s, 20 failures (~103s max)
Liveness HTTP /healthz, delay 0s (startup probe handles the wait)
Readiness HTTP /healthz, delay 0s (startup probe handles the wait)

The full default falco.yaml configuration (engine, outputs, metrics, etc.) is defined in internal/pkg/resources/falco.go.

Deployment Mode

When a Falco CR uses type: Deployment, the operator applies these defaults:

Category Setting Default Value
Engine engine.kind nodriver
Designed for Plugin-only workloads

All other settings (outputs, webserver, resources) follow the same defaults as DaemonSet mode.

Overriding Configuration

Using Config CRs

Create a Config resource to override specific settings:

apiVersion: artifact.falcosecurity.dev/v1alpha1
kind: Config
metadata:
  name: http-output
spec:
  config:
    http_output:
      enabled: true
      url: "http://falcosidekick.falco.svc:2801"
  priority: 50

Using ConfigMap references

Store configuration in a ConfigMap and reference it:

apiVersion: artifact.falcosecurity.dev/v1alpha1
kind: Config
metadata:
  name: base-config
spec:
  configMapRef:
    name: falco-base-config
  priority: 30

The ConfigMap must contain a key named config.yaml.

Priority ordering

Configuration fragments are applied in ascending priority order:

  • Priority 0–29: Base overrides (applied first)
  • Priority 30–69: Standard configuration
  • Priority 70–99: High-priority overrides (applied last, wins on conflicts)

Example: A Config with priority 30 sets output_timeout: 1000, and another with priority 70 sets output_timeout: 5000. The effective value is 5000.

Node-specific configuration

Use label selectors to apply configuration to specific nodes:

apiVersion: artifact.falcosecurity.dev/v1alpha1
kind: Config
metadata:
  name: debug-node1
spec:
  config:
    libs_logger:
      enabled: true
      severity: debug
  priority: 90
  selector:
    matchLabels:
      kubernetes.io/hostname: "node1"

Customizing the Falco Pod

The podTemplateSpec field in the Falco CR allows full control over the pod specification:

apiVersion: instance.falcosecurity.dev/v1alpha1
kind: Falco
metadata:
  name: falco
spec:
  podTemplateSpec:
    spec:
      containers:
        - name: falco
          resources:
            requests:
              cpu: 500m
              memory: 1Gi
            limits:
              cpu: 2000m
              memory: 2Gi
      tolerations:
        - key: "node-role.kubernetes.io/control-plane"
          effect: "NoSchedule"
      nodeSelector:
        kubernetes.io/os: linux

Environment entries in containers and initContainers override defaults by name. An explicit entry replaces the whole variable, including its valueFrom source; value: "" (or just name) sets an empty value. Variables omitted from the override retain their defaults. The same behavior applies to Component Pod templates.

For an environment variable with the same name:

Operator default Pod template override Result
value: "30s" valueFrom.secretKeyRef Only the Secret reference remains; the literal value is removed
valueFrom.fieldRef value: "manual" Only the literal value remains; the field reference is removed
Any value or source value: "" Explicitly empty value, with no valueFrom
Any value or source Variable omitted Operator default retained

This replacement applies to each explicitly overridden environment variable, not to the whole env list or every field of the Pod template.

Reserved names

The following container names are reserved by the operator:

  • falco — The main Falco container
  • artifact-operator: the Artifact Operator regular sidecar container

You can customize these containers in podTemplateSpec by matching their names.

Artifact compatibility

The Helm chart defaults to enforceRequirements: true. OCI plugins must declare compatibility requirements in their OCI metadata. Rulesfile requirements are collected from OCI metadata and every configured rules source, including inline YAML and ConfigMaps. A Rulesfile with neither engine requirements nor plugin dependencies is blocked. Declare the requirements the rules actually need, such as required_engine_version and required_plugin_versions; see the Rulesfile examples.

Missing or incompatible requirements appear in DependenciesSatisfied on the parent and its ArtifactNode resources. A rejected update retains installed files; it does not install the rejected revision. A new pod has fresh emptyDir volumes and cannot retain files from its predecessor.

To allow installation without enforcing these checks, explicitly set the Helm value enforceRequirements: false (advise mode). For non-Helm installations, use --enforce-requirements=false on the instance operator; it propagates this setting to sidecars. This does not make incompatible artifacts loadable by Falco or remove the startup prerequisite below.

Falco API prerequisite

Before starting artifact controllers, the sidecar waits for a successful JSON response from Falco's /versions endpoint. This is required in both enforce and advise mode. The default base URL is http://localhost:8765; keep the Falco webserver enabled. If you change its address or port, set FALCO_URL (or --falco-url) on the artifact-operator container and adjust Falco's probes too. The versions client has no dedicated private-CA or client-certificate setting; the artifact-server TLS options do not configure this connection.

If sidecar logs remain at Waiting for Falco to be available, check Falco startup logs and access to /versions from the pod. Falco must be able to start before artifact installation begins. Disabling Prometheus metrics does not remove this API requirement; metrics are optional and separate from /versions.

Artifact Server DNS

The artifact server URL uses the cluster DNS domain, which defaults to cluster.local. For a different domain, set the Helm value clusterDomain to the domain configured in your cluster. This updates both the advertised URL and the server certificate when mTLS is enabled.

For installations without Helm, configure the instance operator with --cluster-domain or CLUSTER_DOMAIN, and ensure any server certificate covers the resulting Service hostname. An explicit ARTIFACT_SERVER_URL still overrides the generated URL and requires a certificate matching that URL when using TLS.

Artifact Reloads

Artifact reloads are best effort with the default Falco 0.44.1. By default, the Artifact Operator sends SIGHUP and waits at least 5 seconds before checking Falco's HTTP endpoint or sending another signal. This cooldown reduces repeated signals; it does not confirm that a reload completed or prevent every conflict with Falco's own file watcher. A future reload API requires separate integration and validation; selecting Falco 0.45 or later does not itself enable a different reload mechanism.

Configure the cooldown per instance on the artifact-operator container:

apiVersion: instance.falcosecurity.dev/v1alpha1
kind: Falco
metadata:
  name: falco
spec:
  podTemplateSpec:
    spec:
      containers:
        - name: artifact-operator
          env:
            - name: FALCO_RELOAD_COOLDOWN
              value: "5s"

The value must be a positive duration, such as 4s or 10s. The equivalent flag is --falco-reload-cooldown; an explicit flag takes precedence over the environment variable. Changing the Pod template follows the workload's update strategy; this is not a live adjustment to an already-running sidecar. Falco metrics are not required for the cooldown or the HTTP availability check.

Artifact Downloads

The Artifact Operator limits each download from the central artifact server to 5 minutes by default. This is the total time for one attempt, including connection setup and reading the response, not an inactivity timeout. A failed download does not replace the installed OCI file; the controller retries it. This setting does not affect registry pulls performed by the instance operator.

Set a global default using the Helm chart's existing extraEnv:

extraEnv:
  - name: ARTIFACT_DOWNLOAD_TIMEOUT
    value: "2m"

The instance operator injects this value into its Artifact Operator sidecars. Override it for one Falco instance through its Pod template:

spec:
  podTemplateSpec:
    spec:
      containers:
        - name: artifact-operator
          env:
            - name: ARTIFACT_DOWNLOAD_TIMEOUT
              value: "1m"

Both binaries also accept --artifact-download-timeout; an explicit flag takes precedence over the environment variable. Values must be positive Go durations, such as 30s or 2m; zero does not disable the timeout. Updating an injected value changes the Pod template and follows the workload's update strategy, not a live reload. TCP connection setup and TLS handshakes retain their respective 30-second and 10-second limits. The central server's existing 5-minute write timeout is independent: increasing the client timeout does not extend it.

OCI revisions

An OCI reference is resolved when its ociArtifact spec changes. The resolved digest is retained in parent status and reused after pod/operator restarts and cache rebuilds. Rotating auth Secret data retries with new credentials but does not refresh an unchanged floating tag. Neither does changing a Rulesfile's inline or ConfigMap source. Change the tag or pin a new digest (sha256:...) to select new content.

Deleting and recreating the parent also discards its resolved metadata, but runs artifact cleanup first and can interrupt coverage. Dependency finalizers can delay deletion. Prefer an explicit reference update to forcing a refresh this way.

Image Registry

To use a different registry for the default Docker Hub images without maintaining release tags yourself, configure the Helm value:

imageRegistry: nexus.my.tld:8443/dockerhub

This covers the instance operator, artifact-operator sidecar, Falco, Components and their generated auxiliary containers. Each image keeps its own tag or digest; the default operator images retain their matching release versions. For example, docker.io/falcosecurity/artifact-operator:<release-tag> becomes nexus.my.tld:8443/dockerhub/falcosecurity/artifact-operator:<release-tag>. The instance binary embeds only the artifact operator's tag, independently of the registry: main for main builds, the release version for releases, and latest for builds without linker overrides or snapshots. Development Make targets default to dev.

The chart uses this registry for the manager when image.repository equals falcosecurity/falco-operator; other repository values remain literal. image.tag and image.digest retain their existing precedence. Explicit images in podTemplateSpec also remain unchanged. Remove such overrides to use automatic registry/version selection; an explicit image without a tag does not inherit a release tag. Falco and Component versions selected through their CRs retain the existing override precedence.

Outside Helm, configure the instance operator's --image-registry flag or IMAGE_REGISTRY environment variable for its generated workloads; its own container image must be configured separately. Use a registry hostname (with a domain or port) and optional repository prefix, without a URL scheme, tag or digest. An empty value leaves the existing behavior unchanged.

This setting does not rewrite Plugin/Rulesfile OCI references or change pull policies, credentials or TLS trust. Configure node trust and pull secrets separately as needed. Changing or removing the Helm value restarts the operator; workload image changes follow the configured update strategy. A DaemonSet using OnDelete requires manual Pod replacement.

Paired operator versions

The Instance Operator build embeds its compatible Artifact Operator tag. Changing the Instance Operator release therefore selects the corresponding sidecar version; there is no separate runtime tag setting. Pod replacement follows the workload's update strategy, including manual replacement for a DaemonSet using OnDelete.

The sidecar repository remains falcosecurity/artifact-operator; imageRegistry changes only its registry, not the paired tag. An explicit image in the Falco CR's spec.podTemplateSpec.spec.containers takes precedence and must be kept compatible by the user. Development Make targets default to dev; plain go build without linker overrides defaults to latest. Developers can select the paired tag at build time as described in Contributing.

The two must match. The sidecar acts on the ArtifactNode named after its node, which only an Instance Operator of the same release maintains. A sidecar paired with an older operator finds no such object: it installs nothing, and removes what it finds installed.

Operator replicas and artifact downloads

When running more than one operator replica, enable leader election in the Helm values:

replicaCount: 2
extraArgs:
  - --leader-elect=true

Only the leader runs the artifact server. Standby replicas remain Ready so that Deployment rollouts can complete. The artifact Service selects the runtime label artifact.falcosecurity.dev/serving=true, which the operator publishes after opening its listener. Do not set this label in podLabels: it is managed by the running server. Without leader election, each running server publishes its own label.

The operator clears its retained label on startup, before starting its default health endpoint, and reconciles routing every five seconds. In steady state this makes two API reads per server, plus one filtered Pod list when leader election is enabled; unchanged labels are not patched. Keep the default readiness probe to preserve the startup ordering. Election and Service endpoint updates are asynchronous, so failover can temporarily interrupt downloads.

Artifact caches are local to each replica. A newly elected leader rebuilds missing cache entries from the already-resolved digests, without following floating tags to a different revision. It needs access to the registry and the configured credentials; sidecars retry while the cache is being populated. Already-installed artifacts are not removed because the server is temporarily unavailable.

Large clusters

Each node running Falco has its own artifact operator, so their requests to the API server add up with the number of nodes. Two limits apply:

Flag on the operator Default Limits
--kube-api-qps / --kube-api-burst 50 / 100 The operator itself. One new artifact can mean a write to every node's ArtifactNode; the limit spreads such a burst out.
--artifact-operator-kube-api-qps / --artifact-operator-kube-api-burst 5 / 10 Each node's artifact operator. The cluster-wide ceiling is the number of nodes times this value.

Set them with extraArgs in the Helm values. Per-pod limits alone do not bound what thousands of sidecars send together. For that, the chart can install API Priority and Fairness objects (Kubernetes 1.29 or later), which put the sidecars in a bounded priority level while the operator keeps its usual one:

apiPriorityAndFairness:
  enabled: true

Installing them needs permission to create cluster-scoped flowcontrol.apiserver.k8s.io objects. See the chart README for the tunable shares and queues.

By default the sidecars' level matches the ServiceAccounts of every namespace that use the artifact API, so another workload that does, a GitOps controller for instance, shares it. List the namespaces of your Falco instances in apiPriorityAndFairness.artifactOperators.namespaces to match only their ServiceAccounts.

A node that is unreachable keeps its ArtifactNode, and its artifact operator cannot report. A deleted artifact waits for every node that holds it, except the ones that have been unreachable for more than 5 minutes: those remove it by themselves if they come back.

Artifact status

The status.conditions of a Rulesfile, Plugin or Config aggregate what the sidecar of every assigned node reports in its ArtifactNode. For each condition type, False on one node wins over Unknown, which wins over True. The message of a False condition is that of the first failing node and names up to five failing nodes; when they fail for different reasons it says so, and each node's ArtifactNode has its own.

Type Meaning
Programmed Summary: True only when every other condition is True on every assigned node
ResolvedRefs The ConfigMap and Secret references resolve
DependenciesSatisfied Falco on the node provides what the artifact requires. Rulesfile and Plugin only; absent when the artifact has no source
OCIArtifactProgrammed, InlineArtifactProgrammed, ConfigMapArtifactProgrammed The source of that kind is installed
ConfigProgrammed Plugin only: its entry in the plugin configuration is written
DeletionBlocked Plugin only, True or absent: a node cannot remove the plugin because a Rulesfile there still requires it. One node is enough, and the message names the nodes. A node the selector no longer matches reports it too

Reasons of Programmed that do not come from a node's own failure:

Reason Status Meaning
Pending Unknown Not every assigned node has reported on the current generation yet. Also the initial value
GenerationPending Unknown On a node: the instance operator, or the node, has not processed the artifact's generation yet
NoNodesAssigned Unknown No node is expected to report. The message says whether the selector matches no node, or no Falco pod runs on the nodes it matches
InvalidSelector False spec.selector is not a valid label selector, so the artifact is assigned to no node and removed from the nodes that held it
NodeCapacityExceeded False A selected node already lists 100 artifacts
ProgramFailed False Another condition is not True, named in the message; or the artifact declares no source, so there is nothing to install

While an artifact is being deleted, a Plugin keeps aggregating, so that a DeletionBlocked shows why it cannot go yet. A Rulesfile or a Config keeps the conditions it had: their removal cannot be blocked, and a deletion that does not finish is waiting for a node, whose ArtifactNode still lists or reports the artifact.

Restricting artifact operators to their own node

All the artifact operators of a Falco instance share one ServiceAccount, and its Role lets each of them patch every ArtifactNode of the namespace. The chart can install an admission policy (Kubernetes 1.30 or later) that only lets an artifact operator update the ArtifactNode of the node it runs on, and never its spec:

artifactNodeAdmissionPolicy:
  enabled: true

Installing it needs permission to create cluster-scoped admissionregistration.k8s.io objects.

Artifact server CA renewal

With mtls.createIssuer: true, cert-manager automatically renews the bootstrap CA certificate. The chart sets privateKey.rotationPolicy: Never on this CA so renewal reuses its private key and existing, valid server and client certificates remain trusted. This does not change the renewal or key rotation policy of those server and client certificates, or of externally managed CAs.

The chart does not automate CA key rotation. Its trust-manager Bundle normally contains one CA; replacing that CA does not retain trust in the old one, and a CA Secret update does not automatically reissue existing leaf certificates. Plan a dual-trust interval, renew the server and all client certificates against the new CA, and verify their use before withdrawing the old CA. Review the CA issuer requirements before changing the issuer. Key reuse cannot recover a lost CA key or undo a rotation already underway.

Excluding labels from propagation

The operator copies the labels of a Falco (or Component) resource onto the resources it generates. Some external tools add their own labels to the resources they manage and rely on them to decide which objects they own. When such a label is copied onto a generated resource, the tool may treat that resource as one of its own and remove it when it is not part of its desired state. Namespaced resources are protected by their OwnerReference, but cluster-scoped resources (ClusterRole, ClusterRoleBinding) cannot carry one, so they may be removed and recreated repeatedly.

The --excluded-labels flag lists label keys the operator must not copy from the resource's metadata.labels onto the resources it generates. Matching keys are dropped wherever the operator would propagate them — including the workload metadata and its pod template — while pod selector labels are always preserved. Labels you set explicitly (for example in spec.podTemplateSpec.metadata.labels) are left untouched. The * wildcard is supported and the flag may be repeated.

The Helm chart exposes this as the excludedLabels array. It is empty by default — add the label keys your environment requires:

excludedLabels:
  - argocd.argoproj.io/instance
  - kustomize.toolkit.fluxcd.io/name
  - kustomize.toolkit.fluxcd.io/namespace