fix(sandbox): preserve failed Railway audit appends

This commit is contained in:
serrrfirat
2026-08-21 15:16:07 +03:00
parent 23013c537d
commit 85af90c0ab
2 changed files with 4 additions and 2 deletions

View File

@@ -117,7 +117,7 @@ drain_proxy_audit() {
rm -f "$audit_append" "$audit_capture"
return 1
fi
cat "$audit_append" >> "$audit_log"
cat "$audit_append" >> "$audit_log" || return 1
chmod 600 "$audit_log"
rm -f "$audit_append" "$audit_capture"
if [ -n "$last_record" ]; then

View File

@@ -694,7 +694,9 @@ async fn ephemeral_worker_uses_managed_proxy_and_hardened_private_network() {
&& RAILWAY_MANAGED_EGRESS_WRAPPER
.contains("for audit_file in \"$material\"/audit/proxy.log*; do")
&& RAILWAY_MANAGED_EGRESS_WRAPPER
.contains("if [ \"$audit_total\" -gt 268435456 ]; then"),
.contains("if [ \"$audit_total\" -gt 268435456 ]; then")
&& RAILWAY_MANAGED_EGRESS_WRAPPER
.contains("cat \"$audit_append\" >> \"$audit_log\" || return 1"),
"Railway audit append must fail closed before aggregate retained evidence exceeds 256 MiB"
);
assert!(