Publish and pin the verified schema-v5 approval candidate
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a07ff8-19d0-7820-b4d0-1353833cb7fc
This commit is contained in:
parent
be1a388a84
commit
c8f85c6d76
6 changed files with 172 additions and 33 deletions
59
docs/evidence/2026-09-10-human-control-image-smoke.py
Normal file
59
docs/evidence/2026-09-10-human-control-image-smoke.py
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
import hashlib
|
||||
import importlib.metadata
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import tempfile
|
||||
from datetime import datetime, timedelta, timezone
|
||||
|
||||
import approval_engine.store as store
|
||||
from approval_engine.errors import Forbidden
|
||||
|
||||
assert os.getuid() == 10001
|
||||
assert store.LATEST_SCHEMA_VERSION == 5
|
||||
now = datetime.now(timezone.utc)
|
||||
binding = dict(action='fixture.consume', target={'id': 'fixture'}, actor='service:fixture',
|
||||
principal='human:fixture', purpose='disposable-image-verification')
|
||||
validity = {'not_before': (now-timedelta(minutes=1)).isoformat(),
|
||||
'expires_at': (now+timedelta(minutes=5)).isoformat()}
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
path = pathlib.Path(directory)/'approvals.sqlite'
|
||||
engine = store.Engine(path)
|
||||
legacy = engine.create(binding, validity)
|
||||
engine.add_entry(legacy.id, 'human:legacy', principal_type='human')
|
||||
engine._conn().execute('ALTER TABLE approvals DROP COLUMN human_control')
|
||||
engine._conn().execute('PRAGMA user_version=4')
|
||||
engine._conn().commit()
|
||||
engine.close()
|
||||
engine = store.Engine(path)
|
||||
assert engine.storage_status()['schema_version'] == 5
|
||||
assert engine.get(legacy.id).human_control is False
|
||||
assert engine.claim(legacy.id)['valid_now'] is True
|
||||
controlled = engine.create(binding, validity, human_control=True)
|
||||
for principal_type in ('service', 'agent', None):
|
||||
try:
|
||||
engine.add_entry(controlled.id, 'nonhuman', principal_type=principal_type)
|
||||
except Forbidden:
|
||||
pass
|
||||
else:
|
||||
raise AssertionError('nonhuman binding admitted')
|
||||
assert engine.get(controlled.id).entries == []
|
||||
engine.add_entry(controlled.id, 'human:fixture', principal_type='human')
|
||||
assert engine.claim(controlled.id)['binding']['human_control'] is True
|
||||
assert engine.claim(controlled.id)['valid_now'] is True
|
||||
engine.consume(controlled.id, controlled.binding_digest)
|
||||
assert engine.get(controlled.id).status == 'consumed'
|
||||
engine.close()
|
||||
reopened = store.Engine(path)
|
||||
assert reopened.get(controlled.id).human_control is True
|
||||
assert reopened.get(controlled.id).status == 'consumed'
|
||||
reopened.close()
|
||||
print(json.dumps({
|
||||
'status': 'passed', 'uid': os.getuid(), 'schema_version': 5,
|
||||
'store_sha256': hashlib.sha256(pathlib.Path(store.__file__).read_bytes()).hexdigest(),
|
||||
'checks': ['nonroot', 'v4-to-v5-persistent-migration', 'legacy-declaration-false',
|
||||
'service-agent-unknown-refusal', 'human-bind-claim-consume', 'restart-persistence'],
|
||||
'native_identity_or_credential_calls': 0, 'network': 'none',
|
||||
'packages': {name: importlib.metadata.version(name) for name in
|
||||
('approval-engine', 'PyJWT', 'cryptography', 'waitress')},
|
||||
}, indent=2))
|
||||
69
docs/evidence/2026-09-10-human-control-image.json
Normal file
69
docs/evidence/2026-09-10-human-control-image.json
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
"status": "published-not-deployed",
|
||||
"source_commit": "be1a388a848cf59e9ff3a5420f88a70ca0a52e7e",
|
||||
"image": {
|
||||
"repository": "forgejo.coulomb.social/coulomb/approval-engine",
|
||||
"tag": "0.1.0-hfact-be1a388",
|
||||
"digest": "sha256:251941a5cb2724b57cc32cff6b693b1ab0be695bee4f56f02d51961189c0fa49",
|
||||
"linux_amd64_manifest": "sha256:a9fdac46b7a86f7d50389d551731b3dea321f47e90be66bfb8c3e498a8a544c2",
|
||||
"schema_version": 5
|
||||
},
|
||||
"scan": {
|
||||
"scanner_image": "sha256:62b1e65e8869bc4b4c6aa4fa2b21595256c7c2f6018a9d9ad61caf87187c1969",
|
||||
"gate": "CRITICAL,HIGH; exit-code 1",
|
||||
"exit_code": 0,
|
||||
"high": 0,
|
||||
"critical": 0,
|
||||
"os": "Alpine 3.24.1",
|
||||
"warning": "Scanner does not list Alpine 3.24 in its EOL list; vulnerability detection ran.",
|
||||
"lower_severities": "not selected by the existing release gate",
|
||||
"observed_at": "2026-09-10T17:32:22Z"
|
||||
},
|
||||
"container_verification": {
|
||||
"status": "passed",
|
||||
"uid": 10001,
|
||||
"schema_version": 5,
|
||||
"store_sha256": "eb33ce55f1475e19ab25d0727bc244ffc7375ff9ae5f441d7d9a36fb293d7446",
|
||||
"checks": [
|
||||
"nonroot",
|
||||
"v4-to-v5-persistent-migration",
|
||||
"legacy-declaration-false",
|
||||
"service-agent-unknown-refusal",
|
||||
"human-bind-claim-consume",
|
||||
"restart-persistence"
|
||||
],
|
||||
"native_identity_or_credential_calls": 0,
|
||||
"network": "none",
|
||||
"packages": {
|
||||
"approval-engine": "0.1.0",
|
||||
"PyJWT": "2.13.0",
|
||||
"cryptography": "50.0.1",
|
||||
"waitress": "3.0.2"
|
||||
}
|
||||
},
|
||||
"source_suite": {
|
||||
"passed": 152,
|
||||
"new_regressions": 22
|
||||
},
|
||||
"production_deployed": false,
|
||||
"factory_attempts": 0,
|
||||
"paid_model_calls": 0,
|
||||
"remaining_owner_records": [
|
||||
"APPROVAL-WP-0002-T01/T03/T05",
|
||||
"SECRETS-WP-0009-T03",
|
||||
"INFD-WP-0001-T07/T08",
|
||||
"AUDIT-WP-0009-T04/T06/T09"
|
||||
],
|
||||
"log_sha256": {
|
||||
"image-build.txt": "ec1b54fedaccf618f9fe31df5c142d6db4d9612effd900c05c2134eea97a680b",
|
||||
"image-scan.txt": "e0024173a72bc9d3862ed476aefcf2224a4bd54612c3c1c6e5bb20777aa2d5d1",
|
||||
"image-push.txt": "c89bb84760614e782eab64e33c72a578f69615adf5fe8ba35778c733975f0551",
|
||||
"registry-inspect.txt": "577d321cae9c55ed7a7814b33894ecacaf066e4a7b13cb54c488b72938bae1fb",
|
||||
"release-tests.txt": "48ac9c02d5e186c834889c99c651827dcc7605e674811ba7c6522c9890d7371f",
|
||||
"deploy-dry-run.txt": "05e28400d629b0aaefad24c7f12d894ca77eb538427eb1a12c7e0e8bce5d8f32"
|
||||
},
|
||||
"registry_manifest_verified": true,
|
||||
"deployment_validation": "kubectl apply --dry-run=client: passed (6 resources); no apply",
|
||||
"verification_script": "docs/evidence/2026-09-10-human-control-image-smoke.py",
|
||||
"verification_command": "docker run --rm -i --network none --read-only --tmpfs /tmp:rw,nosuid,nodev --cap-drop ALL --security-opt no-new-privileges --entrypoint python forgejo.coulomb.social/coulomb/approval-engine@sha256:251941a5cb2724b57cc32cff6b693b1ab0be695bee4f56f02d51961189c0fa49 - < docs/evidence/2026-09-10-human-control-image-smoke.py"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue