Skip to content

Policy: what TK-A075 to TK-A078 don't read yet (logins, setuid, startup files) #804

Closed

Description

@LoopGlitch26

TK-A075 to TK-A078 (from #752, landed in #799) hold logins, account-file writes, setuid bits and startup-file network shells. Their limits row in docs/limits.md lists what they don't read yet. Each item below is a self-contained change, one PR per item is fine, and several people can take different items.

Not held yet (each is flagged by TK-F011 or allowed today)

  1. macOS's own account tools (TK-A075): sysadminctl -addUser … -admin, dseditgroup -o edit -a <user> -t user admin, and dscl writes other than user records (e.g. appending to /Groups/admin's GroupMembership).
  2. A here-document written to a startup file (TK-A078): cat >> ~/.bashrc <<'EOF' whose body starts a network shell. The rule reads a command's words, and a here-document's body is its input, so this needs the body read the way the rule reads a line (see how other rules reach here-document text).
  3. The 128-character window and the four-word nc limit (TK-A078): a network shell further than 128 characters from the write, or nc with more than four words before its exec option. Widen these only with linear patterns (the speed test in tests/test_policy2.py must pass at 64 KiB on the fallback engine).
  4. More setuid spellings (TK-A077): install -m 4755 … (any setuid/setgid mode through install -m/--mode), and setcap granting cap_setuid, cap_setgid or cap_sys_admin.
  5. Other startup files (TK-A078, TK-A011): shell writes to /etc/profile, /etc/profile.d/*.sh, /etc/zsh/zshrc, ~/.bash_logout, ~/.kshrc; macOS cron tabs (/usr/lib/cron/tabs/<user>, /var/at/tabs/<user>).

Held though harmless

  1. A project's own etc/passwd or etc/group (TK-A076): echo x > ./etc/passwd or cp fixtures/passwd tests/etc/passwd is held because the rule reads the path's end. Anchor it to the real /etc (keeping //etc, /etc/./, /etc/../etc held).

Done when (for any item)

  • The new calls are added to tests/data/policy/deny/shell.jsonl (or fs.jsonl) and a benign twin to benign/, and the test in tests/test_signer_policy.py covers them on every pack and both engines.
  • Nothing gets looser: decide tests/data/policy and the E21 corpora before and after.
  • The pack version is bumped, the evals re-recorded (python eval/e17_policy_corpus.py, python eval/e21_policy_robustness.py, python eval/e21_robustness.py), and the limits row updated to match.

Commits need a DCO sign-off (git commit -s).

Activity

  1. 60507 commented on Nov 14, 2026

    @60507
    Contributor

    I'd like to claim item 4 (\TK-A077: \install -m/--mode\ setuid/setgid modes and \setcap\ \cap_setuid/\cap_setgid/\cap_sys_admin). I have a fix, tests, docs, and updated evals ready to open as a PR.

  2. LoopGlitch26 commented on Nov 14, 2026

    @LoopGlitch26
    MemberAuthor

    Item 4 is yours, thanks, and #834 is the PR for it. Policy PRs merge right after the coming release, because it changes the same packs, so pack versions and eval results get settled at merge. I'll review #834 before then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions