// tech stack
// the challenge
Local privilege-escalation scanners tend to produce noise: a SUID binary with a group-writable parent directory and a sudo rule that ends in a wildcard quoted as critical, even when no unprivileged account can actually use them. On containers with remapped UID ownership the problem is worse — host-owned files suddenly look attacker-writable, and a report full of false positives is worse than no report at all.
// the solution
All permission logic lives in one evaluator (core/permissions.py). It models an identity context — effective UID, effective GID, supplementary groups and namespace trust — then classifies a path from its mode, ownership and full parent chain, with sticky-directory and symlink handling. Group-write becomes a finding only if the group has a member outside the trust set, so "world-writable" is replaced by "reachable by this identity". Container and user-namespace detection qualifies or suppresses ownership findings and records the limitation in every output. Checks are small modules on a shared runner with per-check timeouts; rules live in data/rules.json and can be explained from the CLI.
// measurable impact
A single command gives a reviewable picture of a host: 14 checks with severity, evidence, confidence and coverage limits, exportable as JSON, SARIF for GitHub code scanning, Markdown for tickets or a self-contained HTML page. The absence of third-party dependencies means the tool can be copied onto a hardened host and run without a package manager, and the CI matrix keeps the behaviour identical across Python 3.10 to 3.13 with Ruff, mypy and a packaging smoke test.
- Timeline
- Jul 2026 – Aug 2026
- Team
- Solo
- Role
- Architecture, permission engine, 14 checks, reporting formats, test suite, packaging and CI
// key highlights
- ◆Single permission evaluator shared by every permission-sensitive check — evidence instead of mode-bit guessing
- ◆Identity-aware verdicts: group-write only confirmed with an untrusted group member, sticky-bit aware parent walk
- ◆Container and user-namespace awareness that qualifies ownership findings instead of producing false positives
- ◆14 modular checks on a runner with per-check timeouts, profiles and exclude lists
- ◆Five output formats including SARIF for GitHub code scanning and a standalone HTML report
- ◆Zero runtime dependencies; CI runs unittest on Python 3.10–3.13 plus Ruff, mypy and a wheel build
// implementation sample
def system_group_members(gid: int) -> set[int]:
"""Resolve both primary and supplementary members of a Unix group."""
try:
members = {account.pw_uid for account in pwd.getpwall() if account.pw_gid == gid}
except OSError:
members = set()
try:
names = grp.getgrgid(gid).gr_mem
except KeyError:
names = ()
for name in names:
try:
members.add(pwd.getpwnam(name).pw_uid)
except KeyError:
continue
return members
def assess_path(
path: str | Path,
*,
identity: IdentityContext | None = None,
follow_symlinks: bool = True,
group_members: Callable[[int], set[int]] = system_group_members,
) -> PermissionAssessment:
identity = identity or IdentityContext.current()
target = Path(path)
try:
info = target.stat() if follow_symlinks else target.lstat()
except FileNotFoundError:
return PermissionAssessment(str(target), False, error="not found")