oportunidades 7
tests / ci (push) Waiting to run

This commit is contained in:
2026-10-13 11:40:29 +02:00
parent 20971d523f
commit 287e991486
2902 changed files with 1085456 additions and 25957 deletions
@@ -0,0 +1,7 @@
{
"external_messages_sent": 0,
"source_diagnostics_restricted": true,
"retained_files": 279,
"handoff_file_count": 5,
"handoff_files_restricted": true
}
@@ -0,0 +1,479 @@
{
"at": "2026-10-12T19:42:40.930008+00:00",
"case": "C132",
"access_log_snapshot_sha256": "c8e35a2f157f1fc37534dc0266978983e03867fa09edab91a8ad55a0ded7b97a",
"log_lines_parsed": 1443,
"unparsed_lines": 21,
"all_request_origin_classes": {
"loopback": 1440,
"non_loopback": 3
},
"diagnostic_requests": [
{
"at": "2026-10-12T18:40:45+00:00",
"method": "GET",
"operation": "list",
"status": 200,
"origin_class": "loopback",
"record_id_or_query_exported": false
},
{
"at": "2026-10-12T18:40:45+00:00",
"method": "GET",
"operation": "detail",
"status": 200,
"origin_class": "loopback",
"record_id_or_query_exported": false
},
{
"at": "2026-10-12T18:57:50+00:00",
"method": "GET",
"operation": "list",
"status": 404,
"origin_class": "loopback",
"record_id_or_query_exported": false
},
{
"at": "2026-10-12T18:57:51+00:00",
"method": "GET",
"operation": "detail",
"status": 404,
"origin_class": "loopback",
"record_id_or_query_exported": false
},
{
"at": "2026-10-12T18:57:51+00:00",
"method": "GET",
"operation": "detail",
"status": 404,
"origin_class": "loopback",
"record_id_or_query_exported": false
},
{
"at": "2026-10-12T19:11:12+00:00",
"method": "GET",
"operation": "list",
"status": 404,
"origin_class": "loopback",
"record_id_or_query_exported": false
},
{
"at": "2026-10-12T19:11:12+00:00",
"method": "GET",
"operation": "detail",
"status": 404,
"origin_class": "loopback",
"record_id_or_query_exported": false
},
{
"at": "2026-10-12T19:11:12+00:00",
"method": "GET",
"operation": "detail",
"status": 404,
"origin_class": "loopback",
"record_id_or_query_exported": false
}
],
"successful_diagnostic_requests": 2,
"successful_requests_match_recorded_authorized_audit_time": true,
"audit_events_examined": 130,
"audit_action_counts": [
{
"source": "investment-zones",
"action": "saved",
"actor_user_id": 2,
"count": 17
},
{
"source": "investment-zones",
"action": "published",
"actor_user_id": 13,
"count": 12
},
{
"source": "investment-territory",
"action": "primary_territory_saved",
"actor_user_id": 13,
"count": 6
},
{
"source": "investment-zones",
"action": "saved",
"actor_user_id": 13,
"count": 7
},
{
"source": "investment-submission",
"action": "draft_created",
"actor_user_id": 2,
"count": 3
},
{
"source": "user-instruction",
"action": "public_disclosure_authorized",
"actor_user_id": null,
"count": 1
},
{
"source": "portal-services",
"action": "published_under_user_authorization",
"actor_user_id": 13,
"count": 4
},
{
"source": "documented-relations-repair",
"action": "documented_relations_applied",
"actor_user_id": 13,
"count": 1
},
{
"source": "partnership-exchange",
"action": "partnership_module_installed",
"actor_user_id": 13,
"count": 1
},
{
"source": "portal-management",
"action": "created",
"actor_user_id": 13,
"count": 1
},
{
"source": "portal-management",
"action": "updated",
"actor_user_id": 2,
"count": 9
},
{
"source": "virtual-desk",
"action": "desk_installed",
"actor_user_id": 13,
"count": 1
},
{
"source": "virtual-desk",
"action": "internal_service_published",
"actor_user_id": 13,
"count": 3
},
{
"source": "virtual-desk",
"action": "case_created",
"actor_user_id": 2,
"count": 1
},
{
"source": "virtual-desk",
"action": "consulted",
"actor_user_id": 2,
"count": 8
},
{
"source": "virtual-desk",
"action": "assumptions_corrected",
"actor_user_id": 2,
"count": 1
},
{
"source": "investment-submission",
"action": "draft_saved",
"actor_user_id": 2,
"count": 1
},
{
"source": "investment-submission",
"action": "submitted",
"actor_user_id": 2,
"count": 2
},
{
"source": "investment-workspace",
"action": "message_sent",
"actor_user_id": 2,
"count": 1
},
{
"source": "territory-traceability-v2",
"action": "traceability_applied",
"actor_user_id": 13,
"count": 2
},
{
"source": "territory-traceability-v2",
"action": "traceability_reversed",
"actor_user_id": 13,
"count": 1
},
{
"source": "opportunity-origin-review",
"action": "origin_classification_decided",
"actor_user_id": 13,
"count": 6
},
{
"source": "opportunity-management-install",
"action": "opportunity_management_installed",
"actor_user_id": 13,
"count": 1
},
{
"source": "organization-country-installation",
"action": "install",
"actor_user_id": 13,
"count": 1
},
{
"source": "opportunity-resources-install",
"action": "opportunity_resources_installed",
"actor_user_id": 2,
"count": 1
},
{
"source": "portal-profile-installation",
"action": "install",
"actor_user_id": 13,
"count": 1
},
{
"source": "portal-profile-installation",
"action": "bootstrap-request",
"actor_user_id": 13,
"count": 1
},
{
"source": "portal-profiles-v1",
"action": "superuser_pair_initialized",
"actor_user_id": 2,
"count": 1
},
{
"source": "portal-profile-installation",
"action": "bootstrap-confirm",
"actor_user_id": 2,
"count": 1
},
{
"source": "portal-profiles-v1",
"action": "audit_metadata_read",
"actor_user_id": 13,
"count": 2
},
{
"source": "portal-owner-staff-preparation",
"action": "staff_account_prepared",
"actor_user_id": null,
"count": 3
},
{
"source": "portal-profiles-v1",
"action": "request_denied",
"actor_user_id": 15,
"count": 3
},
{
"source": "portal-profiles-v1",
"action": "request_denied",
"actor_user_id": 17,
"count": 1
},
{
"source": "portal-profiles-v1",
"action": "operator_organization_registered",
"actor_user_id": 13,
"count": 1
},
{
"source": "portal-profiles-v1",
"action": "role_granted",
"actor_user_id": 13,
"count": 7
},
{
"source": "portal-profiles-v1",
"action": "request_denied",
"actor_user_id": 13,
"count": 14
},
{
"source": "portal-profiles-v1",
"action": "operator_organization_registration_recovered",
"actor_user_id": 13,
"count": 1
},
{
"source": "C132-incident-response",
"action": "C132_affected_MFA_rotated_and_sessions_revoked",
"actor_user_id": null,
"count": 1
},
{
"source": "C132-incident-response",
"action": "C132_anonymous_diagnostics_contained",
"actor_user_id": null,
"count": 1
}
],
"denied_profile_requests": [
{
"actor_user_id": 15,
"at": "2026-10-12 08:24:32.288003+00",
"action": "request_denied"
},
{
"actor_user_id": 15,
"at": "2026-10-12 08:25:17.157828+00",
"action": "request_denied"
},
{
"actor_user_id": 15,
"at": "2026-10-12 08:25:37.876732+00",
"action": "request_denied"
},
{
"actor_user_id": 17,
"at": "2026-10-12 08:31:59.461947+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 08:44:41.649736+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 08:45:50.898559+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 08:48:23.493772+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 08:50:55.017891+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 08:50:59.682495+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:05:41.741185+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:06:07.714158+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:06:11.320336+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:06:15.88483+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:06:16.815169+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:06:17.963057+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:08:55.433336+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:09:24.510857+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:29:39.50625+00",
"action": "request_denied"
}
],
"sensitive_route_counts": [
{
"family": "login",
"method": "GET",
"status": 200,
"count": 43
},
{
"family": "login",
"method": "GET",
"status": 308,
"count": 6
},
{
"family": "login",
"method": "POST",
"status": 405,
"count": 2
},
{
"family": "login",
"method": "POST",
"status": 302,
"count": 20
},
{
"family": "MFA",
"method": "GET",
"status": 200,
"count": 10
},
{
"family": "MFA",
"method": "POST",
"status": 302,
"count": 10
},
{
"family": "MFA_enrollment",
"method": "POST",
"status": 302,
"count": 4
},
{
"family": "MFA_enrollment",
"method": "GET",
"status": 200,
"count": 12
},
{
"family": "login",
"method": "GET",
"status": 302,
"count": 3
},
{
"family": "MFA",
"method": "GET",
"status": 302,
"count": 2
}
],
"suspicious_diagnostic_access_identified_in_available_logs": false,
"negative_result_does_not_prove_no_access": true,
"limitations": [
"Common access log is shared across vhosts and does not record Host or authenticated account; it cannot attribute every request to this portal or a person.",
"No complete diagnostic enablement history; diagnostic retention was 24 hours. Exact earlier exposure start and deleted records cannot be recovered from the available files.",
"A denied profile request is an authorization rejection, not proof of an attack. Audit has no comprehensive successful login/MFA or document-download trail.",
"Loopback source identifies a local request or proxy, not the identity of the person making it. No conclusion about earlier or unlogged downloads."
],
"raw_lines_IPs_cookies_tokens_or_payloads_exported": false
}
@@ -0,0 +1,99 @@
{
"audit_schema": [
{
"column_name": "id",
"is_nullable": "NO",
"column_default": "gen_random_uuid()"
},
{
"column_name": "source_system",
"is_nullable": "NO",
"column_default": "'investmoz'::text"
},
{
"column_name": "external_id",
"is_nullable": "YES",
"column_default": null
},
{
"column_name": "data_classification",
"is_nullable": "NO",
"column_default": "'internal'::text"
},
{
"column_name": "correlation_id",
"is_nullable": "YES",
"column_default": null
},
{
"column_name": "created_at",
"is_nullable": "NO",
"column_default": "now()"
},
{
"column_name": "actor_user_id",
"is_nullable": "YES",
"column_default": null
},
{
"column_name": "entity_type",
"is_nullable": "NO",
"column_default": null
},
{
"column_name": "entity_id",
"is_nullable": "YES",
"column_default": null
},
{
"column_name": "action",
"is_nullable": "NO",
"column_default": null
},
{
"column_name": "occurred_at",
"is_nullable": "NO",
"column_default": "now()"
},
{
"column_name": "before_data",
"is_nullable": "YES",
"column_default": null
},
{
"column_name": "after_data",
"is_nullable": "YES",
"column_default": null
}
],
"affected_accounts": [
{
"id": 14,
"name": "Aurora Chachuaio",
"email": "aurora.chachuaio@tempo.co.mz",
"two_factor_confirmed_at": "2026-10-12 08:21:11",
"portal_access_revision": 0
},
{
"id": 15,
"name": "Palmira Uamusse",
"email": "palmira.matsinhe@tempo.co.mz",
"two_factor_confirmed_at": "2026-10-12 08:23:32",
"portal_access_revision": 0
},
{
"id": 16,
"name": "Mario Melembe",
"email": "mario.melembe@tempo.co.mz",
"two_factor_confirmed_at": "2026-10-12 08:19:31",
"portal_access_revision": 0
},
{
"id": 17,
"name": "Tempo Lda",
"email": "info@tempo.co.mz",
"two_factor_confirmed_at": "2026-10-12 08:35:30",
"portal_access_revision": 0
}
]
}
@@ -0,0 +1,8 @@
<?php
ini_set('zend.exception_ignore_args','1');set_exception_handler(function(Throwable $e){fwrite(STDERR,$e::class);exit(1);});
$root=dirname(__DIR__,2);require $root.'/vendor/autoload.php';$app=require $root.'/bootstrap/app.php';(new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables)->bootstrap($app);(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);
$c=config('database.connections.'.config('database.default'));if($c['database']!=='investemoz'||(int)$c['port']!==5432)throw new RuntimeException('Target differs');
$db=new PDO('pgsql:host='.$c['host'].';port='.$c['port'].';dbname='.$c['database'],$c['username'],$c['password']);$db->exec('BEGIN READ ONLY');
$a=$db->query("SELECT column_name,is_nullable,column_default FROM information_schema.columns WHERE table_schema='public' AND table_name='audit_events' ORDER BY ordinal_position")->fetchAll(PDO::FETCH_ASSOC);
$u=$db->query('SELECT id,name,email,two_factor_confirmed_at,portal_access_revision FROM users WHERE id IN (14,15,16,17) ORDER BY id')->fetchAll(PDO::FETCH_ASSOC);$db->exec('ROLLBACK');
$d=['audit_schema'=>$a,'affected_accounts'=>$u];file_put_contents(__DIR__.'/C132-account-metadata.json',json_encode($d,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode($d,JSON_THROW_ON_ERROR);
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:47:48+00:00",
"account_id": 14,
"recipient": "aurora.chachuaio@tempo.co.mz",
"recipient_count": 1,
"CC_BCC": 0,
"transport": "existing_corporate_SMTP",
"TLS_required_and_certificate_verified": true,
"negotiated_TLS_protocol": "TLSv1.3",
"SMTP_accepted": true,
"message_id": "4j3Sg65wmTz13LZt",
"private_attachment_count": 1,
"attachment_contains_secret": true,
"attachment_or_secret_values_in_chat_or_report": false,
"owner_authorization": "Explicit owner reply: send three separate emails to respective corporate addresses with mandatory TLS",
"mailbox_receipt_confirmed": false,
"holder_authentication_confirmed": false,
"notifications_flag_changed": false,
"C131_included": false
}
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:47:48+00:00",
"account_id": 14,
"recipient": "aurora.chachuaio@tempo.co.mz",
"recipient_count": 1,
"CC_BCC": 0,
"transport": "existing_corporate_SMTP",
"TLS_required_and_certificate_verified": true,
"negotiated_TLS_protocol": "TLSv1.3",
"SMTP_accepted": true,
"message_id": "4j3Sg65wmTz13LZt",
"private_attachment_count": 1,
"attachment_contains_secret": true,
"attachment_or_secret_values_in_chat_or_report": false,
"owner_authorization": "Explicit owner reply: send three separate emails to respective corporate addresses with mandatory TLS",
"mailbox_receipt_confirmed": false,
"holder_authentication_confirmed": false,
"notifications_flag_changed": false,
"C131_included": false
}
@@ -0,0 +1,14 @@
{
"recorded_at": "2026-10-13T07:41:04.105260+00:00",
"account_id": 14,
"source": "Owner message in conversation after individual delivery",
"exact_confirmation": "conta 14 — recebido, MFA configurado e dashboard acessível",
"mailbox_receipt_confirmed": true,
"holder_MFA_setup_confirmed": true,
"dashboard_access_confirmed": true,
"evidence_kind": "manual confirmation relayed by owner",
"secrets_or_codes_recorded": false,
"active_changes": 0,
"sessions_not_retested_or_changed": true,
"full_incident_closed": false
}
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:47:57+00:00",
"account_id": 15,
"recipient": "palmira.matsinhe@tempo.co.mz",
"recipient_count": 1,
"CC_BCC": 0,
"transport": "existing_corporate_SMTP",
"TLS_required_and_certificate_verified": true,
"negotiated_TLS_protocol": "TLSv1.3",
"SMTP_accepted": true,
"message_id": "4j3SgJ5CxLz13LZt",
"private_attachment_count": 1,
"attachment_contains_secret": true,
"attachment_or_secret_values_in_chat_or_report": false,
"owner_authorization": "Explicit owner reply: send three separate emails to respective corporate addresses with mandatory TLS",
"mailbox_receipt_confirmed": false,
"holder_authentication_confirmed": false,
"notifications_flag_changed": false,
"C131_included": false
}
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:47:57+00:00",
"account_id": 15,
"recipient": "palmira.matsinhe@tempo.co.mz",
"recipient_count": 1,
"CC_BCC": 0,
"transport": "existing_corporate_SMTP",
"TLS_required_and_certificate_verified": true,
"negotiated_TLS_protocol": "TLSv1.3",
"SMTP_accepted": true,
"message_id": "4j3SgJ5CxLz13LZt",
"private_attachment_count": 1,
"attachment_contains_secret": true,
"attachment_or_secret_values_in_chat_or_report": false,
"owner_authorization": "Explicit owner reply: send three separate emails to respective corporate addresses with mandatory TLS",
"mailbox_receipt_confirmed": false,
"holder_authentication_confirmed": false,
"notifications_flag_changed": false,
"C131_included": false
}
@@ -0,0 +1,14 @@
{
"recorded_at": "2026-10-13T08:29:30.634159+00:00",
"account_id": 15,
"source": "Owner message in conversation after individual delivery",
"exact_confirmation": "conta 15 — recebido, MFA configurado e dashboard acessível",
"mailbox_receipt_confirmed": true,
"holder_MFA_setup_confirmed": true,
"dashboard_access_confirmed": true,
"evidence_kind": "manual confirmation relayed by owner",
"secrets_or_codes_recorded": false,
"active_changes": 0,
"sessions_not_retested_or_changed": true,
"full_incident_closed": false
}
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:48:02+00:00",
"account_id": 16,
"recipient": "mario.melembe@tempo.co.mz",
"recipient_count": 1,
"CC_BCC": 0,
"transport": "existing_corporate_SMTP",
"TLS_required_and_certificate_verified": true,
"negotiated_TLS_protocol": "TLSv1.3",
"SMTP_accepted": true,
"message_id": "4j3SgP40Npz13LZt",
"private_attachment_count": 1,
"attachment_contains_secret": true,
"attachment_or_secret_values_in_chat_or_report": false,
"owner_authorization": "Explicit owner reply: send three separate emails to respective corporate addresses with mandatory TLS",
"mailbox_receipt_confirmed": false,
"holder_authentication_confirmed": false,
"notifications_flag_changed": false,
"C131_included": false
}
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:48:02+00:00",
"account_id": 16,
"recipient": "mario.melembe@tempo.co.mz",
"recipient_count": 1,
"CC_BCC": 0,
"transport": "existing_corporate_SMTP",
"TLS_required_and_certificate_verified": true,
"negotiated_TLS_protocol": "TLSv1.3",
"SMTP_accepted": true,
"message_id": "4j3SgP40Npz13LZt",
"private_attachment_count": 1,
"attachment_contains_secret": true,
"attachment_or_secret_values_in_chat_or_report": false,
"owner_authorization": "Explicit owner reply: send three separate emails to respective corporate addresses with mandatory TLS",
"mailbox_receipt_confirmed": false,
"holder_authentication_confirmed": false,
"notifications_flag_changed": false,
"C131_included": false
}
@@ -0,0 +1,14 @@
{
"recorded_at": "2026-10-13T06:51:07.479650+00:00",
"account_id": 16,
"source": "Owner message in conversation after individual delivery",
"exact_confirmation": "conta 16 — recebido, MFA configurado e dashboard acessível",
"mailbox_receipt_confirmed": true,
"holder_MFA_setup_confirmed": true,
"dashboard_access_confirmed": true,
"evidence_kind": "manual confirmation relayed by owner",
"secrets_or_codes_recorded": false,
"active_changes": 0,
"sessions_not_retested_or_changed": true,
"full_incident_closed": false
}
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:40:51+00:00",
"account_id": 17,
"recipient": "info@tempo.co.mz",
"recipient_count": 1,
"CC_BCC": 0,
"transport": "existing_corporate_SMTP",
"TLS_required_and_certificate_verified": true,
"negotiated_TLS_protocol": "TLSv1.3",
"SMTP_accepted": true,
"message_id": "4j3SW63gPfz13LZt",
"private_attachment_count": 1,
"attachment_contains_secret": true,
"attachment_or_secret_values_in_chat_or_report": false,
"owner_authorization": "Explicit owner reply: send email to info@tempo.co.mz, corporate manager will reply",
"mailbox_receipt_confirmed": false,
"holder_authentication_confirmed": false,
"notifications_flag_changed": false,
"C131_included": false
}
@@ -0,0 +1,8 @@
{
"at": "2026-10-12T19:37:58+00:00",
"stage": "SMTP-connect-TLS-auth",
"error_type": "RuntimeException",
"values_recorded": false,
"outcome_may_be_unknown": false,
"automatic_retry": false
}
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:40:51+00:00",
"account_id": 17,
"recipient": "info@tempo.co.mz",
"recipient_count": 1,
"CC_BCC": 0,
"transport": "existing_corporate_SMTP",
"TLS_required_and_certificate_verified": true,
"negotiated_TLS_protocol": "TLSv1.3",
"SMTP_accepted": true,
"message_id": "4j3SW63gPfz13LZt",
"private_attachment_count": 1,
"attachment_contains_secret": true,
"attachment_or_secret_values_in_chat_or_report": false,
"owner_authorization": "Explicit owner reply: send email to info@tempo.co.mz, corporate manager will reply",
"mailbox_receipt_confirmed": false,
"holder_authentication_confirmed": false,
"notifications_flag_changed": false,
"C131_included": false
}
@@ -0,0 +1,13 @@
{
"recorded_at": "2026-10-12T19:49:32.318259+00:00",
"account_id": 17,
"recipient": "info@tempo.co.mz",
"source": "Owner message in conversation after individual delivery",
"exact_confirmation": "conta 17 — recebido, MFA configurado e dashboard acessível",
"mailbox_receipt_confirmed": true,
"holder_MFA_setup_confirmed": true,
"dashboard_access_confirmed": true,
"evidence_kind": "manual confirmation relayed by owner",
"secrets_or_codes_recorded": false,
"full_incident_closed": false
}
@@ -0,0 +1,73 @@
{
"at": "2026-10-12T18:40:45.350823+00:00",
"case": "C132",
"environment": "active",
"base": "https://portal-investidor.test",
"target_from_existing_read_only_receipt": "investemoz:5432",
"request_methods": [
"GET"
],
"authenticated": false,
"cookies_or_tokens_sent": false,
"TLS_bypass": false,
"response_bodies_saved": false,
"personal_values_saved": false,
"application_code_config_or_business_data_mutations": 0,
"incidental_server_logging_or_guest_session_metadata": "Normal effects of GET are possible; not counted as business writes.",
"index": {
"status": 200,
"json_array": true,
"entries_exposed": 445,
"metadata_keys": [
"batchId",
"component",
"id",
"method",
"redirectLocation",
"requestType",
"serverTimingMs",
"status",
"tabUuid",
"timestamp",
"url",
"utime",
"visitId"
],
"route_family_counts": {
"other": 341,
"login": 48,
"MFA": 14,
"dashboard": 15,
"management": 27
},
"post_requests_metadata": 88
},
"detail": {
"status": 200,
"entry_identifier_saved": false,
"top_level_fields": [
"__meta",
"componentPath",
"http",
"propValues",
"props",
"renderSource",
"route"
],
"request_headers_present": true,
"cookie_header_present": true,
"xsrf_header_present": true,
"request_body_present": true,
"response_body_present": true,
"prop_values_present": true,
"authenticated_user_object_present": true,
"source_paths_present": true,
"no_values_exported": true
},
"result": "exposure_confirmed",
"active_source_and_bundle_unchanged": true,
"source_hashes": {
"config/inertia.php": "45994a9035e8e10d2fbb82f9fc18756cfb1ba403c9597d334122181b6b29839b",
"public/build/manifest.json": "e21d388f2e71bcd762c476d3e0bd1ae7c608ca57cafc2381c2a8888ce5d4efbf"
}
}
@@ -0,0 +1,95 @@
"""Read protected evidence. Export counts/classification only, never captured values."""
from pathlib import Path
from datetime import datetime,timezone
from urllib.parse import urlparse,parse_qs,unquote
import json,hashlib,re,collections
OUT=Path(__file__).resolve().parent;ROOT=OUT.parents[1]
incident=Path(json.loads((OUT/'C132-private-location.json').read_text(encoding='utf-8-sig'))['private_directory'])
manifest=json.loads((incident/'evidence-manifest-private.json').read_text(encoding='utf-8-sig'))
metrics=collections.defaultdict(lambda:collections.Counter());times=[];methods=collections.Counter();families=collections.Counter();auth_ids=set();secrets=[];records=0;body_states=collections.Counter();mfa_times=[]
markers={'[REDACTED]','[UNSERIALIZABLE]','[TRUNCATED]','********','**********','[redacted]'}
def state(v):
if v is None or v=='' or v==[] or v=={}:return 'empty'
if isinstance(v,str) and (v in markers or all(c=='*' for c in v)):return 'redacted'
if isinstance(v,list) and all(state(x) in ['empty','redacted'] for x in v):return 'redacted'
return 'unredacted'
def leaf_values(v):
if isinstance(v,dict):
for x in v.values():yield from leaf_values(x)
elif isinstance(v,list):
for x in v:yield from leaf_values(x)
elif isinstance(v,str):yield v
def walk(v,path=()):
if isinstance(v,dict):
for k,x in v.items():yield path+(str(k),),x;yield from walk(x,path+(str(k),))
elif isinstance(v,list):
for i,x in enumerate(v):yield from walk(x,path+(str(i),))
elif isinstance(v,str) and v[:1] in ['{','['] and len(v)<8000000:
try:decoded=json.loads(v)
except ValueError:return
yield from walk(decoded,path+('embedded-json',))
envsecrets={}
for line in (ROOT/'.env').read_text(encoding='utf-8-sig').splitlines():
if '=' not in line or line.lstrip().startswith('#'):continue
k,v=line.split('=',1);v=v.strip().strip('"').strip("'")
if re.search(r'(?:PASSWORD|SECRET|TOKEN|PRIVATE_KEY|APP_KEY|API_KEY)$',k.strip()) and len(v)>=8:envsecrets[k.strip()]=v
config_matches=collections.Counter();headers=['cookie','set-cookie','authorization','proxy-authorization','x-xsrf-token','x-csrf-token']
for f in manifest['files']:
p=incident/'diagnostics'/f['name'];raw=p.read_bytes();assert hashlib.sha256(raw).hexdigest()==f['sha256']
if not re.fullmatch(r'[0-9A-HJKMNP-TV-Z]{26}\.json',f['name']):continue
d=json.loads(raw);meta=d.get('__meta') or {};records+=1;times.append(meta.get('timestamp'));methods[meta.get('method','unknown')]+=1
route=urlparse(str(meta.get('url',''))).path
family=next((family for prefix,family in [('/management','management'),('/perfis','profile_administration'),('/dashboard','dashboard'),('/login','login'),('/two-factor-challenge','MFA_challenge'),('/user/two-factor','MFA_setup'),('/settings','settings'),('/minhas-oportunidades','opportunities')] if route.startswith(prefix)),'other')
families[family]+=1
http=d.get('http') or {}
for bag in ['requestHeaders','responseHeaders']:
for k,v in (http.get(bag) or {}).items():
lower=str(k).lower()
if lower in headers:
metrics['header:'+lower][state(v)]+=1
if state(v)=='unredacted':secrets.append({'kind':'header:'+lower,'value':v,'entry_id':meta.get('id'),'timestamp':meta.get('timestamp')})
for key in ['requestBody','responseBody']:
if isinstance(http.get(key),dict):body_states[key+':'+str(http[key].get('status','unknown'))]+=1
# Fortify returns recovery codes as a JSON array, with no sensitive field name to trigger generic key redaction.
if route=='/user/two-factor-recovery-codes':
response=http.get('responseBody') or {};value=response.get('value') if isinstance(response,dict) else None
if isinstance(value,str):
try:value=json.loads(value)
except ValueError:pass
if isinstance(value,list):
for code in value:
metrics['MFA_recovery_code'][state(code)]+=1
if state(code)=='unredacted':secrets.append({'kind':'MFA_recovery_code','value':code,'entry_id':meta.get('id'),'timestamp':meta.get('timestamp')})
props=d.get('propValues') or {}
user=(props.get('auth') or {}).get('user') if isinstance(props,dict) and isinstance(props.get('auth'),dict) else None
if isinstance(user,dict) and isinstance(user.get('id'),int):auth_ids.add(user['id'])
for path,v in walk(d):
last=path[-1].lower().replace('-','_')
key=last.replace('_','')
kind=None
if key in ['password','passwordconfirmation','currentpassword']:kind='password'
elif key in ['token','accesstoken','refreshtoken','_token','apikey','clientsecret']:kind='token_or_secret'
elif key in ['secret','secretkey','twofactorsecret','totpsecret','mfasecret']:kind='MFA_or_other_secret'
elif key in ['recoverycode','recoverycodes','twofactorrecoverycodes']:kind='MFA_recovery_code'
elif last=='code' and family=='MFA_challenge' and 'requestBody' in path:kind='MFA_one_time_code'
if kind:
metrics[kind][state(v)]+=1
if state(v)=='unredacted':
secrets.append({'kind':kind,'value':v,'entry_id':meta.get('id'),'timestamp':meta.get('timestamp')})
if kind=='MFA_one_time_code':mfa_times.append(meta.get('timestamp'))
if isinstance(v,str) and 'otpauth://' in v:
metrics['otpauth_URI']['unredacted']+=1;secrets.append({'kind':'otpauth_URI','value':v,'entry_id':meta.get('id'),'timestamp':meta.get('timestamp')})
strings=list(leaf_values(d))
for name,value in envsecrets.items():
if any(value in s or json.dumps(value)[1:-1] in s for s in strings):config_matches[name]+=1
times=sorted(t for t in times if isinstance(t,str));mfa_times=sorted(t for t in mfa_times if isinstance(t,str))
# Potential values remain solely in the already restricted incident directory for usability assessment.
(incident/'secret-candidates-private.json').write_text(json.dumps(secrets,ensure_ascii=False),encoding='utf-8')
summary={'at':datetime.now(timezone.utc).isoformat(),'case':'C132','diagnostic_records_examined':records,'preserved_files':len(manifest['files']),
'retained_first_timestamp':times[0] if times else None,'retained_last_timestamp':times[-1] if times else None,
'retained_window_not_full_exposure_period':True,'methods':dict(methods),'route_families':dict(families),'authenticated_user_ids_in_retained_props':sorted(auth_ids),
'sensitive_field_classification':{k:dict(v) for k,v in sorted(metrics.items())},'body_capture_states':dict(body_states),
'active_config_secret_exact_matches':dict(config_matches),'MFA_code_first_timestamp':mfa_times[0] if mfa_times else None,'MFA_code_last_timestamp':mfa_times[-1] if mfa_times else None,
'unredacted_candidate_occurrences':len(secrets),'values_exported':False,'candidate_values_retained_only_in_restricted_evidence':True,
'usability_assessment_pending':bool(secrets)}
(OUT/'C132-local-analysis.json').write_text(json.dumps(summary,ensure_ascii=False,indent=2),encoding='utf-8');print(json.dumps(summary,ensure_ascii=True))
@@ -0,0 +1,44 @@
<?php
ini_set('zend.exception_ignore_args','1');set_exception_handler(function(Throwable $e){fwrite(STDERR,'Assessment stopped: '.$e::class.' '.basename($e->getFile()).':'.$e->getLine());exit(1);});
$root=dirname(__DIR__,2);require $root.'/vendor/autoload.php';$app=require $root.'/bootstrap/app.php';
(new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables)->bootstrap($app);(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);
$c=config('database.connections.'.config('database.default'));if($c['driver']!=='pgsql'||!empty($c['url'])||(int)$c['port']!==5432||$c['database']!=='investemoz'||!in_array($c['host'],['localhost','127.0.0.1'],true))throw new RuntimeException('Target mismatch');
$db=new PDO('pgsql:host='.$c['host'].';port='.$c['port'].';dbname='.$c['database'],$c['username'],$c['password'],[PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]);$db->exec('BEGIN READ ONLY');
$identity=$db->query('SELECT current_database() as database,inet_server_port() as port')->fetch(PDO::FETCH_ASSOC);if($identity['database']!=='investemoz'||(int)$identity['port']!==5432)throw new RuntimeException('Identity mismatch');
$where=json_decode(ltrim(file_get_contents(__DIR__.'/C132-private-location.json'),"\xEF\xBB\xBF"),true,512,JSON_THROW_ON_ERROR)['private_directory'];
$candidates=json_decode(file_get_contents($where.'/secret-candidates-private.json'),true,512,JSON_THROW_ON_ERROR);
$key=config('app.key');$key=str_starts_with($key,'base64:')?base64_decode(substr($key,7),true):$key;$crypt=new Illuminate\Encryption\Encrypter($key,config('app.cipher'));
$plainString=static function(string $encrypted)use($crypt):string{
$plain=$crypt->decrypt($encrypted,false);
// Fortify encrypt() serializes strings; legacy encryptString() does not. Do not instantiate objects.
if(preg_match('/^s:\d+:"/',$plain)){$decoded=unserialize($plain,['allowed_classes'=>false]);if(!is_string($decoded))throw new RuntimeException('Unexpected envelope type');return $decoded;}
if(!is_string($plain))throw new RuntimeException('Unexpected plaintext type');return $plain;
};
$beforeSnapshot=($argv[1]??'')==='--before-snapshot';
$users=$beforeSnapshot?json_decode(file_get_contents($where.'/recovery/users-before-response-private.json'),true,512,JSON_THROW_ON_ERROR):$db->query('SELECT id,email,password,two_factor_secret,two_factor_recovery_codes,two_factor_confirmed_at,remember_token FROM users ORDER BY id')->fetchAll(PDO::FETCH_ASSOC);
$sessions=$db->query('SELECT id,user_id,last_activity FROM sessions')->fetchAll(PDO::FETCH_ASSOC);
$impacted=[];$detail=[];$types=[];
foreach($candidates as $candidate){
$kind=$candidate['kind'];$types[$kind]=($types[$kind]??0)+1;$values=is_array($candidate['value'])?$candidate['value']:[$candidate['value']];
if($kind==='otpauth_URI'){
$uri=$candidate['value'];$uri=str_replace('&amp;','&',$uri);parse_str(parse_url($uri,PHP_URL_QUERY)??'', $qs);$values=isset($qs['secret'])?[$qs['secret']]:[];
}
foreach($values as $value){if(!is_string($value))continue;
foreach($users as $user){
$matches=false;$effect=null;
if(in_array($kind,['MFA_or_other_secret','otpauth_URI'],true)&&$user['two_factor_secret']){
$secret=$plainString($user['two_factor_secret']);$matches=hash_equals(strtoupper($secret),strtoupper($value));unset($secret);$effect='current_TOTP_seed';
}elseif($kind==='password'){$matches=password_verify($value,$user['password']);$effect='current_password';}
elseif($kind==='MFA_recovery_code'&&$user['two_factor_recovery_codes']){$codes=json_decode($plainString($user['two_factor_recovery_codes']),true);$matches=is_array($codes)&&in_array($value,$codes,true);unset($codes);$effect='current_recovery_code';}
if($matches){$id=(int)$user['id'];$impacted[$id][$effect]=true;$detail[]=['user_id'=>$id,'kind'=>$effect,'entry_id'=>$candidate['entry_id'],'timestamp'=>$candidate['timestamp']];}
}
}
}
$db->exec('ROLLBACK');$detailsPrivate=['at'=>gmdate('c'),'matches'=>$detail];$privateName=$beforeSnapshot?'usability-before-snapshot-matches-private.json':(($argv[1]??'')==='--after-rotation'?'usability-after-rotation-matches-private.json':'usability-matches-private.json');file_put_contents($where.'/'.$privateName,json_encode($detailsPrivate,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));
$known=[];foreach($impacted as $id=>$effects)$known[]=['user_id'=>(int)$id,'usable_exposed_credentials'=>array_keys($effects),'active_session_count'=>count(array_filter($sessions,fn($s)=>(int)$s['user_id']===$id))];
$summary=['at'=>gmdate('c'),'target'=>$identity,'read_only'=>true,'current_credential_matches'=>$known,'current_seed_affected_user_ids'=>array_map(fn($x)=>$x['user_id'],array_values(array_filter($known,fn($x)=>in_array('current_TOTP_seed',$x['usable_exposed_credentials'],true)))),
'source_state'=>$beforeSnapshot?'Verified pre-response backup snapshot':'Current active credentials, READ ONLY',
'recovery_code_candidate_occurrences'=>count(array_filter($candidates,fn($x)=>$x['kind']==='MFA_recovery_code')),
'cookies_and_token_values_redacted_in_retained_records'=>true,'password_values_redacted_in_retained_records'=>true,'one_time_codes_expired_by_age'=>true,'secrets_or_values_exported'=>false,'MFA_not_disabled'=>true];
$output=$beforeSnapshot?'C132-usability-before-snapshot.json':(($argv[1]??'')==='--after-rotation'?'C132-usability-after-rotation.json':'C132-usability.json');
file_put_contents(__DIR__.'/'.$output,json_encode($summary,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES|JSON_THROW_ON_ERROR));echo json_encode($summary,JSON_THROW_ON_ERROR);
@@ -0,0 +1,6 @@
{
"reference": "library-file:fde1_bGliZmlsZV9UTUlzQXdpYjRMMzhSeEtKLU1HdVhB_FileDrive_c902110ccc308191b2f4f6a2fc8c014a",
"sha256": "7549a744e071f6a2d1ee815cf2f265bcaeacedbaea0d134b58b0a0d63be77a21",
"file_access_confirmed": true,
"page_url": "https://chatgpt.com/space/page_dc08a603a4f0819190ead0169eb73599"
}
@@ -0,0 +1,13 @@
{
"at": "2026-10-12T19:12:21+00:00",
"target": {
"database": "investemoz",
"port": 5432
},
"containment_audit_event_id": "f3d7d79b-e6d0-47fe-aff1-b089ac02dd35",
"correlation_id": "ead504de-19c1-4d84-9eca-d5649b8a456a",
"actor_user_id": null,
"no_human_account_impersonated": true,
"configuration_keys_flags_C131_bundle_cookie_preserved": true,
"incident_closed": false
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:02:57+00:00",
"target": {
"database": "investemoz",
"port": 5432
},
"restore_target": {
"database": "c132_incident_20261012_190248_test",
"port": 55441
},
"tables": 295,
"sequences": 31,
"all_table_rows_and_hashes_equal": true,
"restore_verified": true,
"active_writes": 0,
"dump_sha256": "276426add31685bddabe94cfd80cfa6b4696c5d24d3c9f9ead814cd0ab3dda9d",
"recovery_config_preserves_DevTools_OFF": true,
"key_not_rotated": true,
"private_snapshot_outside_webroot": true
}
@@ -0,0 +1,30 @@
<?php
// Incident backup: active source read only; restore and recovery rehearsal exclusively on isolated 55441 *_test.
ini_set('zend.exception_ignore_args','1');set_exception_handler(function(Throwable $e){fwrite(STDERR,'C132 backup stopped: '.$e::class.' '.basename($e->getFile()).':'.$e->getLine());exit(1);});
$root=dirname(__DIR__,2);require $root.'/vendor/autoload.php';$app=require $root.'/bootstrap/app.php';
(new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables)->bootstrap($app);(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);
$c=config('database.connections.'.config('database.default'));if($c['driver']!=='pgsql'||!empty($c['url'])||(int)$c['port']!==5432||$c['database']!=='investemoz'||!in_array($c['host'],['localhost','127.0.0.1'],true))throw new RuntimeException('Source refused');
$source=new PDO('pgsql:host='.$c['host'].';port=5432;dbname=investemoz',$c['username'],$c['password'],[PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]);$source->exec('BEGIN ISOLATION LEVEL REPEATABLE READ READ ONLY');
$identity=$source->query('SELECT current_database() as database,inet_server_port() as port')->fetch(PDO::FETCH_ASSOC);if($identity['database']!=='investemoz'||(int)$identity['port']!==5432)throw new RuntimeException('Identity refused');
$location=json_decode(ltrim(file_get_contents(__DIR__.'/C132-private-location.json'),"\xEF\xBB\xBF"),true,512,JSON_THROW_ON_ERROR)['private_directory'];
$dir=$location.'/recovery';if(is_dir($dir))throw new RuntimeException('Existing recovery path; inspect first');mkdir($dir,0700,true);
$clone='c132_incident_'.gmdate('Ymd_His').'_test';$dump=$dir.'/active-before-credential-response.dump';$snapshot=$source->query('SELECT pg_export_snapshot()')->fetchColumn();
$run=function(array $args,string $password){$p=new Symfony\Component\Process\Process($args,null,['PGPASSWORD'=>$password]);$p->setTimeout(240);$p->run();if(!$p->isSuccessful())throw new RuntimeException('Backup process failed');};
$bin='C:/Program Files/PostgreSQL/17/bin/';$run([$bin.'pg_dump.exe','-h',$c['host'],'-p','5432','-U',$c['username'],'-d','investemoz','-Fc','--snapshot='.$snapshot,'-f',$dump],$c['password']);
$maintenance=new PDO('pgsql:host=127.0.0.1;port=55441;dbname=postgres','postgres','',[PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]);
if((int)$maintenance->query('SELECT inet_server_port()')->fetchColumn()!==55441||!preg_match('/^c132_incident_\d{8}_\d{6}_test$/',$clone))throw new RuntimeException('Restore target refused');
$maintenance->exec('CREATE DATABASE "'.$clone.'"');$run([$bin.'pg_restore.exe','-h','127.0.0.1','-p','55441','-U','postgres','-d',$clone,'--exit-on-error','--no-owner','--no-privileges',$dump],'');
$restored=new PDO('pgsql:host=127.0.0.1;port=55441;dbname='.$clone,'postgres','',[PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]);$restored->exec('BEGIN READ ONLY');
$tables=[];
foreach($source->query("SELECT schemaname,tablename FROM pg_tables WHERE schemaname NOT IN ('pg_catalog','information_schema') ORDER BY schemaname,tablename")->fetchAll(PDO::FETCH_ASSOC)as$t){
$name='"'.str_replace('"','""',$t['schemaname']).'"."'.str_replace('"','""',$t['tablename']).'"';$sql='SELECT row_to_json(t)::text FROM '.$name.' t ORDER BY row_to_json(t)::text';
$a=$source->query($sql)->fetchAll(PDO::FETCH_COLUMN);$b=$restored->query($sql)->fetchAll(PDO::FETCH_COLUMN);if($a!==$b)throw new RuntimeException('Restored table differs');$tables[$name]=['rows'=>count($a),'sha256'=>hash('sha256',implode("\n",$a))];
}
$seq="SELECT * FROM pg_sequences WHERE schemaname NOT IN ('pg_catalog','information_schema') ORDER BY schemaname,sequencename";
$sequences=$source->query($seq)->fetchAll(PDO::FETCH_ASSOC);if($sequences!==$restored->query($seq)->fetchAll(PDO::FETCH_ASSOC))throw new RuntimeException('Sequence mismatch');
$source->exec('ROLLBACK');$restored->exec('ROLLBACK');
$fileHashes=[];foreach(['.env','config/inertia.php','public/build/manifest.json','app/Services/OpportunityContacts.php']as$rel){$name=str_replace('/','__',$rel);$dest=$dir.'/'.$name;copy($root.'/'.$rel,$dest);$fileHashes[$rel]=hash_file('sha256',$dest);if($fileHashes[$rel]!==hash_file('sha256',$root.'/'.$rel))throw new RuntimeException('Recovery file differs');}
$private=['at'=>gmdate('c'),'target'=>$identity,'restore_target'=>['database'=>$clone,'port'=>55441],'dump'=>$dump,'dump_sha256'=>hash_file('sha256',$dump),'tables'=>$tables,'sequence_count'=>count($sequences),'recovery_file_hashes'=>$fileHashes,'restore_verified'=>true,'c132_disabled_in_recovery'=>true,'active_writes'=>0];
file_put_contents($dir.'/backup-proof-private.json',json_encode($private,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));
$safe=['at'=>$private['at'],'target'=>$identity,'restore_target'=>$private['restore_target'],'tables'=>count($tables),'sequences'=>count($sequences),'all_table_rows_and_hashes_equal'=>true,'restore_verified'=>true,'active_writes'=>0,'dump_sha256'=>$private['dump_sha256'],'recovery_config_preserves_DevTools_OFF'=>true,'key_not_rotated'=>true,'private_snapshot_outside_webroot'=>true];
file_put_contents(__DIR__.'/C132-backup-restoration.json',json_encode($safe,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode($safe,JSON_THROW_ON_ERROR);
@@ -0,0 +1,122 @@
[
{
"kind": "MFA_one_time_code",
"at": "2026-10-11T20:12:51.758Z",
"origin": "https://portal-investidor.test",
"path": "/two-factor-challenge",
"actor_id": null,
"value_type": "str",
"value_length": 6,
"uri_starts_at_zero": false
},
{
"kind": "MFA_or_other_secret",
"at": "2026-10-12T08:19:03.175Z",
"origin": "https://portal-investidor.test",
"path": "/user/two-factor-secret-key",
"actor_id": null,
"value_type": "str",
"value_length": 16,
"uri_starts_at_zero": false
},
{
"kind": "otpauth_URI",
"at": "2026-10-12T08:19:04.024Z",
"origin": "https://portal-investidor.test",
"path": "/user/two-factor-qr-code",
"actor_id": null,
"value_type": "str",
"value_length": 121,
"uri_starts_at_zero": true
},
{
"kind": "otpauth_URI",
"at": "2026-10-12T08:20:53.185Z",
"origin": "https://portal-investidor.test",
"path": "/user/two-factor-qr-code",
"actor_id": null,
"value_type": "str",
"value_length": 124,
"uri_starts_at_zero": true
},
{
"kind": "MFA_or_other_secret",
"at": "2026-10-12T08:20:53.193Z",
"origin": "https://portal-investidor.test",
"path": "/user/two-factor-secret-key",
"actor_id": null,
"value_type": "str",
"value_length": 16,
"uri_starts_at_zero": false
},
{
"kind": "MFA_or_other_secret",
"at": "2026-10-12T08:23:16.850Z",
"origin": "https://portal-investidor.test",
"path": "/user/two-factor-secret-key",
"actor_id": null,
"value_type": "str",
"value_length": 16,
"uri_starts_at_zero": false
},
{
"kind": "otpauth_URI",
"at": "2026-10-12T08:23:17.000Z",
"origin": "https://portal-investidor.test",
"path": "/user/two-factor-qr-code",
"actor_id": null,
"value_type": "str",
"value_length": 124,
"uri_starts_at_zero": true
},
{
"kind": "MFA_one_time_code",
"at": "2026-10-12T08:24:31.890Z",
"origin": "https://portal-investidor.test",
"path": "/two-factor-challenge",
"actor_id": null,
"value_type": "str",
"value_length": 6,
"uri_starts_at_zero": false
},
{
"kind": "MFA_or_other_secret",
"at": "2026-10-12T08:35:12.084Z",
"origin": "https://portal-investidor.test",
"path": "/user/two-factor-secret-key",
"actor_id": null,
"value_type": "str",
"value_length": 16,
"uri_starts_at_zero": false
},
{
"kind": "otpauth_URI",
"at": "2026-10-12T08:35:12.206Z",
"origin": "https://portal-investidor.test",
"path": "/user/two-factor-qr-code",
"actor_id": null,
"value_type": "str",
"value_length": 112,
"uri_starts_at_zero": true
},
{
"kind": "MFA_one_time_code",
"at": "2026-10-12T08:40:29.854Z",
"origin": "https://portal-investidor.test",
"path": "/two-factor-challenge",
"actor_id": null,
"value_type": "str",
"value_length": 6,
"uri_starts_at_zero": false
},
{
"kind": "MFA_one_time_code",
"at": "2026-10-12T09:02:01.918Z",
"origin": "https://portal-investidor.test",
"path": "/two-factor-challenge",
"actor_id": null,
"value_type": "str",
"value_length": 6,
"uri_starts_at_zero": false
}
]
@@ -0,0 +1,28 @@
from pathlib import Path
from datetime import datetime,timezone
from urllib.request import Request,build_opener,HTTPRedirectHandler
from urllib.error import HTTPError
from urllib.parse import urlparse
import json,re
OUT=Path(__file__).resolve().parent;BASE='https://portal-investidor.test'
private=Path(json.loads((OUT/'C132-private-location.json').read_text(encoding='utf-8-sig'))['private_directory'])
ids=[p.stem for p in (private/'diagnostics').glob('*.json') if re.fullmatch(r'[0-9A-HJKMNP-TV-Z]{26}',p.stem)]
assert ids
class NoRedirect(HTTPRedirectHandler):
def redirect_request(self,req,fp,code,msg,headers,newurl):return None
opener=build_opener(NoRedirect())
proof={'at':datetime.now(timezone.utc).isoformat(),'case':'C132','base':BASE,'anonymous':True,'credentials_tokens_cookies_sent':False,'TLS_bypass':False,'bodies_saved':False,'checks':[]}
for path,label in [('/_inertia/devtools/entries','index'),('/_inertia/devtools/entries/'+ids[0],'retained_real_detail'),('/_inertia/devtools/entries/01ARZ3NDEKTSV4RRFFQ69G5FAV','arbitrary_detail'),('/login','login'),('/two-factor-challenge','MFA_requires_pending_login'),('/dashboard','dashboard_requires_authentication')]:
try:r=opener.open(Request(BASE+path,headers={'Accept':'application/json' if label in ['index','retained_real_detail','arbitrary_detail'] else 'text/html'},method='GET'),timeout=25)
except HTTPError as e:r=e
with r:status=r.code;headers=r.headers;body=r.read()
check={'label':label,'status':status,'path':'/_inertia/devtools/entries/{retained-id}' if label=='retained_real_detail' else path}
if headers.get('Location'):check['redirect_path']=urlparse(headers['Location']).path
if label=='login':
check['login_form_present']=b'auth/login' in body or b'password' in body
check['cookie_attributes_only']=[{'name':s.split('=',1)[0],'secure':'; secure' in s.lower(),'http_only':'; httponly' in s.lower(),'same_site_lax':'samesite=lax' in s.lower(),'path_root':'path=/' in s.lower()} for s in headers.get_all('Set-Cookie',[])]
check['mixed_http_local_resource']=bool(re.search(rb'(?:src|href)=["\']http://portal-investidor\.test',body))
proof['checks'].append(check)
assert status==404 if label in ['index','retained_real_detail','arbitrary_detail'] else status==200 if label=='login' else status in [302,303]
proof['result']='contained_endpoints_verified';proof['normal_MFA_authenticated_dashboard']='Requires a legitimate existing owner login; anonymous routing is not MFA success.'
(OUT/'C132-http-contained.json').write_text(json.dumps(proof,ensure_ascii=False,indent=2),encoding='utf-8');print(json.dumps(proof,ensure_ascii=True))
@@ -0,0 +1,70 @@
$ErrorActionPreference = 'Stop'
$root = [IO.Path]::GetFullPath('C:\laragon\www\portal-investidor')
$out = Join-Path $root 'outputs\investmoz-audit-current-20261012'
$preflight = Get-Content -LiteralPath (Join-Path $out 'C132-preflight.json') -Raw -Encoding UTF8 | ConvertFrom-Json
if ($preflight.target.database -ne 'investemoz' -or $preflight.target.port -ne 5432 -or $preflight.cached_config -or $preflight.route_cache) { throw 'C132 target/cache differs' }
$active = Join-Path $root 'config\inertia.php'
$prepared = Join-Path $out 'correcoes-preparadas\config\inertia.php'
$oldHash = '45994a9035e8e10d2fbb82f9fc18756cfb1ba403c9597d334122181b6b29839b'
$newHash = '80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7'
if ((Get-FileHash -LiteralPath $active -Algorithm SHA256).Hash.ToLowerInvariant() -ne $oldHash -or (Get-FileHash -LiteralPath $prepared -Algorithm SHA256).Hash.ToLowerInvariant() -ne $newHash) { throw 'C132 source differs; stopped before application' }
$privateBase = [IO.Path]::GetFullPath('C:\Users\macbook\.config\investmoz\incidents')
$incident = [IO.Path]::GetFullPath((Join-Path $privateBase ('C132-' + (Get-Date).ToUniversalTime().ToString('yyyyMMdd_HHmmss'))))
if (-not $incident.StartsWith($privateBase + [IO.Path]::DirectorySeparatorChar,[StringComparison]::OrdinalIgnoreCase)) { throw 'Incident path escaped' }
New-Item -ItemType Directory -Path $incident | Out-Null
$sid = [Security.Principal.WindowsIdentity]::GetCurrent().User
$acl = New-Object Security.AccessControl.DirectorySecurity
$acl.SetAccessRuleProtection($true,$false)
$acl.SetOwner($sid)
$inherit = [Security.AccessControl.InheritanceFlags]'ContainerInherit,ObjectInherit'
$prop = [Security.AccessControl.PropagationFlags]::None
$acl.AddAccessRule((New-Object Security.AccessControl.FileSystemAccessRule($sid,'FullControl',$inherit,$prop,'Allow')))
$acl.AddAccessRule((New-Object Security.AccessControl.FileSystemAccessRule((New-Object Security.Principal.SecurityIdentifier('S-1-5-18')),'FullControl',$inherit,$prop,'Allow')))
Set-Acl -LiteralPath $incident -AclObject $acl
$actualAcl = Get-Acl -LiteralPath $incident
if (-not $actualAcl.AreAccessRulesProtected -or $actualAcl.Access.Count -ne 2) { throw 'Evidence ACL not restricted' }
Copy-Item -LiteralPath $active -Destination (Join-Path $incident 'inertia-before.php')
Copy-Item -LiteralPath $prepared -Destination (Join-Path $incident 'inertia-contained.php')
# A local restore round trip validates the exact one-file recovery. Never restore exposure to the live portal.
$test = Join-Path $incident 'restore-test.php'
Copy-Item -LiteralPath (Join-Path $incident 'inertia-before.php') -Destination $test
if ((Get-FileHash -LiteralPath $test -Algorithm SHA256).Hash.ToLowerInvariant() -ne $oldHash) { throw 'One-file restore verification failed' }
& 'C:\laragon\bin\php\php-8.5.11-Win32-vs17-x64\php.exe' -l $prepared
if ($LASTEXITCODE -ne 0) { throw 'Prepared config syntax invalid' }
$beforeAcl = (Get-Acl -LiteralPath $active).Sddl
$stage = Join-Path $root 'config\inertia.C132.pending.php'
if (Test-Path -LiteralPath $stage) {
if ((Get-FileHash -LiteralPath $stage -Algorithm SHA256).Hash.ToLowerInvariant() -ne $newHash) { throw 'Unexpected staging bytes' }
} else { Copy-Item -LiteralPath $prepared -Destination $stage }
$applicationMethod = 'atomic-replace'
try {
[IO.File]::Replace($stage,$active,$null,$true)
} catch {
# This Windows destination disallows file replacement but permits writing the existing file.
# Use the same exclusive, DACL-preserving method previously used for the authorized portal configuration.
if ((Get-FileHash -LiteralPath $active -Algorithm SHA256).Hash.ToLowerInvariant() -ne $oldHash) { throw 'Atomic failure altered active bytes; stop' }
$bytes = [IO.File]::ReadAllBytes($prepared)
$stream = [IO.File]::Open($active,[IO.FileMode]::Open,[IO.FileAccess]::Write,[IO.FileShare]::None)
try { $stream.Position=0; $stream.Write($bytes,0,$bytes.Length); $stream.SetLength($bytes.Length); $stream.Flush($true) } finally { $stream.Dispose() }
$applicationMethod = 'exclusive-existing-file-write-preserving-DACL'
}
if ((Get-FileHash -LiteralPath $active -Algorithm SHA256).Hash.ToLowerInvariant() -ne $newHash) { throw 'Applied config digest mismatch' }
$containedAt = (Get-Date).ToUniversalTime().ToString('o')
# Recording is disabled before the evidence snapshot so automatic pruning cannot resume on new requests.
$diagnostics = Join-Path $root 'storage\inertia-devtools'
$snapshot = Join-Path $incident 'diagnostics'
New-Item -ItemType Directory -Path $snapshot | Out-Null
$records = @()
foreach ($file in (Get-ChildItem -LiteralPath $diagnostics -File -Force)) {
$dest = Join-Path $snapshot $file.Name
Copy-Item -LiteralPath $file.FullName -Destination $dest
$hash = (Get-FileHash -LiteralPath $dest -Algorithm SHA256).Hash.ToLowerInvariant()
if ($hash -ne (Get-FileHash -LiteralPath $file.FullName -Algorithm SHA256).Hash.ToLowerInvariant()) { throw 'Diagnostic snapshot mismatch' }
$records += @{ name=$file.Name; bytes=$file.Length; sha256=$hash; lastWriteUTC=$file.LastWriteTimeUtc.ToString('o') }
}
$manifest = @{ contained_at=$containedAt; private_evidence_directory=$incident; preservation='Snapshot restricted to current Windows operator and SYSTEM, outside DocumentRoot'; files=$records }
$manifest | ConvertTo-Json -Depth 6 | Set-Content -LiteralPath (Join-Path $incident 'evidence-manifest-private.json') -Encoding UTF8
$proof = @{ case='C132'; active_config_applied=$true; contained_file_at=$containedAt; application_method=$applicationMethod; only_changed_application_file='config/inertia.php'; before_sha256=$oldHash; after_sha256=$newHash; config_DACL_preserved=((Get-Acl -LiteralPath $active).Sddl -eq $beforeAcl); config_restore_round_trip=$true; preserved_diagnostic_files=$records.Count; evidence_outside_DocumentRoot=$true; evidence_inheritance_disabled=$true; authorized_principals_count=2; C131_not_applied=$true; migrations=0; business_data_writes=0; services_restarted=0; config_cache_absent=$true; root_directory=$root }
$proof | ConvertTo-Json -Depth 5 | Set-Content -LiteralPath (Join-Path $out 'C132-containment.json') -Encoding UTF8
@{ private_directory=$incident } | ConvertTo-Json | Set-Content -LiteralPath (Join-Path $out 'C132-private-location.json') -Encoding UTF8
$proof | ConvertTo-Json -Compress
@@ -0,0 +1,21 @@
{
"only_changed_application_file": "config/inertia.php",
"case": "C132",
"evidence_inheritance_disabled": true,
"business_data_writes": 0,
"root_directory": "C:\\laragon\\www\\portal-investidor",
"evidence_outside_DocumentRoot": true,
"config_restore_round_trip": true,
"contained_file_at": "2026-10-12T18:57:15.2365997Z",
"config_cache_absent": true,
"after_sha256": "80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7",
"preserved_diagnostic_files": 279,
"authorized_principals_count": 2,
"migrations": 0,
"config_DACL_preserved": true,
"application_method": "exclusive-existing-file-write-preserving-DACL",
"services_restarted": 0,
"before_sha256": "45994a9035e8e10d2fbb82f9fc18756cfb1ba403c9597d334122181b6b29839b",
"active_config_applied": true,
"C131_not_applied": true
}
@@ -0,0 +1,11 @@
{
"case": "C132",
"result": "passed",
"file": "C:\\laragon\\www\\portal-investidor\\outputs\\investmoz-audit-current-20261012\\investmoz-C132-contencao-revisao-20261012.zip",
"sha256": "7549a744e071f6a2d1ee815cf2f265bcaeacedbaea0d134b58b0a0d63be77a21",
"bytes": 15613,
"entries": 17,
"sensitive_values_included": false,
"C131_included": false,
"incident_closed": false
}
@@ -0,0 +1,39 @@
{
"at": "2026-10-12T19:46:05.972973+00:00",
"case": "C132",
"result": "passed",
"checks": {
"unchanged_destination": "passed",
"safe_candidate": "passed",
"enabled_candidate": "passed",
"missing_explicit_setting": "passed",
"safe": "passed",
"missing_source": "passed",
"enabled_source": "passed",
"stale_cache_enabled": "passed",
"missing_effective": "passed",
"constant_false": "passed",
"comment_only": "passed",
"environment_switch": "passed"
},
"active_configuration_code_build_unchanged": true,
"active_writes": 0,
"services_changed": false,
"historical_deployments_not_repeated": true,
"wired_pre_post_helpers": [
"portal-owner-administration-release.py",
"portal-workflow-activation-stage.py",
"portal-stability-activation-stage.py",
"portal-country-activation-stage.ps1"
],
"CI_guard_added_but_remote_CI_not_executed": true,
"limitations": [
"Guard stops supported staging paths before unsafe candidate configuration. A deliberate manual bypass or unreviewed external deployment cannot be prevented by these scripts. HTTP list and real detail 404 remain mandatory post-deployment checks."
],
"source_hashes": {
"tools/portal-diagnostics-deployment-guard.php": "a5cf1fbc207bdc21e83eaed6a4db88523f411158efb09b0f132dd7fcb5d3b95b",
"tools/portal_diagnostics_deployment_guard.py": "0cc9a6930e5086517c7c492390ce48eb7dc57028ed038d15fed1960094f26770",
".github/workflows/tests.yml": "dd0e1083c9465ea63513e2915a00ceb1b1486bc8a32e604d34664f2f9beedeaf"
},
"C131_included": false
}
@@ -0,0 +1,53 @@
{
"at": "2026-10-12T19:11:11.838462+00:00",
"case": "C132",
"known_anonymous_HTTP_confirmed_at": "2026-10-12T18:40:45.350823+00:00",
"disabled_at": "2026-10-12T18:57:15.2365997Z",
"first_retained_diagnostic_at": "2026-10-11T18:41:14.540Z",
"last_retained_diagnostic_at": "2026-10-12T13:12:01.872Z",
"minimum_inferred_collection_and_endpoint_enabled_start": "2026-10-11T18:41:14.540Z",
"inference_basis": "Recorder and routes use the same DevTools.enabled gate; retained diagnostic timestamps imply enabled collection. Earliest retained entry is not installation/start of full exposure.",
"full_exposure_start": "undetermined; 24-hour pruning and absence of an enable/disable history prevent an exact earlier start. Available access logs were preserved and inspected.",
"retention_hours_from_installed_default": 24,
"all_historical_accesses_identified": false,
"unauthorized_downloads_proven": false,
"absence_of_downloads_proven": false,
"logs_preserved_privately": [
{
"name": "access.log",
"sha256": "8e08de4a53b2a1c31e682854d9013aa04d3e7a83e068b2e82d84c711bce19f3f",
"bytes": 141139,
"last_write_UTC": "2026-10-12T19:10:47.605842+00:00",
"dated_first": "2026-10-04T12:01:41+00:00",
"dated_last": "2026-10-12T19:10:47+00:00",
"devtools_requests_by_status": {
"200": 2,
"404": 3
},
"raw_lines_exported": false
},
{
"name": "error.log",
"sha256": "454558b770a9e1be6ddb858af680e189101d17e6a13d10918899c91188dab65d",
"bytes": 19291,
"last_write_UTC": "2026-10-11T17:58:26.617112+00:00",
"dated_first": null,
"dated_last": null,
"devtools_requests_by_status": {},
"raw_lines_exported": false
},
{
"name": "install.log",
"sha256": "4d4737e20a166fc9141040b719e4ff1cac08dfbb96bb56bb8fcebbd33d68dbd4",
"bytes": 3146,
"last_write_UTC": "2022-06-22T06:02:20+00:00",
"dated_first": null,
"dated_last": null,
"devtools_requests_by_status": {},
"raw_lines_exported": false
}
],
"observed_endpoint_reach": "Local HTTPS hostname, anonymous client; external reach not tested.",
"endpoint_diagnostics_have_no_per_actor_filter": true,
"secret_values_or_IPs_in_report": false
}
@@ -0,0 +1,25 @@
{
"at": "2026-10-12T19:19:14.027019+00:00",
"result": "passed",
"C132_only": true,
"C131_not_applied": true,
"app_key_flags_cookie_bundle_preserved": true,
"original_diagnostics_and_restricted_snapshot_hashes_preserved": true,
"no_new_diagnostics_after_HTTP_and_owner_authentication": true,
"requirements": 3401,
"source_occurrences": 7739,
"new_ids": 0,
"AB_C37_preserved": true,
"states": {
"Sem evidência suficiente": 3062,
"Implementado parcialmente": 316,
"Dependente de decisão concreta da Tempo": 6,
"Implementado com falha": 1,
"Implementado e demonstrado apenas em QA": 7,
"Não implementado": 9
},
"matrix_sha256": "26d3f11da18c3ff2483e48174b52b85f8315b109a477fa946dfbb5df70a77c26",
"backlog_sha256": "3e7fcfb4992b0539fb8f290df9ffd2d0d0381727d0d59f5df503d04ae6779938",
"incident_closed": false,
"MFA_affected_owners_confirmation_pending": true
}
@@ -0,0 +1,33 @@
from pathlib import Path
from datetime import datetime,timezone
import json,csv,copy,hashlib,collections,shutil
csv.field_size_limit(10000000)
OUT=Path(__file__).resolve().parent;ROOT=OUT.parents[1];DOC=ROOT/'docs/investmoz/v2/auditoria-portal'
files=[];id_='AUD-PROFILE-26'
remaining='C132 contido no ativo: index/detalhes anónimos 404; quatro sementes TOTP ainda válidas (14–17) renovadas, códigos de recuperação/revisão de acesso e lembrar-me tratados; nenhum segredo antigo retido coincide agora com MFA ativa. Incidente aberto: entrega individual das novas entradas e confirmação dos titulares; início exato/histórico integral de exposição indeterminado. Privacidade/consentimentos restantes continuam parciais.'
evidence='C132-containment.json; C132-http-contained.json; C132-local-analysis.json; C132-usability.json; C132-rotation-QA.json; C132-rotation-active.json; C132-usability-after-rotation.json; C132-backup-restoration.json; C132-manual-auth-confirmation.json; C132-audit-record.json. Só C132; C131 não aplicado. Diagnósticos/valores privados fora do ZIP/relatório.'
for name in ['matriz-requisitos.csv','backlog-priorizado.csv']:
p=DOC/name;before=list(csv.reader(p.open(encoding='utf-8-sig',newline='')));after=copy.deepcopy(before);h=after[0];ix={k:i for i,k in enumerate(h)};r=next(r for r in after[1:] if r[ix['ID']]==id_)
r[ix['Estado']]='Implementado parcialmente'
if name.startswith('matriz'):
r[ix['Disponibilidade ativa']]='DevTools OFF no ativo desde 12/10 18:57:15 UTC; HTTP anónimo 404, login/MFA/dashboard confirmado manualmente. Quatro MFA afetadas renovadas; papéis/COUNTRY02/bundle/chave preservados.'
r[ix['Lacuna']]=r[ix['Critérios restantes atuais']]=remaining
r[ix['Fundamento do estado atual']]='Falha de exposição contida no destino; não é fecho do incidente ou da privacidade integral. Mantém-se parcial pelos critérios restantes e investigação/handoff.'
r[ix['API']]='Ativo: GET anónimo index, detalhe real retido e detalhe arbitrário 404. Login 200/cookies Secure; MFA/dashboard confirmado pelo responsável. QA/ativo: novas sementes aceites e antigas recusadas pelo mecanismo existente; correspondência de sementes expostas depois da rotação zero.'
r[ix['Evidência funcional']]+=' Suplemento de contenção autorizado: '+evidence
r[ix['Evidências atuais verificadas']]+='; '+evidence
r[ix['Dependência']]=r[ix['Dependências atuais']]='Sem novo pacote, migration, conta, papel ou serviço. Entregar individualmente os ficheiros MFA restritos aos titulares 14–17 por canal legítimo. Preservar evidência/avaliar histórico; não restaurar sementes comprometidas nem reabrir DevTools.'
r[ix['Critérios cobertos pelas provas agrupadas']]+=' | C132 contenção ativa: listagem/detalhes 404, registos restritos preservados, quatro sementes válidas identificadas e renovadas, backup/restauro ativo verificado, confirmação manual de login/MFA/dashboard.'
r[ix['Limites das provas agrupadas']]='DOC-BOUNDARY mantém o âmbito anterior. C132: exposição anterior real, mas atualmente contida; início exato e todos os acessos históricos indeterminados; novos autenticadores dos titulares ainda por entregar/confirmar; privacidade geral não encerrada.'
else:
r[ix['Pendência']]=r[ix['Trabalho ainda necessário']]=remaining
r[ix['Evidência atual']]+='; '+evidence
r[ix['Dependência/pergunta']]=r[ix['Dependências técnicas/dados/configuração']]='Handoff individual e nova entrada 2FAS apenas para 14–17; investigação restante. Não pedir nova autorização para esta resposta C132 já autorizada, não misturar C131 ou outras ativações.'
r[ix['Ordem do próximo lote']]='P0 C132 contido; concluir entrega segura MFA/investigação antes de declarar fecho. C131 continua lote separado QA.'
files.append({'path':str(p),'before_sha256':hashlib.sha256(p.read_bytes()).hexdigest(),'before':before,'after':after})
summary=json.loads((OUT/'reconciliation-summary.json').read_text(encoding='utf-8'));m=files[0]['after'];mx={k:i for i,k in enumerate(m[0])};summary['states']=dict(collections.Counter(r[mx['Estado']] for r in m[1:]));summary.update(C132_active_contained=True,C132_incident_closed=False,C132_credential_user_ids=[14,15,16,17],active_changes_authorized_only_C132=True)
for name in ['authoring-plan.json','csv-authoring-proof.json','reconciliation-summary.json','final-integrity.json','delivery-package-proof.json']:
if (OUT/name).exists():shutil.copyfile(OUT/name,OUT/(name+'.before-C132-containment'))
if (OUT/'investmoz-auditoria-revisao-20261012.zip').exists():shutil.copyfile(OUT/'investmoz-auditoria-revisao-20261012.zip',OUT/'investmoz-auditoria-revisao-20261012-before-containment.zip')
(OUT/'authoring-plan.json').write_text(json.dumps({'files':files,'summary':summary},ensure_ascii=False),encoding='utf-8');(OUT/'reconciliation-summary.json').write_text(json.dumps(summary,ensure_ascii=False,indent=2),encoding='utf-8')
print(json.dumps({'plan_ready':True,'changed_id':id_,'states':summary['states'],'incident_closed':False},ensure_ascii=True))
@@ -0,0 +1,12 @@
{
"page_id": "page_dc08a603a4f0819190ead0169eb73599",
"url": "https://chatgpt.com/space/page_dc08a603a4f0819190ead0169eb73599",
"reference": "library-file:fde1_bGliZmlsZV9SQlU5QkpJcUg2UDNOamhGXzNYc0lB_FileDrive_c902110ccc308191b2f4f6a2fc8c014a",
"sha256": "f7590ae96ef7ffcd97a7f4b4a883e15a6e8a778e52dc7cb33df47163819d2d9d",
"bytes": 2239480,
"file_access_confirmed": true,
"page_readback_verified": true,
"page_sequence": 4,
"contains_private_authenticator_files": false,
"incident_closed": false
}
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:50:43+00:00",
"target": {
"database": "investemoz",
"port": 5432
},
"audit_events_appended": 5,
"audit_correlation_id": "ead504de-19c1-4d84-9eca-d5649b8a456a",
"only_incident_audit_written": true,
"human_actor_impersonated": false,
"new_secret_values_recorded": false,
"users_and_sessions_unchanged": true,
"C131_included": false,
"pending_holder_confirmation_ids": [
14,
15,
16
],
"incident_closed": false
}
@@ -0,0 +1,16 @@
{
"result": "passed",
"file": "C:\\laragon\\www\\portal-investidor\\outputs\\investmoz-audit-current-20261012\\investmoz-C132-seguimento-revisao-20261012.zip",
"sha256": "f7590ae96ef7ffcd97a7f4b4a883e15a6e8a778e52dc7cb33df47163819d2d9d",
"bytes": 2239480,
"entries": 22,
"actual_secret_scan_passed": true,
"original_attachments_preserved": true,
"C131_code_or_activation_included": false,
"pending_holder_access_ids": [
14,
15,
16
],
"incident_closed": false
}
@@ -0,0 +1,32 @@
{
"at": "2026-10-12T19:52:39.243216+00:00",
"result": "passed",
"requirements": 3401,
"source_occurrences": 7739,
"new_ids": 0,
"only_changed_requirement_this_followup": "AUD-PROFILE-26",
"immutable_references_and_other_rows_preserved": true,
"states": {
"Sem evidência suficiente": 3062,
"Implementado parcialmente": 316,
"Dependente de decisão concreta da Tempo": 6,
"Implementado com falha": 1,
"Implementado e demonstrado apenas em QA": 7,
"Não implementado": 9
},
"matrix_sha256": "50d8013fcc1d86f412ce31ee22a5348c3d699219af66ba523466151175352b86",
"backlog_sha256": "52aab133252795805a68f50fa4309ed9825aefdc3d2af0b0041b96be4a3e3164",
"original_diagnostics_and_private_snapshot_unchanged": true,
"no_new_diagnostics_after_handoff_and_manual_confirmation": true,
"C131_not_applied": true,
"COUNTRY02_AB_C37_preserved": true,
"incident_closed": false,
"confirmed_holder_access_ids": [
17
],
"pending_holder_access_ids": [
14,
15,
16
]
}
@@ -0,0 +1,20 @@
{
"case": "C132",
"scope": "Incident followup only; configuration containment already applied and preserved. Deployment gates added, historical deployments not rerun. Four individual MFA handoff messages sent under explicit owner authorization; only account17 manually confirmed.",
"additional_application_code_schema_services_flags_changes": 0,
"only_active_database_changes_this_followup": "Five append-only incident audit events; no accounts, roles, credentials or sessions changed again",
"process_files_sha256": {
"tools/portal-diagnostics-deployment-guard.php": "a5cf1fbc207bdc21e83eaed6a4db88523f411158efb09b0f132dd7fcb5d3b95b",
"tools/portal_diagnostics_deployment_guard.py": "0cc9a6930e5086517c7c492390ce48eb7dc57028ed038d15fed1960094f26770",
"tools/portal-owner-administration-release.py": "b41de0c7dab30922268015da6eed0958081e8ebeb388f3f3712bf45c499b3b3b",
"tools/portal-workflow-activation-stage.py": "5a685897adf75964a75f13b01afac124d1fd371b1a8f9bff6aa98e63b0d58362",
"tools/portal-stability-activation-stage.py": "74aae070315946c835e11e7a24ec29fa4edbfa3f83be418aff63f74a0ef3f2e3",
"tools/portal-country-activation-stage.ps1": "71ba3c1e50ca34314fc2c044b220b92b7a7eb42cb455b3f32b3579925d0516f8",
".github/workflows/tests.yml": "dd0e1083c9465ea63513e2915a00ceb1b1486bc8a32e604d34664f2f9beedeaf"
},
"active_inertia_sha256": "80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7",
"reversal": "Keep containment OFF, HTTPS, encryption key, original evidence and new MFA. Do not restore compromised seeds or an enabled diagnostic configuration. Reversal of deployment-helper changes is separate from incident data and must retain mandatory pre/post verification. No complete data restore performed.",
"technical_gates_limit": "Supported helpers/CI enforce the check; manual bypass or unreviewed external tools are not covered. CI remote run remains unperformed. Anonymous list/real-detail 404 is mandatory after future deployment.",
"C131_code_or_activation_included": false,
"incident_closed": false
}
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,479 @@
{
"at": "2026-10-12T19:42:40.930008+00:00",
"case": "C132",
"access_log_snapshot_sha256": "c8e35a2f157f1fc37534dc0266978983e03867fa09edab91a8ad55a0ded7b97a",
"log_lines_parsed": 1443,
"unparsed_lines": 21,
"all_request_origin_classes": {
"loopback": 1440,
"non_loopback": 3
},
"diagnostic_requests": [
{
"at": "2026-10-12T18:40:45+00:00",
"method": "GET",
"operation": "list",
"status": 200,
"origin_class": "loopback",
"record_id_or_query_exported": false
},
{
"at": "2026-10-12T18:40:45+00:00",
"method": "GET",
"operation": "detail",
"status": 200,
"origin_class": "loopback",
"record_id_or_query_exported": false
},
{
"at": "2026-10-12T18:57:50+00:00",
"method": "GET",
"operation": "list",
"status": 404,
"origin_class": "loopback",
"record_id_or_query_exported": false
},
{
"at": "2026-10-12T18:57:51+00:00",
"method": "GET",
"operation": "detail",
"status": 404,
"origin_class": "loopback",
"record_id_or_query_exported": false
},
{
"at": "2026-10-12T18:57:51+00:00",
"method": "GET",
"operation": "detail",
"status": 404,
"origin_class": "loopback",
"record_id_or_query_exported": false
},
{
"at": "2026-10-12T19:11:12+00:00",
"method": "GET",
"operation": "list",
"status": 404,
"origin_class": "loopback",
"record_id_or_query_exported": false
},
{
"at": "2026-10-12T19:11:12+00:00",
"method": "GET",
"operation": "detail",
"status": 404,
"origin_class": "loopback",
"record_id_or_query_exported": false
},
{
"at": "2026-10-12T19:11:12+00:00",
"method": "GET",
"operation": "detail",
"status": 404,
"origin_class": "loopback",
"record_id_or_query_exported": false
}
],
"successful_diagnostic_requests": 2,
"successful_requests_match_recorded_authorized_audit_time": true,
"audit_events_examined": 130,
"audit_action_counts": [
{
"source": "investment-zones",
"action": "saved",
"actor_user_id": 2,
"count": 17
},
{
"source": "investment-zones",
"action": "published",
"actor_user_id": 13,
"count": 12
},
{
"source": "investment-territory",
"action": "primary_territory_saved",
"actor_user_id": 13,
"count": 6
},
{
"source": "investment-zones",
"action": "saved",
"actor_user_id": 13,
"count": 7
},
{
"source": "investment-submission",
"action": "draft_created",
"actor_user_id": 2,
"count": 3
},
{
"source": "user-instruction",
"action": "public_disclosure_authorized",
"actor_user_id": null,
"count": 1
},
{
"source": "portal-services",
"action": "published_under_user_authorization",
"actor_user_id": 13,
"count": 4
},
{
"source": "documented-relations-repair",
"action": "documented_relations_applied",
"actor_user_id": 13,
"count": 1
},
{
"source": "partnership-exchange",
"action": "partnership_module_installed",
"actor_user_id": 13,
"count": 1
},
{
"source": "portal-management",
"action": "created",
"actor_user_id": 13,
"count": 1
},
{
"source": "portal-management",
"action": "updated",
"actor_user_id": 2,
"count": 9
},
{
"source": "virtual-desk",
"action": "desk_installed",
"actor_user_id": 13,
"count": 1
},
{
"source": "virtual-desk",
"action": "internal_service_published",
"actor_user_id": 13,
"count": 3
},
{
"source": "virtual-desk",
"action": "case_created",
"actor_user_id": 2,
"count": 1
},
{
"source": "virtual-desk",
"action": "consulted",
"actor_user_id": 2,
"count": 8
},
{
"source": "virtual-desk",
"action": "assumptions_corrected",
"actor_user_id": 2,
"count": 1
},
{
"source": "investment-submission",
"action": "draft_saved",
"actor_user_id": 2,
"count": 1
},
{
"source": "investment-submission",
"action": "submitted",
"actor_user_id": 2,
"count": 2
},
{
"source": "investment-workspace",
"action": "message_sent",
"actor_user_id": 2,
"count": 1
},
{
"source": "territory-traceability-v2",
"action": "traceability_applied",
"actor_user_id": 13,
"count": 2
},
{
"source": "territory-traceability-v2",
"action": "traceability_reversed",
"actor_user_id": 13,
"count": 1
},
{
"source": "opportunity-origin-review",
"action": "origin_classification_decided",
"actor_user_id": 13,
"count": 6
},
{
"source": "opportunity-management-install",
"action": "opportunity_management_installed",
"actor_user_id": 13,
"count": 1
},
{
"source": "organization-country-installation",
"action": "install",
"actor_user_id": 13,
"count": 1
},
{
"source": "opportunity-resources-install",
"action": "opportunity_resources_installed",
"actor_user_id": 2,
"count": 1
},
{
"source": "portal-profile-installation",
"action": "install",
"actor_user_id": 13,
"count": 1
},
{
"source": "portal-profile-installation",
"action": "bootstrap-request",
"actor_user_id": 13,
"count": 1
},
{
"source": "portal-profiles-v1",
"action": "superuser_pair_initialized",
"actor_user_id": 2,
"count": 1
},
{
"source": "portal-profile-installation",
"action": "bootstrap-confirm",
"actor_user_id": 2,
"count": 1
},
{
"source": "portal-profiles-v1",
"action": "audit_metadata_read",
"actor_user_id": 13,
"count": 2
},
{
"source": "portal-owner-staff-preparation",
"action": "staff_account_prepared",
"actor_user_id": null,
"count": 3
},
{
"source": "portal-profiles-v1",
"action": "request_denied",
"actor_user_id": 15,
"count": 3
},
{
"source": "portal-profiles-v1",
"action": "request_denied",
"actor_user_id": 17,
"count": 1
},
{
"source": "portal-profiles-v1",
"action": "operator_organization_registered",
"actor_user_id": 13,
"count": 1
},
{
"source": "portal-profiles-v1",
"action": "role_granted",
"actor_user_id": 13,
"count": 7
},
{
"source": "portal-profiles-v1",
"action": "request_denied",
"actor_user_id": 13,
"count": 14
},
{
"source": "portal-profiles-v1",
"action": "operator_organization_registration_recovered",
"actor_user_id": 13,
"count": 1
},
{
"source": "C132-incident-response",
"action": "C132_affected_MFA_rotated_and_sessions_revoked",
"actor_user_id": null,
"count": 1
},
{
"source": "C132-incident-response",
"action": "C132_anonymous_diagnostics_contained",
"actor_user_id": null,
"count": 1
}
],
"denied_profile_requests": [
{
"actor_user_id": 15,
"at": "2026-10-12 08:24:32.288003+00",
"action": "request_denied"
},
{
"actor_user_id": 15,
"at": "2026-10-12 08:25:17.157828+00",
"action": "request_denied"
},
{
"actor_user_id": 15,
"at": "2026-10-12 08:25:37.876732+00",
"action": "request_denied"
},
{
"actor_user_id": 17,
"at": "2026-10-12 08:31:59.461947+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 08:44:41.649736+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 08:45:50.898559+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 08:48:23.493772+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 08:50:55.017891+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 08:50:59.682495+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:05:41.741185+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:06:07.714158+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:06:11.320336+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:06:15.88483+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:06:16.815169+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:06:17.963057+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:08:55.433336+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:09:24.510857+00",
"action": "request_denied"
},
{
"actor_user_id": 13,
"at": "2026-10-12 09:29:39.50625+00",
"action": "request_denied"
}
],
"sensitive_route_counts": [
{
"family": "login",
"method": "GET",
"status": 200,
"count": 43
},
{
"family": "login",
"method": "GET",
"status": 308,
"count": 6
},
{
"family": "login",
"method": "POST",
"status": 405,
"count": 2
},
{
"family": "login",
"method": "POST",
"status": 302,
"count": 20
},
{
"family": "MFA",
"method": "GET",
"status": 200,
"count": 10
},
{
"family": "MFA",
"method": "POST",
"status": 302,
"count": 10
},
{
"family": "MFA_enrollment",
"method": "POST",
"status": 302,
"count": 4
},
{
"family": "MFA_enrollment",
"method": "GET",
"status": 200,
"count": 12
},
{
"family": "login",
"method": "GET",
"status": 302,
"count": 3
},
{
"family": "MFA",
"method": "GET",
"status": 302,
"count": 2
}
],
"suspicious_diagnostic_access_identified_in_available_logs": false,
"negative_result_does_not_prove_no_access": true,
"limitations": [
"Common access log is shared across vhosts and does not record Host or authenticated account; it cannot attribute every request to this portal or a person.",
"No complete diagnostic enablement history; diagnostic retention was 24 hours. Exact earlier exposure start and deleted records cannot be recovered from the available files.",
"A denied profile request is an authorization rejection, not proof of an attack. Audit has no comprehensive successful login/MFA or document-download trail.",
"Loopback source identifies a local request or proxy, not the identity of the person making it. No conclusion about earlier or unlogged downloads."
],
"raw_lines_IPs_cookies_tokens_or_payloads_exported": false
}
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:47:48+00:00",
"account_id": 14,
"recipient": "aurora.chachuaio@tempo.co.mz",
"recipient_count": 1,
"CC_BCC": 0,
"transport": "existing_corporate_SMTP",
"TLS_required_and_certificate_verified": true,
"negotiated_TLS_protocol": "TLSv1.3",
"SMTP_accepted": true,
"message_id": "4j3Sg65wmTz13LZt",
"private_attachment_count": 1,
"attachment_contains_secret": true,
"attachment_or_secret_values_in_chat_or_report": false,
"owner_authorization": "Explicit owner reply: send three separate emails to respective corporate addresses with mandatory TLS",
"mailbox_receipt_confirmed": false,
"holder_authentication_confirmed": false,
"notifications_flag_changed": false,
"C131_included": false
}
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:47:57+00:00",
"account_id": 15,
"recipient": "palmira.matsinhe@tempo.co.mz",
"recipient_count": 1,
"CC_BCC": 0,
"transport": "existing_corporate_SMTP",
"TLS_required_and_certificate_verified": true,
"negotiated_TLS_protocol": "TLSv1.3",
"SMTP_accepted": true,
"message_id": "4j3SgJ5CxLz13LZt",
"private_attachment_count": 1,
"attachment_contains_secret": true,
"attachment_or_secret_values_in_chat_or_report": false,
"owner_authorization": "Explicit owner reply: send three separate emails to respective corporate addresses with mandatory TLS",
"mailbox_receipt_confirmed": false,
"holder_authentication_confirmed": false,
"notifications_flag_changed": false,
"C131_included": false
}
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:48:02+00:00",
"account_id": 16,
"recipient": "mario.melembe@tempo.co.mz",
"recipient_count": 1,
"CC_BCC": 0,
"transport": "existing_corporate_SMTP",
"TLS_required_and_certificate_verified": true,
"negotiated_TLS_protocol": "TLSv1.3",
"SMTP_accepted": true,
"message_id": "4j3SgP40Npz13LZt",
"private_attachment_count": 1,
"attachment_contains_secret": true,
"attachment_or_secret_values_in_chat_or_report": false,
"owner_authorization": "Explicit owner reply: send three separate emails to respective corporate addresses with mandatory TLS",
"mailbox_receipt_confirmed": false,
"holder_authentication_confirmed": false,
"notifications_flag_changed": false,
"C131_included": false
}
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:40:51+00:00",
"account_id": 17,
"recipient": "info@tempo.co.mz",
"recipient_count": 1,
"CC_BCC": 0,
"transport": "existing_corporate_SMTP",
"TLS_required_and_certificate_verified": true,
"negotiated_TLS_protocol": "TLSv1.3",
"SMTP_accepted": true,
"message_id": "4j3SW63gPfz13LZt",
"private_attachment_count": 1,
"attachment_contains_secret": true,
"attachment_or_secret_values_in_chat_or_report": false,
"owner_authorization": "Explicit owner reply: send email to info@tempo.co.mz, corporate manager will reply",
"mailbox_receipt_confirmed": false,
"holder_authentication_confirmed": false,
"notifications_flag_changed": false,
"C131_included": false
}
@@ -0,0 +1,13 @@
{
"recorded_at": "2026-10-12T19:49:32.318259+00:00",
"account_id": 17,
"recipient": "info@tempo.co.mz",
"source": "Owner message in conversation after individual delivery",
"exact_confirmation": "conta 17 — recebido, MFA configurado e dashboard acessível",
"mailbox_receipt_confirmed": true,
"holder_MFA_setup_confirmed": true,
"dashboard_access_confirmed": true,
"evidence_kind": "manual confirmation relayed by owner",
"secrets_or_codes_recorded": false,
"full_incident_closed": false
}
@@ -0,0 +1,39 @@
{
"at": "2026-10-12T19:46:05.972973+00:00",
"case": "C132",
"result": "passed",
"checks": {
"unchanged_destination": "passed",
"safe_candidate": "passed",
"enabled_candidate": "passed",
"missing_explicit_setting": "passed",
"safe": "passed",
"missing_source": "passed",
"enabled_source": "passed",
"stale_cache_enabled": "passed",
"missing_effective": "passed",
"constant_false": "passed",
"comment_only": "passed",
"environment_switch": "passed"
},
"active_configuration_code_build_unchanged": true,
"active_writes": 0,
"services_changed": false,
"historical_deployments_not_repeated": true,
"wired_pre_post_helpers": [
"portal-owner-administration-release.py",
"portal-workflow-activation-stage.py",
"portal-stability-activation-stage.py",
"portal-country-activation-stage.ps1"
],
"CI_guard_added_but_remote_CI_not_executed": true,
"limitations": [
"Guard stops supported staging paths before unsafe candidate configuration. A deliberate manual bypass or unreviewed external deployment cannot be prevented by these scripts. HTTP list and real detail 404 remain mandatory post-deployment checks."
],
"source_hashes": {
"tools/portal-diagnostics-deployment-guard.php": "a5cf1fbc207bdc21e83eaed6a4db88523f411158efb09b0f132dd7fcb5d3b95b",
"tools/portal_diagnostics_deployment_guard.py": "0cc9a6930e5086517c7c492390ce48eb7dc57028ed038d15fed1960094f26770",
".github/workflows/tests.yml": "dd0e1083c9465ea63513e2915a00ceb1b1486bc8a32e604d34664f2f9beedeaf"
},
"C131_included": false
}
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:50:43+00:00",
"target": {
"database": "investemoz",
"port": 5432
},
"audit_events_appended": 5,
"audit_correlation_id": "ead504de-19c1-4d84-9eca-d5649b8a456a",
"only_incident_audit_written": true,
"human_actor_impersonated": false,
"new_secret_values_recorded": false,
"users_and_sessions_unchanged": true,
"C131_included": false,
"pending_holder_confirmation_ids": [
14,
15,
16
],
"incident_closed": false
}
@@ -0,0 +1,32 @@
{
"at": "2026-10-12T19:52:39.243216+00:00",
"result": "passed",
"requirements": 3401,
"source_occurrences": 7739,
"new_ids": 0,
"only_changed_requirement_this_followup": "AUD-PROFILE-26",
"immutable_references_and_other_rows_preserved": true,
"states": {
"Sem evidência suficiente": 3062,
"Implementado parcialmente": 316,
"Dependente de decisão concreta da Tempo": 6,
"Implementado com falha": 1,
"Implementado e demonstrado apenas em QA": 7,
"Não implementado": 9
},
"matrix_sha256": "50d8013fcc1d86f412ce31ee22a5348c3d699219af66ba523466151175352b86",
"backlog_sha256": "52aab133252795805a68f50fa4309ed9825aefdc3d2af0b0041b96be4a3e3164",
"original_diagnostics_and_private_snapshot_unchanged": true,
"no_new_diagnostics_after_handoff_and_manual_confirmation": true,
"C131_not_applied": true,
"COUNTRY02_AB_C37_preserved": true,
"incident_closed": false,
"confirmed_holder_access_ids": [
17
],
"pending_holder_access_ids": [
14,
15,
16
]
}
@@ -0,0 +1,58 @@
{
"at": "2026-10-12T19:49:32.321198+00:00",
"case": "C132",
"accounts": [
{
"account_id": 14,
"recipient": "aurora.chachuaio@tempo.co.mz",
"SMTP_accepted_at": "2026-10-12T19:47:48+00:00",
"TLS": "TLSv1.3",
"recipient_count": 1,
"individual_entry_delivered_to_SMTP": true,
"mailbox_receipt_confirmed": false,
"holder_access_confirmed": false,
"proof": "C132-account14-email-receipt.json"
},
{
"account_id": 15,
"recipient": "palmira.matsinhe@tempo.co.mz",
"SMTP_accepted_at": "2026-10-12T19:47:57+00:00",
"TLS": "TLSv1.3",
"recipient_count": 1,
"individual_entry_delivered_to_SMTP": true,
"mailbox_receipt_confirmed": false,
"holder_access_confirmed": false,
"proof": "C132-account15-email-receipt.json"
},
{
"account_id": 16,
"recipient": "mario.melembe@tempo.co.mz",
"SMTP_accepted_at": "2026-10-12T19:48:02+00:00",
"TLS": "TLSv1.3",
"recipient_count": 1,
"individual_entry_delivered_to_SMTP": true,
"mailbox_receipt_confirmed": false,
"holder_access_confirmed": false,
"proof": "C132-account16-email-receipt.json"
},
{
"account_id": 17,
"recipient": "info@tempo.co.mz",
"SMTP_accepted_at": "2026-10-12T19:40:51+00:00",
"TLS": "TLSv1.3",
"recipient_count": 1,
"individual_entry_delivered_to_SMTP": true,
"mailbox_receipt_confirmed": true,
"holder_access_confirmed": true,
"proof": "C132-account17-email-receipt.json"
}
],
"secure_entries_or_values_in_chat": false,
"pending_access_confirmation_ids": [
14,
15,
16
],
"incident_closed": false,
"C131_included": false
}
@@ -0,0 +1,63 @@
{
"at": "2026-10-12T19:46:06.182921+00:00",
"case": "C132",
"base": "https://portal-investidor.test",
"anonymous": true,
"credentials_tokens_cookies_sent": false,
"TLS_bypass": false,
"bodies_saved": false,
"checks": [
{
"label": "index",
"status": 404,
"path": "/_inertia/devtools/entries"
},
{
"label": "retained_real_detail",
"status": 404,
"path": "/_inertia/devtools/entries/{retained-id}"
},
{
"label": "arbitrary_detail",
"status": 404,
"path": "/_inertia/devtools/entries/01ARZ3NDEKTSV4RRFFQ69G5FAV"
},
{
"label": "login",
"status": 200,
"path": "/login",
"login_form_present": true,
"cookie_attributes_only": [
{
"name": "XSRF-TOKEN",
"secure": true,
"http_only": false,
"same_site_lax": true,
"path_root": true
},
{
"name": "portal_investidor_https",
"secure": true,
"http_only": true,
"same_site_lax": true,
"path_root": true
}
],
"mixed_http_local_resource": false
},
{
"label": "MFA_requires_pending_login",
"status": 302,
"path": "/two-factor-challenge",
"redirect_path": "/login"
},
{
"label": "dashboard_requires_authentication",
"status": 302,
"path": "/dashboard",
"redirect_path": "/login"
}
],
"result": "contained_endpoints_verified",
"normal_MFA_authenticated_dashboard": "Requires a legitimate existing owner login; anonymous routing is not MFA success."
}
@@ -0,0 +1,168 @@
{
"at": "2026-10-12T19:46:07+00:00",
"rotation_at": "2026-10-12T19:06:57+00:00",
"read_only": true,
"sensitive_payloads_in_report": false,
"targets": {
"active": {
"identity": {
"database": "investemoz",
"port": 5432
},
"accounts": [
{
"id": 14,
"name": "Aurora Chachuaio",
"email": "aurora.chachuaio@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": true,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
},
{
"id": 15,
"name": "Palmira Uamusse",
"email": "palmira.matsinhe@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": true,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
},
{
"id": 16,
"name": "Mario Melembe",
"email": "mario.melembe@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": true,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
},
{
"id": 17,
"name": "Tempo Lda",
"email": "info@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": true,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
}
],
"all_session_rows_examined": 14,
"unreadable_payloads": 0,
"post_rotation_bindings_not_deleted": 0,
"audit_events_examined": 130
},
"restored_snapshot": {
"identity": {
"database": "c132_incident_20261012_190248_test",
"port": 55441
},
"accounts": [
{
"id": 14,
"name": "Aurora Chachuaio",
"email": "aurora.chachuaio@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": null,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
},
{
"id": 15,
"name": "Palmira Uamusse",
"email": "palmira.matsinhe@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": null,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
},
{
"id": 16,
"name": "Mario Melembe",
"email": "mario.melembe@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": null,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
},
{
"id": 17,
"name": "Tempo Lda",
"email": "info@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": null,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
}
],
"all_session_rows_examined": 19,
"unreadable_payloads": 0,
"post_rotation_bindings_not_deleted": 0,
"audit_events_examined": 129
}
}
}
@@ -0,0 +1,18 @@
{
"at": "2026-10-12T19:43:35+00:00",
"target": {
"database": "c132_incident_20261012_190248_test",
"port": 55441
},
"active_writes": 0,
"result": "passed",
"nonempty_authenticated_session_removed": true,
"unaffected_session_preserved": true,
"remember_me_invalidated": true,
"access_revision_incremented": true,
"existing_middleware_rejected_stale_session_401": true,
"session_data_invalidated": true,
"fixtures_rolled_back": true,
"no_MFA_rotation_repeated": true,
"browser_holder_access_confirmed": false
}
@@ -0,0 +1,32 @@
<?php
// C132 deployment-only gate: no providers, DB, jobs, mail, configuration writes or secrets in output.
ini_set('zend.exception_ignore_args','1');set_exception_handler(function(Throwable $e){fwrite(STDERR,json_encode(['result'=>'blocked','case'=>'C132','error_type'=>$e::class,'reason'=>$e instanceof LogicException?$e->getMessage():'Guard could not verify diagnostics configuration','secret_values_recorded'=>false]));exit(2);});
function c132GuardValues(array $source,array $effective):void {
if(($source['devtools']['enabled']??null)!==false)throw new LogicException('Explicit source DevTools OFF required; local fallback is unsafe');
if(($effective['devtools']['enabled']??null)!==false)throw new LogicException('Effective or cached configuration could enable DevTools');
}
function c132GuardConstant(string $code):void {
$clean='';foreach(token_get_all($code)as$t){if(is_array($t)&&in_array($t[0],[T_COMMENT,T_DOC_COMMENT],true))continue;$clean.=is_array($t)?$t[1]:$t;}
if(!preg_match('/[\'\"]devtools[\'\"]\s*=>\s*\[\s*[\'\"]enabled[\'\"]\s*=>\s*false\b/',$clean))throw new LogicException('DevTools OFF must be a constant, independent of APP_ENV or environment flags');
}
if(in_array('--self-test',$argv,true)){
$checks=[];foreach(['safe'=>[['devtools'=>['enabled'=>false]],['devtools'=>['enabled'=>false]],false],
'missing_source'=>[[],['devtools'=>['enabled'=>false]],true],
'enabled_source'=>[['devtools'=>['enabled'=>true]],['devtools'=>['enabled'=>false]],true],
'stale_cache_enabled'=>[['devtools'=>['enabled'=>false]],['devtools'=>['enabled'=>true]],true],
'missing_effective'=>[['devtools'=>['enabled'=>false]],[],true]]as$name=>[$s,$e,$expectBlocked]){
$blocked=false;try{c132GuardValues($s,$e);}catch(LogicException){$blocked=true;}if($blocked!==$expectBlocked)throw new LogicException('Guard regression: '.$name);$checks[$name]='passed';
}
foreach(['constant_false'=>["<?php return ['devtools'=>['enabled'=>false]];",false],
'comment_only'=>["<?php // 'devtools'=>['enabled'=>false]\nreturn [];",true],
'environment_switch'=>["<?php return ['devtools'=>['enabled'=>env('DEVTOOLS',false)]];",true]]as$name=>[$code,$expectBlocked]){
$blocked=false;try{c132GuardConstant($code);}catch(LogicException){$blocked=true;}if($blocked!==$expectBlocked)throw new LogicException('Guard regression: '.$name);$checks[$name]='passed';
}echo json_encode(['result'=>'passed','case'=>'C132','checks'=>$checks,'active_writes'=>0]);exit;
}
$root=dirname(__DIR__);$candidate=null;
for($i=1;$i<count($argv);$i++){if($argv[$i]==='--root')$root=$argv[++$i]??throw new LogicException('Root argument missing');elseif($argv[$i]==='--candidate-inertia')$candidate=$argv[++$i]??throw new LogicException('Candidate argument missing');else throw new LogicException('Unknown guard argument');}
$root=realpath($root);if(!$root||!is_file($root.'/vendor/autoload.php')||!is_file($root.'/bootstrap/app.php'))throw new LogicException('Application root cannot be verified');
require $root.'/vendor/autoload.php';$app=require $root.'/bootstrap/app.php';(new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables)->bootstrap($app);(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);
$sourcePath=$candidate??$root.'/config/inertia.php';if(!is_file($sourcePath))throw new LogicException('Configuration source absent');c132GuardConstant(file_get_contents($sourcePath));$source=require $sourcePath;
c132GuardValues($source,config('inertia',[]));
echo json_encode(['result'=>'passed','case'=>'C132','source_explicit_constant_OFF'=>true,'effective_configuration_OFF'=>true,'configuration_cached'=>$app->configurationIsCached(),'database_connections_used'=>0,'active_writes'=>0]);
@@ -0,0 +1,23 @@
"""Mandatory C132 pre/post gate for reviewed deployment helpers; no deployment or service control."""
from pathlib import Path
import subprocess, tempfile, json, os
def assert_diagnostics_off(root, candidate_inertia=None, payload=None):
root=Path(root).resolve()
php=os.environ.get('INVESTMOZ_DEPLOY_PHP','C:/laragon/bin/php/php-8.5.11-Win32-vs17-x64/php.exe')
args=[php,str(root/'tools/portal-diagnostics-deployment-guard.php'),'--root',str(root)]
temp=None
try:
if payload is not None and 'config/inertia.php' in payload:
# Only verified configuration bytes are written to a transient guard input. No secrets or destination changes.
with tempfile.NamedTemporaryFile(suffix='.php',delete=False) as f:
f.write(payload['config/inertia.php']);temp=Path(f.name)
candidate_inertia=temp
if candidate_inertia is not None:args+=['--candidate-inertia',str(candidate_inertia)]
r=subprocess.run(args,capture_output=True,text=True)
if r.returncode!=0:raise RuntimeError('C132 deployment blocked: diagnostics OFF could not be verified')
proof=json.loads(r.stdout)
if proof['result']!='passed':raise RuntimeError('C132 diagnostics guard failed')
return proof
finally:
if temp is not None:temp.unlink()
@@ -0,0 +1,20 @@
{
"case": "C132",
"scope": "Incident followup only; configuration containment already applied and preserved. Deployment gates added, historical deployments not rerun. Four individual MFA handoff messages sent under explicit owner authorization; only account17 manually confirmed.",
"additional_application_code_schema_services_flags_changes": 0,
"only_active_database_changes_this_followup": "Five append-only incident audit events; no accounts, roles, credentials or sessions changed again",
"process_files_sha256": {
"tools/portal-diagnostics-deployment-guard.php": "a5cf1fbc207bdc21e83eaed6a4db88523f411158efb09b0f132dd7fcb5d3b95b",
"tools/portal_diagnostics_deployment_guard.py": "0cc9a6930e5086517c7c492390ce48eb7dc57028ed038d15fed1960094f26770",
"tools/portal-owner-administration-release.py": "b41de0c7dab30922268015da6eed0958081e8ebeb388f3f3712bf45c499b3b3b",
"tools/portal-workflow-activation-stage.py": "5a685897adf75964a75f13b01afac124d1fd371b1a8f9bff6aa98e63b0d58362",
"tools/portal-stability-activation-stage.py": "74aae070315946c835e11e7a24ec29fa4edbfa3f83be418aff63f74a0ef3f2e3",
"tools/portal-country-activation-stage.ps1": "71ba3c1e50ca34314fc2c044b220b92b7a7eb42cb455b3f32b3579925d0516f8",
".github/workflows/tests.yml": "dd0e1083c9465ea63513e2915a00ceb1b1486bc8a32e604d34664f2f9beedeaf"
},
"active_inertia_sha256": "80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7",
"reversal": "Keep containment OFF, HTTPS, encryption key, original evidence and new MFA. Do not restore compromised seeds or an enabled diagnostic configuration. Reversal of deployment-helper changes is separate from incident data and must retain mandatory pre/post verification. No complete data restore performed.",
"technical_gates_limit": "Supported helpers/CI enforce the check; manual bypass or unreviewed external tools are not covered. CI remote run remains unperformed. Anonymous list/real-detail 404 is mandatory after future deployment.",
"C131_code_or_activation_included": false,
"incident_closed": false
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,78 @@
# C132 — contenção aplicada, incidente ainda aberto
Autorização específica do responsável nesta conversa: desativar o diagnóstico anónimo ativo usando a correção QA, preservar os registos restritamente e tratar as credenciais efetivamente afetadas. **Só C132 foi aplicado.** C131, outras funcionalidades, migrations, flags, serviços, COUNTRY02, papéis e as provas A/B/C37 não foram incluídos nesta intervenção.
## Contenção e verificações
- Em **12/10/2026 às 18:57:15 UTC (20:57:15 de Moçambique)**, `config/inertia.php` passou a definir `devtools.enabled=false`. Hash anterior `45994a9035e8e10d2fbb82f9fc18756cfb1ba403c9597d334122181b6b29839b`; novo `80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7`. É a mesma fonte validada em QA. A DACL foi conservada; a troca atómica foi recusada pelo Windows e a aplicação utilizou escrita exclusiva do ficheiro existente, já usada na configuração anterior do portal. Staging removido após conferir o hash.
- HTTP em `https://portal-investidor.test`, TLS reconhecido, sem autenticação/cookies: listagem **404**, detalhe real retido **404**, detalhe arbitrário **404**. Login **200**, cookies Secure/HttpOnly/SameSite=Lax para a sessão e sem conteúdo misto local. Pedidos anónimos ao desafio MFA/dashboard redirecionam para login; isso não foi contado como autenticação bem-sucedida.
- O responsável confirmou em janela privada: **«login, MFA e dashboard funcionam»**, com uma das contas existentes 2/13 e o seu autenticador. O ID exato não foi indicado na resposta; não inventar qual foi usado. Não repetiu A/B ou C37.
- 279 ficheiros preservados com hashes, incluindo 276 diagnósticos, fora da raiz web. Originais e cópia de incidente com ACL restrita ao operador Windows atual e SYSTEM. Logs Apache preservados separadamente. Não foram copiados corpos, cookies, passwords, códigos ou segredos para relatórios/ZIP.
## Alcance conhecido e período
A listagem anónima ativa tinha **445 metadados** às 18:40:45 UTC. O detalhe examinado então expunha dados de utilizador, cabeçalhos, corpos e caminhos internos. Presença de uma chave não significa valor utilizável: a análise local posterior distinguiu valores mascarados de segredos efetivos.
Os 276 diagnósticos preservados abrangem **11/10/2026 18:41:14 UTC a 12/10/2026 13:12:01 UTC**. A recolha e as rotas usam o mesmo gate DevTools; infere-se que o diagnóstico estava habilitado pelo menos na geração do primeiro registo retido. **O início exato da exposição é indeterminado**: a retenção/pruning de 24 horas não constitui um histórico de instalação/habilitação. A diferença entre os 445 metadados anteriormente observados e os 276 ficheiros de entrada preservados não pode ser tratada como inventário integral recuperado; a retenção automática existia antes da contenção.
Os logs disponíveis de acesso (04/10–12/10) foram examinados e preservados; contêm dois pedidos DevTools 200 correspondentes à conferência autorizada e pedidos posteriores 404. O formato é partilhado por vhosts e não prova todos os acessos históricos. **Não foi provada descarga não autorizada; também não foi provada a sua ausência.** O acesso demonstrado foi pelo hostname HTTPS local; alcance externo não foi ensaiado nesta contenção.
## Dados de autenticação efetivamente guardados
| Tipo | Evidência nos registos retidos | Tratamento |
|---|---|---|
| Passwords | 28 ocorrências mascaradas | Sem rotação indiscriminada de passwords. |
| Cookies / XSRF / tokens genéricos | Cookie 267, XSRF 203 e tokens 21 ocorrências mascaradas; Set-Cookie também mascarado | Não se alegou que estes campos presentes continham cookies/tokens utilizáveis. |
| Códigos MFA pontuais | Quatro valores não mascarados, de 11/10 20:12 a 12/10 09:02 UTC | Já expirados; não foram guardados nos recibos públicos. |
| Sementes TOTP / QR otpauth | Quatro sementes e quatro URI, ainda correspondentes às contas ativas antes da resposta | Rotação seletiva das contas 14, 15, 16 e 17. |
| Códigos de recuperação MFA | 32 valores nas quatro respostas JSON em array, sem chave sensível para a máscara genérica; correspondência confirmada no snapshot anterior à resposta | Os oito códigos por conta foram renovados na mesma rotação seletiva. Nenhum dos valores retidos corresponde agora às credenciais atuais. |
| Segredos da configuração ativa | Nenhuma correspondência literal encontrada com os valores secretos da configuração examinada | `APP_KEY`, cifra, HTTPS e histórico preservados; não executar `key:generate`. Isto não prova todo o período anterior à retenção. |
Contas afetadas:
| ID | Titular / conta existente | Resultado |
|---|---|---|
| 14 | Aurora Chachuaio | MFA/recovery renovados; password e papel intactos. |
| 15 | Palmira Uamusse | MFA/recovery renovados; password e papel intactos. |
| 16 | Mario Melembe | MFA/recovery renovados; password e papel intactos. |
| 17 | Tempo Lda — info@tempo.co.mz | MFA/recovery renovados; entrega ao responsável legítimo desta conta. |
Reutilizada a ação Fortify de renovação e `PortalProfileAccess::revokeSessions`: revisão de acesso incrementada, “lembrar-me” invalidado e verificação de sessões/tokens por estas quatro contas. Havia zero sessões autenticadas e zero tokens API dessas contas a eliminar; não se afirma ter eliminado sessões inexistentes. As sementes e os códigos antigos já não coincidem com os atuais; o mecanismo aceita código do novo segredo e recusa o do antigo. **MFA permanece obrigatório durante a entrega das novas entradas**, sem desativação para contorno. Os restantes utilizadores, as atribuições e a dupla 2/13 ficaram intactos. Na renovação inicial não houve envio externo; as entregas individuais posteriores estão registadas no seguimento abaixo.
## Backup, ensaio e auditoria
Antes da mudança do ficheiro, conferidos os hashes dos arquivos e o restauro válido anterior do destino, e realizado round trip da configuração em armazenamento privado. Antes de alterar credenciais, renovado o dump do destino e restaurado no clone isolado `c132_incident_20261012_190248_test:55441`: **295 tabelas e 31 sequências**, linhas/hashes integralmente iguais. O backup de resposta mantém DevTools OFF e a chave estável; originais/documentos de negócio não foram alterados.
A renovação/revogação foi ensaiada primeiro nesse clone e só depois aplicada às quatro contas ativas, por transação. Passwords, obrigatoriedade MFA, papéis, dupla e utilizadores não afetados verificados. Incidente auditado no mecanismo existente, como resposta administrativa autorizada, ator humano NULL (sem personificação): correlação `ead504de-19c1-4d84-9eca-d5649b8a456a`; evento de contenção `f3d7d79b-e6d0-47fe-aff1-b089ac02dd35`. A auditoria não contém novos segredos.
## Medidas ainda necessárias
1. O responsável entrega **individualmente** ao titular os ficheiros MFA locais protegidos `conta-14-2fas-local.html` até `conta-17-2fas-local.html`, no diretório privado de incidente indicado ao Codex local. Estes ficheiros contêm segredos: não anexar à conversa, não publicar URLs, não distribuir o conjunto aos funcionários. Usar 2FAS Auth continua válido: nova entrada TOTP dessa mesma conta, sem reutilizar a anterior. Cada pessoa entra com a sua password e novo autenticador, abre o dashboard e confirma ao responsável. Os códigos de recuperação novos podem ser consultados pelo fluxo autenticado existente.
2. Completar a delimitação histórica quando existirem snapshots/logs adicionais: procurar apenas dados com correspondência concreta, sem rotações gerais por hipótese. Preservar os registos e hashes; não expurgar automaticamente.
3. Verificar que DevTools continua OFF em futuras disponibilizações e que os registos retidos não se tornam anexos públicos. Uma eventual política futura de diagnóstico/retention é decisão separada; a correção mínima presente não ativa outro pacote.
**C132 está contido, não encerrado.** O fecho exige entrega/confirmação dos novos autenticadores, tratamento de outras credenciais que venham a ser efetivamente identificadas e aceitação dos limites históricos documentados. Reversão não deve reabilitar diagnóstico anónimo nem repor segredos comprometidos. Restauro integral de base ou código continua dependente de decisão separada.
Provas sanitizadas no pacote de revisão: `C132-containment.json`, `C132-http-contained.json`, `C132-local-analysis.json`, `C132-usability-before-snapshot.json`, `C132-usability-after-rotation.json`, `C132-rotation-QA.json`, `C132-rotation-active.json`, `C132-backup-restoration.json`, `C132-manual-auth-confirmation.json`, `C132-audit-record.json`, `C132-ACL-verification.json` e `C132-exposure-period.json`. A matriz existente mantém AUD-PROFILE-26 parcial pelos restantes critérios, sem novos IDs ou fecho global.
## Seguimento de 12 outubro e recuperação individual
O cadastro ativo confirma sem inferir a ordem dos nomes: **14 Aurora Chachuaio** (`aurora.chachuaio@tempo.co.mz`), **15 Palmira Uamusse** (`palmira.matsinhe@tempo.co.mz`), **16 Mario Melembe** (`mario.melembe@tempo.co.mz`) e **17 Tempo Lda** (`info@tempo.co.mz`). Para a conta corporativa 17, o responsável determinou entrega ao email, com resposta do gestor; não foi inventado um titular pessoal.
As quatro novas entradas foram conferidas contra as sementes atuais e enviadas em **quatro emails individuais**, um único destinatário por mensagem, sem CC/BCC, TLS 1.3 obrigatório e certificado verificado. A flag geral de notificações permaneceu inalterada; não houve consumo da fila. Os anexos/QR/segredos ficam fora da conversa e dos pacotes de revisão. A tentativa inicial da conta 17 parou antes do envio por uma verificação adicional que confundia TLS implícito com STARTTLS; a negociação TLS real foi conferida antes do único envio aceite. Não houve repetição de email após aceitação.
| Conta | Entrega SMTP | Confirmação do titular |
|---|---|---|
| 14 Aurora | Aceite individualmente com TLS | Receção e acesso ainda pendentes. |
| 15 Palmira | Aceite individualmente com TLS | Receção e acesso ainda pendentes. |
| 16 Mario | Aceite individualmente com TLS | Receção e acesso ainda pendentes. |
| 17 Tempo Lda | Aceite individualmente com TLS | Responsável confirmou: recebido, MFA configurado e dashboard acessível. Prova manual; não repetir. |
A leitura adicional examinou todos os payloads de sessão pela serialização JSON efetiva: **nenhuma sessão autenticada nem `login.id` pendente para 14–17**, no ativo ou no clone restaurado. A revisão de acesso está em 1 e lembrar-me está anulado. A ausência de sessões não é apresentada como eliminação de sessões inexistentes. Num ensaio isolado e transacional de QA, uma sessão autenticada existente foi eliminada pela rotina reutilizada; uma sessão de outra conta permaneceu; o middleware existente devolveu **401**, fez logout e invalidou a sessão antiga com revisão divergente. Os fixtures foram integralmente revertidos. Esta prova QA não substitui as confirmações manuais de recuperação.
Examinados **1.443 pedidos legíveis** e **130 eventos de auditoria** dos registos disponíveis. Os dois únicos pedidos de diagnóstico com 200 coincidem com a conferência autorizada de 18:40:45 UTC, com origem loopback; os posteriores devolvem 404. Não foi identificado outro acesso bem-sucedido ao diagnóstico nesses registos. Rejeições de autorização em perfis foram separadas de prova de ataque. O log é partilhado entre vhosts sem Host/conta autenticada; 21 linhas não correspondem ao formato HTTP analisado. Retenção de 24h, lacunas históricas e ausência de auditoria integral de login/descarga impedem concluir que nunca existiram outros acessos. **Não se declara ausência de exfiltração nem início exato da exposição.**
O diagnóstico mantém-se **OFF constante**, independente de APP_ENV. Acrescentado um gate técnico C132 que verifica a fonte da candidata e a configuração efetiva/cache, antes e depois da disponibilização nos quatro helpers existentes, e uma verificação de CI. Foram ensaiados localmente o estado seguro e a rejeição de configuração ausente, habilitada, condicionada por ambiente e cache habilitadora. CI remoto não foi executado. A verificação HTTP anónima de listagem e detalhe real continua obrigatória após implantação. Não se afirma que um gate possa impedir contorno manual deliberado. Nenhum desses ensaios repetiu disponibilizações históricas, migrations ou alterações de serviço; C131 não foi integrado.
**Restam:** confirmações individuais de 14–16 e avaliação de eventual evidência histórica adicional. Incidente mantido aberto. As pendências gerais de privacidade, C131, A/B e C37 mantêm os âmbitos e estados anteriores.
@@ -0,0 +1,72 @@
from pathlib import Path
from datetime import datetime,timezone
import json,csv,copy,hashlib,collections,shutil
csv.field_size_limit(10000000)
OUT=Path(__file__).resolve().parent;ROOT=OUT.parents[1];DOC=ROOT/'docs/investmoz/v2/auditoria-portal'
load=lambda p:json.loads(p.read_text(encoding='utf-8-sig'))
confirmation={'recorded_at':datetime.now(timezone.utc).isoformat(),'account_id':17,'recipient':'info@tempo.co.mz','source':'Owner message in conversation after individual delivery','exact_confirmation':'conta 17 — recebido, MFA configurado e dashboard acessível','mailbox_receipt_confirmed':True,'holder_MFA_setup_confirmed':True,'dashboard_access_confirmed':True,'evidence_kind':'manual confirmation relayed by owner','secrets_or_codes_recorded':False,'full_incident_closed':False}
assert not (OUT/'C132-account17-manual-recovery.json').exists(),'Preserve prior confirmation; do not overwrite blindly'
(OUT/'C132-account17-manual-recovery.json').write_text(json.dumps(confirmation,ensure_ascii=False,indent=2),encoding='utf-8')
delivery=[]
for uid in [14,15,16,17]:
r=load(OUT/f'C132-account{uid}-email-receipt.json');assert r['SMTP_accepted'] and r['TLS_required_and_certificate_verified'] and r['recipient_count']==1 and r['CC_BCC']==0
delivery.append({'account_id':uid,'recipient':r['recipient'],'SMTP_accepted_at':r['at'],'TLS':r['negotiated_TLS_protocol'],'recipient_count':1,'individual_entry_delivered_to_SMTP':True,'mailbox_receipt_confirmed':uid==17,'holder_access_confirmed':uid==17,'proof':f'C132-account{uid}-email-receipt.json'})
status={'at':datetime.now(timezone.utc).isoformat(),'case':'C132','accounts':delivery,'secure_entries_or_values_in_chat':False,'pending_access_confirmation_ids':[14,15,16],'incident_closed':False,'C131_included':False}
(OUT/'C132-handoff-status.json').write_text(json.dumps(status,ensure_ascii=False,indent=2),encoding='utf-8')
remaining='C132 contido no ativo. Titulares 14 Aurora/15 Palmira/16 Mario/17 conta corporativa Tempo Lda confirmados por leitura. Quatro emails individuais aceites com TLS 1.3; conta 17: recebimento/MFA/dashboard confirmados manualmente. Faltam confirmações individuais 14–16. Sessões autenticadas e MFA pendente dos quatro: zero na leitura; lembrar-me/revisão de acesso tratados. QA não vazia demonstra revogação/401 e preservação de outro utilizador. Guardas de fonte/configuração efetiva/cache e implantação acrescentadas. Exposição histórica integral indeterminada; privacidade/consentimentos gerais permanecem parciais.'
evidence='C132-session-review.json; C132-session-revocation-QA.json; C132-handoff-status.json; C132-account17-manual-recovery.json; C132-access-review.json; C132-deployment-guard-proof.json; C132-http-contained.json; C132-followup-audit.json'
files=[]
for name in ['matriz-requisitos.csv','backlog-priorizado.csv']:
p=DOC/name;before=list(csv.reader(p.open(encoding='utf-8-sig',newline='')));after=copy.deepcopy(before);ix={k:i for i,k in enumerate(after[0])};r=next(r for r in after[1:]if r[ix['ID']]=='AUD-PROFILE-26')
if name.startswith('matriz'):
for col in ['Lacuna','Critérios restantes atuais']:r[ix[col]]=remaining
r[ix['Disponibilidade ativa']]='C132: diagnóstico OFF e anónimo 404; MFA obrigatório preservado. Conta 17: entrega e recuperação manual confirmadas; 14–16: envio individual concluído, confirmação de acesso pendente. COUNTRY02/papéis/bundle/cifra intactos.'
for col in ['Evidência funcional','Evidências atuais verificadas']:r[ix[col]]+=' | Seguimento C132: '+evidence
for col in ['Dependência','Dependências atuais']:r[ix[col]]='Confirmar acesso pelos titulares 14–16; nenhuma nova nomeação, implantação funcional ou rotação geral. Registos/logs retidos com acesso restrito; início integral da exposição não determinável pelos registos atuais. Guardas C132 obrigatórias pré/pós-disponibilização.'
r[ix['Critérios cobertos pelas provas agrupadas']]+=' | C132: identidade por ID; envio individual SMTP TLS; confirmação manual apenas 17; leitura de todas as sessões JSON sem pendência dos quatro; revogação não vazia e stale-session 401 ensaiadas QA; prevenção por configuração constante OFF, guardas de implantação e CI.'
r[ix['Limites das provas agrupadas']]='Não confundir SMTP aceite com receção/autenticação: somente 17 confirmada manualmente. Prova de revogação não vazia é QA; ativo tinha zero sessões dos quatro, sem alegar eliminações inexistentes. Logs partilhados sem Host e retenção de diagnósticos 24h não permitem provar a ausência de acesso histórico não autorizado. CI remoto não executado; guardas locais testadas. Privacidade geral permanece parcial.'
else:
for col in ['Pendência','Trabalho ainda necessário']:r[ix[col]]=remaining
r[ix['Evidência atual']]+='; '+evidence
for col in ['Dependência/pergunta','Dependências técnicas/dados/configuração']:r[ix[col]]='Confirmar recebimento, MFA e dashboard de 14/15/16 após emails individuais autorizados e enviados. Conta 17 já confirmada; não repetir. Preservar limites da investigação e guardas de implantação. C131 separado.'
r[ix['Ordem do próximo lote']]='C132: recolher três confirmações individuais restantes; contenção, sessões e prevenção verificadas. Avaliar novas evidências históricas se disponíveis. Não reabrir A/B/C37.'
files.append({'path':str(p),'before_sha256':hashlib.sha256(p.read_bytes()).hexdigest(),'before':before,'after':after})
summary=load(OUT/'reconciliation-summary.json');summary.update(C132_confirmed_access_account_ids=[17],C132_pending_access_confirmation_ids=[14,15,16],C132_individual_SMTP_deliveries=4,C132_incident_closed=False)
for name in ['authoring-plan.json','csv-authoring-proof.json','reconciliation-summary.json']:
backup=OUT/(name+'.before-C132-followup');assert not backup.exists();shutil.copyfile(OUT/name,backup)
(OUT/'authoring-plan.json').write_text(json.dumps({'files':files,'summary':summary},ensure_ascii=False),encoding='utf-8');(OUT/'reconciliation-summary.json').write_text(json.dumps(summary,ensure_ascii=False,indent=2),encoding='utf-8')
report=DOC/'C132-incidente-contido.md';text=report.read_text(encoding='utf-8');text=text.replace('Nenhuma mensagem externa foi enviada.','Na renovação inicial não houve envio externo; as entregas individuais posteriores estão registadas no seguimento abaixo.')
text+='''
## Seguimento de 12 outubro e recuperação individual
O cadastro ativo confirma sem inferir a ordem dos nomes: **14 Aurora Chachuaio** (`aurora.chachuaio@tempo.co.mz`), **15 Palmira Uamusse** (`palmira.matsinhe@tempo.co.mz`), **16 Mario Melembe** (`mario.melembe@tempo.co.mz`) e **17 Tempo Lda** (`info@tempo.co.mz`). Para a conta corporativa 17, o responsável determinou entrega ao email, com resposta do gestor; não foi inventado um titular pessoal.
As quatro novas entradas foram conferidas contra as sementes atuais e enviadas em **quatro emails individuais**, um único destinatário por mensagem, sem CC/BCC, TLS 1.3 obrigatório e certificado verificado. A flag geral de notificações permaneceu inalterada; não houve consumo da fila. Os anexos/QR/segredos ficam fora da conversa e dos pacotes de revisão. A tentativa inicial da conta 17 parou antes do envio por uma verificação adicional que confundia TLS implícito com STARTTLS; a negociação TLS real foi conferida antes do único envio aceite. Não houve repetição de email após aceitação.
| Conta | Entrega SMTP | Confirmação do titular |
|---|---|---|
| 14 Aurora | Aceite individualmente com TLS | Receção e acesso ainda pendentes. |
| 15 Palmira | Aceite individualmente com TLS | Receção e acesso ainda pendentes. |
| 16 Mario | Aceite individualmente com TLS | Receção e acesso ainda pendentes. |
| 17 Tempo Lda | Aceite individualmente com TLS | Responsável confirmou: recebido, MFA configurado e dashboard acessível. Prova manual; não repetir. |
A leitura adicional examinou todos os payloads de sessão pela serialização JSON efetiva: **nenhuma sessão autenticada nem `login.id` pendente para 14–17**, no ativo ou no clone restaurado. A revisão de acesso está em 1 e lembrar-me está anulado. A ausência de sessões não é apresentada como eliminação de sessões inexistentes. Num ensaio isolado e transacional de QA, uma sessão autenticada existente foi eliminada pela rotina reutilizada; uma sessão de outra conta permaneceu; o middleware existente devolveu **401**, fez logout e invalidou a sessão antiga com revisão divergente. Os fixtures foram integralmente revertidos. Esta prova QA não substitui as confirmações manuais de recuperação.
Examinados **1.443 pedidos legíveis** e **130 eventos de auditoria** dos registos disponíveis. Os dois únicos pedidos de diagnóstico com 200 coincidem com a conferência autorizada de 18:40:45 UTC, com origem loopback; os posteriores devolvem 404. Não foi identificado outro acesso bem-sucedido ao diagnóstico nesses registos. Rejeições de autorização em perfis foram separadas de prova de ataque. O log é partilhado entre vhosts sem Host/conta autenticada; 21 linhas não correspondem ao formato HTTP analisado. Retenção de 24h, lacunas históricas e ausência de auditoria integral de login/descarga impedem concluir que nunca existiram outros acessos. **Não se declara ausência de exfiltração nem início exato da exposição.**
O diagnóstico mantém-se **OFF constante**, independente de APP_ENV. Acrescentado um gate técnico C132 que verifica a fonte da candidata e a configuração efetiva/cache, antes e depois da disponibilização nos quatro helpers existentes, e uma verificação de CI. Foram ensaiados localmente o estado seguro e a rejeição de configuração ausente, habilitada, condicionada por ambiente e cache habilitadora. CI remoto não foi executado. A verificação HTTP anónima de listagem e detalhe real continua obrigatória após implantação. Não se afirma que um gate possa impedir contorno manual deliberado. Nenhum desses ensaios repetiu disponibilizações históricas, migrations ou alterações de serviço; C131 não foi integrado.
**Restam:** confirmações individuais de 14–16 e avaliação de eventual evidência histórica adicional. Incidente mantido aberto. As pendências gerais de privacidade, C131, A/B e C37 mantêm os âmbitos e estados anteriores.
'''
report.write_text(text,encoding='utf-8')
block='''<!-- C132-followup-20261012 -->
## C132 entregas individuais e prevenção
Quatro emails individuais aceites com TLS obrigatório; **conta 17 confirmou receção, MFA e dashboard**. Faltam confirmações de Aurora/14, Palmira/15 e Mario/16. Não foram encontrados desafios MFA ou sessões autenticadas dos quatro na leitura; revogação de sessão não vazia e rejeição de sessão antiga foram demonstradas exclusivamente em QA. Configuração OFF preservada e gate C132 incluído nos helpers/CI. Listagem e detalhes continuam 404 no ativo. Logs disponíveis não permitem garantir o período integral nem ausência de acesso histórico não autorizado. [Seguimento e critérios restantes](C132-incidente-contido.md). C131 separado; A/B/C37 preservados; incidente aberto.
<!-- /C132-followup-20261012 -->
'''
for name in ['relatorio-executivo.md','backlog.md']:
p=DOC/name;t=p.read_text(encoding='utf-8');assert '<!-- C132-followup-20261012 -->'not in t;p.write_text(block+t,encoding='utf-8')
print(json.dumps({'same_requirement_updated':'AUD-PROFILE-26','new_ids':0,'account17_manual_confirmation_recorded':True,'SMTP_deliveries':4,'pending_holder_confirmation_ids':[14,15,16],'incident_closed':False}))
@@ -0,0 +1,59 @@
{
"at": "2026-10-13T08:29:30.634159+00:00",
"case": "C132",
"accounts": [
{
"account_id": 14,
"recipient": "aurora.chachuaio@tempo.co.mz",
"SMTP_accepted_at": "2026-10-12T19:47:48+00:00",
"TLS": "TLSv1.3",
"recipient_count": 1,
"individual_entry_delivered_to_SMTP": true,
"mailbox_receipt_confirmed": true,
"holder_access_confirmed": true,
"proof": "C132-account14-email-receipt.json",
"manual_proof": "C132-account14-manual-recovery.json"
},
{
"account_id": 15,
"recipient": "palmira.matsinhe@tempo.co.mz",
"SMTP_accepted_at": "2026-10-12T19:47:57+00:00",
"TLS": "TLSv1.3",
"recipient_count": 1,
"individual_entry_delivered_to_SMTP": true,
"mailbox_receipt_confirmed": true,
"holder_access_confirmed": true,
"proof": "C132-account15-email-receipt.json",
"manual_proof": "C132-account15-manual-recovery.json"
},
{
"account_id": 16,
"recipient": "mario.melembe@tempo.co.mz",
"SMTP_accepted_at": "2026-10-12T19:48:02+00:00",
"TLS": "TLSv1.3",
"recipient_count": 1,
"individual_entry_delivered_to_SMTP": true,
"mailbox_receipt_confirmed": true,
"holder_access_confirmed": true,
"proof": "C132-account16-email-receipt.json",
"manual_proof": "C132-account16-manual-recovery.json"
},
{
"account_id": 17,
"recipient": "info@tempo.co.mz",
"SMTP_accepted_at": "2026-10-12T19:40:51+00:00",
"TLS": "TLSv1.3",
"recipient_count": 1,
"individual_entry_delivered_to_SMTP": true,
"mailbox_receipt_confirmed": true,
"holder_access_confirmed": true,
"proof": "C132-account17-email-receipt.json"
}
],
"secure_entries_or_values_in_chat": false,
"pending_access_confirmation_ids": [],
"incident_closed": false,
"C131_included": false,
"secrets_or_values_recorded": false,
"individual_recovery_criterion_complete": true
}
@@ -0,0 +1,63 @@
{
"at": "2026-10-12T19:46:06.182921+00:00",
"case": "C132",
"base": "https://portal-investidor.test",
"anonymous": true,
"credentials_tokens_cookies_sent": false,
"TLS_bypass": false,
"bodies_saved": false,
"checks": [
{
"label": "index",
"status": 404,
"path": "/_inertia/devtools/entries"
},
{
"label": "retained_real_detail",
"status": 404,
"path": "/_inertia/devtools/entries/{retained-id}"
},
{
"label": "arbitrary_detail",
"status": 404,
"path": "/_inertia/devtools/entries/01ARZ3NDEKTSV4RRFFQ69G5FAV"
},
{
"label": "login",
"status": 200,
"path": "/login",
"login_form_present": true,
"cookie_attributes_only": [
{
"name": "XSRF-TOKEN",
"secure": true,
"http_only": false,
"same_site_lax": true,
"path_root": true
},
{
"name": "portal_investidor_https",
"secure": true,
"http_only": true,
"same_site_lax": true,
"path_root": true
}
],
"mixed_http_local_resource": false
},
{
"label": "MFA_requires_pending_login",
"status": 302,
"path": "/two-factor-challenge",
"redirect_path": "/login"
},
{
"label": "dashboard_requires_authentication",
"status": 302,
"path": "/dashboard",
"redirect_path": "/login"
}
],
"result": "contained_endpoints_verified",
"normal_MFA_authenticated_dashboard": "Requires a legitimate existing owner login; anonymous routing is not MFA success."
}
@@ -0,0 +1,33 @@
<?php
// Read-only review of actual owners and authenticated/pending session bindings. Payloads never leave memory.
ini_set('zend.exception_ignore_args','1');set_exception_handler(function(Throwable $e){fwrite(STDERR,json_encode(['error_type'=>$e::class,'line'=>$e->getLine(),'sensitive_values_recorded'=>false]));exit(1);});
$root=dirname(__DIR__,2);require $root.'/vendor/autoload.php';$app=require $root.'/bootstrap/app.php';(new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables)->bootstrap($app);(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);
$c=config('database.connections.'.config('database.default'));if($c['database']!=='investemoz'||(int)$c['port']!==5432||!empty($c['url']))throw new RuntimeException('Target differs');
$key=config('app.key');$crypt=new Illuminate\Encryption\Encrypter(str_starts_with($key,'base64:')?base64_decode(substr($key,7),true):$key,config('app.cipher'));
$rotation=json_decode(file_get_contents(__DIR__.'/C132-rotation-active.json'),true,512,JSON_THROW_ON_ERROR);$cutoff=strtotime($rotation['at']);$ids=[14,15,16,17];
$backup=json_decode(file_get_contents(__DIR__.'/C132-backup-restoration.json'),true,512,JSON_THROW_ON_ERROR);
$location=json_decode(ltrim(file_get_contents(__DIR__.'/C132-private-location.json'),"\xEF\xBB\xBF"),true,512,JSON_THROW_ON_ERROR)['private_directory'];
$report=['at'=>gmdate('c'),'rotation_at'=>$rotation['at'],'read_only'=>true,'sensitive_payloads_in_report'=>false,'targets'=>[]];
foreach(['active'=>[...$c],'restored_snapshot'=>[...$c,'host'=>'127.0.0.1','port'=>55441,'database'=>$backup['restore_target']['database'],'username'=>'postgres','password'=>'']]as$label=>$conn){
$db=new PDO('pgsql:host='.$conn['host'].';port='.$conn['port'].';dbname='.$conn['database'],$conn['username'],$conn['password'],[PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]);$db->exec('BEGIN READ ONLY');
$identity=$db->query('SELECT current_database() AS database,inet_server_port() AS port')->fetch(PDO::FETCH_ASSOC);if($identity['database']!==$conn['database']||(int)$identity['port']!==(int)$conn['port'])throw new RuntimeException('Actual identity differs');
$accounts=$db->query('SELECT id,name,email,email_verified_at,two_factor_confirmed_at,portal_access_revision,remember_token,two_factor_secret FROM users WHERE id IN(14,15,16,17) ORDER BY id')->fetchAll(PDO::FETCH_ASSOC);
$sessionRows=$db->query('SELECT user_id,payload,last_activity FROM sessions')->fetchAll(PDO::FETCH_ASSOC);$counts=array_fill_keys($ids,['authenticated_rows'=>0,'authenticated_payloads'=>0,'pending_MFA'=>0,'stale_before_rotation'=>0,'revision_mismatch'=>0]);$unreadable=0;$newLegitimate=0;
foreach($sessionRows as$row){$payload=base64_decode($row['payload'],true);try{if(config('session.encrypt'))$payload=$crypt->decrypt($payload,false);$state=config('session.serialization','php')==='json'?json_decode($payload,true,512,JSON_THROW_ON_ERROR):@unserialize($payload,['allowed_classes'=>false]);}catch(Throwable){$unreadable++;continue;}
if(!is_array($state)){$unreadable++;continue;}$bound=[];
if(in_array((int)$row['user_id'],$ids,true)){$counts[(int)$row['user_id']]['authenticated_rows']++;$bound[(int)$row['user_id']]=true;}
foreach($state as$k=>$v)if(str_starts_with($k,'login_web_')&&in_array((int)$v,$ids,true)){$counts[(int)$v]['authenticated_payloads']++;$bound[(int)$v]=true;}
if(isset($state['login.id'])&&in_array((int)$state['login.id'],$ids,true)){$counts[(int)$state['login.id']]['pending_MFA']++;$bound[(int)$state['login.id']]=true;}
foreach(array_keys($bound)as$id){if((int)$row['last_activity']<$cutoff)$counts[$id]['stale_before_rotation']++;else$newLegitimate++;
if(isset($state['portal.access_revision'])&&(int)$state['portal.access_revision']!==1)$counts[$id]['revision_mismatch']++;
}unset($state,$payload);
}
$safeAccounts=[];foreach($accounts as$u){$id=(int)$u['id'];$matched=null;if($label==='active'){$html=file_get_contents($location.'/handoff-affected-users/conta-'.$id.'-2fas-local.html');if(preg_match('/<code>([A-Z2-7]{16,})<\/code>/',$html,$m)!==1)throw new RuntimeException('Handoff format');$matched=hash_equals($crypt->decrypt($u['two_factor_secret']),$m[1]);unset($html,$m);}
$safeAccounts[]=['id'=>$id,'name'=>$u['name'],'email'=>$u['email'],'contact_verified'=>$u['email_verified_at']!==null,'MFA_required'=>$u['two_factor_confirmed_at']!==null&&$u['two_factor_secret']!==null,'access_revision'=>(int)$u['portal_access_revision'],'remember_token_null'=>$u['remember_token']===null,'handoff_matches_current_MFA'=>$matched,'sessions'=>$counts[$id]];
}
$audits=$db->query("SELECT id,source_system,actor_user_id,entity_type,action,occurred_at,created_at FROM audit_events WHERE created_at >= '2026-10-04 00:00:00+00' ORDER BY created_at,id")->fetchAll(PDO::FETCH_ASSOC);
$report['targets'][$label]=['identity'=>$identity,'accounts'=>$safeAccounts,'all_session_rows_examined'=>count($sessionRows),'unreadable_payloads'=>$unreadable,'post_rotation_bindings_not_deleted'=>$newLegitimate,'audit_events_examined'=>count($audits)];
if($label==='active')file_put_contents(__DIR__.'/C132-audit-timeline-safe.json',json_encode(['at'=>gmdate('c'),'events'=>$audits,'raw_data_fields_exported'=>false],JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));
$db->exec('ROLLBACK');
}
file_put_contents(__DIR__.'/C132-session-review.json',json_encode($report,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode($report,JSON_THROW_ON_ERROR);
@@ -0,0 +1,72 @@
{
"at": "2026-10-12T19:15:14.996522+00:00",
"case": "C132",
"diagnostic_records_examined": 276,
"preserved_files": 279,
"retained_first_timestamp": "2026-10-11T18:41:14.540Z",
"retained_last_timestamp": "2026-10-12T13:12:01.872Z",
"retained_window_not_full_exposure_period": true,
"methods": {
"GET": 198,
"POST": 78
},
"route_families": {
"other": 133,
"login": 38,
"MFA_challenge": 8,
"dashboard": 15,
"profile_administration": 48,
"management": 2,
"settings": 16,
"MFA_setup": 16
},
"authenticated_user_ids_in_retained_props": [
13,
14,
15,
16,
17
],
"sensitive_field_classification": {
"MFA_one_time_code": {
"unredacted": 4
},
"MFA_or_other_secret": {
"unredacted": 4
},
"MFA_recovery_code": {
"unredacted": 32
},
"header:cookie": {
"redacted": 267
},
"header:set-cookie": {
"redacted": 1
},
"header:x-xsrf-token": {
"redacted": 203
},
"otpauth_URI": {
"unredacted": 4
},
"password": {
"redacted": 28
},
"token_or_secret": {
"redacted": 21
}
},
"body_capture_states": {
"requestBody:empty": 189,
"responseBody:present": 276,
"requestBody:present": 63,
"requestBody:omitted": 24
},
"active_config_secret_exact_matches": {},
"MFA_code_first_timestamp": "2026-10-11T20:12:51.758Z",
"MFA_code_last_timestamp": "2026-10-12T09:02:01.918Z",
"unredacted_candidate_occurrences": 44,
"values_exported": false,
"candidate_values_retained_only_in_restricted_evidence": true,
"usability_assessment_pending": true
}
@@ -0,0 +1,46 @@
{
"case": "C132",
"state": "contained_incident_open",
"at": "2026-10-12T19:17:55.738984+00:00",
"owner_authorization": "Explicit incident-response instruction in this conversation",
"application_files": [
{
"path": "config/inertia.php",
"before_sha256": "45994a9035e8e10d2fbb82f9fc18756cfb1ba403c9597d334122181b6b29839b",
"after_sha256": "80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7"
}
],
"C131_applied": false,
"schema_changes": 0,
"flags_changes": 0,
"bundle_changes": 0,
"services_changes": 0,
"active_MFA_credentials_rotated_user_ids": [
14,
15,
16,
17
],
"app_key_rotated": false,
"authenticated_sessions_deleted": 0,
"API_tokens_deleted": 0,
"remember_me_invalidated_and_access_revision_incremented": true,
"roles_and_other_accounts_unchanged": true,
"private_secrets_or_diagnostics_attached": false,
"proofs": {
"C132-containment.json": "12a2bfa9b9a379d703088b0c33a8291f327fa9e29c73d467faf57a6577abafc3",
"C132-http-contained.json": "8e684ea0826dc2e1722c7b207e8d100c2cf5b90e45c441c737117f7876396673",
"C132-local-analysis.json": "920473a8e61c331266060966f35c7ec22b95b88e0c4f5183c424a668e10ddd79",
"C132-usability.json": "d93862ff3745b0dbb6c9adb9cd44d51a4fe65cc2c2d724d82f6a6d328246b0e9",
"C132-usability-before-snapshot.json": "db767c102f174412d421e9f2d60fddc4de6252b9a032cfd77a4dddbac78c30fe",
"C132-usability-after-rotation.json": "0d48901e89afa2133114311b21da8c74e0978f78aa5fd8823adf7d2abedbf3cd",
"C132-rotation-QA.json": "ce6f5c4c8e25e07682e8523cdc3a7cae1e3988982cce0a7adda508118665eea0",
"C132-rotation-active.json": "93bbbcf16dab95c6c955963ca2652ac9b002978e8225bb247e967f6a0a6e5695",
"C132-backup-restoration.json": "2253bd9c360aa31471c8bb10f84a9938d8400cdf452150a9b011db0a95fd2220",
"C132-manual-auth-confirmation.json": "bdfca0e5a09d8399b6b32b313de281e3c1dd2db4053848cc406672edf64e207a",
"C132-audit-record.json": "16b401e1fc5af3107025c495f6c3068db8f2269f7bdb1976d14ef6d8b4d28baf",
"C132-ACL-verification.json": "e1ce41a7dd86ae4e584473da9972d46057bc84c24945bacbbbcba2400be5e1a6",
"C132-exposure-period.json": "21e5e7c21491024885b5f0d9c52266d48256816cf1e283a0f0672e2239d8b41e"
},
"rollback": "Never re-enable anonymous diagnostics or restore compromised seeds; full restoration requires a separate decision."
}
@@ -0,0 +1,15 @@
{
"case": "C132",
"environment": "active",
"base": "https://portal-investidor.test",
"evidence_kind": "manual_confirmation_in_conversation",
"requested_scope": "Existing account 2 or 13, private window, login and own MFA, then dashboard",
"owner_reply": "login, MFA e dashboard funcionam",
"login_confirmed": true,
"MFA_confirmed": true,
"dashboard_confirmed": true,
"exact_account_not_specified_in_reply": true,
"credentials_codes_or_secrets_recorded": false,
"AB_and_C37_not_reopened_or_repeated": true,
"incident_closed": false
}
@@ -0,0 +1,49 @@
from pathlib import Path
from datetime import datetime,timezone
import json,hashlib,csv,zipfile,re,shutil,collections
csv.field_size_limit(10000000)
OUT=Path(__file__).resolve().parent;ROOT=OUT.parents[1];DOC=ROOT/'docs/investmoz/v2/auditoria-portal'
load=lambda p:json.loads(p.read_text(encoding='utf-8-sig'));sha=lambda p:hashlib.sha256(p.read_bytes()).hexdigest()
plan=load(OUT/'authoring-plan.json');author=load(OUT/'csv-authoring-proof.json')
for f,r in zip(plan['files'],author['files']):
actual=list(csv.reader(Path(f['path']).open(encoding='utf-8-sig',newline='')));assert actual==f['after'];ix=actual[0].index('ID')
changed=[a[ix] for a,b in zip(actual[1:],f['before'][1:])if a!=b];assert changed==['AUD-PROFILE-26']
assert sha(Path(f['path']))==r['after_sha256'];assert len(actual)==3402
before=load(OUT/'C132-preflight.json');assert sha(ROOT/'config/inertia.php')=='80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7';assert sha(ROOT/'app/Services/OpportunityContacts.php')==before['C131_active_hash'];assert sha(ROOT/'public/build/manifest.json')==before['build_hash']
loc=Path(load(OUT/'C132-private-location.json')['private_directory']);evidence=load(loc/'evidence-manifest-private.json')
assert all(sha(loc/'diagnostics'/r['name'])==r['sha256'] and sha(ROOT/'storage/inertia-devtools'/r['name'])==r['sha256'] for r in evidence['files'])
assert {p.name for p in (ROOT/'storage/inertia-devtools').iterdir()if p.is_file()}=={r['name']for r in evidence['files']}
guard=load(OUT/'C132-deployment-guard-proof.json');assert guard['result']=='passed';assert load(OUT/'C132-session-revocation-QA.json')['result']=='passed';assert all(x['status']==404 for x in load(OUT/'C132-http-contained.json')['checks'][:3]);assert load(OUT/'C132-handoff-status.json')['pending_access_confirmation_ids']==[14,15,16]
allmatrix=list(csv.DictReader((DOC/'matriz-requisitos.csv').open(encoding='utf-8-sig',newline='')))
integrity={'at':datetime.now(timezone.utc).isoformat(),'result':'passed','requirements':3401,'source_occurrences':sum(int(r['Quantidade de linhas de origem'])for r in allmatrix),'new_ids':0,'only_changed_requirement_this_followup':'AUD-PROFILE-26','immutable_references_and_other_rows_preserved':True,'states':dict(collections.Counter(r['Estado']for r in allmatrix)),
'matrix_sha256':sha(DOC/'matriz-requisitos.csv'),'backlog_sha256':sha(DOC/'backlog-priorizado.csv'),'original_diagnostics_and_private_snapshot_unchanged':True,'no_new_diagnostics_after_handoff_and_manual_confirmation':True,'C131_not_applied':True,'COUNTRY02_AB_C37_preserved':True,'incident_closed':False,'confirmed_holder_access_ids':[17],'pending_holder_access_ids':[14,15,16]}
(OUT/'C132-followup-integrity.json').write_text(json.dumps(integrity,ensure_ascii=False,indent=2),encoding='utf-8')
paths=['tools/portal-diagnostics-deployment-guard.php','tools/portal_diagnostics_deployment_guard.py','tools/portal-owner-administration-release.py','tools/portal-workflow-activation-stage.py','tools/portal-stability-activation-stage.py','tools/portal-country-activation-stage.ps1','.github/workflows/tests.yml']
manifest={'case':'C132','scope':'Incident followup only; configuration containment already applied and preserved. Deployment gates added, historical deployments not rerun. Four individual MFA handoff messages sent under explicit owner authorization; only account17 manually confirmed.',
'additional_application_code_schema_services_flags_changes':0,'only_active_database_changes_this_followup':'Five append-only incident audit events; no accounts, roles, credentials or sessions changed again','process_files_sha256':{p:sha(ROOT/p)for p in paths},'active_inertia_sha256':sha(ROOT/'config/inertia.php'),
'reversal':'Keep containment OFF, HTTPS, encryption key, original evidence and new MFA. Do not restore compromised seeds or an enabled diagnostic configuration. Reversal of deployment-helper changes is separate from incident data and must retain mandatory pre/post verification. No complete data restore performed.',
'technical_gates_limit':'Supported helpers/CI enforce the check; manual bypass or unreviewed external tools are not covered. CI remote run remains unperformed. Anonymous list/real-detail 404 is mandatory after future deployment.', 'C131_code_or_activation_included':False,'incident_closed':False}
(OUT/'C132-followup-manifest.json').write_text(json.dumps(manifest,ensure_ascii=False,indent=2),encoding='utf-8')
review=OUT/'C132-followup-para-revisao';assert not review.exists();review.mkdir()
copies={DOC/'C132-incidente-contido.md':'relatorio-C132.md',DOC/'relatorio-executivo.md':'relatorio-executivo.md',DOC/'backlog.md':'backlog.md',DOC/'matriz-requisitos.csv':'matriz-requisitos.csv',DOC/'backlog-priorizado.csv':'backlog-priorizado.csv',OUT/'C132-followup-manifest.json':'manifesto-C132-seguimento.json',ROOT/'tools/portal-diagnostics-deployment-guard.php':'guardas/portal-diagnostics-deployment-guard.php',ROOT/'tools/portal_diagnostics_deployment_guard.py':'guardas/portal_diagnostics_deployment_guard.py'}
for name in ['C132-http-contained.json','C132-session-review.json','C132-session-revocation-QA.json','C132-handoff-status.json','C132-account17-manual-recovery.json','C132-access-review.json','C132-deployment-guard-proof.json','C132-followup-audit.json','C132-followup-integrity.json',*[f'C132-account{i}-email-receipt.json'for i in [14,15,16,17]]]:copies[OUT/name]='evidencias/'+name
for source,target in copies.items():
p=review/target;p.parent.mkdir(parents=True,exist_ok=True);shutil.copyfile(source,p)
# Compare against actual secrets only in local memory. Never write or print them.
privateValues=[r['value']for r in load(loc/'secret-candidates-private.json')if isinstance(r['value'],str)and len(r['value'])>=12]
for p in (loc/'handoff-affected-users').glob('conta-*-2fas-local.html'):
privateValues+=re.findall(r'<code>([A-Z2-7]{16,})</code>',p.read_text(encoding='utf-8'))
fileManifest=[]
for p in sorted(review.rglob('*')):
if not p.is_file():continue
t=p.read_text(encoding='utf-8-sig');assert 'otpauth://'not in t and not re.search(r'QA-[a-f0-9]{32,}',t);assert all(v not in t for v in privateValues)
fileManifest.append({'file':p.relative_to(review).as_posix(),'bytes':p.stat().st_size,'sha256':sha(p)})
zipPath=OUT/'investmoz-C132-seguimento-revisao-20261012.zip';assert not zipPath.exists()
with zipfile.ZipFile(zipPath,'w',zipfile.ZIP_DEFLATED,compresslevel=8)as z:
for r in fileManifest:z.write(review/r['file'],r['file'])
z.writestr('inventario-pacote.json',json.dumps(fileManifest,ensure_ascii=False,indent=2))
with zipfile.ZipFile(zipPath)as z:assert z.testzip()is None;assert all(hashlib.sha256(z.read(r['file'])).hexdigest()==r['sha256']for r in fileManifest)
# Refresh only exported review copies; original historical ZIPs and canonical IDs remain unchanged.
for name in ['C132-incidente-contido.md','relatorio-executivo.md','backlog.md','matriz-requisitos.csv','backlog-priorizado.csv']:shutil.copyfile(DOC/name,OUT/'para-revisao'/name)
delivery={'result':'passed','file':str(zipPath),'sha256':sha(zipPath),'bytes':zipPath.stat().st_size,'entries':len(fileManifest)+1,'actual_secret_scan_passed':True,'original_attachments_preserved':True,'C131_code_or_activation_included':False,'pending_holder_access_ids':[14,15,16],'incident_closed':False}
(OUT/'C132-followup-delivery-proof.json').write_text(json.dumps(delivery,indent=2),encoding='utf-8');print(json.dumps(delivery))
@@ -0,0 +1,73 @@
<?php
return [
// Runtime diagnostics must not expose portal requests or private props.
'devtools' => ['enabled' => false],
/*
|--------------------------------------------------------------------------
| Server Side Rendering
|--------------------------------------------------------------------------
|
| These options configures if and how Inertia uses Server Side Rendering
| to pre-render each initial request made to your application's pages
| so that server rendered HTML is delivered for the user's browser.
|
| See: https://inertiajs.com/server-side-rendering
|
*/
'ssr' => [
'enabled' => true,
'url' => 'http://127.0.0.1:13714',
// 'bundle' => base_path('bootstrap/ssr/ssr.mjs'),
],
/*
|--------------------------------------------------------------------------
| Pages
|--------------------------------------------------------------------------
|
| These options configure how Inertia discovers page components on the
| filesystem. The paths and extensions are used to locate components
| when rendering responses and during testing assertions.
|
*/
'pages' => [
'paths' => [
resource_path('js/pages'),
],
'extensions' => [
'js',
'jsx',
'svelte',
'ts',
'tsx',
'vue',
],
],
/*
|--------------------------------------------------------------------------
| Testing
|--------------------------------------------------------------------------
|
| The values described here are used to locate Inertia components on the
| filesystem. For instance, when using `assertInertia`, the assertion
| attempts to locate the component as a file relative to the paths.
|
*/
'testing' => [
'ensure_pages_exist' => true,
],
];
@@ -0,0 +1,7 @@
{
"external_messages_sent": 0,
"source_diagnostics_restricted": true,
"retained_files": 279,
"handoff_file_count": 5,
"handoff_files_restricted": true
}
@@ -0,0 +1,13 @@
{
"at": "2026-10-12T19:12:21+00:00",
"target": {
"database": "investemoz",
"port": 5432
},
"containment_audit_event_id": "f3d7d79b-e6d0-47fe-aff1-b089ac02dd35",
"correlation_id": "ead504de-19c1-4d84-9eca-d5649b8a456a",
"actor_user_id": null,
"no_human_account_impersonated": true,
"configuration_keys_flags_C131_bundle_cookie_preserved": true,
"incident_closed": false
}
@@ -0,0 +1,20 @@
{
"at": "2026-10-12T19:02:57+00:00",
"target": {
"database": "investemoz",
"port": 5432
},
"restore_target": {
"database": "c132_incident_20261012_190248_test",
"port": 55441
},
"tables": 295,
"sequences": 31,
"all_table_rows_and_hashes_equal": true,
"restore_verified": true,
"active_writes": 0,
"dump_sha256": "276426add31685bddabe94cfd80cfa6b4696c5d24d3c9f9ead814cd0ab3dda9d",
"recovery_config_preserves_DevTools_OFF": true,
"key_not_rotated": true,
"private_snapshot_outside_webroot": true
}
@@ -0,0 +1,21 @@
{
"only_changed_application_file": "config/inertia.php",
"case": "C132",
"evidence_inheritance_disabled": true,
"business_data_writes": 0,
"root_directory": "C:\\laragon\\www\\portal-investidor",
"evidence_outside_DocumentRoot": true,
"config_restore_round_trip": true,
"contained_file_at": "2026-10-12T18:57:15.2365997Z",
"config_cache_absent": true,
"after_sha256": "80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7",
"preserved_diagnostic_files": 279,
"authorized_principals_count": 2,
"migrations": 0,
"config_DACL_preserved": true,
"application_method": "exclusive-existing-file-write-preserving-DACL",
"services_restarted": 0,
"before_sha256": "45994a9035e8e10d2fbb82f9fc18756cfb1ba403c9597d334122181b6b29839b",
"active_config_applied": true,
"C131_not_applied": true
}
@@ -0,0 +1,53 @@
{
"at": "2026-10-12T19:11:11.838462+00:00",
"case": "C132",
"known_anonymous_HTTP_confirmed_at": "2026-10-12T18:40:45.350823+00:00",
"disabled_at": "2026-10-12T18:57:15.2365997Z",
"first_retained_diagnostic_at": "2026-10-11T18:41:14.540Z",
"last_retained_diagnostic_at": "2026-10-12T13:12:01.872Z",
"minimum_inferred_collection_and_endpoint_enabled_start": "2026-10-11T18:41:14.540Z",
"inference_basis": "Recorder and routes use the same DevTools.enabled gate; retained diagnostic timestamps imply enabled collection. Earliest retained entry is not installation/start of full exposure.",
"full_exposure_start": "undetermined; 24-hour pruning and absence of an enable/disable history prevent an exact earlier start. Available access logs were preserved and inspected.",
"retention_hours_from_installed_default": 24,
"all_historical_accesses_identified": false,
"unauthorized_downloads_proven": false,
"absence_of_downloads_proven": false,
"logs_preserved_privately": [
{
"name": "access.log",
"sha256": "8e08de4a53b2a1c31e682854d9013aa04d3e7a83e068b2e82d84c711bce19f3f",
"bytes": 141139,
"last_write_UTC": "2026-10-12T19:10:47.605842+00:00",
"dated_first": "2026-10-04T12:01:41+00:00",
"dated_last": "2026-10-12T19:10:47+00:00",
"devtools_requests_by_status": {
"200": 2,
"404": 3
},
"raw_lines_exported": false
},
{
"name": "error.log",
"sha256": "454558b770a9e1be6ddb858af680e189101d17e6a13d10918899c91188dab65d",
"bytes": 19291,
"last_write_UTC": "2026-10-11T17:58:26.617112+00:00",
"dated_first": null,
"dated_last": null,
"devtools_requests_by_status": {},
"raw_lines_exported": false
},
{
"name": "install.log",
"sha256": "4d4737e20a166fc9141040b719e4ff1cac08dfbb96bb56bb8fcebbd33d68dbd4",
"bytes": 3146,
"last_write_UTC": "2022-06-22T06:02:20+00:00",
"dated_first": null,
"dated_last": null,
"devtools_requests_by_status": {},
"raw_lines_exported": false
}
],
"observed_endpoint_reach": "Local HTTPS hostname, anonymous client; external reach not tested.",
"endpoint_diagnostics_have_no_per_actor_filter": true,
"secret_values_or_IPs_in_report": false
}
@@ -0,0 +1,25 @@
{
"at": "2026-10-12T19:19:14.027019+00:00",
"result": "passed",
"C132_only": true,
"C131_not_applied": true,
"app_key_flags_cookie_bundle_preserved": true,
"original_diagnostics_and_restricted_snapshot_hashes_preserved": true,
"no_new_diagnostics_after_HTTP_and_owner_authentication": true,
"requirements": 3401,
"source_occurrences": 7739,
"new_ids": 0,
"AB_C37_preserved": true,
"states": {
"Sem evidência suficiente": 3062,
"Implementado parcialmente": 316,
"Dependente de decisão concreta da Tempo": 6,
"Implementado com falha": 1,
"Implementado e demonstrado apenas em QA": 7,
"Não implementado": 9
},
"matrix_sha256": "26d3f11da18c3ff2483e48174b52b85f8315b109a477fa946dfbb5df70a77c26",
"backlog_sha256": "3e7fcfb4992b0539fb8f290df9ffd2d0d0381727d0d59f5df503d04ae6779938",
"incident_closed": false,
"MFA_affected_owners_confirmation_pending": true
}
@@ -0,0 +1,63 @@
{
"at": "2026-10-12T19:11:12.387212+00:00",
"case": "C132",
"base": "https://portal-investidor.test",
"anonymous": true,
"credentials_tokens_cookies_sent": false,
"TLS_bypass": false,
"bodies_saved": false,
"checks": [
{
"label": "index",
"status": 404,
"path": "/_inertia/devtools/entries"
},
{
"label": "retained_real_detail",
"status": 404,
"path": "/_inertia/devtools/entries/{retained-id}"
},
{
"label": "arbitrary_detail",
"status": 404,
"path": "/_inertia/devtools/entries/01ARZ3NDEKTSV4RRFFQ69G5FAV"
},
{
"label": "login",
"status": 200,
"path": "/login",
"login_form_present": true,
"cookie_attributes_only": [
{
"name": "XSRF-TOKEN",
"secure": true,
"http_only": false,
"same_site_lax": true,
"path_root": true
},
{
"name": "portal_investidor_https",
"secure": true,
"http_only": true,
"same_site_lax": true,
"path_root": true
}
],
"mixed_http_local_resource": false
},
{
"label": "MFA_requires_pending_login",
"status": 302,
"path": "/two-factor-challenge",
"redirect_path": "/login"
},
{
"label": "dashboard_requires_authentication",
"status": 302,
"path": "/dashboard",
"redirect_path": "/login"
}
],
"result": "contained_endpoints_verified",
"normal_MFA_authenticated_dashboard": "Requires a legitimate existing owner login; anonymous routing is not MFA success."
}
@@ -0,0 +1,72 @@
{
"at": "2026-10-12T19:15:14.996522+00:00",
"case": "C132",
"diagnostic_records_examined": 276,
"preserved_files": 279,
"retained_first_timestamp": "2026-10-11T18:41:14.540Z",
"retained_last_timestamp": "2026-10-12T13:12:01.872Z",
"retained_window_not_full_exposure_period": true,
"methods": {
"GET": 198,
"POST": 78
},
"route_families": {
"other": 133,
"login": 38,
"MFA_challenge": 8,
"dashboard": 15,
"profile_administration": 48,
"management": 2,
"settings": 16,
"MFA_setup": 16
},
"authenticated_user_ids_in_retained_props": [
13,
14,
15,
16,
17
],
"sensitive_field_classification": {
"MFA_one_time_code": {
"unredacted": 4
},
"MFA_or_other_secret": {
"unredacted": 4
},
"MFA_recovery_code": {
"unredacted": 32
},
"header:cookie": {
"redacted": 267
},
"header:set-cookie": {
"redacted": 1
},
"header:x-xsrf-token": {
"redacted": 203
},
"otpauth_URI": {
"unredacted": 4
},
"password": {
"redacted": 28
},
"token_or_secret": {
"redacted": 21
}
},
"body_capture_states": {
"requestBody:empty": 189,
"responseBody:present": 276,
"requestBody:present": 63,
"requestBody:omitted": 24
},
"active_config_secret_exact_matches": {},
"MFA_code_first_timestamp": "2026-10-11T20:12:51.758Z",
"MFA_code_last_timestamp": "2026-10-12T09:02:01.918Z",
"unredacted_candidate_occurrences": 44,
"values_exported": false,
"candidate_values_retained_only_in_restricted_evidence": true,
"usability_assessment_pending": true
}
@@ -0,0 +1,15 @@
{
"case": "C132",
"environment": "active",
"base": "https://portal-investidor.test",
"evidence_kind": "manual_confirmation_in_conversation",
"requested_scope": "Existing account 2 or 13, private window, login and own MFA, then dashboard",
"owner_reply": "login, MFA e dashboard funcionam",
"login_confirmed": true,
"MFA_confirmed": true,
"dashboard_confirmed": true,
"exact_account_not_specified_in_reply": true,
"credentials_codes_or_secrets_recorded": false,
"AB_and_C37_not_reopened_or_repeated": true,
"incident_closed": false
}
@@ -0,0 +1,82 @@
{
"at": "2026-10-12T19:06:30+00:00",
"result": "passed",
"mode": "--qa",
"target": {
"database": "c132_incident_20261012_190248_test",
"port": 55441
},
"affected_ids": [
14,
15,
16,
17
],
"checks": [
{
"user_id": 14,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
},
{
"user_id": 15,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
},
{
"user_id": 16,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
},
{
"user_id": 17,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
}
],
"roles_and_superuser_pair_unchanged": true,
"unaffected_users_unchanged": true,
"app_key_not_rotated": true,
"MFA_not_disabled": true,
"no_external_messages_sent": true,
"secret_values_in_report": false,
"secure_handoff_required": false,
"backup_sha256": "276426add31685bddabe94cfd80cfa6b4696c5d24d3c9f9ead814cd0ab3dda9d",
"audit_correlation_id": "1f50aa2c-9063-4de3-aee4-f3b4be2a46c6"
}
@@ -0,0 +1,82 @@
{
"at": "2026-10-12T19:06:57+00:00",
"result": "passed",
"mode": "--apply-active",
"target": {
"database": "investemoz",
"port": 5432
},
"affected_ids": [
14,
15,
16,
17
],
"checks": [
{
"user_id": 14,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
},
{
"user_id": 15,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
},
{
"user_id": 16,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
},
{
"user_id": 17,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
}
],
"roles_and_superuser_pair_unchanged": true,
"unaffected_users_unchanged": true,
"app_key_not_rotated": true,
"MFA_not_disabled": true,
"no_external_messages_sent": true,
"secret_values_in_report": false,
"secure_handoff_required": true,
"backup_sha256": "276426add31685bddabe94cfd80cfa6b4696c5d24d3c9f9ead814cd0ab3dda9d",
"audit_correlation_id": "ead504de-19c1-4d84-9eca-d5649b8a456a"
}
@@ -0,0 +1,17 @@
{
"at": "2026-10-12T19:15:44+00:00",
"target": {
"database": "investemoz",
"port": 5432
},
"read_only": true,
"current_credential_matches": [],
"current_seed_affected_user_ids": [],
"source_state": "Current active credentials, READ ONLY",
"recovery_code_candidate_occurrences": 32,
"cookies_and_token_values_redacted_in_retained_records": true,
"password_values_redacted_in_retained_records": true,
"one_time_codes_expired_by_age": true,
"secrets_or_values_exported": false,
"MFA_not_disabled": true
}
@@ -0,0 +1,55 @@
{
"at": "2026-10-12T19:15:43+00:00",
"target": {
"database": "investemoz",
"port": 5432
},
"read_only": true,
"current_credential_matches": [
{
"user_id": 16,
"usable_exposed_credentials": [
"current_TOTP_seed",
"current_recovery_code"
],
"active_session_count": 0
},
{
"user_id": 14,
"usable_exposed_credentials": [
"current_TOTP_seed",
"current_recovery_code"
],
"active_session_count": 0
},
{
"user_id": 15,
"usable_exposed_credentials": [
"current_TOTP_seed",
"current_recovery_code"
],
"active_session_count": 0
},
{
"user_id": 17,
"usable_exposed_credentials": [
"current_TOTP_seed",
"current_recovery_code"
],
"active_session_count": 0
}
],
"current_seed_affected_user_ids": [
16,
14,
15,
17
],
"source_state": "Verified pre-response backup snapshot",
"recovery_code_candidate_occurrences": 32,
"cookies_and_token_values_redacted_in_retained_records": true,
"password_values_redacted_in_retained_records": true,
"one_time_codes_expired_by_age": true,
"secrets_or_values_exported": false,
"MFA_not_disabled": true
}
@@ -0,0 +1,46 @@
{
"case": "C132",
"state": "contained_incident_open",
"at": "2026-10-12T19:17:55.738984+00:00",
"owner_authorization": "Explicit incident-response instruction in this conversation",
"application_files": [
{
"path": "config/inertia.php",
"before_sha256": "45994a9035e8e10d2fbb82f9fc18756cfb1ba403c9597d334122181b6b29839b",
"after_sha256": "80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7"
}
],
"C131_applied": false,
"schema_changes": 0,
"flags_changes": 0,
"bundle_changes": 0,
"services_changes": 0,
"active_MFA_credentials_rotated_user_ids": [
14,
15,
16,
17
],
"app_key_rotated": false,
"authenticated_sessions_deleted": 0,
"API_tokens_deleted": 0,
"remember_me_invalidated_and_access_revision_incremented": true,
"roles_and_other_accounts_unchanged": true,
"private_secrets_or_diagnostics_attached": false,
"proofs": {
"C132-containment.json": "12a2bfa9b9a379d703088b0c33a8291f327fa9e29c73d467faf57a6577abafc3",
"C132-http-contained.json": "8e684ea0826dc2e1722c7b207e8d100c2cf5b90e45c441c737117f7876396673",
"C132-local-analysis.json": "920473a8e61c331266060966f35c7ec22b95b88e0c4f5183c424a668e10ddd79",
"C132-usability.json": "d93862ff3745b0dbb6c9adb9cd44d51a4fe65cc2c2d724d82f6a6d328246b0e9",
"C132-usability-before-snapshot.json": "db767c102f174412d421e9f2d60fddc4de6252b9a032cfd77a4dddbac78c30fe",
"C132-usability-after-rotation.json": "0d48901e89afa2133114311b21da8c74e0978f78aa5fd8823adf7d2abedbf3cd",
"C132-rotation-QA.json": "ce6f5c4c8e25e07682e8523cdc3a7cae1e3988982cce0a7adda508118665eea0",
"C132-rotation-active.json": "93bbbcf16dab95c6c955963ca2652ac9b002978e8225bb247e967f6a0a6e5695",
"C132-backup-restoration.json": "2253bd9c360aa31471c8bb10f84a9938d8400cdf452150a9b011db0a95fd2220",
"C132-manual-auth-confirmation.json": "bdfca0e5a09d8399b6b32b313de281e3c1dd2db4053848cc406672edf64e207a",
"C132-audit-record.json": "16b401e1fc5af3107025c495f6c3068db8f2269f7bdb1976d14ef6d8b4d28baf",
"C132-ACL-verification.json": "e1ce41a7dd86ae4e584473da9972d46057bc84c24945bacbbbcba2400be5e1a6",
"C132-exposure-period.json": "21e5e7c21491024885b5f0d9c52266d48256816cf1e283a0f0672e2239d8b41e"
},
"rollback": "Never re-enable anonymous diagnostics or restore compromised seeds; full restoration requires a separate decision."
}
@@ -0,0 +1,56 @@
# C132 — contenção aplicada, incidente ainda aberto
Autorização específica do responsável nesta conversa: desativar o diagnóstico anónimo ativo usando a correção QA, preservar os registos restritamente e tratar as credenciais efetivamente afetadas. **Só C132 foi aplicado.** C131, outras funcionalidades, migrations, flags, serviços, COUNTRY02, papéis e as provas A/B/C37 não foram incluídos nesta intervenção.
## Contenção e verificações
- Em **12/10/2026 às 18:57:15 UTC (20:57:15 de Moçambique)**, `config/inertia.php` passou a definir `devtools.enabled=false`. Hash anterior `45994a9035e8e10d2fbb82f9fc18756cfb1ba403c9597d334122181b6b29839b`; novo `80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7`. É a mesma fonte validada em QA. A DACL foi conservada; a troca atómica foi recusada pelo Windows e a aplicação utilizou escrita exclusiva do ficheiro existente, já usada na configuração anterior do portal. Staging removido após conferir o hash.
- HTTP em `https://portal-investidor.test`, TLS reconhecido, sem autenticação/cookies: listagem **404**, detalhe real retido **404**, detalhe arbitrário **404**. Login **200**, cookies Secure/HttpOnly/SameSite=Lax para a sessão e sem conteúdo misto local. Pedidos anónimos ao desafio MFA/dashboard redirecionam para login; isso não foi contado como autenticação bem-sucedida.
- O responsável confirmou em janela privada: **«login, MFA e dashboard funcionam»**, com uma das contas existentes 2/13 e o seu autenticador. O ID exato não foi indicado na resposta; não inventar qual foi usado. Não repetiu A/B ou C37.
- 279 ficheiros preservados com hashes, incluindo 276 diagnósticos, fora da raiz web. Originais e cópia de incidente com ACL restrita ao operador Windows atual e SYSTEM. Logs Apache preservados separadamente. Não foram copiados corpos, cookies, passwords, códigos ou segredos para relatórios/ZIP.
## Alcance conhecido e período
A listagem anónima ativa tinha **445 metadados** às 18:40:45 UTC. O detalhe examinado então expunha dados de utilizador, cabeçalhos, corpos e caminhos internos. Presença de uma chave não significa valor utilizável: a análise local posterior distinguiu valores mascarados de segredos efetivos.
Os 276 diagnósticos preservados abrangem **11/10/2026 18:41:14 UTC a 12/10/2026 13:12:01 UTC**. A recolha e as rotas usam o mesmo gate DevTools; infere-se que o diagnóstico estava habilitado pelo menos na geração do primeiro registo retido. **O início exato da exposição é indeterminado**: a retenção/pruning de 24 horas não constitui um histórico de instalação/habilitação. A diferença entre os 445 metadados anteriormente observados e os 276 ficheiros de entrada preservados não pode ser tratada como inventário integral recuperado; a retenção automática existia antes da contenção.
Os logs disponíveis de acesso (04/10–12/10) foram examinados e preservados; contêm dois pedidos DevTools 200 correspondentes à conferência autorizada e pedidos posteriores 404. O formato é partilhado por vhosts e não prova todos os acessos históricos. **Não foi provada descarga não autorizada; também não foi provada a sua ausência.** O acesso demonstrado foi pelo hostname HTTPS local; alcance externo não foi ensaiado nesta contenção.
## Dados de autenticação efetivamente guardados
| Tipo | Evidência nos registos retidos | Tratamento |
|---|---|---|
| Passwords | 28 ocorrências mascaradas | Sem rotação indiscriminada de passwords. |
| Cookies / XSRF / tokens genéricos | Cookie 267, XSRF 203 e tokens 21 ocorrências mascaradas; Set-Cookie também mascarado | Não se alegou que estes campos presentes continham cookies/tokens utilizáveis. |
| Códigos MFA pontuais | Quatro valores não mascarados, de 11/10 20:12 a 12/10 09:02 UTC | Já expirados; não foram guardados nos recibos públicos. |
| Sementes TOTP / QR otpauth | Quatro sementes e quatro URI, ainda correspondentes às contas ativas antes da resposta | Rotação seletiva das contas 14, 15, 16 e 17. |
| Códigos de recuperação MFA | 32 valores nas quatro respostas JSON em array, sem chave sensível para a máscara genérica; correspondência confirmada no snapshot anterior à resposta | Os oito códigos por conta foram renovados na mesma rotação seletiva. Nenhum dos valores retidos corresponde agora às credenciais atuais. |
| Segredos da configuração ativa | Nenhuma correspondência literal encontrada com os valores secretos da configuração examinada | `APP_KEY`, cifra, HTTPS e histórico preservados; não executar `key:generate`. Isto não prova todo o período anterior à retenção. |
Contas afetadas:
| ID | Titular / conta existente | Resultado |
|---|---|---|
| 14 | Aurora Chachuaio | MFA/recovery renovados; password e papel intactos. |
| 15 | Palmira Uamusse | MFA/recovery renovados; password e papel intactos. |
| 16 | Mario Melembe | MFA/recovery renovados; password e papel intactos. |
| 17 | Tempo Lda — info@tempo.co.mz | MFA/recovery renovados; entrega ao responsável legítimo desta conta. |
Reutilizada a ação Fortify de renovação e `PortalProfileAccess::revokeSessions`: revisão de acesso incrementada, “lembrar-me” invalidado e verificação de sessões/tokens por estas quatro contas. Havia zero sessões autenticadas e zero tokens API dessas contas a eliminar; não se afirma ter eliminado sessões inexistentes. As sementes e os códigos antigos já não coincidem com os atuais; o mecanismo aceita código do novo segredo e recusa o do antigo. **MFA permanece obrigatório durante a entrega das novas entradas**, sem desativação para contorno. Os restantes utilizadores, as atribuições e a dupla 2/13 ficaram intactos. Nenhuma mensagem externa foi enviada.
## Backup, ensaio e auditoria
Antes da mudança do ficheiro, conferidos os hashes dos arquivos e o restauro válido anterior do destino, e realizado round trip da configuração em armazenamento privado. Antes de alterar credenciais, renovado o dump do destino e restaurado no clone isolado `c132_incident_20261012_190248_test:55441`: **295 tabelas e 31 sequências**, linhas/hashes integralmente iguais. O backup de resposta mantém DevTools OFF e a chave estável; originais/documentos de negócio não foram alterados.
A renovação/revogação foi ensaiada primeiro nesse clone e só depois aplicada às quatro contas ativas, por transação. Passwords, obrigatoriedade MFA, papéis, dupla e utilizadores não afetados verificados. Incidente auditado no mecanismo existente, como resposta administrativa autorizada, ator humano NULL (sem personificação): correlação `ead504de-19c1-4d84-9eca-d5649b8a456a`; evento de contenção `f3d7d79b-e6d0-47fe-aff1-b089ac02dd35`. A auditoria não contém novos segredos.
## Medidas ainda necessárias
1. O responsável entrega **individualmente** ao titular os ficheiros MFA locais protegidos `conta-14-2fas-local.html` até `conta-17-2fas-local.html`, no diretório privado de incidente indicado ao Codex local. Estes ficheiros contêm segredos: não anexar à conversa, não publicar URLs, não distribuir o conjunto aos funcionários. Usar 2FAS Auth continua válido: nova entrada TOTP dessa mesma conta, sem reutilizar a anterior. Cada pessoa entra com a sua password e novo autenticador, abre o dashboard e confirma ao responsável. Os códigos de recuperação novos podem ser consultados pelo fluxo autenticado existente.
2. Completar a delimitação histórica quando existirem snapshots/logs adicionais: procurar apenas dados com correspondência concreta, sem rotações gerais por hipótese. Preservar os registos e hashes; não expurgar automaticamente.
3. Verificar que DevTools continua OFF em futuras disponibilizações e que os registos retidos não se tornam anexos públicos. Uma eventual política futura de diagnóstico/retention é decisão separada; a correção mínima presente não ativa outro pacote.
**C132 está contido, não encerrado.** O fecho exige entrega/confirmação dos novos autenticadores, tratamento de outras credenciais que venham a ser efetivamente identificadas e aceitação dos limites históricos documentados. Reversão não deve reabilitar diagnóstico anónimo nem repor segredos comprometidos. Restauro integral de base ou código continua dependente de decisão separada.
Provas sanitizadas no pacote de revisão: `C132-containment.json`, `C132-http-contained.json`, `C132-local-analysis.json`, `C132-usability-before-snapshot.json`, `C132-usability-after-rotation.json`, `C132-rotation-QA.json`, `C132-rotation-active.json`, `C132-backup-restoration.json`, `C132-manual-auth-confirmation.json`, `C132-audit-record.json`, `C132-ACL-verification.json` e `C132-exposure-period.json`. A matriz existente mantém AUD-PROFILE-26 parcial pelos restantes critérios, sem novos IDs ou fecho global.
@@ -0,0 +1,28 @@
{
"at": "2026-10-12T18:55:59+00:00",
"target": {
"database": "investemoz",
"port": 5432
},
"cached_config": false,
"route_cache": false,
"APP_ENV": "local",
"session_driver": "database",
"session_cookie": "portal_investidor_https",
"key_fingerprint": "c68aa236a4cd6bf0619c3796dd3898ce834c9af5596a24424d80cda6c204fbc7",
"previous_key_count": 0,
"flags": {
"organization_country_enabled": true,
"profile_access_enabled": true,
"profile_administration_enabled": true,
"opportunity_dashboard_access_enabled": true,
"opportunity_specialized_drafts_enabled": true,
"notifications_enabled": false
},
"backup_verified_at": "2026-10-12T11:10:30+00:00",
"backup_artifacts_hashes_verified": true,
"backup_restore_tables": 295,
"C131_active_hash": "e6bd6d786cb8b0ecfcb1e4bbe6778e2bf1cf5460650db2fd9f0e443e096e7827",
"active_inertia_hash": "45994a9035e8e10d2fbb82f9fc18756cfb1ba403c9597d334122181b6b29839b",
"build_hash": "e21d388f2e71bcd762c476d3e0bd1ae7c608ca57cafc2381c2a8888ce5d4efbf"
}
@@ -0,0 +1,24 @@
<?php
ini_set('zend.exception_ignore_args','1');
set_exception_handler(function(Throwable $e){fwrite(STDERR,"C132 preflight stopped: ".$e::class." at ".basename($e->getFile()).":".$e->getLine()."\n");exit(1);});
$root=dirname(__DIR__,2); require $root.'/vendor/autoload.php';
$app=require $root.'/bootstrap/app.php';
(new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables)->bootstrap($app);
(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);
$c=config('database.connections.'.config('database.default'));
if($c['driver']!=='pgsql'||!empty($c['url'])||!in_array($c['host'],['localhost','127.0.0.1'],true)||(int)$c['port']!==5432||$c['database']!=='investemoz')throw new RuntimeException('Target mismatch');
$db=new PDO('pgsql:host='.$c['host'].';port='.$c['port'].';dbname='.$c['database'],$c['username'],$c['password'],[PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]);
$db->exec('BEGIN READ ONLY');$target=$db->query('select current_database() as database,inet_server_port() as port')->fetch(PDO::FETCH_ASSOC);$db->exec('ROLLBACK');
if($target['database']!=='investemoz'||(int)$target['port']!==5432)throw new RuntimeException('Identity mismatch');
$backup=json_decode(file_get_contents($root.'/storage/app/private/investmoz-v2/portal-audit/internal-designation-target-backup.json'),true,512,JSON_THROW_ON_ERROR);
if(empty($backup['restore_verified'])||empty($backup['files_verified'])||count($backup['tables'])!==295)throw new RuntimeException('Existing restore proof not valid');
foreach(['dump_path'=>'dump_sha256','files_path'=>'files_sha256'] as $p=>$h){if(!is_file($backup[$p])||hash_file('sha256',$backup[$p])!==$backup[$h])throw new RuntimeException('Recovery artifact differs');}
$data=['at'=>gmdate('c'),'target'=>$target,'cached_config'=>$app->configurationIsCached(),'route_cache'=>count(glob($root.'/bootstrap/cache/routes*.php'))>0,
'APP_ENV'=>config('app.env'),'session_driver'=>config('session.driver'),'session_cookie'=>config('session.cookie'),
'key_fingerprint'=>hash('sha256',config('app.key')),'previous_key_count'=>count(config('app.previous_keys',[])),
'flags'=>array_intersect_key(config('portal'),array_flip(['organization_country_enabled','profile_administration_enabled','profile_access_enabled','opportunity_dashboard_access_enabled','opportunity_specialized_drafts_enabled','notifications_enabled'])),
'backup_verified_at'=>$backup['verified_at'],'backup_artifacts_hashes_verified'=>true,'backup_restore_tables'=>count($backup['tables']),
'C131_active_hash'=>hash_file('sha256',$root.'/app/Services/OpportunityContacts.php'),
'active_inertia_hash'=>hash_file('sha256',$root.'/config/inertia.php'),'build_hash'=>hash_file('sha256',$root.'/public/build/manifest.json')];
$output=($argv[1]??'')==='--after'?'C132-runtime-after.json':'C132-preflight.json';
file_put_contents(__DIR__.'/'.$output,json_encode($data,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES|JSON_THROW_ON_ERROR));echo json_encode($data,JSON_THROW_ON_ERROR);
@@ -0,0 +1,31 @@
from pathlib import Path
from datetime import datetime,timezone
import json,hashlib,re,shutil,subprocess,collections
OUT=Path(__file__).resolve().parent;ROOT=OUT.parents[1]
incident=Path(json.loads((OUT/'C132-private-location.json').read_text(encoding='utf-8-sig'))['private_directory'])
safe=[]
logdir=Path('C:/laragon/bin/apache/httpd-2.4.54-win64-VS16/logs');dest=incident/('apache-logs-'+datetime.now(timezone.utc).strftime('%Y%m%d_%H%M%S'));dest.mkdir(exist_ok=False)
for source in sorted(logdir.glob('*.log')):
original=source.read_bytes();target=dest/source.name;target.write_bytes(original);assert hashlib.sha256(target.read_bytes()).digest()==hashlib.sha256(original).digest()
lines=original.decode('utf-8',errors='replace').splitlines();dates=[];endpoint=collections.Counter();requests=0
for line in lines:
match=re.search(r'\[(\d{2}/[A-Za-z]{3}/\d{4}:\d{2}:\d{2}:\d{2} [+-]\d{4})\]',line)
if match:
try:dates.append(datetime.strptime(match[1],'%d/%b/%Y:%H:%M:%S %z').astimezone(timezone.utc).isoformat())
except ValueError:pass
if '/_inertia/devtools/entries' in line:
status=re.search(r'"\s+(\d{3})\s',line);endpoint[status[1] if status else 'unknown']+=1
if re.search(r'"(?:GET|POST|HEAD) ',line):requests+=1
safe.append({'name':source.name,'sha256':hashlib.sha256(original).hexdigest(),'bytes':len(original),'last_write_UTC':datetime.fromtimestamp(source.stat().st_mtime,timezone.utc).isoformat(),'dated_first':min(dates) if dates else None,'dated_last':max(dates) if dates else None,'devtools_requests_by_status':dict(endpoint),'raw_lines_exported':False})
analysis=json.loads((OUT/'C132-local-analysis.json').read_text(encoding='utf-8'))
containment=json.loads((OUT/'C132-containment.json').read_text(encoding='utf-8-sig'))
before=json.loads((OUT/'C132-active-readonly.json').read_text(encoding='utf-8'))
period={'at':datetime.now(timezone.utc).isoformat(),'case':'C132','known_anonymous_HTTP_confirmed_at':before['at'],'disabled_at':containment['contained_file_at'],
'first_retained_diagnostic_at':analysis['retained_first_timestamp'],'last_retained_diagnostic_at':analysis['retained_last_timestamp'],
'minimum_inferred_collection_and_endpoint_enabled_start':analysis['retained_first_timestamp'],
'inference_basis':'Recorder and routes use the same DevTools.enabled gate; retained diagnostic timestamps imply enabled collection. Earliest retained entry is not installation/start of full exposure.',
'full_exposure_start':'undetermined; 24-hour pruning and absence of an enable/disable history prevent an exact earlier start. Available access logs were preserved and inspected.',
'retention_hours_from_installed_default':24,'all_historical_accesses_identified':False,'unauthorized_downloads_proven':False,
'absence_of_downloads_proven':False,'logs_preserved_privately':safe,'observed_endpoint_reach':'Local HTTPS hostname, anonymous client; external reach not tested.',
'endpoint_diagnostics_have_no_per_actor_filter':True,'secret_values_or_IPs_in_report':False}
(OUT/'C132-exposure-period.json').write_text(json.dumps(period,ensure_ascii=False,indent=2),encoding='utf-8');print(json.dumps(period,ensure_ascii=True))
@@ -0,0 +1,3 @@
{
"private_directory": "C:\\Users\\macbook\\.config\\investmoz\\incidents\\C132-20261012_185715"
}
@@ -0,0 +1,13 @@
<?php
ini_set('zend.exception_ignore_args','1');set_exception_handler(function(Throwable $e){fwrite(STDERR,$e::class.' '.basename($e->getFile()).':'.$e->getLine());exit(1);});
$root=dirname(__DIR__,2);require $root.'/vendor/autoload.php';$app=require $root.'/bootstrap/app.php';(new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables)->bootstrap($app);(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);
$c=config('database.connections.'.config('database.default'));if($c['driver']!=='pgsql'||!empty($c['url'])||(int)$c['port']!==5432||$c['database']!=='investemoz')throw new RuntimeException('Target differs');
$db=new PDO('pgsql:host='.$c['host'].';port=5432;dbname=investemoz',$c['username'],$c['password'],[PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]);$identity=$db->query('SELECT current_database() AS database,inet_server_port() AS port')->fetch(PDO::FETCH_ASSOC);if($identity['database']!=='investemoz'||(int)$identity['port']!==5432)throw new RuntimeException('Wrong identity');
$action='C132_anonymous_diagnostics_contained';$correlation='ead504de-19c1-4d84-9eca-d5649b8a456a';
$before=json_decode(file_get_contents(__DIR__.'/C132-preflight.json'),true,512,JSON_THROW_ON_ERROR);$after=json_decode(file_get_contents(__DIR__.'/C132-runtime-after.json'),true,512,JSON_THROW_ON_ERROR);
foreach(['key_fingerprint','flags','build_hash','C131_active_hash','session_cookie']as$k)if($before[$k]!==$after[$k])throw new RuntimeException('Out-of-scope change');
if($after['active_inertia_hash']!=='80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7')throw new RuntimeException('Not contained');
$existing=$db->prepare('SELECT id FROM audit_events WHERE source_system=? AND action=? AND correlation_id=?');$existing->execute(['C132-incident-response',$action,$correlation]);$id=$existing->fetchColumn();
if(!$id){$q=$db->prepare("INSERT INTO audit_events(source_system,entity_type,action,data_classification,actor_user_id,correlation_id,after_data) VALUES ('C132-incident-response','security_incident',?,'restricted',NULL,?,?::jsonb) RETURNING id");
$q->execute([$action,$correlation,json_encode(['case'=>'C132','authorization'=>'Explicit owner incident-response instruction in conversation','changed_file'=>'config/inertia.php','before_sha256'=>$before['active_inertia_hash'],'after_sha256'=>$after['active_inertia_hash'],'anonymous_index_and_real_detail_HTTP'=>404,'login_MFA_dashboard_manual_confirmed'=>true,'MFA_seed_rotation_user_ids'=>[14,15,16,17],'C131_included'=>false,'app_key_and_flags_unchanged'=>true,'incident_closed'=>false,'raw_sensitive_values_recorded'=>false],JSON_THROW_ON_ERROR)]);$id=$q->fetchColumn();}
$proof=['at'=>gmdate('c'),'target'=>$identity,'containment_audit_event_id'=>$id,'correlation_id'=>$correlation,'actor_user_id'=>null,'no_human_account_impersonated'=>true,'configuration_keys_flags_C131_bundle_cookie_preserved'=>true,'incident_closed'=>false];file_put_contents(__DIR__.'/C132-audit-record.json',json_encode($proof,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode($proof,JSON_THROW_ON_ERROR);
@@ -0,0 +1,25 @@
<?php
// Scoped incident audit only; never impersonate a human, rotate again, or alter profiles/sessions.
ini_set('zend.exception_ignore_args','1');set_exception_handler(function(Throwable $e){fwrite(STDERR,json_encode(['error_type'=>$e::class,'SQLSTATE'=>$e->getCode(),'line'=>$e->getLine(),'secret_values_recorded'=>false]));exit(1);});
$root=dirname(__DIR__,2);require $root.'/vendor/autoload.php';$app=require $root.'/bootstrap/app.php';(new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables)->bootstrap($app);(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);
$out=__DIR__;$load=fn($p)=>json_decode(ltrim(file_get_contents($p),"\xEF\xBB\xBF"),true,512,JSON_THROW_ON_ERROR);
$before=$load($out.'/C132-preflight.json');if(hash_file('sha256',$root.'/config/inertia.php')!=='80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7'||hash_file('sha256',$root.'/app/Services/OpportunityContacts.php')!==$before['C131_active_hash'])throw new RuntimeException('Incident scope differs');
$backup=$load($out.'/C132-backup-restoration.json');$private=$load($out.'/C132-private-location.json');$b=$load($private['private_directory'].'/recovery/backup-proof-private.json');
if(!$backup['restore_verified']||hash_file('sha256',$b['dump'])!==$backup['dump_sha256'])throw new RuntimeException('Verified recovery unavailable');
$c=config('database.connections.'.config('database.default'));if($c['database']!=='investemoz'||(int)$c['port']!==5432||!empty($c['url']))throw new RuntimeException('Target differs');
$db=new PDO('pgsql:host='.$c['host'].';port='.$c['port'].';dbname='.$c['database'],$c['username'],$c['password'],[PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]);$db->exec('BEGIN');
try{$target=$db->query('SELECT current_database() AS database,inet_server_port() AS port')->fetch(PDO::FETCH_ASSOC);if($target['database']!=='investemoz'||(int)$target['port']!==5432)throw new RuntimeException('Actual target differs');
$usersBefore=$db->query('SELECT row_to_json(u)::text FROM users u ORDER BY id')->fetchAll(PDO::FETCH_COLUMN);$sessionsBefore=$db->query('SELECT row_to_json(s)::text FROM sessions s ORDER BY id')->fetchAll(PDO::FETCH_COLUMN);
$correlation='ead504de-19c1-4d84-9eca-d5649b8a456a';$events=[];$inserted=0;
foreach([14,15,16,17]as$id){$r=$load($out.'/C132-account'.$id.'-email-receipt.json');if(!$r['SMTP_accepted']||!$r['TLS_required_and_certificate_verified']||$r['recipient_count']!==1||$r['CC_BCC']!==0)throw new RuntimeException('Receipt differs');
$events[]=['id'=>$id,'action'=>'C132_individual_MFA_handoff_SMTP_accepted','data'=>['case'=>'C132','account_id'=>$id,'SMTP_accepted_at'=>$r['at'],'single_recipient'=>true,'TLS_protocol'=>$r['negotiated_TLS_protocol'],'mailbox_or_holder_confirmation_inferred'=>false,'authorization'=>'Explicit owner instructed individual email delivery','secret_values_recorded'=>false]];
}
$manual=$load($out.'/C132-account17-manual-recovery.json');if(!$manual['dashboard_access_confirmed']||!$manual['mailbox_receipt_confirmed'])throw new RuntimeException('Manual confirmation differs');
$events[]=['id'=>17,'action'=>'C132_holder_access_recovered_manual_confirmation','data'=>['case'=>'C132','account_id'=>17,'source'=>'Owner relayed individual account confirmation','received'=>true,'MFA_configured'=>true,'dashboard_accessible'=>true,'automated_browser_proof'=>false,'secret_values_recorded'=>false]];
$exists=$db->prepare("SELECT COUNT(*) FROM audit_events WHERE source_system=:source AND correlation_id=:correlation AND action=:action AND after_data->>'account_id'=:account");
$insert=$db->prepare("INSERT INTO audit_events(source_system,correlation_id,entity_type,action,actor_user_id,data_classification,after_data) VALUES(:source,:correlation,'security_incident_account',:action,NULL,'restricted',CAST(:data AS jsonb))");
foreach($events as$event){$params=['source'=>'C132-incident-response','correlation'=>$correlation,'action'=>$event['action']];$exists->execute([...$params,'account'=>(string)$event['id']]);if((int)$exists->fetchColumn()===0){$insert->execute([...$params,'data'=>json_encode($event['data'],JSON_THROW_ON_ERROR)]);$inserted++;}}
if($usersBefore!==$db->query('SELECT row_to_json(u)::text FROM users u ORDER BY id')->fetchAll(PDO::FETCH_COLUMN)||$sessionsBefore!==$db->query('SELECT row_to_json(s)::text FROM sessions s ORDER BY id')->fetchAll(PDO::FETCH_COLUMN))throw new RuntimeException('Unrelated data changed');
$db->exec('COMMIT');
}catch(Throwable $e){$db->exec('ROLLBACK');throw$e;}
$proof=['at'=>gmdate('c'),'target'=>$target,'audit_events_appended'=>$inserted,'audit_correlation_id'=>$correlation,'only_incident_audit_written'=>true,'human_actor_impersonated'=>false,'new_secret_values_recorded'=>false,'users_and_sessions_unchanged'=>true,'C131_included'=>false,'pending_holder_confirmation_ids'=>[14,15,16],'incident_closed'=>false];file_put_contents($out.'/C132-followup-audit.json',json_encode($proof,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode($proof);
@@ -0,0 +1,38 @@
from pathlib import Path
from datetime import datetime, timezone
from urllib.parse import urlsplit, unquote
import json,re,collections,ipaddress,hashlib
OUT=Path(__file__).resolve().parent
incident=Path(json.loads((OUT/'C132-private-location.json').read_text(encoding='utf-8-sig'))['private_directory'])
source=Path('C:/laragon/bin/apache/httpd-2.4.54-win64-VS16/logs/access.log')
data=source.read_bytes();dest=incident/('access-review-'+datetime.now(timezone.utc).strftime('%Y%m%d_%H%M%S'));dest.mkdir();(dest/'access.log').write_bytes(data)
assert hashlib.sha256((dest/'access.log').read_bytes()).digest()==hashlib.sha256(data).digest()
all_classes=collections.Counter();diag=[];sensitive=collections.Counter();parsed=0;unparsed=0
for line in data.decode('utf-8',errors='replace').splitlines():
m=re.match(r'^(\S+) .*?\[([^]]+)\] "([A-Z]+) (.*?) HTTP/[^"]+" (\d{3})',line)
if not m: unparsed+=1;continue
try: stamp=datetime.strptime(m[2],'%d/%b/%Y:%H:%M:%S %z').astimezone(timezone.utc).isoformat();origin='loopback' if ipaddress.ip_address(m[1]).is_loopback else 'non_loopback'
except ValueError: unparsed+=1;continue
parsed+=1;all_classes[origin]+=1;path=urlsplit(m[4]).path
for _ in range(3):path=unquote(path)
if '/_inertia/devtools' in path.lower():
diag.append({'at':stamp,'method':m[3],'operation':'list' if path.rstrip('/').endswith('/entries') else 'detail','status':int(m[5]),'origin_class':origin,'record_id_or_query_exported':False})
for family,prefix in [('login','/login'),('MFA','/two-factor-challenge'),('profile_administration','/management/profiles'),('MFA_enrollment','/user/two-factor'),('document_access','/opportunity-resources')]:
if path.startswith(prefix):sensitive[(family,m[3],int(m[5]))]+=1
audits=json.loads((OUT/'C132-audit-timeline-safe.json').read_text(encoding='utf-8'))['events']
group=collections.Counter((x['source_system'],x['action'],x['actor_user_id']) for x in audits)
denied=[{'actor_user_id':x['actor_user_id'],'at':x['created_at'],'action':x['action']} for x in audits if x['action']=='request_denied']
success=[x for x in diag if 200<=x['status']<300]
assert len(success)==2 and all(x['origin_class']=='loopback' and x['at'].startswith('2026-10-12T18:40:') for x in success),'Additional successful diagnostic access requires investigation'
proof={'at':datetime.now(timezone.utc).isoformat(),'case':'C132','access_log_snapshot_sha256':hashlib.sha256(data).hexdigest(),'log_lines_parsed':parsed,'unparsed_lines':unparsed,
'all_request_origin_classes':dict(all_classes),'diagnostic_requests':diag,'successful_diagnostic_requests':len(success),'successful_requests_match_recorded_authorized_audit_time':True,
'audit_events_examined':len(audits),'audit_action_counts':[{'source':k[0],'action':k[1],'actor_user_id':k[2],'count':v} for k,v in group.items()],
'denied_profile_requests':denied,'sensitive_route_counts':[{'family':k[0],'method':k[1],'status':k[2],'count':v} for k,v in sensitive.items()],
'suspicious_diagnostic_access_identified_in_available_logs':False,'negative_result_does_not_prove_no_access':True,
'limitations':['Common access log is shared across vhosts and does not record Host or authenticated account; it cannot attribute every request to this portal or a person.',
'No complete diagnostic enablement history; diagnostic retention was 24 hours. Exact earlier exposure start and deleted records cannot be recovered from the available files.',
'A denied profile request is an authorization rejection, not proof of an attack. Audit has no comprehensive successful login/MFA or document-download trail.',
'Loopback source identifies a local request or proxy, not the identity of the person making it. No conclusion about earlier or unlogged downloads.'],
'raw_lines_IPs_cookies_tokens_or_payloads_exported':False}
(OUT/'C132-access-review.json').write_text(json.dumps(proof,ensure_ascii=False,indent=2),encoding='utf-8')
print(json.dumps({k:proof[k] for k in ['log_lines_parsed','unparsed_lines','all_request_origin_classes','diagnostic_requests','audit_events_examined','suspicious_diagnostic_access_identified_in_available_logs','limitations']}))
@@ -0,0 +1,65 @@
<?php
// Exact C132 response. First run --qa; active run requires its proof and the current restored snapshot.
ini_set('zend.exception_ignore_args','1');set_exception_handler(function(Throwable $e){$safe=['error_type'=>$e::class,'source'=>basename($e->getFile()),'line'=>$e->getLine()];if($e instanceof Illuminate\Database\QueryException){$safe['SQLSTATE']=$e->getCode();$safe['SQL_template_without_bindings']=$e->getSql();}fwrite(STDERR,json_encode($safe));exit(1);});
$mode=$argv[1]??'';if(!in_array($mode,['--qa','--apply-active'],true))throw new RuntimeException('Explicit mode required');
$root=dirname(__DIR__,2);require $root.'/vendor/autoload.php';$app=require $root.'/bootstrap/app.php';(new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables)->bootstrap($app);(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);
$location=json_decode(ltrim(file_get_contents(__DIR__.'/C132-private-location.json'),"\xEF\xBB\xBF"),true,512,JSON_THROW_ON_ERROR)['private_directory'];
$backup=json_decode(file_get_contents(__DIR__.'/C132-backup-restoration.json'),true,512,JSON_THROW_ON_ERROR);$privateBackup=json_decode(file_get_contents($location.'/recovery/backup-proof-private.json'),true,512,JSON_THROW_ON_ERROR);
if(empty($backup['restore_verified'])||hash_file('sha256',$privateBackup['dump'])!==$backup['dump_sha256']||time()-strtotime($backup['at'])>3600)throw new RuntimeException('Restore proof stale or changed');
$assessment=json_decode(file_get_contents(__DIR__.'/C132-usability.json'),true,512,JSON_THROW_ON_ERROR);$ids=$assessment['current_seed_affected_user_ids'];sort($ids);if($ids!==[14,15,16,17])throw new RuntimeException('Affected scope differs');
$active=config('database.connections.'.config('database.default'));if($active['driver']!=='pgsql'||!empty($active['url'])||(int)$active['port']!==5432||$active['database']!=='investemoz')throw new RuntimeException('Active configuration differs');
if($mode==='--apply-active'){
$qa=json_decode(file_get_contents(__DIR__.'/C132-rotation-QA.json'),true,512,JSON_THROW_ON_ERROR);if($qa['result']!=='passed'||$qa['affected_ids']!==$ids||$qa['backup_sha256']!==$backup['dump_sha256'])throw new RuntimeException('QA proof mismatch');
$connection=$active;
}else{$connection=[...$active,'host'=>'127.0.0.1','port'=>55441,'database'=>$backup['restore_target']['database'],'username'=>'postgres','password'=>''];if(!preg_match('/^c132_incident_\d{8}_\d{6}_test$/',$connection['database']))throw new RuntimeException('QA name refused');}
$manager=new Illuminate\Database\Capsule\Manager($app);$manager->addConnection($connection);$manager->setAsGlobal();$manager->bootEloquent();
Illuminate\Support\Facades\Facade::setFacadeApplication($app);$app->instance('db',$manager->getDatabaseManager());$app->bind('db.schema',fn()=>$manager->getConnection()->getSchemaBuilder());
$dispatcher=new Illuminate\Events\Dispatcher($app);$app->instance('events',$dispatcher);Illuminate\Support\Facades\Facade::clearResolvedInstance('events');Illuminate\Support\Facades\Facade::clearResolvedInstance('db');Illuminate\Support\Facades\Facade::clearResolvedInstance('db.schema');
$db=$manager->getConnection();$identity=(array)$db->selectOne('SELECT current_database() as database,inet_server_port() as port');
if($identity['database']!==$connection['database']||(int)$identity['port']!==(int)$connection['port'])throw new RuntimeException('Actual target differs');
if($mode==='--qa'&&(int)$identity['port']!==55441)throw new RuntimeException('QA cannot write active');
if($mode==='--apply-active'&&hash_file('sha256',$root.'/config/inertia.php')!=='80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7')throw new RuntimeException('Containment not applied');
$key=config('app.key');$crypt=new Illuminate\Encryption\Encrypter(str_starts_with($key,'base64:')?base64_decode(substr($key,7),true):$key,config('app.cipher'));Laravel\Fortify\Fortify::encryptUsing($crypt);
$provider=new Laravel\Fortify\TwoFactorAuthenticationProvider(new PragmaRX\Google2FA\Google2FA());$action=new Laravel\Fortify\Actions\EnableTwoFactorAuthentication($provider);
$access=new App\Services\PortalProfileAccess();$engine=new PragmaRX\Google2FA\Google2FA();
$incidentId='ead504de-19c1-4d84-9eca-d5649b8a456a';$correlation=$mode==='--qa'?'1f50aa2c-9063-4de3-aee4-f3b4be2a46c6':$incidentId;
if($db->table('audit_events')->where('source_system','C132-incident-response')->where('correlation_id',$correlation)->exists())throw new RuntimeException('Operation already recorded; inspect before repetition');
$allBefore=$db->table('users')->orderBy('id')->get()->map(fn($u)=>(array)$u)->keyBy('id')->all();
$grantsBefore=$db->table('portal_role_assignments')->orderBy('id')->get()->toJson();$pairBefore=$db->table('portal_superuser_pair')->orderBy('id')->get()->toJson();
$protectedDir=$location.'/'.($mode==='--qa'?'QA-rotation-test':'handoff-affected-users');
if(is_dir($protectedDir)){if($mode!=='--qa'||array_diff(scandir($protectedDir),['.','..'])!==[])throw new RuntimeException('Existing handoff directory; inspect first');}
else mkdir($protectedDir,0700,true);
$checks=[];$users=[];
$capturedCandidates=json_decode(file_get_contents($location.'/secret-candidates-private.json'),true,512,JSON_THROW_ON_ERROR);
$capturedSeeds=array_values(array_map(fn($x)=>strtoupper($x['value']),array_filter($capturedCandidates,fn($x)=>$x['kind']==='MFA_or_other_secret'&&is_string($x['value'])&&preg_match('/^[A-Z2-7]{16,}$/i',$x['value']))));
$db->beginTransaction();
try{
foreach($ids as$id){
$u=App\Models\User::query()->whereKey($id)->lockForUpdate()->firstOrFail();if($u->two_factor_confirmed_at===null||$u->two_factor_secret===null)throw new RuntimeException('MFA state changed');
$oldSecret=$crypt->decrypt($u->two_factor_secret);$oldRecovery=$u->two_factor_recovery_codes;$confirmed=$u->getRawOriginal('two_factor_confirmed_at');$password=$u->getRawOriginal('password');$revision=(int)$u->portal_access_revision;
if($mode==='--apply-active'&&!in_array(strtoupper($oldSecret),$capturedSeeds,true))throw new RuntimeException('Current affected seed no longer matches exposure; stop before commit');
// The existing Fortify force-enrollment action replaces the seed and recovery codes. Keeping the confirmed flag enforces MFA at every login during secure handoff.
$sessionsBefore=$db->table('sessions')->where('user_id',$id)->count();$tokensBefore=$db->getSchemaBuilder()->hasTable('personal_access_tokens')?$db->table('personal_access_tokens')->where('tokenable_type',App\Models\User::class)->where('tokenable_id',$id)->count():0;
$action($u,true);$access->revokeSessions($u);$u->refresh();
$newSecret=$crypt->decrypt($u->two_factor_secret);
if(hash_equals($oldSecret,$newSecret)||$oldRecovery===$u->two_factor_recovery_codes||$u->getRawOriginal('password')!==$password||$u->getRawOriginal('two_factor_confirmed_at')!==$confirmed||(int)$u->portal_access_revision!==$revision+1)throw new RuntimeException('Rotation invariants failed');
$newCode=$engine->getCurrentOtp($newSecret);$oldCode=$engine->getCurrentOtp($oldSecret);
if(!$provider->verify($newSecret,$newCode)||$provider->verify($newSecret,$oldCode))throw new RuntimeException('MFA rotation validation failed');
$uri=$provider->qrCodeUrl(config('app.name'),$u->email,$newSecret);
$svg=(new BaconQrCode\Writer(new BaconQrCode\Renderer\ImageRenderer(new BaconQrCode\Renderer\RendererStyle\RendererStyle(256),new BaconQrCode\Renderer\Image\SvgImageBackEnd())))->writeString($uri);
$name=htmlspecialchars($u->name,ENT_QUOTES,'UTF-8');$email=htmlspecialchars($u->email,ENT_QUOTES,'UTF-8');$secret=htmlspecialchars($newSecret,ENT_QUOTES,'UTF-8');
$html='<!doctype html><html lang="pt"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>C132 MFA conta '.$id.'</title><body><h1>MFA renovado — '.$name.'</h1><p>Conta '.$id.' — '.$email.'</p><p>Entregar exclusivamente ao titular por canal privado. Adicionar no 2FAS Auth uma nova entrada para esta conta no portal ativo. A entrada anterior deixou de funcionar. Nunca enviar este QR/segredo na conversa ou por ligação pública.</p>'.$svg.'<p>Alternativa manual: <code>'.$secret.'</code>. TOTP, SHA-1, 6 dígitos, 30 segundos.</p><p>Depois: login no portal ativo com a password própria e o novo código, abrir o dashboard e confirmar com o responsável. MFA permanece obrigatório; os papéis e a password não mudaram.</p></body></html>';
file_put_contents($protectedDir.'/conta-'.$id.'-2fas-local.html',$html);
$sessionsAfter=$db->table('sessions')->where('user_id',$id)->count();$tokensAfter=$db->getSchemaBuilder()->hasTable('personal_access_tokens')?$db->table('personal_access_tokens')->where('tokenable_type',App\Models\User::class)->where('tokenable_id',$id)->count():0;if($sessionsAfter||$tokensAfter||$u->remember_token!==null)throw new RuntimeException('Revocation incomplete');
$checks[]=['user_id'=>$id,'seed_rotated'=>true,'recovery_codes_rotated'=>true,'old_seed_code_rejected'=>true,'new_seed_code_accepted'=>true,'password_unchanged'=>true,'MFA_required_unchanged'=>true,'access_revision_incremented'=>true,'sessions_revoked'=>$sessionsBefore,'api_tokens_revoked'=>$tokensBefore,'remaining_authenticated_sessions'=>0,'remaining_api_tokens'=>0];
$users[]=['id'=>$id,'name'=>$u->name,'email'=>$u->email,'local_file'=>'conta-'.$id.'-2fas-local.html'];unset($oldSecret,$newSecret,$oldCode,$newCode,$svg,$uri,$secret,$html);
}
$allAfter=$db->table('users')->orderBy('id')->get()->map(fn($u)=>(array)$u)->keyBy('id')->all();
foreach($allBefore as$id=>$before){if(!in_array((int)$id,$ids,true)&&$before!==$allAfter[$id])throw new RuntimeException('Unaffected user changed');}
if($grantsBefore!==$db->table('portal_role_assignments')->orderBy('id')->get()->toJson()||$pairBefore!==$db->table('portal_superuser_pair')->orderBy('id')->get()->toJson())throw new RuntimeException('Roles or pair changed');
$db->table('audit_events')->insert(['source_system'=>'C132-incident-response','entity_type'=>'security_incident','action'=>'C132_affected_MFA_rotated_and_sessions_revoked','data_classification'=>'restricted','actor_user_id'=>null,'correlation_id'=>$correlation,'after_data'=>json_encode(['authorization'=>'Explicit owner instruction in conversation; administrative incident response, no human account impersonated','case'=>'C132','affected_user_ids'=>$ids,'evidence'=>'Current TOTP seeds matched retained QR/secret responses','checks'=>$checks,'new_secret_values_in_audit'=>false,'incident_closed'=>false],JSON_THROW_ON_ERROR)]);
$db->commit();
}catch(Throwable$e){$db->rollBack();throw$e;}
file_put_contents($protectedDir.'/handoff-manifest-private.json',json_encode(['users'=>$users,'files_contain_secrets'=>true,'distribute_only_to_each_legitimate_holder'=>true,'public_URL'=>null],JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));
$result=['at'=>gmdate('c'),'result'=>'passed','mode'=>$mode,'target'=>$identity,'affected_ids'=>$ids,'checks'=>$checks,'roles_and_superuser_pair_unchanged'=>true,'unaffected_users_unchanged'=>true,'app_key_not_rotated'=>true,'MFA_not_disabled'=>true,'no_external_messages_sent'=>true,'secret_values_in_report'=>false,'secure_handoff_required'=>$mode==='--apply-active','backup_sha256'=>$backup['dump_sha256'],'audit_correlation_id'=>$correlation];
file_put_contents(__DIR__.'/'.($mode==='--qa'?'C132-rotation-QA.json':'C132-rotation-active.json'),json_encode($result,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode($result,JSON_THROW_ON_ERROR);
@@ -0,0 +1,82 @@
{
"at": "2026-10-12T19:06:30+00:00",
"result": "passed",
"mode": "--qa",
"target": {
"database": "c132_incident_20261012_190248_test",
"port": 55441
},
"affected_ids": [
14,
15,
16,
17
],
"checks": [
{
"user_id": 14,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
},
{
"user_id": 15,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
},
{
"user_id": 16,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
},
{
"user_id": 17,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
}
],
"roles_and_superuser_pair_unchanged": true,
"unaffected_users_unchanged": true,
"app_key_not_rotated": true,
"MFA_not_disabled": true,
"no_external_messages_sent": true,
"secret_values_in_report": false,
"secure_handoff_required": false,
"backup_sha256": "276426add31685bddabe94cfd80cfa6b4696c5d24d3c9f9ead814cd0ab3dda9d",
"audit_correlation_id": "1f50aa2c-9063-4de3-aee4-f3b4be2a46c6"
}
@@ -0,0 +1,82 @@
{
"at": "2026-10-12T19:06:57+00:00",
"result": "passed",
"mode": "--apply-active",
"target": {
"database": "investemoz",
"port": 5432
},
"affected_ids": [
14,
15,
16,
17
],
"checks": [
{
"user_id": 14,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
},
{
"user_id": 15,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
},
{
"user_id": 16,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
},
{
"user_id": 17,
"seed_rotated": true,
"recovery_codes_rotated": true,
"old_seed_code_rejected": true,
"new_seed_code_accepted": true,
"password_unchanged": true,
"MFA_required_unchanged": true,
"access_revision_incremented": true,
"sessions_revoked": 0,
"api_tokens_revoked": 0,
"remaining_authenticated_sessions": 0,
"remaining_api_tokens": 0
}
],
"roles_and_superuser_pair_unchanged": true,
"unaffected_users_unchanged": true,
"app_key_not_rotated": true,
"MFA_not_disabled": true,
"no_external_messages_sent": true,
"secret_values_in_report": false,
"secure_handoff_required": true,
"backup_sha256": "276426add31685bddabe94cfd80cfa6b4696c5d24d3c9f9ead814cd0ab3dda9d",
"audit_correlation_id": "ead504de-19c1-4d84-9eca-d5649b8a456a"
}
@@ -0,0 +1,28 @@
{
"at": "2026-10-12T19:12:20+00:00",
"target": {
"database": "investemoz",
"port": 5432
},
"cached_config": false,
"route_cache": false,
"APP_ENV": "local",
"session_driver": "database",
"session_cookie": "portal_investidor_https",
"key_fingerprint": "c68aa236a4cd6bf0619c3796dd3898ce834c9af5596a24424d80cda6c204fbc7",
"previous_key_count": 0,
"flags": {
"organization_country_enabled": true,
"profile_access_enabled": true,
"profile_administration_enabled": true,
"opportunity_dashboard_access_enabled": true,
"opportunity_specialized_drafts_enabled": true,
"notifications_enabled": false
},
"backup_verified_at": "2026-10-12T11:10:30+00:00",
"backup_artifacts_hashes_verified": true,
"backup_restore_tables": 295,
"C131_active_hash": "e6bd6d786cb8b0ecfcb1e4bbe6778e2bf1cf5460650db2fd9f0e443e096e7827",
"active_inertia_hash": "80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7",
"build_hash": "e21d388f2e71bcd762c476d3e0bd1ae7c608ca57cafc2381c2a8888ce5d4efbf"
}
@@ -0,0 +1,44 @@
<?php
// Single explicit recipient authorized by the owner. No collective send, queues, secrets in reports, or flags changed.
ini_set('zend.exception_ignore_args','1');
$out=__DIR__;$stage='initial';$accountId=in_array('--account',$argv,true)?(int)($argv[array_search('--account',$argv,true)+1]??0):17;
$recipients=[14=>'aurora.chachuaio@tempo.co.mz',15=>'palmira.matsinhe@tempo.co.mz',16=>'mario.melembe@tempo.co.mz',17=>'info@tempo.co.mz'];
if(!isset($recipients[$accountId])){fwrite(STDERR,'Recipient outside explicitly authorized incident scope');exit(2);}
$recipient=$recipients[$accountId];$attemptFile=$out.'/C132-account'.$accountId.'-email-attempt.json';
if(is_file($attemptFile)){
$previous=json_decode(file_get_contents($attemptFile),true,512,JSON_THROW_ON_ERROR);
if(($argv[1]??'')!=='--retry-before-send'||($previous['stage']??'')!=='SMTP-connect-TLS-auth'||!array_key_exists('outcome_may_be_unknown',$previous)||$previous['outcome_may_be_unknown']!==false){fwrite(STDERR,'Previous attempt requires reconciliation; no message sent');exit(2);}
$archive=$out.'/C132-account17-email-before-send-failure-'.gmdate('Ymd_His').'.json';
if(!rename($attemptFile,$archive))throw new RuntimeException('Cannot preserve previous attempt');
}
set_exception_handler(function(Throwable $e)use(&$stage,$attemptFile){$safe=['at'=>gmdate('c'),'stage'=>$stage,'error_type'=>$e::class,'values_recorded'=>false,'outcome_may_be_unknown'=>$stage==='SMTP-send','automatic_retry'=>false];file_put_contents($attemptFile,json_encode($safe,JSON_PRETTY_PRINT));fwrite(STDERR,json_encode($safe));exit(1);});
$root=dirname(__DIR__,2);require $root.'/vendor/autoload.php';$app=require $root.'/bootstrap/app.php';(new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables)->bootstrap($app);(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);
if(is_file($attemptFile))throw new RuntimeException('Existing attempt; inspect before any resend');
$c=config('database.connections.'.config('database.default'));if($c['database']!=='investemoz'||(int)$c['port']!==5432)throw new RuntimeException('Target mismatch');
$db=new PDO('pgsql:host='.$c['host'].';port='.$c['port'].';dbname='.$c['database'],$c['username'],$c['password'],[PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]);$db->exec('BEGIN READ ONLY');
$query=$db->prepare('SELECT id,name,email,email_verified_at,two_factor_secret FROM users WHERE id=:id');$query->execute(['id'=>$accountId]);$u=$query->fetch(PDO::FETCH_ASSOC);$db->exec('ROLLBACK');
if(!$u||strtolower($u['email'])!==$recipient||$u['email_verified_at']===null)throw new RuntimeException('Verified recipient mismatch');
$loc=json_decode(ltrim(file_get_contents($out.'/C132-private-location.json'),"\xEF\xBB\xBF"),true,512,JSON_THROW_ON_ERROR)['private_directory'];
$file=$loc.'/handoff-affected-users/conta-'.$accountId.'-2fas-local.html';$html=file_get_contents($file);if(preg_match_all('/<code>([A-Z2-7]{16,})<\/code>/',$html,$matches)!==1)throw new RuntimeException('Handoff format differs');
$key=config('app.key');$crypt=new Illuminate\Encryption\Encrypter(str_starts_with($key,'base64:')?base64_decode(substr($key,7),true):$key,config('app.cipher'));
if(!hash_equals($crypt->decrypt($u['two_factor_secret']),$matches[1][0]))throw new RuntimeException('Handoff does not match current MFA');unset($html,$matches);
$smtp=config('mail.mailers.smtp');if(empty($smtp['host'])||empty($smtp['username'])||empty($smtp['password'])||!empty($smtp['url']))throw new RuntimeException('Explicit SMTP required');
// SocketStream::isTLS describes the implicit TLS setting, not a subsequent STARTTLS negotiation.
// Inspect only negotiated cryptography metadata; never expose the SMTP debug buffer.
$transport=new Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport($smtp['host'],(int)$smtp['port'],(int)$smtp['port']===465);
$transport->setUsername($smtp['username'])->setPassword($smtp['password'])->setRequireTls(true)->setAutoTls(true);
$transport->getStream()->setTimeout(20)->setStreamOptions(['ssl'=>['verify_peer'=>true,'verify_peer_name'=>true,'allow_self_signed'=>false,'peer_name'=>$smtp['host'],'crypto_method'=>STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT|(defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT')?STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT:0)]]);
$transport->setLocalDomain($smtp['local_domain']?:'portal-investidor.test');
$from=config('mail.from');if(!filter_var($from['address'],FILTER_VALIDATE_EMAIL))throw new RuntimeException('Invalid sender');
$body="Ao gestor da conta corporativa info@tempo.co.mz,\n\nPor instrução do responsável da Tempo, enviamos individualmente a nova entrada 2FAS da conta 17 do Portal InvesteMoz ativo. O anexo pertence exclusivamente a esta conta e substitui a entrada anterior, renovada na resposta ao incidente C132. A password existente mantém-se.\n\n1. Abra o anexo localmente, num equipamento sob o seu controlo.\n2. No 2FAS Auth, adicione a nova entrada pelo QR ou pela alternativa manual do próprio anexo. Pode continuar a usar o 2FAS Auth.\n3. Na máquina onde o portal está disponível, abra https://portal-investidor.test/login, use a password própria e o código do novo autenticador; depois abra /dashboard. Não use as contas ou portas QA para esta validação.\n4. Responda apenas: conta 17 — recebido, MFA configurado e dashboard acessível; ou o texto de um erro sem dados sensíveis.\n\nO anexo contém um segredo de autenticação: mantenha-o privado e não o reencaminhe. Não responda com QR, password, segredo, código MFA ou códigos de recuperação. Após configurar, guarde os códigos de recuperação novos pelo fluxo autenticado do portal.\n\nA confirmação do gestor é necessária para registar recuperação do acesso; o envio deste email, por si só, não a comprova.\n\nTempo Lda — Portal InvesteMoz\n";
$body=str_replace(['Ao gestor da conta corporativa info@tempo.co.mz,','conta 17','conta 17 —'],['Ao titular '.$u['name'].' ('.$recipient.'),','conta '.$accountId,'conta '.$accountId.' —'],$body);
$email=(new Symfony\Component\Mime\Email())->from(new Symfony\Component\Mime\Address($from['address'],$from['name']))->to($recipient)->subject('InvesteMoz C132 — nova entrada 2FAS individual da conta '.$accountId)->text($body)->attachFromPath($file,'InvesteMoz-conta-'.$accountId.'-2FAS.html','text/html');
$email->getHeaders()->addIdHeader('Message-ID','c132-account'.$accountId.'-20261012-'.bin2hex(random_bytes(12)).'@'.substr(strrchr($from['address'],'@'),1));
$stage='SMTP-connect-TLS-auth';$transport->start();
$socket=(new ReflectionProperty(Symfony\Component\Mailer\Transport\Smtp\Stream\AbstractStream::class,'stream'))->getValue($transport->getStream());
$tls=stream_get_meta_data($socket)['crypto']??[];unset($socket);
if(empty($tls['protocol'])||!str_starts_with($tls['protocol'],'TLS'))throw new RuntimeException('TLS not established');
$stage='SMTP-send';file_put_contents($attemptFile,json_encode(['at'=>gmdate('c'),'account_id'=>$accountId,'recipient'=>$recipient,'stage'=>'SMTP-send-started','automatic_retry'=>false,'private_attachment'=>true,'values_recorded'=>false],JSON_PRETTY_PRINT));
$sent=$transport->send($email);$transport->stop();if(!$sent)throw new RuntimeException('No SMTP acceptance receipt');
$proof=['at'=>gmdate('c'),'account_id'=>$accountId,'recipient'=>$recipient,'recipient_count'=>1,'CC_BCC'=>0,'transport'=>'existing_corporate_SMTP','TLS_required_and_certificate_verified'=>true,'negotiated_TLS_protocol'=>$tls['protocol'],'SMTP_accepted'=>true,'message_id'=>$sent->getMessageId(),'private_attachment_count'=>1,'attachment_contains_secret'=>true,'attachment_or_secret_values_in_chat_or_report'=>false,'owner_authorization'=>$accountId===17?'Explicit owner reply: send email to info@tempo.co.mz, corporate manager will reply':'Explicit owner reply: send three separate emails to respective corporate addresses with mandatory TLS','mailbox_receipt_confirmed'=>false,'holder_authentication_confirmed'=>false,'notifications_flag_changed'=>false,'C131_included'=>false];
file_put_contents($attemptFile,json_encode($proof,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));file_put_contents($out.'/C132-account'.$accountId.'-email-receipt.json',json_encode($proof,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode($proof,JSON_THROW_ON_ERROR);
@@ -0,0 +1,168 @@
{
"at": "2026-10-12T19:46:07+00:00",
"rotation_at": "2026-10-12T19:06:57+00:00",
"read_only": true,
"sensitive_payloads_in_report": false,
"targets": {
"active": {
"identity": {
"database": "investemoz",
"port": 5432
},
"accounts": [
{
"id": 14,
"name": "Aurora Chachuaio",
"email": "aurora.chachuaio@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": true,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
},
{
"id": 15,
"name": "Palmira Uamusse",
"email": "palmira.matsinhe@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": true,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
},
{
"id": 16,
"name": "Mario Melembe",
"email": "mario.melembe@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": true,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
},
{
"id": 17,
"name": "Tempo Lda",
"email": "info@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": true,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
}
],
"all_session_rows_examined": 14,
"unreadable_payloads": 0,
"post_rotation_bindings_not_deleted": 0,
"audit_events_examined": 130
},
"restored_snapshot": {
"identity": {
"database": "c132_incident_20261012_190248_test",
"port": 55441
},
"accounts": [
{
"id": 14,
"name": "Aurora Chachuaio",
"email": "aurora.chachuaio@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": null,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
},
{
"id": 15,
"name": "Palmira Uamusse",
"email": "palmira.matsinhe@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": null,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
},
{
"id": 16,
"name": "Mario Melembe",
"email": "mario.melembe@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": null,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
},
{
"id": 17,
"name": "Tempo Lda",
"email": "info@tempo.co.mz",
"contact_verified": true,
"MFA_required": true,
"access_revision": 1,
"remember_token_null": true,
"handoff_matches_current_MFA": null,
"sessions": {
"authenticated_rows": 0,
"authenticated_payloads": 0,
"pending_MFA": 0,
"stale_before_rotation": 0,
"revision_mismatch": 0
}
}
],
"all_session_rows_examined": 19,
"unreadable_payloads": 0,
"post_rotation_bindings_not_deleted": 0,
"audit_events_examined": 129
}
}
}
@@ -0,0 +1,18 @@
{
"at": "2026-10-12T19:43:35+00:00",
"target": {
"database": "c132_incident_20261012_190248_test",
"port": 55441
},
"active_writes": 0,
"result": "passed",
"nonempty_authenticated_session_removed": true,
"unaffected_session_preserved": true,
"remember_me_invalidated": true,
"access_revision_incremented": true,
"existing_middleware_rejected_stale_session_401": true,
"session_data_invalidated": true,
"fixtures_rolled_back": true,
"no_MFA_rotation_repeated": true,
"browser_holder_access_confirmed": false
}
@@ -0,0 +1,28 @@
<?php
// Meaningful nonempty-session revocation and stale-binding rejection, in the guarded restored QA transaction only.
ini_set('zend.exception_ignore_args','1');set_exception_handler(function(Throwable $e){fwrite(STDERR,json_encode(['error_type'=>$e::class,'line'=>$e->getLine(),'values_recorded'=>false]));exit(1);});
$root=dirname(__DIR__,2);require $root.'/vendor/autoload.php';$app=require $root.'/bootstrap/app.php';(new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables)->bootstrap($app);(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);
$proof=json_decode(file_get_contents(__DIR__.'/C132-backup-restoration.json'),true,512,JSON_THROW_ON_ERROR);$c=config('database.connections.'.config('database.default'));
$c=[...$c,'host'=>'127.0.0.1','port'=>55441,'database'=>$proof['restore_target']['database'],'username'=>'postgres','password'=>'','url'=>null];if(!preg_match('/^c132_incident_\d{8}_\d{6}_test$/',$c['database']))throw new RuntimeException('QA name refused');
$m=new Illuminate\Database\Capsule\Manager($app);$m->addConnection($c);$m->setAsGlobal();$m->bootEloquent();Illuminate\Support\Facades\Facade::setFacadeApplication($app);$app->instance('db',$m->getDatabaseManager());$app->bind('db.schema',fn()=>$m->getConnection()->getSchemaBuilder());$app->instance('events',new Illuminate\Events\Dispatcher($app));
$db=$m->getConnection();$id=(array)$db->selectOne('SELECT current_database() AS database,inet_server_port() AS port');if($id['database']!==$c['database']||(int)$id['port']!==55441)throw new RuntimeException('Active write denied');
$originalSessions=$db->table('sessions')->orderBy('id')->get()->toJson();$originalUsers=$db->table('users')->orderBy('id')->get()->toJson();
$db->beginTransaction();try{
$user=App\Models\User::findOrFail(14);$rev=(int)$user->portal_access_revision;$affected=bin2hex(random_bytes(20));$unaffected=bin2hex(random_bytes(20));
$db->table('sessions')->insert([['id'=>$affected,'user_id'=>14,'payload'=>base64_encode(json_encode(['portal.access_revision'=>$rev])),'last_activity'=>time()],['id'=>$unaffected,'user_id'=>13,'payload'=>base64_encode(json_encode(['portal.access_revision'=>0])),'last_activity'=>time()]]);
$db->table('users')->where('id',14)->update(['remember_token'=>bin2hex(random_bytes(30))]);
$access=new App\Services\PortalProfileAccess();$access->revokeSessions($user);$user->refresh();
if($db->table('sessions')->where('id',$affected)->exists()||!$db->table('sessions')->where('id',$unaffected)->exists()||(int)$user->portal_access_revision!==$rev+1||$user->remember_token!==null)throw new RuntimeException('Revocation invariants failed');
// Execute the existing middleware with an actual session store; replace only the transport response/authentication sink.
$session=new Illuminate\Session\Store('C132_QA',new Illuminate\Session\ArraySessionHandler(120));$session->start();$session->put('portal.access_revision',$rev);
$request=Illuminate\Http\Request::create('/dashboard','GET',server:['HTTP_ACCEPT'=>'application/json']);$request->setLaravelSession($session);$request->setUserResolver(fn()=>$user);
$app->instance(App\Services\PortalProfileAccess::class,$access);$loggedOut=false;
$guard=Mockery::mock(Illuminate\Contracts\Auth\StatefulGuard::class);$guard->shouldReceive('logout')->once()->andReturnUsing(function()use(&$loggedOut){$loggedOut=true;});
$auth=Mockery::mock(Illuminate\Contracts\Auth\Factory::class);$auth->shouldReceive('guard')->with('web')->once()->andReturn($guard);Illuminate\Support\Facades\Auth::swap($auth);
$responses=Mockery::mock(Illuminate\Contracts\Routing\ResponseFactory::class);$responses->shouldReceive('json')->with(Mockery::type('array'),401)->once()->andReturnUsing(fn($body,$status)=>new Illuminate\Http\JsonResponse($body,$status));$app->instance(Illuminate\Contracts\Routing\ResponseFactory::class,$responses);
$result=(new App\Http\Middleware\PortalProfileSession())->handle($request,fn()=>throw new RuntimeException('Stale session reached dashboard'));
if($result->getStatusCode()!==401||!$loggedOut||$session->has('portal.access_revision'))throw new RuntimeException('Stale session not invalidated');
Mockery::close();$db->rollBack();
}catch(Throwable $e){$db->rollBack();throw$e;}
if($originalSessions!==$db->table('sessions')->orderBy('id')->get()->toJson()||$originalUsers!==$db->table('users')->orderBy('id')->get()->toJson())throw new RuntimeException('QA fixture rollback incomplete');
$out=['at'=>gmdate('c'),'target'=>$id,'active_writes'=>0,'result'=>'passed','nonempty_authenticated_session_removed'=>true,'unaffected_session_preserved'=>true,'remember_me_invalidated'=>true,'access_revision_incremented'=>true,'existing_middleware_rejected_stale_session_401'=>true,'session_data_invalidated'=>true,'fixtures_rolled_back'=>true,'no_MFA_rotation_repeated'=>true,'browser_holder_access_confirmed'=>false];file_put_contents(__DIR__.'/C132-session-revocation-QA.json',json_encode($out,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode($out);
@@ -0,0 +1,47 @@
from pathlib import Path
from datetime import datetime,timezone
import json,hashlib,shutil
OUT=Path(__file__).resolve().parent;ROOT=OUT.parents[1];DOC=ROOT/'docs/investmoz/v2/auditoria-portal';REVIEW=OUT/'para-revisao'
note='''<!-- C132-contained-20261012 -->
## C132 contido no ativo — incidente ainda aberto
Autorização específica do responsável executada: apenas `config/inertia.php`, DevTools OFF desde 12/10 18:57:15 UTC. HTTP anónimo index/detalhe real/detalhe arbitrário **404**. Login **200** e confirmação manual de **login, MFA e dashboard**. C131 não aplicado; COUNTRY02, papéis, bundle, chave/cifra, A/B e C37 preservados.
276 diagnósticos em 279 ficheiros preservados restritamente. Cookies/passwords/tokens mascarados nos exemplares retidos, mas quatro sementes TOTP e 32 códigos de recuperação correspondentes às contas 14–17 foram expostos: renovados seletivamente, obrigatoriedade MFA preservada. Zero correspondências entre os valores retidos e as credenciais atuais. Backup/restauro do destino renovado antes da resposta às credenciais, 295 tabelas/31 sequências, clone isolado 55441. Restam entrega individual das novas entradas e delimitação histórica; **não declarar fecho do incidente**.
[Relatório de contenção, alcance, período, provas e medidas restantes](C132-incidente-contido.md). Os retratos anteriores de C132 exposto abaixo são histórico anterior à contenção, não o estado atual. A matriz existente mantém os IDs; AUD-PROFILE-26 passa a parcial, sem fecho da privacidade integral.
<!-- /C132-contained-20261012 -->
'''
for name in ['relatorio-executivo.md','backlog.md','plano-ativacao.md','casos-reproducao.md','registo-constrangimentos.md']:
p=DOC/name;s=p.read_text(encoding='utf-8');assert '<!-- C132-contained-20261012 -->' not in s
p.write_text(note+s,encoding='utf-8')
p=DOC/'visao-consolidada-modulos.md';s=p.read_text(encoding='utf-8')
s=s.replace('C132 expõe diagnósticos no ativo e tem prioridade P0; a correção está apenas em QA.','C132 foi contido no ativo por autorização específica: endpoints anónimos 404, quatro MFA afetadas renovadas. O incidente continua aberto; C131 permanece apenas em QA.')
s=s.replace('C132 ativo com exposição anónima.','C132 ativo contido; entrega individual das novas entradas MFA e investigação ainda pendentes.')
s=s.replace('**Ativo continua exposto: a correção QA não o protege.** Próxima disponibilização deverá tratar C132 como contenção prioritária, com backup correspondente e autorização própria; preservar diagnósticos restritamente, nunca distribuí-los no ZIP. Este lote não altera o ativo nem recomenda restaurar uma configuração que reabra a exposição.','**Suplemento autorizado de 12/10 18:57:15 UTC: ativo contido, endpoints 404.** A análise local confirmou quatro sementes e 32 códigos de recuperação válidos antes da resposta: renovados apenas para 14–17. Registos com ACL restrita, backup/restauro renovado e login/MFA/dashboard confirmado pelo responsável. Incidente permanece aberto; consultar [relatório específico](C132-incidente-contido.md). A descrição acima conserva a prova anterior à contenção. Não restaurar uma configuração que reabra a exposição.')
s=s.replace('o próximo delta técnico é a correção de C131/C132.','C132 foi disponibilizado separadamente sob autorização específica; C131 permanece o próximo delta QA separado.')
s=s.replace('315 parciais; 2 com falha','316 parciais; 1 com falha')
s=s.replace('Duas correções PHP QA, zero alterações de schema, flags, serviços ou bundle.','C131 permanece correção PHP QA. C132: uma configuração PHP aplicada no ativo e quatro credenciais MFA renovadas por resposta autorizada ao incidente; zero alterações de schema, flags, serviços ou bundle.')
s=s.replace('O backup/restauro de 12/10 11:10:30 UTC é da entrega ativa anterior (295 tabelas, 31 sequências, 1.391 ficheiros); não alegar que foi renovado para este delta QA.','O backup/restauro de 12/10 11:10:30 UTC é da entrega ativa anterior; C132 tem novo dump/restauro de 19:02:57 UTC (295 tabelas/31 sequências) e recuperação da configuração/cifra em armazenamento restrito. Não reutilizar segredos comprometidos na reversão.')
p.write_text(note+s,encoding='utf-8')
for src,dst in {'relatorio-executivo.md':'relatorio-executivo.md','backlog.md':'backlog.md','plano-ativacao.md':'plano-das-correcoes.md','casos-reproducao.md':'casos-reproducao.md','registo-constrangimentos.md':'constrangimentos.md','visao-consolidada-modulos.md':'visao-consolidada-modulos.md','C132-incidente-contido.md':'C132-incidente-contido.md'}.items():
s=(DOC/src).read_text(encoding='utf-8').replace('(plano-ativacao.md)','(plano-das-correcoes.md)').replace('(registo-constrangimentos.md)','(constrangimentos.md)').replace('(demonstracao-auditoria-atual.md)','(roteiro-qa.md)')
s=s.replace('../../../../outputs/investmoz-audit-current-20261012/manifesto-correcoes-qa.json','manifesto-correcoes-qa.json')
for name in ['contact-normalization-http.json','devtools-isolation-http.json','C132-active-readonly.json']:s=s.replace('../../../../outputs/investmoz-audit-current-20261012/'+name,'evidencias/'+name)
(REVIEW/dst).write_text(s,encoding='utf-8')
names=['C132-containment.json','C132-http-contained.json','C132-local-analysis.json','C132-usability.json','C132-usability-before-snapshot.json','C132-usability-after-rotation.json','C132-rotation-QA.json','C132-rotation-active.json','C132-backup-restoration.json','C132-manual-auth-confirmation.json','C132-audit-record.json','C132-ACL-verification.json','C132-exposure-period.json']
for n in names:shutil.copyfile(OUT/n,REVIEW/'evidencias'/n)
proof={'case':'C132','state':'contained_incident_open','at':datetime.now(timezone.utc).isoformat(),'owner_authorization':'Explicit incident-response instruction in this conversation',
'application_files':[{'path':'config/inertia.php','before_sha256':'45994a9035e8e10d2fbb82f9fc18756cfb1ba403c9597d334122181b6b29839b','after_sha256':'80c68e12bf6cb64e39931e2467b43909893cea3eb6d04c3c1e68bdcb1236dfb7'}],
'C131_applied':False,'schema_changes':0,'flags_changes':0,'bundle_changes':0,'services_changes':0,'active_MFA_credentials_rotated_user_ids':[14,15,16,17],'app_key_rotated':False,
'authenticated_sessions_deleted':0,'API_tokens_deleted':0,'remember_me_invalidated_and_access_revision_incremented':True,'roles_and_other_accounts_unchanged':True,'private_secrets_or_diagnostics_attached':False,
'proofs':{n:hashlib.sha256((OUT/n).read_bytes()).hexdigest() for n in names},'rollback':'Never re-enable anonymous diagnostics or restore compromised seeds; full restoration requires a separate decision.'}
(OUT/'C132-manifesto-contencao.json').write_text(json.dumps(proof,ensure_ascii=False,indent=2),encoding='utf-8');shutil.copyfile(OUT/'C132-manifesto-contencao.json',REVIEW/'C132-manifesto-contencao.json')
groups=json.loads((OUT/'proof-groups.json').read_text(encoding='utf-8'));g=next(g for g in groups['groups'] if g['group']=='C132');g['sources']+=[{'file':n,'sha256':proof['proofs'][n]} for n in names]
g['criteria_covered']+=' Suplemento autorizado: ativo 404 em index/detalhes, dados restritos, MFA afetadas renovadas/revogação seletiva, backup/restauro ativo e login/MFA/dashboard confirmado manualmente.'
g['criteria_not_covered']='Incidente ainda aberto: entrega dos novos autenticadores e confirmação individual, início exato/todos os acessos anteriores indeterminados; privacidade geral não encerrada.'
(OUT/'proof-groups.json').write_text(json.dumps(groups,ensure_ascii=False,indent=2),encoding='utf-8')
counts=json.loads((OUT/'module-counts.json').read_text(encoding='utf-8'));counts['states']=json.loads((OUT/'reconciliation-summary.json').read_text(encoding='utf-8'))['states'];(OUT/'module-counts.json').write_text(json.dumps(counts,ensure_ascii=False,indent=2),encoding='utf-8')
p=REVIEW/'LEIA-ME.md';s=p.read_text(encoding='utf-8');s=note+s;s=s.replace('correção QA não aplicada no ativo.','contenção mínima C132 agora aplicada separadamente no ativo; incidente permanece aberto.');p.write_text(s,encoding='utf-8')
print(json.dumps({'reports_updated':True,'private_values_excluded':True,'C132_only':True,'incident_closed':False}))

Some files were not shown because too many files have changed in this diff Show More