Metadata-Version: 2.4
Name: aegvanta-scopeguard
Version: 0.1.0
Summary: Offline deny-by-default IP scope policy helper
License-Expression: MIT
Project-URL: Repository, https://github.com/emrecoskunz/aegvanta-scopeguard
Project-URL: Issues, https://github.com/emrecoskunz/aegvanta-scopeguard/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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.

## Install from source

```sh
python -m pip install .
```

Requires Python 3.10+. No package registry publication is claimed.

## Library example

```python
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'
```

## CLI example

```sh
python -m scopeguard --policy examples/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

```sh
python -m unittest discover -s tests -v
```

See [project background](docs/AEGVANTA.md), [contribution guide](CONTRIBUTING.md), [security policy](SECURITY.md), and [MIT license](LICENSE). Reproducible bug reports, genuine use cases and focused patches are welcome. Use synthetic data; never include credentials, customer logs or private infrastructure information.
