Commit Graph

247 Commits

Author SHA1 Message Date
Marco Cadetg
52fb1c2cce feat: make eBPF default on Linux (#46)
Make eBPF the default build configuration on Linux for better
performance and lower overhead process identification.

Changes:
- Set default features to include ebpf in Cargo.toml
- Remove explicit --features linux-default from build configs
- Update all documentation to reflect eBPF is now default
- Add instructions for building without eBPF (--no-default-features)

eBPF automatically falls back to procfs if it fails to load.

Closes #32
2025-10-12 13:53:11 +02:00
Marco Cadetg
811c0f8659 docs: add contributors 2025-10-12 09:11:59 +02:00
Marco Cadetg
0fa0a61ab7 feat: add JSON logging for SIEM integration (#9) (#44)
Add --json-log flag to output connection events as JSON lines.
Logs new_connection and connection_closed events with IPs, ports,
protocol, DPI info, and traffic statistics for SIEM tools.
2025-10-12 09:11:08 +02:00
Marco Cadetg
529cab9d12 fix: eliminate excessive procfs scanning causing high CPU usage (#45)
The procfs-based process lookup was triggering a full scan on every cache
miss instead of relying on periodic refresh. This caused 50+ full procfs
scans per enrichment cycle when multiple connections lacked process info.

Changed get_process_for_connection() to do simple cache lookups only.
Periodic refresh (every 5s) is already handled by the enrichment thread.

Also added PROFILING.md with flamegraph profiling guide.
2025-10-11 16:40:47 +02:00
Marco Cadetg
0d55a86605 Add TUN/TAP interface support (#43)
* feat: add TUN/TAP interface support

Add comprehensive support for TUN/TAP virtual network interfaces by
refactoring link layer parsing into modular components.

New modules:
- link_layer: Modular packet parsing (ethernet, raw_ip, linux_sll, tun_tap)
- protocol: Dedicated TCP/UDP/ICMP parsers

Changes:
- Remove TUN/TAP interface exclusions in capture.rs
- Add TUN/TAP detection and parsing support
- macOS PKTAP support with conditional compilation

Platform compatibility:
- Linux: Full TUN/TAP support
- macOS: TUN (utun*) and TAP support
- Windows: No breaking changes

Fixes #39
2025-10-11 14:10:50 +02:00
Marco Cadetg
5ad0095b91 feat: make rustnet rusty again 2025-10-09 20:10:06 +02:00
Marco Cadetg
21f2814f35 docs: document musl static build challenges (#42)
Adds documentation explaining why musl static builds are not currently provided
and the technical challenges encountered during implementation attempts.

The main issue appears to be related to statically linking libpcap with musl,
which resulted in linker errors. The ubuntu-22.04 pinning already solves the
GLIBC compatibility issue reported in #40.

This document serves as a reference for anyone interested in pursuing musl
builds in the future.
2025-10-09 16:31:13 +02:00
Marco Cadetg
9f5ef592bf chore: use ubuntu 22.04 on linux x86 builds 2025-10-09 15:03:49 +02:00
Marco Cadetg
a51efe309b Update INSTALL.md 2025-10-09 13:14:31 +02:00
Marco Cadetg
b6b593056c docs: restructure documentation into focused files
Split large README.md (1101 lines) into separate documentation files
for better organization and maintainability:

- README.md: condensed to 233 lines with quick start and overview
- INSTALL.md: complete installation guide and permissions setup
- USAGE.md: detailed usage guide with filtering and sorting
- ARCHITECTURE.md: technical details and platform implementations
- EBPF_BUILD.md: updated references to new INSTALL.md structure

Added collapsible sections in README for optional details and
included "Documentation Moved" section for backward compatibility
with external links.
2025-10-09 13:12:47 +02:00
Marco Cadetg
b0f2d01510 Remove AppImage packaging and add desktop integration to RPM
- Remove AppImage files (incompatible with capabilities/setcap)
- Add icon and desktop file to cargo-generate-rpm in Cargo.toml
- Add icon and desktop file to Fedora COPR spec file
- RPM packages now have proper desktop integration like DEB packages
2025-10-09 12:49:33 +02:00
Marco Cadetg
0229fa1079 chore: update build dependencies 2025-10-09 12:21:58 +02:00
Marco Cadetg
0d02b99b79 Bundle vmlinux.h files to eliminate network dependency during builds (#41)
* feat: bundle vmlinux.h files to eliminate network dependency during builds

- Add bundled vmlinux.h for x86, aarch64, and arm (~3MB total)
- Remove network download code from build.rs
- Remove ureq dependency and transitive deps
- Update Dockerfile to copy bundled headers
- Remove obsolete vmlinux_min.h
- Update documentation to reflect bundled approach

Fixes #38
2025-10-09 12:07:40 +02:00
Marco Cadetg
24efc498f5 chore: fedora copr install instructions 2025-10-04 20:23:19 +02:00
Marco Cadetg
d029611024 feat: fedora copr rpm 2025-10-04 19:41:56 +02:00
Marco Cadetg
ed543746a0 Release v0.13.0
- Windows process identification via IP Helper API
- Privilege detection with platform-specific guidance
- Fix packet length calculation for large packets
v0.13.0
2025-10-04 16:54:04 +02:00
Marco Cadetg
6a8e738a63 feat: implement Windows process identification via IP Helper API (#37)
- Add Windows process lookup using GetExtendedTcpTable/GetExtendedUdpTable
- Resolve process names via OpenProcess and QueryFullProcessImageNameW
- Support TCP/UDP IPv4 and IPv6 connections
- Implement time-based caching with 2-second TTL
- Fix port byte order conversion from network to host order
- Migrate from winapi to windows crate (v0.59)
- Add debug logging for process lookup operations
- Update documentation in ROADMAP.md and README.md

Closes #36
2025-10-04 16:32:08 +02:00
Marco Cadetg
80b5b0c2c1 feat: privilege detection (#31)
* feat: detect insufficient privileges before network interface access

- Add privilege detection module for Linux, macOS, and Windows
- Check privileges before TUI initialization for visible errors
- Provide platform-specific instructions (sudo, setcap, Docker flags)
- Detect container environments and provide Docker-specific guidance
2025-10-04 15:33:42 +02:00
Marco Cadetg
c832718833 fix: use actual packet length from IP headers instead of captured length (#35)
Fixes #34 - Extract actual packet size from IP header Total Length field
instead of using captured buffer length (limited by snaplen). This fixes
severe undercounting for large packets (NFS, jumbo frames).
2025-10-03 21:20:52 +02:00
Marco Cadetg
2df8f14d6c chore: fix markdown checkbox syntax 2025-10-03 17:01:00 +02:00
Marco Cadetg
97ae20cd7b chore: document arch linux installation 2025-10-03 15:25:53 +02:00
Marco Cadetg
12a7d2e51a fix: add build dependencies to publish workflow v0.12.1 2025-10-02 09:07:41 +02:00
Marco Cadetg
7f7925b5e4 Release v0.12.1
- Improved crate metadata for crates.io publishing
2025-10-02 08:58:49 +02:00
Marco Cadetg
e22c95fec1 fix: remove vmlinux crate dep (#28)
* fix: remove vmlinux crate dep

* fix: download architecture-specific vmlinux.h at build time

Instead of using a git dependency (not allowed on crates.io), download the
architecture-specific vmlinux.h header at build time from the libbpf/vmlinux.h
repository. This approach:

- Removes git dependency from Cargo.toml (crates.io compatible)
- Downloads correct arch-specific header (x86, aarch64, arm)
- Caches downloaded headers in OUT_DIR (reuses between builds)
- Works with cargo install
- Supports cross-compilation for all architectures

The vmlinux.h file (~3-4MB per arch) is downloaded once per architecture
and cached, so subsequent builds are fast.

* fix: use ureq with rustls instead of http_req

http_req depends on native-tls/openssl-sys which requires OpenSSL to be
installed in the cross-compilation containers. Switch to ureq with the
rustls backend which has no system dependencies and works in all
cross-compilation environments.

* fix: follow symlink when downloading vmlinux.h

The vmlinux.h files in the libbpf/vmlinux.h repository are symlinks to
versioned files (e.g. vmlinux_6.14.h). When downloading via
raw.githubusercontent.com, we get the symlink content (just the target
filename) instead of the actual file.

Solution: Download the symlink first to get the target filename, then
download the actual versioned file. This ensures we get the full header
content instead of just the symlink text.

* add crate publish workflow
2025-10-02 08:49:20 +02:00
Marco Cadetg
df38754959 Release v0.12.0
### Added
- Vim-style navigation (g/G) for jumping to beginning/end of connection list
- Comprehensive table sorting functionality with visual indicators
- Port display toggle (p key) to switch between service names and port numbers
- Enhanced connection navigation with better cleanup indication
- Localhost filtering control with --show-localhost flag

### Fixed
- Windows double key event handling
- Windows MSI runtime dependency checks for Npcap/WinPcap
- Linux "any" interface selection
- Package dependencies cleanup (removed clang/llvm from RPM/DEB)
- Docker build stability (removed armv7)
v0.12.0
2025-10-01 20:48:22 +02:00
Marco Cadetg
9481cef4fd Fix windows double key issue (#27)
* fix: windows double key event
2025-10-01 20:28:39 +02:00
Marco Cadetg
9ac3714ca4 fix: windows msi missing VC++ dist (#26)
- Add startup check that detects missing Npcap/WinPcap DLLs
- Display helpful error message with installation instructions
- Update README with note about runtime dependency checking
- Add winapi dependency for Windows DLL detection
2025-10-01 20:17:37 +02:00
Marco Cadetg
34fcec5273 feat: vim style g and shift G jump beginning / end 2025-10-01 18:25:23 +02:00
Marco Cadetg
ac1c954d43 update roadmap 2025-10-01 18:19:56 +02:00
Marco Cadetg
e2bba4c854 fix: any interface on linux and add --show-localhost (#25) 2025-10-01 18:10:24 +02:00
Marco Cadetg
1cd719ab3b fix: allow any interface on linux (#24) 2025-10-01 17:41:38 +02:00
Marco Cadetg
ebdbff6b7c feat: improve connection navigation and cleanup indication (#23) 2025-10-01 17:08:28 +02:00
Marco Cadetg
aac52a79d4 feat: adding sort (#22) 2025-10-01 10:53:56 +02:00
Marco Cadetg
5c656130e0 feat: add port option with using p (#21) 2025-10-01 07:36:30 +02:00
Marco Cadetg
27a258abb8 fix: remove runtime deps clang, llvm from rpm, deb package 2025-09-30 21:56:23 +02:00
Marco Cadetg
dceb949652 fix: remove armv7 again for docker 2025-09-30 10:17:45 +02:00
Marco Cadetg
8ade340a36 Release v0.11.0
- Docker support with eBPF for enhanced Linux performance
- Multi-architecture Docker builds (amd64, arm64, armv7)
- Cross-platform packaging and release automation
- Fixed RPM package dependencies and Windows MSI packaging
- Improved release workflow automation
v0.11.0
2025-09-30 10:11:59 +02:00
Marco Cadetg
99c69e6f51 feat: ebpf docker builds 2025-09-30 09:59:22 +02:00
Marco Cadetg
225ed42359 fix: libelf dep in rpm 2025-09-30 09:46:06 +02:00
Marco Cadetg
42db7f5614 fix: release workflow (#17)
* Remove musl targets to simplify Linux builds and fix cross-compilation issues
* Enable eBPF by default on Linux via linux-default feature for better packet capture
* Add macOS code signing and notarization support with graceful fallback for unsigned builds
* Fix Windows MSI packaging with improved WiX configuration and Npcap library linking
* Auto-extract changelog content from CHANGELOG.md into GitHub release notes
* Fix ARM cross-compilation (aarch64, armv7) with proper library paths and eBPF support
* Add comprehensive installation documentation for DMG, MSI, DEB, and RPM packages
* Allow re-running releases with --clobber flag for artifact uploads
2025-09-30 09:39:26 +02:00
Marco Cadetg
d9798f9605 maybe fix windows msi packaging 2025-09-29 21:57:44 +02:00
Marco Cadetg
eca0e6000d feat: add cross-platform packaging and release automation
- Add GitHub Actions workflow for automated releases
- Create .deb, .rpm, AppImage, .dmg, and .msi packages
- Generate shell completions and manpages in build.rs
- Add platform-specific icons from rustnet3.svg
- Include eBPF dependencies for Linux packages
- Support Windows 32-bit and 64-bit builds
- Extract shared CLI module to prevent duplication
2025-09-29 11:56:55 +02:00
Marco Cadetg
b642205e38 Release v0.10.0
- Added minimum Rust version requirement (1.88.0+)
v0.10.0
2025-09-28 17:45:10 +02:00
DeepChirp
33e80645ef chore(Cargo.lock): change package version (#16) 2025-09-26 17:33:14 +02:00
Marco Cadetg
6d451c39df RustNet version bump 0.10.0 2025-09-26 08:46:31 +02:00
Marco Cadetg
4f5d84620b add minimum rust version 2025-09-26 08:43:36 +02:00
Marco Cadetg
56c229e384 Include Cargo.lock in release commit
Updated the release process to include Cargo.lock.
2025-09-18 13:15:28 +02:00
Marco Cadetg
6e89440114 Release v0.9.0
- Experimental eBPF support for enhanced Linux socket tracking
- Windows platform support
v0.9.0
2025-09-18 11:53:33 +02:00
Marco Cadetg
799d66cf86 feat: Add experimental eBPF support for enhanced socket tracking (#11)
* feat: Add experimental eBPF support for enhanced socket tracking

- Implement eBPF-based socket tracker for Linux with CO-RE support
- Add minimal vmlinux header (5.5KB) instead of full 3.4MB file
- Create graceful fallback mechanism to procfs when eBPF unavailable
- Add comprehensive eBPF build documentation
- Integrate libbpf-rs for eBPF program loading and management
- Support both IPv4 and IPv6 socket tracking
- Add capability checking for required permissions

The eBPF feature is optional and disabled by default. When enabled,
it provides faster and more accurate process-to-socket mapping on
Linux systems with appropriate permissions.
2025-09-18 11:46:03 +02:00
Marco Cadetg
47d9748fba Update README.md badges
Removed unused badges and added Docker image badge.
2025-09-12 21:09:18 +02:00