Skip to main content

Aegvanta ScopeGuard

A small, dependency-free Python library and CLI for evaluating literal IP addresses against an explicit assessment scope. Intended for authorized defensive security tooling and offline policy checks. Deny rules take precedence; missing allow rules deny access. No network connections, DNS queries, scanning, or third-party runtime dependencies.

Installation

Requires Python 3.10+. The package is available on PyPI.

python -m pip install aegvanta-scopeguard

For development, clone this repository and install from the repository root:

python -m pip install .

Download versioned distributions and SHA-256 checksums from GitHub releases.

Library example

from scopeguard import ScopePolicy
policy = ScopePolicy(allow=['192.0.2.0/24'], deny=['192.0.2.10/32'])
assert policy.permits('192.0.2.1')
assert not policy.permits('192.0.2.10')
assert policy.evaluate('192.0.2.10').reason == 'explicit_deny'

Reuse a JSON policy in Python

Version 0.2.0 adds ScopePolicy.from_json and the scopeguard command. Both use the same parser. Check your installed version with python -m pip show aegvanta-scopeguard. To evaluate a policy from your application:

from scopeguard import ScopePolicy

# ValueError or an I/O error must abort the operation, not allow the target.
policy = ScopePolicy.from_json('{"allow":["192.0.2.0/24"],"deny":["192.0.2.10/32"]}')
decision = policy.evaluate("192.0.2.1")

The JSON Schema describes the file structure for editor validation. The library is authoritative for CIDR validity, duplicate keys, and address handling. A positive decision is a scope match only; it does not authorize a network connection.

CLI example

Save this JSON as policy.json in your working directory:

{"allow":["192.0.2.0/24"],"deny":["192.0.2.10/32"]}

Run the module with any supported version. Version 0.2.0 also provides the equivalent scopeguard --policy policy.json 192.0.2.1 command.

python -m scopeguard --policy policy.json 192.0.2.1

The CLI prints a JSON decision and exits with code 0 (allowed), 1 (denied or invalid target), or 2 (invalid/missing policy or invalid CLI usage). Example addresses are reserved for documentation. Policies accept only allow and deny arrays of explicit CIDR strings; duplicate keys, invalid CIDRs and unsupported target forms are rejected.

Limits

This is a standalone prototype and policy helper, not an authorization system or a network enforcement boundary. Callers must verify written authorization, independently enforce egress controls, and validate the actual destination at connection time. Hostnames, IPv4-mapped IPv6 targets and scoped IPv6 addresses are rejected. Invalid policy CIDRs raise an error; do not catch configuration errors and fall back to permissive behavior. It does not resolve hostnames, authorize redirects, or establish that a target is safe.

Development

python -m unittest discover -s tests -v

See project background, contribution guide, security policy, and MIT license. Reproducible bug reports, genuine use cases and focused patches are welcome. Use synthetic data; never include credentials, customer logs or private infrastructure information.

Metadata

Release files for aegvanta-scopeguard 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aegvanta-scopeguard 0.2.0
File Size Uploaded Provenance Actions
aegvanta_scopeguard-0.2.0.tar.gz 6.6 kB With provenance Details for aegvanta_scopeguard-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aegvanta-scopeguard 0.2.0
File Interpreter ABI Platform Actions
aegvanta_scopeguard-0.2.0-py3-none-any.whl Python 3 none any Details for aegvanta_scopeguard-0.2.0-py3-none-any.whl

Total release size: 12.7 kB

Release files / aegvanta_scopeguard-0.2.0.tar.gz

Download URL aegvanta_scopeguard-0.2.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
69ae1b6c68599c52b35c2dc09cc0b67489b566fb79caa97428f6c181edfb4b5b
BLAKE2b-256 checksum
How to use checksums
89948b9a484922319b97cf179ec4a527600a21e080ad9742c71f4d59b0828ee2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / aegvanta_scopeguard-0.2.0-py3-none-any.whl

Download URL aegvanta_scopeguard-0.2.0-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5249875fbe9d7f808cecab51fdde6aef2572e565f68b5fd664e0125bd5a27f6a
BLAKE2b-256 checksum
How to use checksums
792ee649c3acd5af8840ef63eeec02400d51e2392dc3b9e9d96d97b5f62ffcb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for aegvanta-scopeguard 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aegvanta_scopeguard-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page