Skip to main content

CI-native network egress auditing via strace

Project description

netaudit

CI PyPI Python License: Apache 2.0

CI-native network egress auditing via strace. Wrap any process or test suite, declare what connections are allowed, get pass/fail — no raw strace noise.

Install

pip install netaudit

Requires strace (Linux only):

sudo apt-get install strace   # Debian/Ubuntu
sudo dnf install strace       # RHEL/Fedora

Quick start

  1. Create netaudit.yaml in your project root:
version: 1
allowlist:
  - name: "Internal API"
    family: AF_INET
    addr: 10.0.0.1
    port: 8080
  1. Run:
# Trace pytest (or any command) and fail on unexpected connections
netaudit run -- pytest

# Offline analysis of an existing strace log
netaudit analyze /tmp/trace.log

# Machine-readable output for CI artifacts
netaudit run --format json -- make test

Exit codes: 0 clean · 1 violations · 2 strace not found

Documentation

Full docs at netaudit.readthedocs.io:

How it works

netaudit run spawns your command under strace -e trace=connect -f -tt, parses every connect() syscall, and checks each against your allowlist. Built-in rules automatically permit loopback, Unix sockets, and AF_NETLINK — you only need to list external destinations.

Development

python3.11 -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netaudit-0.2.0.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netaudit-0.2.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file netaudit-0.2.0.tar.gz.

File metadata

  • Download URL: netaudit-0.2.0.tar.gz
  • Upload date:
  • Size: 36.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for netaudit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3f7240c3f1b961011a8bdf8265fe5f44d2d3330e0c763258b8024d3a778dde5c
MD5 d413e17e6adec4495027afddc1d9abaf
BLAKE2b-256 1aea6e6ca785b9def1d520a633405c9e431cd458c0b5bc703da7b057c5530cb4

See more details on using hashes here.

File details

Details for the file netaudit-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: netaudit-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for netaudit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a79bdd9dfaa05f714ab952af843cf08f8395d795afd43a293cdf9deecc75ecb1
MD5 4bfff5243108450b5a1469c4fba8f88f
BLAKE2b-256 d03eff77f9b4c5076acf5ca3e25941038e88d567bc328fa526e4c0fee0254eaf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page