mirror of
https://scm.tikali.ai/tikali/applications/monky/monky-deployd.git
synced 2026-09-18 04:36:15 +00:00
1c42e913a8
Stdlib-only Python 3.12 agent for docker VMs and laptops: flock → checkin
(bearer = the agent's OpenBao token, bootstrapped from the install kit's
jwt-tenancy deploy grant) → action apply|none|down → bundle (sha256
verified) → refusal checks (unresolved ${VAR} names only, manifest paths
pinned to monky/data/<env>/see/, privileged/host-network, rollback, disk
need×1.5+headroom) → lease → POST /v1/auth/jwt-tenancy/login → KV reads →
.env 0600 → promote → compose pull/up → wait healthy → report; finally
renew-self / re-lease before max TTL, scrub. Exit 0/75/78/1. Redactor log
filter. Transports sdk (openziti) / proxy (ziti tunnel proxy 18443/18200) /
system. Laptop mode.
Packaging: hardened oneshot + 60 s timer + proxy unit, nfpm .deb with
/opt/monky-deployd/venv, install.sh for Ubuntu 26.04 (Gitea release
download, enrol, ACLs, bootstrap from stdin), ansible role skeleton for
osg1-07. CI: lint/test on every change; wheel (openziti on ubuntu:26.04) and
package (nfpm) allow_failure until runner egress is proven; GitLab release +
release:gitea on v* tags. Docs: README, PROTOCOL, OPERATIONS, CHANGELOG,
CLAUDE/AGENTS.
Divergence noted: monky-tenancy main (MR !15) still ships the AppRole lease
and kit; this agent implements the plan's Gate 1 RESULT (login_jwt, no
unwrap) and refuses an AppRole lease loudly (LEASE_SHAPE).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KLB7jieMNRkTsJ2epr4Ds1
28 lines
938 B
Python
28 lines
938 B
Python
import logging
|
|
|
|
from monky_deployd.redact import MASK, Redactor
|
|
|
|
|
|
def test_redacts_token_shapes_and_registered_values():
|
|
r = Redactor()
|
|
r.add("pg-s3cret-value")
|
|
text = "tok hvs.CAESIJabcdefghijklmnopqrstuvwxyz0123456789 jwt eyJhbGciOiJFUzI1NiJ9.eyJzdWIiOiJhZ2VudCJ9.c2lnbmF0dXJlLXNpZw pw=pg-s3cret-value ok"
|
|
out = r.scrub(text)
|
|
assert "hvs." not in out and "eyJ" not in out and "pg-s3cret-value" not in out
|
|
assert out.count(MASK) == 3
|
|
assert r.scrub("Authorization: Bearer abc.def") == f"Authorization: Bearer {MASK}"
|
|
|
|
|
|
def test_filter_rewrites_records_in_place():
|
|
r = Redactor()
|
|
r.add("SUPERSECRET")
|
|
rec = logging.LogRecord("x", logging.INFO, "f", 1, "value=%s", ("SUPERSECRET",), None)
|
|
assert r.filter(rec) is True
|
|
assert rec.getMessage() == f"value={MASK}"
|
|
|
|
|
|
def test_short_values_are_not_registered():
|
|
r = Redactor()
|
|
r.add("ab")
|
|
assert r.scrub("ab is fine") == "ab is fine"
|