glovebox-core
Glovebox's security decisions as pure functions: the host rules, the JSON reader, the egress verdict and the monitor's fail-closed rules. No module here reads a file, a socket, a subprocess, the clock, a thread or the environment. An input that needs one arrives as an argument: a Protocol the caller implements, or a value the caller read. tests/core/test_purity.py refuses any other import.
Host rules
glovebox_core.host_rules is the one answer to "which host is this" that every part of glovebox uses: the egress proxy's verdict service, the launcher, the session driver and the evals. A host is compared in one spelling: ASCII only, surrounding whitespace removed, lowercased, and an IP literal in its standard form. A name that is not ASCII, or that starts or ends with a dot, is refused rather than folded, so two readers can never disagree about it.
pod_grants is the one reader of a Kata pod's glovebox.dev/egress-grants annotation, and the node calls it. It returns the granted hosts at their tiers, the address grants and the port grants. It raises GrantRefused with the node's own message for the first entry the node refuses. How wide an address grant may be is each node's own setting, so it is not checked here.
A host with a port, such as {"host": "git.example.com:22", "rw": true}, is a port grant. The node relays a raw stream to that port on the name's public addresses, so it needs "rw": true. A host without a port keeps its plain host meaning.
A grant may not name a *. wildcard over a public suffix, or over a name with one below it. pod_grants takes the Public Suffix List as an argument: glovebox_hosts.BUNDLED_SUFFIXES is the list tldextract bundles. Where the list cannot be read, every name is refused.
>>> from glovebox_core.host_rules import pod_grants
>>> from glovebox_hosts import BUNDLED_SUFFIXES
>>> granted = pod_grants('["httpbin.org", {"host": "git.example.com:22", "rw": true}]', BUNDLED_SUFFIXES)
>>> granted.hosts
{'httpbin.org': 'ro'}
>>> granted.ports
[PortGrant(host='git.example.com', port=22)]
>>> pod_grants('["*.amazonaws.com"]', BUNDLED_SUFFIXES)
Traceback (most recent call last):
...
glovebox_core.host_rules.GrantRefused: glovebox.dev/egress-grants: '*.amazonaws.com' is a wildcard over a name with the public suffix ...
encode_pod_grants is the writer for the same annotation. It writes each entry as a bare read-only string, sorted and once, and never adds "rw". It raises GrantRefused for an address or HOST:PORT, which opens a raw tunnel that only a person grants, read-write, on the node. It reads its text back with pod_grants, so it also raises for any other entry the node would refuse.
A runner that writes the annotation checks each entry before it asks for a pod. grant_host_refusal(host, suffixes) gives the node's reason for refusing a host name, or None. address_grant(entry) reads an address entry as an AddressGrant, returns None for a host name, and raises GrantRefused for a malformed one.
The host rules and glovebox_core.json_object import only the standard library, so they run under Python 3.9. The egress modules need Python 3.11.
Egress verdict
glovebox_core.verdict.decide rules where one request Envoy asks about may go. The caller passes what it read as Facts, such as the setup window, and every address screen as a Screen. The verdict resolves no name and writes no record.
Monitor fail-closed rules
glovebox_core.monitor gives the answer for a tool call that no monitor model judged. An outage takes outage_decision: the configured fail mode, or ASK for a high-risk call. A reply with no readable verdict, an open circuit breaker and a missing API key each take their own fixed_decision. No fail-closed answer is ALLOW. The monitor package makes the model call and keeps the breaker and the records.
Metadata
Release files for glovebox-core 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| glovebox_core-0.1.6.tar.gz | 84.3 kB | Without provenance | Details for glovebox_core-0.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| glovebox_core-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for glovebox_core-0.1.6-py3-none-any.whl |
Total release size: 176.5 kB
Release files / glovebox_core-0.1.6.tar.gz
| Download URL | glovebox_core-0.1.6.tar.gz |
|---|---|
| Size | 84.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
779229c3b1af9646988bdab889949b5adea0dd5b32aa01cffd0986c96010c6db
|
|
BLAKE2b-256 checksum How to use checksums |
7896be41f4a42f95c398a2e8bcf78ffbc1db32f4ddd90c5c59e671ea284adef5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / glovebox_core-0.1.6-py3-none-any.whl
| Download URL | glovebox_core-0.1.6-py3-none-any.whl |
|---|---|
| Size | 92.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e691c52591d85a38db1f755d50562eca1bccf5c670bca911691aaa54af6cd90
|
|
BLAKE2b-256 checksum How to use checksums |
662271c2371f7be1491179c7d85644af3ff7c678379dac32930d22301719ca69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for glovebox-core 0.1.6
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.