Record refused APT readiness and confirm strict bootstrap metadata cause
Rust development slice / linux (push) Failing after 6s

This commit is contained in:
2026-11-13 22:18:16 +01:00
parent a2ce8f5e8a
commit f956c52ab7
2 changed files with 38 additions and 0 deletions
+21
View File
@@ -1,6 +1,27 @@
"""Operational process state for the three project services; no customer scan."""
def apt_install_metadata_keys(payload):
"""Read only the fixed bootstrap metadata schemas; never secret contents."""
identifier = str(uuid.UUID(payload['id']))
base = Path('/var/lib/rmm-apt-transaction')
history = Path('/var/lib/rmm-bootstrap-history') / ('post-reboot-apt-readiness-' + identifier)
current = base / 'install-metadata.json'
previous = history / 'var__lib__rmm-apt-transaction__install-metadata.json'
values = []
for path in (current, previous):
require(not path.is_symlink() and path.stat().st_uid == 0
and path.stat().st_mode & 0o077 == 0 and path.stat().st_size < 4096,
'fixed private bootstrap metadata')
values.append(json.loads(path.read_bytes()))
original = {'schema_version', 'provider_sha256', 'hook_sha256', 'unit_sha256'}
return dict(current_keys=sorted(values[0]), previous_keys=sorted(values[1]),
original_strict_schema=set(values[1]) == original,
original_fields_unchanged=all(values[0].get(k) == values[1][k] for k in original),
current_sha256=hashlib.sha256(current.read_bytes()).hexdigest(),
previous_sha256=hashlib.sha256(previous.read_bytes()).hexdigest())
def service_processes(payload):
result={}
# Same read-only kernel clock-readiness query required by the runtime;