MCPcopy Index your code
hub / github.com/FCSC-FR/couic

github.com/FCSC-FR/couic @v1.0.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.2 ↗ · + Follow
617 symbols 1,069 edges 69 files 54 documented · 9%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Couic logo

couic

<strong>eBPF firewall that cuts fast!</strong>


A lightweight XDP-powered network filtering solution controllable through a REST API.






<a href="https://github.com/FCSC-FR/couic/actions/workflows/ci.yml"><img src="https://github.com/FCSC-FR/couic/actions/workflows/ci.yml/badge.svg" alt="Github Actions Clippy" /></a>
<a href="https://couic.net" target="_blank"><img src="https://img.shields.io/badge/docs-online-blue" alt="Couic Online Documentation" /></a>

Introduction

Couic [kwɪk] is a lightweight eBPF-powered network filtering solution specifically designed to defend against Layer 7 (application layer) DDoS attacks. It attaches on network interfaces using XDP and then exposes an HTTP REST API to manage blocklists and allowlists.

Couic has been used in production since 2021, evolving every year and taking different forms to adapt to the needs of the France Cybersecurity Challenge🦕 infrastructure. This CTF competition, organized every year by ANSSI (the French national cybersecurity agency), requires a good level of protection against platform overload caused by CTF participants as well as DDoS attacks, especially at layer 7.

This program is designed to complement the L3/L4 protection measures implemented by the hosting provider by focusing on application-layer threats that bypass lower-layer defenses. It aims to be as simple and efficient as possible and to work alongside existing filtering solutions on the server (iptables, ipsets, nftables...).

Couic was presented for the first time during SSTIC2024 symposium[^1].

Features

  • Linux 5.11+ support
  • IPv4 and IPv6 CIDRs support
  • Static configuration using set files
  • Dynamic configuration with the JSON API
  • Ease of use with the provided CLI
  • Anti Lock-out system thanks to IGNORE and DROP filtering policies
  • Automatic expiration of API-added entries
  • Tagging to facilitate entry management
  • Real-time monitoring of network and eBPF-program performance with Prometheus exporter endpoint
  • Reporting with webhook notifications for filtering activity
  • Simple Synchronisation between distributed instances of Couic
  • High performance packet processing

Project Architecture

The project provides a programmable firewall built around two core components, with auxiliary tools provided as integration examples:

Couic System Architecture

Component Type Purpose Status
couic Core eBPF filtering daemon with REST API (via Unix Domain Socket) Public
couicctl Core Command-line administration tool Public
couic-report Auxiliary Telemetry aggregation and notifications (Discord) Public
couicmon Auxiliary Log-based automatic rule injection Coming soon
client Library REST API client implementation Public
common Library Shared types and definitions for Couic components Public

[!TIP] Couic is designed as a filtering backend. Users are encouraged to connect their own solutions or develop custom modules using the REST API. An OpenAPI specification is provided to facilitate client development.

Documentation

Comprehensive documentation—including Getting Started, Administration, and Reference sections—is available in the Couic Documentation.

Licence

This project is licensed under either of Apache License, Version 2.0 or MIT at your option.

[^1]: Read more about Couic story (previously Hodor) in the paper (french): SSTIC2024 - Retour d’expérience sur l’organisation d’un CTF : Rétrospective de 5 ans de FCSC

Extension points exported contracts — how you extend this code

ValidateFrom (Interface)
Trait for validation: 1. Input is deserialized with primitive types (serde never fails on content) 2. Input is converted [7 …
common/src/validation.rs
Command (Interface)
(no doc) [4 implementers]
couicctl/src/cli/mod.rs
Notifier (Interface)
(no doc) [1 implementers]
couic-report/src/notifier/mod.rs
PolicyAction (Interface)
(no doc) [2 implementers]
couicctl/src/cli/policy.rs

Core symbols most depended-on inside this repo

into_response
called by 43
couic/src/error.rs
get
called by 27
client/src/lib.rs
add_detail
called by 26
common/src/error.rs
as_str
called by 17
common/src/tag.rs
acquire
called by 16
couic/src/firewall/tag.rs
create_test_config
called by 16
couic/src/api/rbac.rs
add_client
called by 12
couic/src/api/rbac.rs
get_current_user_group
called by 10
couic/src/security.rs

Shape

Function 255
Method 237
Class 89
Enum 32
Interface 4

Languages

Rust100%

Modules by API surface

couic/src/api/rbac.rs44 symbols
couic/src/config.rs35 symbols
client/src/lib.rs35 symbols
couic/src/firewall/service.rs30 symbols
common/src/cidr.rs27 symbols
couicctl/src/cli/policy.rs23 symbols
common/src/tag.rs23 symbols
couic/src/firewall/tag.rs21 symbols
common/src/error.rs21 symbols
common/src/setname.rs20 symbols
common/src/rawentry.rs20 symbols
common/src/clientname.rs20 symbols

For agents

$ claude mcp add couic \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact