Document verified grade-five security study and deployment evidence
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
@@ -39,6 +39,13 @@ def main():
|
||||
[sys.executable, "scripts/rotate_identity.py"], cwd=ROOT, text=True, capture_output=True
|
||||
)
|
||||
check(rotate.returncode == 0, "operator rotation failed; inspect private operator execution")
|
||||
revoked = subprocess.run(
|
||||
[sys.executable, "scripts/security_checks.py", "revoked"],
|
||||
cwd=ROOT,
|
||||
text=True,
|
||||
capture_output=True,
|
||||
)
|
||||
check(revoked.returncode == 0, "revoked material was not denied before original token expiry")
|
||||
errors = 0
|
||||
deadline = time.monotonic() + 90
|
||||
pending = {a[0]["id"] for a in accepted}
|
||||
@@ -70,6 +77,27 @@ def main():
|
||||
thumbnail = c.call(
|
||||
"GET", "/api/v1/attachments/" + att["id"] + "/content?variant=thumbnail", actor=bob
|
||||
)["bytes"]
|
||||
metadata = c.call(
|
||||
"GET", "/api/v1/attachments/" + att["id"], actor=alice, schema="Attachment"
|
||||
)["json"]
|
||||
variants = []
|
||||
for advertised in metadata["variants"]:
|
||||
content = c.call(
|
||||
"GET",
|
||||
"/api/v1/attachments/" + att["id"] + "/content?variant=" + advertised["name"],
|
||||
actor=bob,
|
||||
)["bytes"]
|
||||
actual = hashlib.sha256(content).hexdigest()
|
||||
variants.append(
|
||||
{
|
||||
"name": advertised["name"],
|
||||
"sha256": actual,
|
||||
"advertised_sha256": advertised["sha256"],
|
||||
"size_matches": len(content) == advertised["size_bytes"],
|
||||
"passed": actual == advertised["sha256"]
|
||||
and len(content) == advertised["size_bytes"],
|
||||
}
|
||||
)
|
||||
sha = hashlib.sha256(original).hexdigest()
|
||||
rows.append(
|
||||
{
|
||||
@@ -78,6 +106,7 @@ def main():
|
||||
"download_sha256": hashlib.sha256(downloaded).hexdigest(),
|
||||
"thumbnail_sha256": hashlib.sha256(thumbnail).hexdigest(),
|
||||
"thumbnail_nonempty": bool(thumbnail),
|
||||
"variants": variants,
|
||||
"accepted_original_sha_matches": sha == att["sha256"],
|
||||
}
|
||||
)
|
||||
@@ -90,12 +119,16 @@ def main():
|
||||
"images_before": before,
|
||||
"images_after": after,
|
||||
"image_unchanged": before == after,
|
||||
"revoked_material_checks_passed": True,
|
||||
"variants_verified": sum(len(row["variants"]) for row in rows),
|
||||
"rows": rows,
|
||||
"passed": before == after
|
||||
and all(
|
||||
r["original_sha256"] == r["download_sha256"]
|
||||
and r["thumbnail_nonempty"]
|
||||
and r["accepted_original_sha_matches"]
|
||||
and len(r["variants"]) == 3
|
||||
and all(v["passed"] for v in r["variants"])
|
||||
for r in rows
|
||||
),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user