fiberfw
A Go API that follows the system logs and manages firewall and log data in PostgreSQL.
fiberfw is an API that follows the server's syslog and collects and manages firewall and log data in PostgreSQL. I wrote it in Go on the Fiber web framework. The API definitions are generated in OpenAPI format with Huma.
Purpose
A server's firewall and system logs usually pile up in plain text files. Searching, filtering and looking back through those records inside files is tedious. With fiberfw I wanted to move this data into a database that can be queried and to reach it through an API.
How it works
The application follows the system's syslog and writes firewall and log data to a PostgreSQL database. This data is managed through an HTTP API built with Fiber. Syslog is the standard logging mechanism on Linux and Unix systems that collects log messages from services and the kernel.
The API endpoints are defined with Huma, a library that automatically produces an OpenAPI document from endpoints written in Go. OpenAPI is a standard that describes an API's addresses, parameters and responses in a form machines can read as well.
Key features
- Firewall and log data are collected by following syslog.
- The collected data is stored in PostgreSQL, so it can be queried with SQL.
- The data is managed through an HTTP API.
- Thanks to Huma, the API is documented in OpenAPI format and is easy to call from other tools.
Technical stack
The project is written in Go. I use the Fiber framework for the HTTP layer, Huma for API definitions and the OpenAPI document, and PostgreSQL for storage.
Use cases
- Collecting a server's firewall records in a central database.
- Serving log data to an admin panel or another service through an API.
- Working with tools that generate client code from the OpenAPI document.
- Category
- Networking, servers & infrastructure
- Year
- 2025
Technologies
- Go
- Fiber
- OpenAPI
- PostgreSQL
- Security