blindkey 0.3.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- blindkey-0.3.9.dist-info/METADATA +157 -0
- blindkey-0.3.9.dist-info/RECORD +85 -0
- blindkey-0.3.9.dist-info/WHEEL +5 -0
- blindkey-0.3.9.dist-info/entry_points.txt +3 -0
- blindkey-0.3.9.dist-info/licenses/LICENSE +202 -0
- blindkey-0.3.9.dist-info/licenses/NOTICE +4 -0
- blindkey-0.3.9.dist-info/top_level.txt +1 -0
- gatekeeper/__init__.py +1 -0
- gatekeeper/cli/__init__.py +0 -0
- gatekeeper/cli/cakey.py +52 -0
- gatekeeper/cli/commands/__init__.py +0 -0
- gatekeeper/cli/commands/add_client.py +135 -0
- gatekeeper/cli/commands/audit_anchor.py +29 -0
- gatekeeper/cli/commands/audit_repair.py +52 -0
- gatekeeper/cli/commands/audit_verify.py +35 -0
- gatekeeper/cli/commands/client_status.py +70 -0
- gatekeeper/cli/commands/confirm.py +91 -0
- gatekeeper/cli/commands/decoy_create.py +55 -0
- gatekeeper/cli/commands/init.py +154 -0
- gatekeeper/cli/commands/list_clients.py +48 -0
- gatekeeper/cli/commands/renew.py +84 -0
- gatekeeper/cli/commands/renew_server.py +70 -0
- gatekeeper/cli/commands/run.py +22 -0
- gatekeeper/cli/commands/status.py +70 -0
- gatekeeper/cli/main.py +130 -0
- gatekeeper/cli/output.py +12 -0
- gatekeeper/client/__init__.py +1 -0
- gatekeeper/client/botapi.py +55 -0
- gatekeeper/client/http_io.py +54 -0
- gatekeeper/client/session.py +60 -0
- gatekeeper/client/transport.py +30 -0
- gatekeeper/core/__init__.py +0 -0
- gatekeeper/core/constants.py +27 -0
- gatekeeper/core/errors.py +25 -0
- gatekeeper/core/events.py +47 -0
- gatekeeper/core/fileio.py +25 -0
- gatekeeper/core/kdf.py +47 -0
- gatekeeper/core/redact.py +89 -0
- gatekeeper/core/signing.py +139 -0
- gatekeeper/core/timeutil.py +29 -0
- gatekeeper/pki/__init__.py +0 -0
- gatekeeper/pki/ca.py +249 -0
- gatekeeper/pki/fingerprint.py +30 -0
- gatekeeper/py.typed +0 -0
- gatekeeper/server/__init__.py +0 -0
- gatekeeper/server/anomaly.py +71 -0
- gatekeeper/server/app.py +382 -0
- gatekeeper/server/audit/__init__.py +0 -0
- gatekeeper/server/audit/anchor.py +107 -0
- gatekeeper/server/audit/chain.py +282 -0
- gatekeeper/server/audit/repair.py +41 -0
- gatekeeper/server/audit/rotate.py +136 -0
- gatekeeper/server/audit/sink.py +179 -0
- gatekeeper/server/audit/verify.py +175 -0
- gatekeeper/server/config.py +273 -0
- gatekeeper/server/confirm_body.py +87 -0
- gatekeeper/server/honey/__init__.py +1 -0
- gatekeeper/server/honey/decoys.py +77 -0
- gatekeeper/server/http_io.py +195 -0
- gatekeeper/server/http_response.py +54 -0
- gatekeeper/server/identity.py +137 -0
- gatekeeper/server/limits.py +232 -0
- gatekeeper/server/nonce_cache.py +91 -0
- gatekeeper/server/observe.py +86 -0
- gatekeeper/server/pipeline.py +342 -0
- gatekeeper/server/policy.py +89 -0
- gatekeeper/server/providers/__init__.py +25 -0
- gatekeeper/server/providers/base.py +52 -0
- gatekeeper/server/providers/bearer.py +164 -0
- gatekeeper/server/providers/cloudflare.py +36 -0
- gatekeeper/server/providers/github.py +68 -0
- gatekeeper/server/providers/jsonscan.py +147 -0
- gatekeeper/server/providers/openai.py +34 -0
- gatekeeper/server/providers/telegram.py +106 -0
- gatekeeper/server/providers/vercel.py +31 -0
- gatekeeper/server/state.py +141 -0
- gatekeeper/server/tls.py +34 -0
- gatekeeper/server/upstream.py +180 -0
- gatekeeper/store/__init__.py +0 -0
- gatekeeper/store/approvals.py +265 -0
- gatekeeper/store/atomic.py +41 -0
- gatekeeper/store/fsperm.py +53 -0
- gatekeeper/store/layout.py +45 -0
- gatekeeper/store/registry.py +143 -0
- gatekeeper/store/secrets.py +30 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: blindkey
|
|
3
|
+
Version: 0.3.9
|
|
4
|
+
Summary: Self-hosted mTLS gateway that keeps API tokens (Telegram, GitHub, OpenAI, Vercel, Cloudflare) off bots, scripts and AI agents
|
|
5
|
+
Author: Anonimman01
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/Anonimman01/blindkey
|
|
8
|
+
Project-URL: Repository, https://github.com/Anonimman01/blindkey
|
|
9
|
+
Project-URL: Issues, https://github.com/Anonimman01/blindkey/issues
|
|
10
|
+
Project-URL: Documentation, https://github.com/Anonimman01/blindkey#readme
|
|
11
|
+
Project-URL: Security, https://github.com/Anonimman01/blindkey/security/policy
|
|
12
|
+
Project-URL: Changelog, https://github.com/Anonimman01/blindkey/blob/main/CHANGELOG.md
|
|
13
|
+
Keywords: mtls,api-gateway,api-key,secrets,secret-management,credential-proxy,telegram,telegram-bot,github,openai,ai-agents,vercel,cloudflare,hmac,audit-log,honeytoken,zero-trust,security,gateway,proxy
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Framework :: AsyncIO
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Intended Audience :: System Administrators
|
|
19
|
+
Classifier: Topic :: Internet :: Proxy Servers
|
|
20
|
+
Classifier: Topic :: Security
|
|
21
|
+
Classifier: Topic :: Security :: Cryptography
|
|
22
|
+
Classifier: Topic :: System :: Logging
|
|
23
|
+
Classifier: Programming Language :: Python :: 3
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
28
|
+
Classifier: Operating System :: OS Independent
|
|
29
|
+
Classifier: Typing :: Typed
|
|
30
|
+
Requires-Python: >=3.11
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
License-File: LICENSE
|
|
33
|
+
License-File: NOTICE
|
|
34
|
+
Requires-Dist: cryptography>=42
|
|
35
|
+
Requires-Dist: h11>=0.16
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
38
|
+
Requires-Dist: pytest-cov>=5; extra == "dev"
|
|
39
|
+
Requires-Dist: ruff>=0.9; extra == "dev"
|
|
40
|
+
Requires-Dist: mypy>=1.13; extra == "dev"
|
|
41
|
+
Requires-Dist: pip-audit; extra == "dev"
|
|
42
|
+
Dynamic: license-file
|
|
43
|
+
|
|
44
|
+
# BlindKey / gatekeeper: mTLS API-key gateway for bots, scripts and AI agents
|
|
45
|
+
|
|
46
|
+
**Language:** English · [Русский](README.ru.md)
|
|
47
|
+
|
|
48
|
+
[](https://github.com/Anonimman01/blindkey/actions/workflows/ci.yml)
|
|
49
|
+
[](https://github.com/Anonimman01/blindkey/actions/workflows/codeql.yml)
|
|
50
|
+
[](LICENSE)
|
|
51
|
+

|
|
52
|
+
|
|
53
|
+
**BlindKey** (PyPI: `blindkey`, command: `gatekeeper` or `blindkey`) is a small self-hosted Python gateway that sits in
|
|
54
|
+
front of third-party APIs and keeps your **real API token off the machines that use it**. Your bot,
|
|
55
|
+
script or AI agent never sees the Telegram, GitHub, OpenAI, Vercel or Cloudflare token. It gets a
|
|
56
|
+
revocable client certificate and an allowlist of API methods instead. If the client is compromised,
|
|
57
|
+
you revoke one certificate. The token is not leaked, and does not need to be rotated.
|
|
58
|
+
|
|
59
|
+
Typical uses: a **Telegram bot token proxy**, an **OpenAI API key proxy for AI agents**, a
|
|
60
|
+
**secretless credential gateway** for CI jobs and scripts, per-client allowlists for the GitHub API.
|
|
61
|
+
|
|
62
|
+
## How it works
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
bot / script / AI agent gatekeeper (your server) upstream API
|
|
66
|
+
----------------------- ------------------------ ------------
|
|
67
|
+
client certificate (mTLS) ──TLS 1.3──▶ verify cert + HMAC signature
|
|
68
|
+
signed request, no token check allowlist, rate limit, budget
|
|
69
|
+
[dangerous method? wait for operator]
|
|
70
|
+
add the real token ───────────────────▶ api.telegram.org
|
|
71
|
+
filter response for token leaks ◀─────── api.github.com ...
|
|
72
|
+
response ◀──────── write hash-chained audit log
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Features
|
|
76
|
+
|
|
77
|
+
- **mTLS (TLS 1.3 only)** with your own CA: each client gets a revocable certificate.
|
|
78
|
+
- **HMAC-SHA256 request signing** bound to the certificate fingerprint, with replay protection
|
|
79
|
+
(nonce cache and a ±30 s time window).
|
|
80
|
+
- **Per-client allowlist** of `METHOD:api` rules. The upstream path comes from the rule, never from
|
|
81
|
+
the client request, so there is no SSRF through the gateway.
|
|
82
|
+
- **Response filter**: a response that contains the gateway's token is blocked (502) and logged.
|
|
83
|
+
Compressed responses and duplicate-key JSON tricks are rejected rather than inspected.
|
|
84
|
+
- **Hash-chained audit log** with size-based rotation, truncated-tail recovery and external
|
|
85
|
+
anchors (`audit-anchor`, `audit-verify`).
|
|
86
|
+
- **Decoys (honeytokens)**: a client that uses a decoy credential is caught and its IP banned.
|
|
87
|
+
- **Operator confirmation** for dangerous methods (`[confirm]`): the request waits until an
|
|
88
|
+
operator runs `gatekeeper approve`.
|
|
89
|
+
- **Rate limits, daily request budget, anomaly counters and auto-freeze** of misbehaving clients.
|
|
90
|
+
- **Several providers on one gateway**: Telegram Bot API, GitHub, OpenAI, Vercel, Cloudflare.
|
|
91
|
+
Each client is bound to one provider.
|
|
92
|
+
- Small footprint: Python 3.11+, two runtime dependencies (`cryptography`, `h11`),
|
|
93
|
+
hash-pinned lock files, Apache-2.0.
|
|
94
|
+
|
|
95
|
+
## Supported providers
|
|
96
|
+
|
|
97
|
+
| Provider | Typical use |
|
|
98
|
+
|---|---|
|
|
99
|
+
| Telegram Bot API | keep the bot token off the bot host and off the app that talks to Telegram |
|
|
100
|
+
| GitHub | give scripts and agents a narrow slice of the GitHub API |
|
|
101
|
+
| OpenAI | keep the OpenAI API key away from agents and per-project runtimes |
|
|
102
|
+
| Vercel | limited access to selected Vercel API calls |
|
|
103
|
+
| Cloudflare | limited access to selected Cloudflare API calls |
|
|
104
|
+
|
|
105
|
+
## Quick start (Linux)
|
|
106
|
+
|
|
107
|
+
pip install blindkey
|
|
108
|
+
|
|
109
|
+
The PyPI distribution is called `blindkey`. The command is `gatekeeper` (alias: `blindkey`) and the
|
|
110
|
+
Python package is `gatekeeper`. Do **not** run `pip install gatekeeper`: that name on PyPI belongs
|
|
111
|
+
to a different project. To work from a checkout with hash-pinned dependencies:
|
|
112
|
+
|
|
113
|
+
git clone https://github.com/Anonimman01/blindkey
|
|
114
|
+
cd blindkey
|
|
115
|
+
python -m venv .venv && source .venv/bin/activate
|
|
116
|
+
pip install --require-hashes -r requirements.lock
|
|
117
|
+
pip install --no-deps -e .
|
|
118
|
+
|
|
119
|
+
Create the CA and the gateway certificate, add a client, start the gateway:
|
|
120
|
+
|
|
121
|
+
useradd --system --create-home gatekeeper && su - gatekeeper
|
|
122
|
+
export GATEKEEPER_CONFIG_DIR=$HOME/etc GATEKEEPER_DATA_DIR=$HOME/data
|
|
123
|
+
|
|
124
|
+
gatekeeper init --host 203.0.113.10 --host gw.example.com --ca-key-out /safe/ca.key
|
|
125
|
+
gatekeeper add-client --id mybot --ca-key /safe/ca.key --out ./mybot-bundle \
|
|
126
|
+
--allow GET:getMe --allow POST:sendMessage
|
|
127
|
+
export GATEKEEPER_UPSTREAM_TOKEN='123456:ABC...'
|
|
128
|
+
gatekeeper run
|
|
129
|
+
|
|
130
|
+
Copy `mybot-bundle` to the bot's machine over a secure channel. `client.key` and `master.secret`
|
|
131
|
+
are secrets. A client example is in [examples/client_send_message.py](examples/client_send_message.py),
|
|
132
|
+
and all settings are in [examples/config.example.toml](examples/config.example.toml).
|
|
133
|
+
|
|
134
|
+
Production use is Linux only (file permissions 0600/0700 are enforced there). Windows works for
|
|
135
|
+
development. The full operator guide is currently in Russian: [README.ru.md](README.ru.md).
|
|
136
|
+
|
|
137
|
+
## Status and security
|
|
138
|
+
|
|
139
|
+
- Beta (0.3.x). The test suite has 700+ tests and CI runs lint, type checks, `pip-audit`,
|
|
140
|
+
CodeQL and a lock-file drift check.
|
|
141
|
+
- The project has been through several internal and external audit passes. There is **no formal
|
|
142
|
+
third-party certification or penetration test**. Findings and fixes are tracked in
|
|
143
|
+
[docs/SECURITY-HISTORY.md](docs/SECURITY-HISTORY.md); the threat model is in
|
|
144
|
+
[docs/threat-model.md](docs/threat-model.md).
|
|
145
|
+
- All provider secrets live in the memory of one gateway process. Compromising the gateway host
|
|
146
|
+
compromises every configured provider token.
|
|
147
|
+
- Report vulnerabilities as described in [SECURITY.md](SECURITY.md).
|
|
148
|
+
|
|
149
|
+
## Documentation
|
|
150
|
+
|
|
151
|
+
- [README.ru.md](README.ru.md): full guide in Russian (install, config, providers, audit log, decoys, limits)
|
|
152
|
+
- [SECURITY.md](SECURITY.md), [docs/threat-model.md](docs/threat-model.md)
|
|
153
|
+
- [CHANGELOG.md](CHANGELOG.md)
|
|
154
|
+
|
|
155
|
+
## License
|
|
156
|
+
|
|
157
|
+
Apache-2.0, see [LICENSE](LICENSE) and [NOTICE](NOTICE).
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
blindkey-0.3.9.dist-info/licenses/LICENSE,sha256=-z-NJUbryZlZJ-BT77bi5fZvqPa2_d838uhpRe_KlPw,11348
|
|
2
|
+
blindkey-0.3.9.dist-info/licenses/NOTICE,sha256=ADHC4LVF0KZHOeg5xdTEzKPJ0Uk5Dv-LyEFzwgDj9rA,87
|
|
3
|
+
gatekeeper/__init__.py,sha256=iewMzRtaDPooRgantgCks6hCDqQmbxHS5oH20RmLyFs,53
|
|
4
|
+
gatekeeper/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
gatekeeper/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
gatekeeper/cli/cakey.py,sha256=yIOi4Zin4YdvOrJgGJFY2axaXA-BRb4KRPnZJntRdw0,2276
|
|
7
|
+
gatekeeper/cli/main.py,sha256=f-Kxe6bEa2NqWwCCigXkB4uZpNelxlvvuixR8FsEZks,7041
|
|
8
|
+
gatekeeper/cli/output.py,sha256=IxJtuJ5imaXF7oLE_Lotk96Bf8GbGXbP4gSKeaqyNGE,309
|
|
9
|
+
gatekeeper/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
gatekeeper/cli/commands/add_client.py,sha256=lyywXsAtVL8LNcTiLJi0ZZLJZLEWSHWlJF09CMGSOhk,5574
|
|
11
|
+
gatekeeper/cli/commands/audit_anchor.py,sha256=gsM823NnI9FeXO1zPX2uZKq6_d2o7R3qYWng_6fzjco,1380
|
|
12
|
+
gatekeeper/cli/commands/audit_repair.py,sha256=W4rYsuhSFzSp0QMWsjl-tARVGIGgkabXB22oYqObo5M,2835
|
|
13
|
+
gatekeeper/cli/commands/audit_verify.py,sha256=0EACoxellzTkwo_hMZ9rz6hYle-WXLaTmqBK5-UGTxg,1956
|
|
14
|
+
gatekeeper/cli/commands/client_status.py,sha256=3NneLrCrTJJjxy0l8ogDeV5jsYkcZM4fCyKwE81SYvk,3485
|
|
15
|
+
gatekeeper/cli/commands/confirm.py,sha256=Omcrfi3uvQXp9MfbXqCpgUhe3FCNfszo0_KL7aI9PuE,3991
|
|
16
|
+
gatekeeper/cli/commands/decoy_create.py,sha256=YwkR5nxLT0gJ7KOq3hEt0ftJcCr_QLiMImhQo9EGtBo,2689
|
|
17
|
+
gatekeeper/cli/commands/init.py,sha256=mbJsI3bvCuYuyXJjxyyi96tZaNcs8W8Ag52JoVIHvlM,6680
|
|
18
|
+
gatekeeper/cli/commands/list_clients.py,sha256=gmIFmVH64nJG5L9OtsnBUz-5uLlDQJwUuli105ZjNFY,2035
|
|
19
|
+
gatekeeper/cli/commands/renew.py,sha256=FnVfypxQM3oirH40e4AzcHnHCbjdZ_05T9tq2PCFCFA,4238
|
|
20
|
+
gatekeeper/cli/commands/renew_server.py,sha256=eJJS0bAzn-GaTN3aTQmAbmrlqYVqtDoo-gbjsxTo9_A,3311
|
|
21
|
+
gatekeeper/cli/commands/run.py,sha256=03nUQyk6nIYu6SKcvjcVS0MYlpeCRSq8gLTlH9EcQ1s,661
|
|
22
|
+
gatekeeper/cli/commands/status.py,sha256=fskrXDfLjj5R3FPZq0mHQ_xaopYlcNbx8Lj-xesvNnY,3433
|
|
23
|
+
gatekeeper/client/__init__.py,sha256=Zrruv0BvLqp5yozNV1ApPGU_zf4RLHsbAPjN2I1m_3w,102
|
|
24
|
+
gatekeeper/client/botapi.py,sha256=DCmRAbz1T5HGI0RSIXXMcQF6qDLVvYDb1pKBvASrVk4,2479
|
|
25
|
+
gatekeeper/client/http_io.py,sha256=_IZnKlM36Xaz35kUm9q2HhzEiKDCn0tCZuft2EqwOn0,2046
|
|
26
|
+
gatekeeper/client/session.py,sha256=OHZPEUf2hfkhdi0Xz70Zb9xgtsaRFrsmtp6E1uY7rRM,2671
|
|
27
|
+
gatekeeper/client/transport.py,sha256=G-7aa2ziYVRYqEoKvV_FhQfPzCzcCbdUfqPgxGkNuX8,1595
|
|
28
|
+
gatekeeper/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
|
+
gatekeeper/core/constants.py,sha256=tePAHaRNTsIXX4GQNzCqhe5S3nSZpv_JpmuU1BK-MK0,1217
|
|
30
|
+
gatekeeper/core/errors.py,sha256=ZgteSQjlL4r1UzDwfkur6oRBj7jink0lR3fN6XFzUJA,832
|
|
31
|
+
gatekeeper/core/events.py,sha256=gkA-lt_ImJvgH5lCLaCBEo0hJpknTQDPmDAlCxj5qwQ,2335
|
|
32
|
+
gatekeeper/core/fileio.py,sha256=5bc5oQ0Sn5a4mNgcHUfunEFvpB_rAQdidmqNx75RPuE,1272
|
|
33
|
+
gatekeeper/core/kdf.py,sha256=eo1sa48RYhrnSlSt05GhFqfrq97BbsjQ-YKUOLFrnYE,1871
|
|
34
|
+
gatekeeper/core/redact.py,sha256=hdsMaxiqk-mP-bYteyyalhMdJnCQx9Y6-LjhgcqtFms,3925
|
|
35
|
+
gatekeeper/core/signing.py,sha256=CP-hSRnTIJf27puKghkjQqEK_h9VccJj8ODnbwbqxq4,4842
|
|
36
|
+
gatekeeper/core/timeutil.py,sha256=ptMEV93pB5rF9mSyh5hn-NXn6m-qeZItO_GhB6VpYiA,855
|
|
37
|
+
gatekeeper/pki/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
|
+
gatekeeper/pki/ca.py,sha256=ms3nVSZHE0whGEk2Nu_92Oik34Bd-b94vCJkLoKFffE,10253
|
|
39
|
+
gatekeeper/pki/fingerprint.py,sha256=mNG8IL_EShY1huuBgnwYugYFTL7YArBli1KBpxtbvwM,1038
|
|
40
|
+
gatekeeper/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
|
+
gatekeeper/server/anomaly.py,sha256=VIf26NrCLudtm-O3W_BFu1NS662a_3Lxp24goxVfe8I,3233
|
|
42
|
+
gatekeeper/server/app.py,sha256=6fcvGwgQMtSoQ9u1f3L5-aRLC_DwUqaov7f9S4HbFME,21035
|
|
43
|
+
gatekeeper/server/config.py,sha256=GVekIfOm8OBRR4WQBSAx1lVvMMVaRMAM0n0SzHwM5rk,14293
|
|
44
|
+
gatekeeper/server/confirm_body.py,sha256=Hx2PTl2w8sLsKLhhf4W0x4v3Pw9TVNyI8Ri2qaLALpE,3960
|
|
45
|
+
gatekeeper/server/http_io.py,sha256=n8ZvR4kK-K2EdH1XuC5hiN2LeWzOL8cHiUDzcX1MwoY,8382
|
|
46
|
+
gatekeeper/server/http_response.py,sha256=4f1m4qXP4R-fLq5WbdNMThC9HmgKYg0LDvIjcoXwnXU,2316
|
|
47
|
+
gatekeeper/server/identity.py,sha256=R2wg5DU7Vj6-U_lV6lqNby0BjLdpjMGI-pIbxRMOQWY,5901
|
|
48
|
+
gatekeeper/server/limits.py,sha256=cTk52rBiw2j5lb1hOGrrhBqv18vD2sPQS1wjiyzKcAw,9476
|
|
49
|
+
gatekeeper/server/nonce_cache.py,sha256=UeDgykcXAt8sh2Eg1-bapAvUZAILHalS6dGFtSqv-u8,3884
|
|
50
|
+
gatekeeper/server/observe.py,sha256=4gXCj40qZnAUUZyuevrlurwR8ikVvuECjLOtQKj94IU,3760
|
|
51
|
+
gatekeeper/server/pipeline.py,sha256=BS7Na2YbljDN9_iW7eABh2EGsXuru74yvCoeMEm9l_4,23047
|
|
52
|
+
gatekeeper/server/policy.py,sha256=26v94Py1gXMLtSdTVTnICVAMR6JvSbc14K7w5OjVKM8,3532
|
|
53
|
+
gatekeeper/server/state.py,sha256=1JjSiy4SNLX8XUMtWC1ISD1W3IokzKuTD3OPhjyLGOA,7333
|
|
54
|
+
gatekeeper/server/tls.py,sha256=x-Osqi1XYL04ECquCNuUsW6r8TXLNm5_UVSTLGuSYgk,1621
|
|
55
|
+
gatekeeper/server/upstream.py,sha256=mAkf1Qs03uD_N-1kzk-VPAxza-3640gjrr-p-dPs6CI,8703
|
|
56
|
+
gatekeeper/server/audit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
|
+
gatekeeper/server/audit/anchor.py,sha256=C2zHriOpbSoG5hFW9EELyHcXAj71gbXCQ9TsYhhrGBI,4619
|
|
58
|
+
gatekeeper/server/audit/chain.py,sha256=RVCGItbNaf1EXLWWIJthjXlYkFVXjT799agvaG8OO3A,13733
|
|
59
|
+
gatekeeper/server/audit/repair.py,sha256=ILEPuLBIE8KEsBRZ2j_SeNifAMLS7naqI01ua9qPvv4,2063
|
|
60
|
+
gatekeeper/server/audit/rotate.py,sha256=kea66xZCXIgRmdxxxGJ51YEsIVOxJrpeyQL3JwT66FA,6159
|
|
61
|
+
gatekeeper/server/audit/sink.py,sha256=CCn5g_en12kYiTmYRu3bNSusmoy8JrAcKn0pCbmBoLw,7093
|
|
62
|
+
gatekeeper/server/audit/verify.py,sha256=P_h9oYwJFreczB2xhotHYJ1YugZ6gB5umcAtz7S-6C8,8294
|
|
63
|
+
gatekeeper/server/honey/__init__.py,sha256=NJm4FTzKpcjp4i6BZNWLPAbeP4qcYCuYZmyGyNFoOYU,24
|
|
64
|
+
gatekeeper/server/honey/decoys.py,sha256=lyxTc4xSzi8tNZqQV1j_vRaOFf92SUNzI7jeQbDp1Os,3134
|
|
65
|
+
gatekeeper/server/providers/__init__.py,sha256=K7QLpaPf0771dDzYSEHysSZ-HAj0wCacX2trCf5meN8,1179
|
|
66
|
+
gatekeeper/server/providers/base.py,sha256=aR24JEo6sEH6Pfq1_u8dkXwVElKxs-8nvbnNp3oU-W0,1902
|
|
67
|
+
gatekeeper/server/providers/bearer.py,sha256=C4gXptJase_8ILMTOAEHoPXU0p2hv6AxY3e56UyAJFg,7911
|
|
68
|
+
gatekeeper/server/providers/cloudflare.py,sha256=7vhZKqu7kXYgTgjethgxLETZqxztydXHR_BfXZFfjEU,1977
|
|
69
|
+
gatekeeper/server/providers/github.py,sha256=RiQHg9lDVMP5jLMuFDGq8qBmiAPwSfpxcdhx8GJ5XPA,3116
|
|
70
|
+
gatekeeper/server/providers/jsonscan.py,sha256=E2u1n_OzOYiFMDn0zP0py8ysUL9GooGZsPa0Q_ry3v4,6492
|
|
71
|
+
gatekeeper/server/providers/openai.py,sha256=PSMiIxc_7in3M633BbdJdft_WxNcFgUQG635nyZWRbI,1794
|
|
72
|
+
gatekeeper/server/providers/telegram.py,sha256=sC6jHMkpbIq0gKVbQB4-qgYPngsCZRm_5jdJmXIdaco,5800
|
|
73
|
+
gatekeeper/server/providers/vercel.py,sha256=zNyoqO5ULryvt-xCI93qhtBKHao2y8W0OEAxJfp_kOE,1562
|
|
74
|
+
gatekeeper/store/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
75
|
+
gatekeeper/store/approvals.py,sha256=ZOqjc4vfIp5bXdWCn4BuhMHbzkUofUSdHXXtsm5v09U,12785
|
|
76
|
+
gatekeeper/store/atomic.py,sha256=WvaS0uDV6gSIo2SSq_g6bZeGaDvUdjYnjk4CxCNwvNE,1831
|
|
77
|
+
gatekeeper/store/fsperm.py,sha256=5P8WKUbodHponAbD5R6HWwZkIHMLIafbTnHrdc-BeiE,2467
|
|
78
|
+
gatekeeper/store/layout.py,sha256=NF7FW3gm28obCbRElGpVStg4FsQPrShqHybDRinrEic,1599
|
|
79
|
+
gatekeeper/store/registry.py,sha256=QcoOuz_IhlHzilqEf6qnKAYlsl1V9hvsLY37TrXYGk8,6423
|
|
80
|
+
gatekeeper/store/secrets.py,sha256=VqJjV9Pe4sVF1HnXDU0kTizbukoiQwwFxBEbaOoUwns,1186
|
|
81
|
+
blindkey-0.3.9.dist-info/METADATA,sha256=Q45z_gTzk4Oxu6XtDvqBS5MmRp-d2TImjxazER0mBrc,8350
|
|
82
|
+
blindkey-0.3.9.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
83
|
+
blindkey-0.3.9.dist-info/entry_points.txt,sha256=8yA7OPxbj6nLOU9gVLl-O6kiAsQtgVHLnysgMpgHy6k,92
|
|
84
|
+
blindkey-0.3.9.dist-info/top_level.txt,sha256=sL8xT6obAhjxoAEWqpeB3KxA2i0vFZtfTkZHkfNP5Cc,11
|
|
85
|
+
blindkey-0.3.9.dist-info/RECORD,,
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
https://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [2026] [Anonimman01]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gatekeeper
|
gatekeeper/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""gatekeeper: защищённый API-шлюз."""
|
|
File without changes
|
gatekeeper/cli/cakey.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""Парольная фраза для `ca.key` (C-09).
|
|
2
|
+
|
|
3
|
+
Корневой ключ CA нужен только в операциях выпуска (`init`, `add-client`, `renew`,
|
|
4
|
+
`decoy-create`, `renew-server`). Хранить его незашифрованным не обязательно: `ca.key`
|
|
5
|
+
шифруется PKCS8, а фраза передаётся файлом (`--ca-key-pass-file`, права не шире 0600)
|
|
6
|
+
или переменной окружения `GATEKEEPER_CA_KEY_PASSPHRASE`. Фраза не пишется ни в журнал,
|
|
7
|
+
ни в вывод CLI.
|
|
8
|
+
"""
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import os
|
|
12
|
+
import stat
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
from cryptography.hazmat.primitives.asymmetric import ec
|
|
16
|
+
|
|
17
|
+
from gatekeeper.core.errors import GatekeeperError
|
|
18
|
+
from gatekeeper.pki import ca
|
|
19
|
+
|
|
20
|
+
ENV_PASSPHRASE = "GATEKEEPER_CA_KEY_PASSPHRASE"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class CaKeyError(GatekeeperError):
|
|
24
|
+
"""Ошибка чтения фразы или ключа CA."""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def read_passphrase(args) -> bytes | None:
|
|
28
|
+
"""Прочитать фразу: файл важнее переменной окружения. None = ключ без пароля."""
|
|
29
|
+
path = getattr(args, "ca_key_pass_file", None)
|
|
30
|
+
if path:
|
|
31
|
+
try:
|
|
32
|
+
st = os.stat(path)
|
|
33
|
+
if os.name != "nt" and st.st_mode & (stat.S_IRWXG | stat.S_IRWXO):
|
|
34
|
+
raise CaKeyError(
|
|
35
|
+
"CA key passphrase file must not be accessible to group/others (chmod 0400)")
|
|
36
|
+
value = Path(path).read_text("utf-8").rstrip("\r\n")
|
|
37
|
+
except OSError as exc:
|
|
38
|
+
raise CaKeyError("cannot read CA key passphrase file") from exc
|
|
39
|
+
if not value:
|
|
40
|
+
raise CaKeyError("CA key passphrase file is empty")
|
|
41
|
+
return value.encode("utf-8")
|
|
42
|
+
value = os.environ.get(ENV_PASSPHRASE, "")
|
|
43
|
+
return value.encode("utf-8") if value else None
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def load_ca_key(path: str | os.PathLike, passphrase: bytes | None) -> ec.EllipticCurvePrivateKey:
|
|
47
|
+
"""Загрузить `ca.key` (зашифрованный или нет). Ошибка = понятный PkiError."""
|
|
48
|
+
try:
|
|
49
|
+
pem = Path(path).read_bytes()
|
|
50
|
+
except OSError as exc:
|
|
51
|
+
raise CaKeyError("cannot read CA key") from exc
|
|
52
|
+
return ca.load_key_pem(pem, password=passphrase)
|
|
File without changes
|