Skip to content

Commit ce1a40c

Browse files
ci: which tree a confined program of this system reads to start, measured when the test fails
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent 47fdacf commit ce1a40c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,18 @@ jobs:
257257
run: |
258258
log show --last 10m --style compact --predicate 'eventMessage CONTAINS "deny("' 2>/dev/null \
259259
| grep -E 'openkal|conformance' | tail -80 || true
260+
log show --last 10m --style compact --predicate 'process == "openkal_0_23" OR eventMessage CONTAINS[c] "ignition"' \
261+
2>/dev/null | tail -60 || true
262+
# The confinement's rule for reading, given a system program, and
263+
# then with each of a few trees allowed beside it: which one a
264+
# program of this system needs to start.
265+
base='(subpath "/System") (subpath "/usr/lib") (subpath "/usr/share") (subpath "/private/var/db/dyld") (subpath "/private/preboot/Cryptexes") (subpath "/Library/Apple") (subpath "/dev") (literal "/bin/echo")'
266+
for extra in '' '(subpath "/private/preboot")' '(subpath "/private/var")' '(subpath "/private/etc")' \
267+
'(subpath "/Library")' '(subpath "/usr")' '(subpath "/private")' '(subpath "/")'; do
268+
p="(version 1)(allow default)(deny file-read-data (require-not (require-any $base $extra)))"
269+
if out=$(sandbox-exec -p "$p" /bin/echo started 2>&1); then r=ok; else r="ended $?"; fi
270+
echo " with ${extra:-nothing beside}: $r $out"
271+
done
260272
for f in "$HOME"/Library/Logs/DiagnosticReports/*.ips; do
261273
[ -f "$f" ] || continue
262274
echo "--- $f"; head -c 6000 "$f"; echo

0 commit comments

Comments
 (0)