# falcosecurity/falco-talon architecture

> Architecture diagram of the GitHub repository falcosecurity/falco-talon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/falcosecurity/falco-talon
- Repository: https://github.com/falcosecurity/falco-talon

## Overview

##### Main components
- External Event Sources: Represent Falco and Falcosidekick as external systems that send events.
- Falco Talon Core: The heart of the application that receives and processes events. This core includes:
- The rule engine (rules defined in YAML files like rules.yaml and rules_override.yaml) that decides what action(s) to run based on event characteristics.
- The configuration component (loaded from config.yaml or environment variables, as per the “Configuration” section in the README).
- The context builder that gathers information from Falco events, Falco Talon elements, and Kubernetes (see directories under internal/context).
- Actionners: A modular set of components that carry out specific actions. The “actionners” directory is divided by targets (aws, gcp, calico, cilium, kubernetes, etc.). Each actionner executes a particular remediation or operational action.
- Notifiers: The “notifiers” directory contains components (Slack, HTTP, Elasticsearch, SMTP, webhook, etc.) that send notifications after an action.
- Outputs: The “outputs” directory represents storage or logging sinks such as S3, file systems, GCS, or Minio.
- Supporting Internal Libraries: Look at the “internal” directory which holds clients, checks, handlers, events processing, and models. These underpin the proper functioning of actionners and provide integration with external services (for instance, AWS, Kubernetes, GCP, and even Observability layers like OTLP metrics and traces).
- Command-line Interface & Server: The “cmd” directory contains the executables (actionners.go, notifiers.go, server.go, etc.) which bootstrap the system and expose endpoints (e.g., /metrics) for monitoring.

##### Diagramming relationships and data flow
o The Rule Engine (driving decisions on actions).
o The Context Builder (merging events with additional Kubernetes context).
o The Configuration Manager.
- Don’t forget to include the integration with external observability components:
o Metrics: Expose /metrics endpoints (Prometheus and OTEL) as seen in the deployment/composition.
o Tracing: OTEL traces export.

##### Architectural patterns and design principles
- Extensibility: The projects’ file tree shows “internal” packages for clients and checks; these support adding more integrations without affecting the core logic.

##### Technologies and deployment aspects
- Deployment artifacts such as Docker images built via “ko” and the Helm chart configuration (from the deployment/compose directory). Include a small note indicating that the system can be deployed in Kubernetes using Helm.
- Mention that observability is provided with Prometheus, Grafana, Loki, Tempo, and OTEL collectors—all integrated in the Docker Compose stack provided for local development.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Sources
    subgraph "External Sources"
        Falco["Falco"]:::external
        Falcosidekick["Falcosidekick"]:::external
        Kube["Kubernetes (Context)"]:::external
    end

    %% Falco Talon Core and its Subcomponents
    subgraph "Falco Talon Core"
        Core["Falco Talon Core"]:::core
        RE["Rule Engine"]:::core
        Config["Configuration Component"]:::core
        ContextBuilder["Context Builder"]:::core
        Core --> RE
        Core --> Config
        Core --> ContextBuilder
    end

    %% Extensions: Actions, Notifications, Outputs
    subgraph "Extensions"
        Actionners["Actionners"]:::action
        Notifiers["Notifiers"]:::notifier
        Outputs["Outputs"]:::output
    end

    %% Supporting Libraries and Deployment
    subgraph "Supporting and Deployment"
        Internal["Internal Libraries"]:::support
        CLI["CLI & Server"]:::cli
        Observability["Observability (/metrics, OTEL)"]:::observability
    end

    %% Data Flow Connections
    Falco -->|"sendsEvent"| Core
    Falcosidekick -->|"sendsEvent"| Core
    Kube -.->|"providesContext"| Core

    RE -->|"executeAction"| Actionners
    RE -->|"sendNotification"| Notifiers
    RE -->|"logOutput"| Outputs

    Core -->|"usesLibs"| Internal
    Core -->|"managesDeployment"| CLI
    Core -->|"reportsMetrics"| Observability

    %% Click Events for Component Mapping
    click RE "https://github.com/falcosecurity/falco-talon/blob/main/internal/rules/rules.go"
    click RE "https://github.com/falcosecurity/falco-talon/blob/main/internal/rules/priority.go"
    click Config "https://github.com/falcosecurity/falco-talon/blob/main/config_example.yaml"
    click Config "https://github.com/falcosecurity/falco-talon/blob/main/configuration/configuration.go"
    click Config "https://github.com/falcosecurity/falco-talon/blob/main/configuration/version.go"
    click ContextBuilder "https://github.com/falcosecurity/falco-talon/tree/main/internal/context"
    click ContextBuilder "https://github.com/falcosecurity/falco-talon/blob/main/internal/context/aws/aws.go"
    click ContextBuilder "https://github.com/falcosecurity/falco-talon/blob/main/internal/context/kubernetes/kubernetes.go"
    click Actionners "https://github.com/falcosecurity/falco-talon/tree/main/actionners"
    click Notifiers "https://github.com/falcosecurity/falco-talon/tree/main/notifiers"
    click Outputs "https://github.com/falcosecurity/falco-talon/tree/main/outputs"
    click Internal "https://github.com/falcosecurity/falco-talon/tree/main/internal"
    click CLI "https://github.com/falcosecurity/falco-talon/tree/main/cmd"

    %% Styling
    classDef external fill:#f9c,stroke:#333,stroke-width:2px;
    classDef core fill:#bbf,stroke:#333,stroke-width:2px;
    classDef action fill:#cfc,stroke:#333,stroke-width:2px;
    classDef notifier fill:#cff,stroke:#333,stroke-width:2px;
    classDef output fill:#fcf,stroke:#333,stroke-width:2px;
    classDef support fill:#ffd,stroke:#333,stroke-width:2px;
    classDef cli fill:#fdd,stroke:#333,stroke-width:2px;
    classDef observability fill:#dfd,stroke:#333,stroke-width:2px;
```
