Commit Graph

26 Commits

Author SHA1 Message Date
Marco Cadetg
e87696b4b5 chore: remove unused deps, add cargo audit to CI 2025-12-29 17:24:00 +01:00
Marco Cadetg
7f9dd7c336 fix: use as_ref() for safer pointer dereference in interface stats (#105) 2025-12-21 14:56:02 +01:00
Marco Cadetg
37486111c4 feat(logging): add pid, process_name, service_name to JSON log (#102)
* feat(logging): add pid, process_name, service_name to JSON log (#99)

* feat(logging): add connection direction to JSON log for TCP
2025-12-20 17:48:49 +01:00
Marco Cadetg
b12b7d38ab fix(linux): resolve eBPF thread names to main process names (#87)
Use periodic procfs PID cache to resolve thread names (e.g. 'Socket Thread')
to main process names (e.g. 'firefox'). Falls back to eBPF name for
short-lived processes that have already exited.
2025-12-07 11:24:58 +01:00
Marco Cadetg
5a059a3a12 feat: add Landlock sandbox and capability dropping for Linux (#86)
* feat: add Landlock sandbox and capability dropping for Linux

- Restrict filesystem access to /proc only after initialization
- Block TCP bind/connect on kernel 6.4+ (network sandbox)
- Drop CAP_NET_RAW after pcap handle opened
- Add --no-sandbox and --sandbox-strict CLI options
- Show privilege info on non-Linux platforms in UI
- Add SECURITY.md documentation

* fix: remove unused set_sandbox_info and hide Landlock line on non-Linux

* fix: gate SandboxInfo to Linux only to fix clippy warnings

* fix: add is_admin() function for Windows builds

The Windows build was failing because ui.rs called crate::is_admin()
but the function didn't exist. Added the implementation using Windows
Security API to check if the process has elevated privileges.

Also added Win32_Security feature to windows crate dependencies.

* fix: add is_admin() to main.rs for Windows binary crate

The previous fix added is_admin() to lib.rs but ui.rs is compiled
as part of the binary crate (main.rs), not the library crate.
Added the function to main.rs so crate::is_admin() resolves correctly.
2025-12-06 17:50:21 +01:00
Marco Cadetg
5c8ca435b3 refactor: simplify QUIC DPI and reorganize platform code (#84)
* refactor: simplify QUIC DPI and unify SNI extraction helpers

* refactor: reorganize platform code and improve code structure
2025-12-06 13:31:17 +01:00
Marco Cadetg
3a8e8614bc feat: reorganize platform code into per-platform directories (#81)
* feat: reorganize platform code into per-platform directories

- Move platform files into linux/, macos/, windows/, freebsd/ subdirectories
- Unify create_process_lookup() API with _use_pktap parameter across all platforms
- Update build.rs paths for eBPF program location
- Reduce cfg attributes in main mod.rs from ~42 to 8

* fix: widen tolerance for test_sliding_window_no_skip_first_sample

Increase acceptable range from 9000-11000 to 5000-15000 to account
for timing variability on macOS ARM CI runners.

* docs: update Linux build dependencies and remove EBPF_BUILD.md

- Add missing build-essential, pkg-config, zlib1g-dev to documentation
- Update rust.yml CI with complete dependencies
- Remove EBPF_BUILD.md (info already in INSTALL.md)
- Update references in README.md and ARCHITECTURE.md
2025-11-30 18:08:11 +01:00
Marco Cadetg
6e1426170b Feature/interface stats (#79)
* feat: adding interface stats

* macOS specific improvements

* fix windows interface stats
2025-11-22 17:34:53 +01:00
Marco Cadetg
85b2662c85 feat: add freebsd (#71)
* feat: add freebsd
2025-11-02 19:47:26 +01:00
Marco Cadetg
03cc04624f chore: cleanup dead code 2025-10-31 14:31:07 +01:00
Marco Cadetg
4ae965a8a4 feat: remove CAP_NET_ADMIN and CAP_SYS_ADMIN, use read-only packet capture (#59)
Remove CAP_NET_ADMIN requirement and eliminate need for CAP_SYS_ADMIN on
modern kernels by using non-promiscuous mode for packet capture. This
significantly reduces security surface by following principle of least privilege.
2025-10-19 17:03:58 +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
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
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
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
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
3d4b1a8121 feat: successfully tested on windows 2025-09-12 17:57:49 +02:00
Marco Cadetg
3329eed6c5 cargo fmt 2025-09-09 15:45:14 +02:00
Marco Cadetg
a51acfbe28 improve linux build warnings 2025-08-29 10:03:24 +02:00
Marco Cadetg
6b24e86675 fix: get rid of warnings and fix all clippy issues 2025-08-28 15:28:58 +02:00
Marco Cadetg
f183417216 use pktab on mac to retrieve process information 2025-08-27 17:43:54 +02:00
Marco Cadetg
e5cdacd996 WIP tcp connection tracking 2025-08-01 13:47:02 +02:00
Marco Cadetg
a30e502cb9 add process information 2025-06-30 15:54:25 +02:00
Marco Cadetg
0eee869a2b working code ;) 2025-06-30 14:15:40 +02:00