lab7: live stand integration fixes and verified evidence

This commit is contained in:
2026-11-26 19:17:22 +03:00
parent 33cec9bb7a
commit 210d645e28
47 changed files with 50612 additions and 80 deletions
+4 -4
View File
@@ -174,7 +174,7 @@ def _probe_pg_blast_radius(ca_pem, db_user, db_pass, att_id):
deny_select_chat_members: await run('SELECT chat_id, user_id FROM chat_members LIMIT 1'),
deny_select_message_attachments: await run('SELECT message_id, attachment_id FROM message_attachments LIMIT 1'),
deny_select_idempotency: await run('SELECT key FROM idempotency_keys LIMIT 1'),
deny_select_migrations: await run('SELECT filename FROM schema_migrations LIMIT 1'),
deny_select_migrations: await run('SELECT version FROM schema_migrations LIMIT 1'),
deny_delete_attachments: await run('DELETE FROM attachments WHERE id = $1', [payload.att_id]),
deny_delete_jobs: await run('DELETE FROM attachment_jobs WHERE attachment_id = $1', [payload.att_id]),
deny_update_sha256: await run("UPDATE attachments SET sha256 = '0000000000000000000000000000000000000000000000000000000000000000' WHERE id = $1", [payload.att_id]),
@@ -310,13 +310,13 @@ def _probe_rabbitmq_blast_radius(ca_pem, cert_pem, key_pem):
rejectUnauthorized: true,
minVersion: 'TLSv1.2',
secureOptions: crypto.constants.SSL_OP_NO_TICKET,
credentials: amqp.credentials.external(),
};
async function tryOp(vhost, fn) {
let conn = null;
try {
conn = await amqp.connect({
protocol: 'amqps', hostname: 'broker', port: 5671, vhost,
credentials: amqp.credentials.external(),
}, sockOpts);
conn.on('error', () => {});
const val = await fn(conn);
@@ -513,11 +513,11 @@ def _probe_revoked_g1(ca_pem, bao_url, ca_file, stolen_token, stolen_crt_pem, st
try {
conn = await amqp.connect({
protocol: 'amqps', hostname: 'broker', port: 5671, vhost: 'messenger',
credentials: amqp.credentials.external(),
}, {
ca: [Buffer.from(payload.ca_pem)], cert: Buffer.from(payload.cert_pem), key: Buffer.from(payload.key_pem),
servername: 'broker', rejectUnauthorized: true, minVersion: 'TLSv1.2',
secureOptions: crypto.constants.SSL_OP_NO_TICKET,
credentials: amqp.credentials.external(),
});
await conn.close();
return { rejected: false };
@@ -564,7 +564,7 @@ def _verify_attachment_durability(client, actor, att_id, expected_bytes):
)
db_counts = common.psql_admin(
f"SELECT count(*), count(DISTINCT name) FROM attachment_variants WHERE attachment_id = '{att_id}'"
f"SELECT count(*), count(DISTINCT variant) FROM attachment_variants WHERE attachment_id = '{att_id}'"
)
total_v, distinct_v = (int(x) for x in db_counts.split(','))
no_dups = (total_v == distinct_v and total_v == 3)