mirror of
https://github.com/Heretek-Games/flatpark.git
synced 2026-10-12 02:05:52 +00:00
fix(audit): exempt declared sandbox-escape perms from hard fail
An escape permission listed in policy.dangerous_permissions is an explicit, reviewed exemption; downgrade it from FAIL to WARN so it stays visible without blocking the gate. Undeclared escape perms still hard-fail. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
+3
-2
@@ -73,8 +73,9 @@ artifact provenance tier (1/2/3).
|
||||
only); `archive` → `sha256` + genuine-upstream URL; `extra-data` → `sha256` +
|
||||
non-zero `size`; `file` → local, reviewed as part of the PR; other → NEEDS-HUMAN.
|
||||
- **finish-args risk scan:** near-auto-reject on escape perms
|
||||
(`--talk-name=org.freedesktop.Flatpak`, `--filesystem=host`, `--filesystem=/`);
|
||||
warn on `--device=all`, `--filesystem=home`, needless `--share=network`.
|
||||
(`--talk-name=org.freedesktop.Flatpak`, `--filesystem=host`, `--filesystem=/`)
|
||||
unless declared in `policy.dangerous_permissions` (then a reviewed exemption →
|
||||
warn); warn on `--device=all`, `--filesystem=home`, needless `--share=network`.
|
||||
- **`policy:` block vs reality:** `proprietary` accurate; `dangerous_permissions`
|
||||
covers the high-risk finish-args actually used (hard enforcement deferred — see
|
||||
guardrail G2(b)).
|
||||
|
||||
@@ -172,7 +172,12 @@ const ESCAPE = ['--talk-name=org.freedesktop.Flatpak', '--filesystem=host', '--f
|
||||
// G2(b) — broad perms must be declared in policy.dangerous_permissions (warn until schema lands).
|
||||
const WATCH = ['--device=all', '--filesystem=home'];
|
||||
for (const fa of finishArgs) {
|
||||
if (ESCAPE.includes(fa)) fail(`sandbox-escape permission: ${fa}`);
|
||||
if (ESCAPE.includes(fa)) {
|
||||
// A declared escape permission is an explicit, reviewed exemption: downgrade
|
||||
// the hard fail to a warning so it stays visible without blocking the gate.
|
||||
if (dangerousPerms.includes(fa)) warn(`sandbox-escape permission ${fa} (declared in policy.dangerous_permissions)`);
|
||||
else fail(`sandbox-escape permission: ${fa}`);
|
||||
}
|
||||
if (WATCH.includes(fa) && !dangerousPerms.includes(fa)) {
|
||||
warn(`dangerous permission ${fa} not declared in policy.dangerous_permissions`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user