Skip to content

Commit

Permalink
docs: describe features in readme, add namib project logo
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhb committed Feb 6, 2024
1 parent 5e10bbb commit 9cc11f0
Showing 1 changed file with 44 additions and 15 deletions.
59 changes: 44 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,54 @@
# nftables-rs   [![Latest Version]][crates.io] [![docs.io Badge]][docs.io] [![Actions Badge]][Actions] [![license Badge]][license]
<h1>
<p align="center">
<a href="README.md">
<img src="https://avatars.githubusercontent.com/u/74997251?s=400&u=72b0315c726d0b2e0a85d7da71cfc18ce8fb0d14&v=4" alt="Logo" width="160" height="160">
</a>
<br>nftables-rs
</h1>

[Latest Version]: https://img.shields.io/crates/v/nftables.svg
[crates.io]: https://crates.io/crates/nftables
[docs.io Badge]: https://img.shields.io/badge/docs.rs-nftables-green.svg
[docs.io]: https://docs.rs/nftables/latest/nftables/
[Actions Badge]: https://github.com/namib-project/nftables-rs/actions/workflows/rust.yml/badge.svg
[Actions]: https://github.com/namib-project/nftables-rs/actions/workflows/rust.yml
[license Badge]: https://img.shields.io/crates/l/nftables.svg
[license]: LICENSE-MIT
<h3 align='center'> Automate modern Linux firewalls with nftables through its declarative and imperative JSON API in Rust. </h3>

Safe abstraction for nftables JSON API ([libnftables-json](https://manpages.debian.org/testing/libnftables1/libnftables-json.5.en.html)).
It can be used to create nftables rulesets in Rust and parse existing nftables rulesets from JSON.
This library can also interact with local nftables system with helper functions for reading and applying rulesets.
<!-- primary badges -------------------------------------->
<p align="center">
<!-- version -->
<a href="https://crates.io/crates/nftables"><img src='https://img.shields.io/crates/v/nftables.svg' /></a>
<!-- downloads -->
<a href="https://crates.io/crates/nftables"><img alt="Crates.io Total Downloads" src="https://img.shields.io/crates/d/nftables"></a>
<!-- docs.io -->
<a href="https://docs.rs/nftables/latest/nftables/"><img alt="rs" src="https://img.shields.io/badge/docs.rs-nftables-green.svg"></a>
<!-- actions: rust -->
<a href="https://github.com/namib-project/nftables-rs/actions/workflows/rust.yml"><img alt="Actions Workflow Status" src="https://github.com/namib-project/nftables-rs/actions/workflows/rust.yml/badge.svg"></a>
<!-- license -->
<a href="LICENSE-MIT"><img alt="License" src="https://img.shields.io/crates/l/nftables.svg"></a>
</p>
<br/>

nftables-rs is inspired by [nftnl-rs](https://github.com/mullvad/nftnl-rs), which directly accesses the nf_tables kernel subsystem to work with nftables.
The goal of this library is to provide access to the complete expressiveness of the nftables schema.
## Features 🌟

- 🛡️ **Safe and Easy-to-Use Abstraction**: Provides a high-level, safe abstraction over the [nftables JSON API](https://manpages.debian.org/testing/libnftables1/libnftables-json.5.en.html), making it easier and safer to work with nftables in Rust.

- 🛠️ **Comprehensive Functions**: Includes a wide range of functions to create, read, and apply nftables rulesets directly from Rust, streamlining the management of firewall rules.

- 📄 **JSON Parsing and Generation**: Offers detailed parsing and generation capabilities for nftables rulesets in JSON format, enabling seamless integration and manipulation of rulesets.

- 💡 **Inspired by nftnl-rs**: While taking inspiration from [nftnl-rs](https://github.com/mullvad/nftnl-rs), `nftables-rs` focuses on utilizing the JSON API for broader accessibility and catering to diverse use cases.

## Motivation

`nftables-rs` is a Rust library designed to provide a safe and easy-to-use abstraction over the nftables JSON API, known as libnftables-json.

This library is engineered for developers who need to interact with nftables, the Linux kernel's next-generation firewalling tool, directly from Rust applications.
By abstracting the underlying JSON API, nftables-rs facilitates the creation, manipulation, and application of firewall rulesets without requiring deep knowledge of nftables' internal workings.

## Installation

```toml
[dependencies]
nftables = "0.2.0"
nftables = "0.3.0"
```

Linux nftables v0.9.3 or newer is required at runtime: `nft --version`

## Example

Here are some examples that show use cases of this library.
Expand Down Expand Up @@ -113,3 +141,4 @@ This project is currently maintained by the following developers:
| Name | Email Address | GitHub Username |
|:----------------:|:----------------------:|:--------------------------------------------:|
| Jasper Wiegratz | wiegratz@uni-bremen.de | [@jwhb](https://github.com/jwhb) |

0 comments on commit 9cc11f0

Please sign in to comment.