|
| 1 | +# Falco Headlamp Plugin |
| 2 | + |
| 3 | +A modern, Headlamp plugin for visualizing and managing [Falco](https://falco.org/) security events and rules in Kubernetes clusters. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Falco Events Viewer:** |
| 8 | + |
| 9 | + - Real-time streaming and display of Falco security events from all cluster namespaces. |
| 10 | + - Powerful search and filter UI for namespaces, pods, containers, and severity. |
| 11 | + - Multiple backend options: file-based (default) or Redis for persistent storage. |
| 12 | + - Fully type-safe event handling and clear, maintainable utility functions. |
| 13 | + |
| 14 | +- **Falco Rules Explorer:** |
| 15 | + |
| 16 | + - Lists all Falco rules loaded in the cluster, with support for multiple pods and custom rule files. |
| 17 | + - Search and filter by rule name, description, pod, or source file. |
| 18 | + |
| 19 | +- **Storage Backends:** |
| 20 | + |
| 21 | + - **File-based** (default): Access events directly from Falco output files. |
| 22 | + - **Redis**: Store events in Redis for persistence and centralized access via a Redis REST proxy. |
| 23 | + |
| 24 | +## Prerequisites |
| 25 | + |
| 26 | +Before you begin, ensure you have the following: |
| 27 | + |
| 28 | +- A running Kubernetes cluster (minikube, kind, or a production cluster) |
| 29 | +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) installed and configured |
| 30 | +- [Helm](https://helm.sh/docs/intro/install/) v3+ installed |
| 31 | +- [Node.js](https://nodejs.org/) and npm installed (for development) |
| 32 | +- [Headlamp](https://headlamp.dev/docs/latest/installation/) installed and access to your cluster |
| 33 | + |
| 34 | +## Setup |
| 35 | + |
| 36 | +### Basic Setup |
| 37 | + |
| 38 | +1. Clone this repository and install dependencies: |
| 39 | + |
| 40 | + ```bash |
| 41 | + npm install |
| 42 | + ``` |
| 43 | + |
| 44 | +2. Install Falco with file output enabled: |
| 45 | + |
| 46 | + ```bash |
| 47 | + helm install falco falcosecurity/falco \ |
| 48 | + --namespace falco \ |
| 49 | + --set falco.file_output.enabled=true \ |
| 50 | + --set falco.file_output.filename="/tmp/falco_events.json" \ |
| 51 | + --set falco.file_output.keep_alive=true \ |
| 52 | + --set falco.json_output=true \ |
| 53 | + --set driver.kind=modern_ebpf \ |
| 54 | + --set falco.tty=true |
| 55 | + ``` |
| 56 | + |
| 57 | +### Redis Backend Setup |
| 58 | + |
| 59 | +To use the Redis backend for persistent event storage: |
| 60 | + |
| 61 | +1. Deploy Redis and the REST proxy in your Kubernetes cluster: |
| 62 | + |
| 63 | + ```bash |
| 64 | + npm run setup-redis |
| 65 | + ``` |
| 66 | + |
| 67 | + > **Important Note:** If you already have a Redis server but not the REST proxy, you must still deploy the Redis REST proxy component. This plugin communicates with Redis via HTTP and requires the proxy layer. |
| 68 | + > |
| 69 | + > **For Production Environments**: To connect to your existing Redis server, modify `redis/redis-rest-proxy.yaml` by changing line 46 in the Python code: |
| 70 | + > |
| 71 | + > ```python |
| 72 | + > # Change this line: |
| 73 | + > rclient = redis.Redis(host='redis-service', port=6379) |
| 74 | + > |
| 75 | + > # To point to your Redis server: |
| 76 | + > rclient = redis.Redis(host='your-redis-hostname', port=6379, password='your-password-if-needed') |
| 77 | + > ``` |
| 78 | + > |
| 79 | + > You may also need to adjust security settings, resource limits, and consider adding persistence for production deployments. |
| 80 | +
|
| 81 | +2. Install Falco with both file and Redis output enabled using our provided values file: |
| 82 | +
|
| 83 | + ```bash |
| 84 | + # The falco-values.yaml file in the repo already contains the Redis configuration |
| 85 | + helm install falco falcosecurity/falco \ |
| 86 | + --namespace falco \ |
| 87 | + --set falco.file_output.enabled=true \ |
| 88 | + --set falco.file_output.filename="/tmp/falco_events.json" \ |
| 89 | + --set falco.file_output.keep_alive=true \ |
| 90 | + --set falco.json_output=true \ |
| 91 | + --set driver.kind=modern_ebpf \ |
| 92 | + --values=falco-values.yaml \ |
| 93 | + --set falco.tty=true |
| 94 | + ``` |
| 95 | +
|
| 96 | +3. In the plugin settings, switch to Redis backend and test the connection. |
| 97 | +
|
| 98 | +## Development |
| 99 | +
|
| 100 | +To develop or extend this plugin: |
| 101 | +
|
| 102 | +1. Clone this repository and install dependencies (see `package.json`). |
| 103 | +2. Run Headlamp in plugin development mode. |
| 104 | +3. Edit TypeScript/TSX files in `src/` for UI or logic changes. |
| 105 | +4. All contributions must maintain or improve type safety and documentation. |
| 106 | +
|
| 107 | +See the following resources for Headlamp plugin development: |
| 108 | +
|
| 109 | +- [Headlamp Plugin Getting Started](https://headlamp.dev/docs/latest/development/plugins/) |
| 110 | +- [Headlamp API Reference](https://headlamp.dev/docs/latest/development/api/) |
| 111 | +- [UI Component Storybook](https://headlamp.dev/docs/latest/development/frontend/#storybook) |
| 112 | +- [Plugin Examples](https://github.com/headlamp-k8s/headlamp/tree/main/plugins/examples) |
| 113 | +
|
| 114 | +## Contributing |
| 115 | +
|
| 116 | +Contributions are welcome! Please ensure that: |
| 117 | +
|
| 118 | +- All new code is type-safe and well-documented. |
| 119 | +- Comments describing utility functions are replaced with TypeScript type annotations and JSDoc comments. |
| 120 | +- No business logic or user experience is broken by refactors. |
0 commit comments