bash-classify 0.12.0__tar.gz → 0.13.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bash_classify-0.12.0 → bash_classify-0.13.1}/.claude-plugin/marketplace.json +1 -1
- {bash_classify-0.12.0 → bash_classify-0.13.1}/.gitignore +3 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/PKG-INFO +13 -3
- {bash_classify-0.12.0 → bash_classify-0.13.1}/README.md +12 -2
- {bash_classify-0.12.0 → bash_classify-0.13.1}/SPEC.md +84 -18
- {bash_classify-0.12.0 → bash_classify-0.13.1}/coding-agent-plugins/claude-code/.claude-plugin/plugin.json +1 -1
- {bash_classify-0.12.0 → bash_classify-0.13.1}/docs/classification-guidance.md +13 -2
- {bash_classify-0.12.0 → bash_classify-0.13.1}/schemas/command.schema.json +5 -1
- bash_classify-0.13.1/src/bash_classify/__init__.py +60 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/classifier.py +158 -10
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/cli.py +7 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/cp.yaml +3 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/curl.yaml +2 -2
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/git.yaml +2 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/mv.yaml +3 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/sort.yaml +2 -2
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/unzip.yaml +1 -0
- bash_classify-0.13.1/src/bash_classify/commands/wget.yaml +12 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/database.py +1 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/matcher.py +59 -9
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/models.py +57 -7
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/sensitive.py +31 -1
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/test_classifier.py +450 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/test_cli.py +119 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/test_cli_serialization.py +51 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/test_database.py +48 -0
- bash_classify-0.13.1/tests/test_output_paths.py +218 -0
- bash_classify-0.13.1/tests/test_public_api.py +77 -0
- bash_classify-0.12.0/src/bash_classify/__init__.py +0 -28
- bash_classify-0.12.0/src/bash_classify/commands/wget.yaml +0 -7
- {bash_classify-0.12.0 → bash_classify-0.13.1}/.claude/rules/command-database.md +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/.editorconfig +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/.github/workflows/ci.yml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/.github/workflows/publish.yml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/.python-version +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/CLAUDE.md +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/LICENSE +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/coding-agent-plugins/claude-code/hooks/hook-permission-request.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/coding-agent-plugins/claude-code/hooks/hook-pre-tool-use.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/coding-agent-plugins/claude-code/hooks/hooks.json +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/pyproject.toml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/ruff.toml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/schemas/match-rules.schema.json +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/schemas/sensitive-paths.schema.json +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/__main__.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/agent-browser.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/apt.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/awk.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/basename.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/bash-classify.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/bash.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/black.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/brew.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/builtin.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/cargo.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/cat.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/chgrp.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/chmod.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/chown.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/column.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/comm.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/command.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/cut.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/date.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/df.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/diff.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/dig.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/dirname.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/docker.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/du.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/echo.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/env.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/eslint.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/eval.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/exec.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/expand.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/false.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/file.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/find.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/fmt.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/fold.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/free.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/gawk.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/gcloud.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/gh.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/glab-discussion.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/glab.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/go.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/gog.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/gradle.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/gradlew.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/grep.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/groups.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/gunzip.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/gws.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/gzip.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/hadolint.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/head.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/helm.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/hostname.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/id.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/install.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/isort.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/java.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/javac.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/join.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/journalctl.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/jq.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/kill.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/killall.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/kubectl.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/less.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/ln.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/ls.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/make.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/md5sum.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/mise.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/mkdir.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/more.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/mvn.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/mvnw.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/mypy.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/netstat.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/nice.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/nl.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/node.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/nohup.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/npm.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/npx.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/nslookup.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/paste.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/ping.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/pip.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/pip3.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/pipx.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/pkill.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/pnpm.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/poetry.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/prettier.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/printenv.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/printf.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/ps.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/pup.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/pwd.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/pytest.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/python.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/python3.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/read.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/readlink.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/realpath.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/rev.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/rg.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/rm.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/rsync.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/rtk.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/ruff.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/scp.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/sed.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/seq.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/sh.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/sha1sum.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/sha256sum.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/shellcheck.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/slack.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/sleep.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/snip.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/ss.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/ssh.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/stat.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/stdbuf.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/strace.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/strings.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/sudo.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/systemctl.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/tac.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/tail.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/tar.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/tee.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/terraform.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/test.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/time.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/timeout.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/top.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/touch.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/tr.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/traceroute.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/true.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/tsc.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/type.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/uname.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/unexpand.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/uniq.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/uptime.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/uv.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/wait.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/wc.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/whereis.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/which.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/whoami.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/xargs.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/xmllint.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/yarn.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/yes.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/yq.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/zip.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/commands/zsh.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/parser.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/py.typed +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/redirects.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/rules.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/src/bash_classify/sensitive-paths.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/__init__.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/conftest.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/api-merge-request-award-emoji.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/api-merge-request-include-diverged.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/api-merge-request-itself.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/api-merge-request-pipelines-list.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/api-merge-request-update-description.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/api-project-lookup.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/ci-list.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/comment-only-mention.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/echo-mentions-api-endpoint.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/echo-mentions-command.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/git-commit-heredoc-message.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/git-commit-inline-message.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/glab-discussion-read-and-api-mr.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/glab-discussion-read.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/glab-pipeline-inspect.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/grep-pattern-mentions-command.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/grep-recursive-for-command.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/heredoc-brief-2026-09-04.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/heredoc-brief-mentions-blocked-commands.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/heredoc-report-mentions-blocked.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/heredoc-skill-custom-delimiter.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/heredoc-skill-phrase-split-across-lines.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/hook-self-test-json-payload.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/loop-over-quoted-command-strings.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/mr-note-list-output-json.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/mr-note-list.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/mr-update-then-view.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/mr-view-bare.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/mr-view-grep-pipeline.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/mr-view-output-equals-json.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/mr-view-output-json.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/mr-view-output-short-flag.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/printf-mentions-command.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/python-heredoc-triple-quoted-mention.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/allow/ripgrep-pattern-args.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-absolute-binary-path.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-delete-note-nested-api.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-cd-and-prefix.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-export-host-loop.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-for-loop.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-heredoc-then-call.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-hostname-python-consumer.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-line-continuation.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-method-get-field.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-output-ndjson.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-paginate-before-path.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-paginate.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-per-page-query.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-quoted-paginate-jq.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-redirect-to-file.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-repo-flag-first.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-discussions-var-capture.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-edit-note-put-heredoc.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-new-diff-note-input-stdin.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-new-diff-note-position-fields.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-note-award-emoji.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-note-by-id-or-retry.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-notes-after-allowed-mr-view.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-notes-query-sort.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-notes-timeout-prefix.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-reply-method-post-after-path.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-reply-post-body-from-file.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-reply-post-heredoc-body.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-resolve-loop.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-resolve-put-field.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/api-single-discussion-by-id.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/heredoc-then-and-chain-to-blocked.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/heredoc-then-pipe-to-blocked.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-note-custom-heredoc-delimiter.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-note-help.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-note-heredoc-body.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-note-inline-after-mr-update.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-note-long-message-flag.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-note-repo-before-message.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-note-second-in-pipeline.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-note-then-close.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-view-comments-bare.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-view-comments-loop.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-view-comments-no-iid.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-view-comments-page-flag.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-view-comments-repo-flag.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-view-comments-short-cluster.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/mr-view-comments-short-flag.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/wrapper-bash-c.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/block/wrapper-sudo.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-discussion/rules.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/api-job-metadata-without-trace.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/api-job-metadata-xargs.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/api-merge-request-itself.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/api-merge-request-pipelines-list-per-page.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/api-merge-request-pipelines-list.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/api-pipelines-list-bash-c.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/api-pipelines-list-ref.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/api-pipelines-list-single-quoted.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/ci-lint-local-file.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/ci-list-per-page.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/ci-list.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/ci-status-compact.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/ci-status-pipeline-id.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/comment-only-mention.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/echo-mentions-ci-command.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/git-commit-heredoc-message.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/git-commit-inline-message.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/glab-discussion-read.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/glab-pipeline-inspect.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/grep-pattern-mentions-ci.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/heredoc-brief-mentions-ci-commands.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/heredoc-skill-mentions-ci.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/loop-over-quoted-command-strings.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/printf-mentions-ci-command.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/allow/ripgrep-pattern-args.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-ci-lint-continuation-lines.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-ci-lint-input-and-header.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-ci-lint-method-post-field.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-ci-lint-raw-field-cat.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-job-trace-after-allowed-metadata.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-job-trace-env-assignment.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-job-trace-redirect-to-file.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-job-trace-retry-loop.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-job-trace-xargs.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-pipeline-detail.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-pipeline-env-assignment.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-pipeline-hostname-after-path.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-pipeline-jobs-comment-and-loop.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-pipeline-jobs-list.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-pipeline-jobs-nested-loop-timeout.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-pipeline-jobs-paginate-ndjson.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-pipeline-jobs-python-consumer.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-pipeline-jobs-scope-failed-loop.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-pipeline-status-poll-loop.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/api-pipeline-test-report.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/ci-get-after-allowed-status.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/ci-get-branch-in-echo-chain.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/ci-get-branch-ref-sleep-prefix.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/ci-get-json-jq-sort-uniq.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/ci-get-then-ci-trace.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/ci-get-var-capture-poll-loop.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/ci-get-with-job-details-repo.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/ci-trace-job-name-with-pipeline.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/ci-trace-pipeline-id-before-job-name.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/ci-trace-redirect-to-file.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/ci-trace-repo-before-job-id.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/ci-view-help.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/ci-view-job-web-or-api.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/ci-view-pipeline-id.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/heredoc-then-pipe-to-blocked.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/pipe-get-alias.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/pipeline-view-alias.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/wrapper-bash-c.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/block/wrapper-sudo.sh +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/fixtures/match/glab-pipeline/rules.yaml +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/test_match_fixtures.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/test_matcher.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/test_models.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/test_parser.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/test_real_world.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/test_rules.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/test_schema.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/test_sensitive_paths.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/tests/test_smoke.py +0 -0
- {bash_classify-0.12.0 → bash_classify-0.13.1}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: bash-classify
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.1
|
|
4
4
|
Summary: Classify bash commands as READONLY, WRITE, DANGEROUS, or UNKNOWN
|
|
5
5
|
Project-URL: Homepage, https://github.com/fprochazka/bash-classify
|
|
6
6
|
Project-URL: Repository, https://github.com/fprochazka/bash-classify
|
|
@@ -45,6 +45,14 @@ uv tool install bash-classify
|
|
|
45
45
|
pip install bash-classify
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
To track a commit rather than a release — worth doing if you want to test a change before it ships — pin it directly:
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
bash-classify @ git+https://github.com/fprochazka/bash-classify@<commit>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The version is derived from the last tag, so a commit past it resolves to a pre-release such as `0.12.1.dev3+g8699357`. An ordinary constraint still admits that: `>=0.12,<0.13` contains it, because a specifier set only excludes pre-releases when its `prereleases` flag is explicitly false, and it is not by default. Writing the floor as `>=0.12.1.dev0,<0.13` is worth doing anyway — it says out loud that the pinned thing is a pre-release, and it sets that flag — but it is a marker for whoever reads the file next, not something the resolver needs.
|
|
55
|
+
|
|
48
56
|
## Quick start
|
|
49
57
|
|
|
50
58
|
```bash
|
|
@@ -147,7 +155,9 @@ $ echo 'cat ~/.ssh/id_rsa' | bash-classify | jq '{classification, risk, sensitiv
|
|
|
147
155
|
|
|
148
156
|
`sensitive_paths` is always present, on the expression and on every command and inner command, so a caller that wants a different policy reads the detail instead of the verdict. A hit found inside `sudo`, `xargs`, `sh -c` or `find -exec` is reported at that depth and again on every level above it, up to the expression.
|
|
149
157
|
|
|
150
|
-
`source` says where the token came from: `argv`, `redirect_read`, `redirect_write` or `env_dump`. `argv` is vague on purpose. `cat X` reads and `tee X` writes, and telling those apart needs per-command knowledge the database does not carry
|
|
158
|
+
`source` says where the token came from: `argv`, `argv_write`, `redirect_read`, `redirect_write` or `env_dump`. `argv` is vague on purpose. `cat X` reads and `tee X` writes, and telling those apart needs per-command knowledge the database does not carry for a positional. Two sources do know the direction. A redirect knows it because the operator says so, and `argv_write` is the value of an option the tool documents as naming a file it writes, such as `curl -o` — so `curl -o ~/.ssh/authorized_keys https://x` reports a write while `cat ~/.ssh/authorized_keys` reports an argument of unknown direction.
|
|
159
|
+
|
|
160
|
+
A marked option's value is reported *only* as `argv_write`, so selecting `source == "argv"` no longer sees it — `curl -o ~/.ssh/authorized_keys` has one hit and it is not an `argv` one. And `argv_write` never covers a destination written as a plain positional (`cp a b`, `tee out.txt`), an operand that is not an option (`dd of=X`), or an option whose direction depends on another option (`tar -f`, `tar -C`). Read it as an extra signal, never as the definition of "this writes" — `source != "argv_write"` does not mean nothing is written. [SPEC.md](SPEC.md) has the full list.
|
|
151
161
|
|
|
152
162
|
Paths match on whole segments and are never anchored, so `~/.ssh/id_rsa`, `/home/me/.ssh/id_rsa` and `../.ssh/id_rsa` all hit the `ssh` rule, while `.gitignore` and `.github` are not `.git`. A `.` segment is dropped and a `..` is resolved against the one before it, so `/etc/./shadow` and `~/.aws/x/../credentials` hit while `.ssh/../notes` does not. Each token is read three ways — as written, with `\` as a Windows separator, and with `\x` read as the POSIX escape `x` — so `~/.s\sh/id_rsa` is caught. A glob segment is matched backwards, the denylisted name against the token as the pattern, so `~/.ss?/id_rsa`, `~/.[^x]sh/id_rsa` and `.e*` are caught too. `spelling` reports which reading matched: `literal`, `posix_escape`, `windows` or `glob`.
|
|
153
163
|
|
|
@@ -237,7 +247,7 @@ Risk defaults are derived from classification (`READONLY`→LOW, `LOCAL_EFFECTS`
|
|
|
237
247
|
- **Subcommand aliases** -- a subcommand can declare other names for itself, so `glab pipeline view` resolves to `glab ci view` and any rule written for the canonical name catches the aliased spelling
|
|
238
248
|
- **Multi-goal build tools** -- `subcommand_mode: match_all` handles commands like `mvn clean install` and `gradle clean build test` where multiple goals can be combined in any order
|
|
239
249
|
- **Delegation for wrappers** -- commands like `xargs`, `sudo`, and `env` delegate classification to the inner command
|
|
240
|
-
- **File path detection** -- redirect targets
|
|
250
|
+
- **File path detection** -- `write_paths` holds redirect targets and the values of options the database marks as naming an output (`curl -o`, `wget -O`, `cp -t`, `sort -o`), `read_paths` holds input redirect targets; a write is `>` or `>>` with the optional file descriptor and `|` no-clobber override bash allows (`1>`, `2>>`, `>|`), plus `&>`, `&>>` and `>&`; writes to `/tmp` and `/var/tmp` stay at LOW risk. A destination named by a plain positional (`cp a b`, `tee out.txt`) is in neither field
|
|
241
251
|
- **Sensitive path detection** -- argv tokens and redirect targets are matched against a denylist of credential paths; a hit floors risk at HIGH and is reported in `sensitive_paths`
|
|
242
252
|
|
|
243
253
|
## Python API
|
|
@@ -16,6 +16,14 @@ uv tool install bash-classify
|
|
|
16
16
|
pip install bash-classify
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
To track a commit rather than a release — worth doing if you want to test a change before it ships — pin it directly:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
bash-classify @ git+https://github.com/fprochazka/bash-classify@<commit>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The version is derived from the last tag, so a commit past it resolves to a pre-release such as `0.12.1.dev3+g8699357`. An ordinary constraint still admits that: `>=0.12,<0.13` contains it, because a specifier set only excludes pre-releases when its `prereleases` flag is explicitly false, and it is not by default. Writing the floor as `>=0.12.1.dev0,<0.13` is worth doing anyway — it says out loud that the pinned thing is a pre-release, and it sets that flag — but it is a marker for whoever reads the file next, not something the resolver needs.
|
|
26
|
+
|
|
19
27
|
## Quick start
|
|
20
28
|
|
|
21
29
|
```bash
|
|
@@ -118,7 +126,9 @@ $ echo 'cat ~/.ssh/id_rsa' | bash-classify | jq '{classification, risk, sensitiv
|
|
|
118
126
|
|
|
119
127
|
`sensitive_paths` is always present, on the expression and on every command and inner command, so a caller that wants a different policy reads the detail instead of the verdict. A hit found inside `sudo`, `xargs`, `sh -c` or `find -exec` is reported at that depth and again on every level above it, up to the expression.
|
|
120
128
|
|
|
121
|
-
`source` says where the token came from: `argv`, `redirect_read`, `redirect_write` or `env_dump`. `argv` is vague on purpose. `cat X` reads and `tee X` writes, and telling those apart needs per-command knowledge the database does not carry
|
|
129
|
+
`source` says where the token came from: `argv`, `argv_write`, `redirect_read`, `redirect_write` or `env_dump`. `argv` is vague on purpose. `cat X` reads and `tee X` writes, and telling those apart needs per-command knowledge the database does not carry for a positional. Two sources do know the direction. A redirect knows it because the operator says so, and `argv_write` is the value of an option the tool documents as naming a file it writes, such as `curl -o` — so `curl -o ~/.ssh/authorized_keys https://x` reports a write while `cat ~/.ssh/authorized_keys` reports an argument of unknown direction.
|
|
130
|
+
|
|
131
|
+
A marked option's value is reported *only* as `argv_write`, so selecting `source == "argv"` no longer sees it — `curl -o ~/.ssh/authorized_keys` has one hit and it is not an `argv` one. And `argv_write` never covers a destination written as a plain positional (`cp a b`, `tee out.txt`), an operand that is not an option (`dd of=X`), or an option whose direction depends on another option (`tar -f`, `tar -C`). Read it as an extra signal, never as the definition of "this writes" — `source != "argv_write"` does not mean nothing is written. [SPEC.md](SPEC.md) has the full list.
|
|
122
132
|
|
|
123
133
|
Paths match on whole segments and are never anchored, so `~/.ssh/id_rsa`, `/home/me/.ssh/id_rsa` and `../.ssh/id_rsa` all hit the `ssh` rule, while `.gitignore` and `.github` are not `.git`. A `.` segment is dropped and a `..` is resolved against the one before it, so `/etc/./shadow` and `~/.aws/x/../credentials` hit while `.ssh/../notes` does not. Each token is read three ways — as written, with `\` as a Windows separator, and with `\x` read as the POSIX escape `x` — so `~/.s\sh/id_rsa` is caught. A glob segment is matched backwards, the denylisted name against the token as the pattern, so `~/.ss?/id_rsa`, `~/.[^x]sh/id_rsa` and `.e*` are caught too. `spelling` reports which reading matched: `literal`, `posix_escape`, `windows` or `glob`.
|
|
124
134
|
|
|
@@ -208,7 +218,7 @@ Risk defaults are derived from classification (`READONLY`→LOW, `LOCAL_EFFECTS`
|
|
|
208
218
|
- **Subcommand aliases** -- a subcommand can declare other names for itself, so `glab pipeline view` resolves to `glab ci view` and any rule written for the canonical name catches the aliased spelling
|
|
209
219
|
- **Multi-goal build tools** -- `subcommand_mode: match_all` handles commands like `mvn clean install` and `gradle clean build test` where multiple goals can be combined in any order
|
|
210
220
|
- **Delegation for wrappers** -- commands like `xargs`, `sudo`, and `env` delegate classification to the inner command
|
|
211
|
-
- **File path detection** -- redirect targets
|
|
221
|
+
- **File path detection** -- `write_paths` holds redirect targets and the values of options the database marks as naming an output (`curl -o`, `wget -O`, `cp -t`, `sort -o`), `read_paths` holds input redirect targets; a write is `>` or `>>` with the optional file descriptor and `|` no-clobber override bash allows (`1>`, `2>>`, `>|`), plus `&>`, `&>>` and `>&`; writes to `/tmp` and `/var/tmp` stay at LOW risk. A destination named by a plain positional (`cp a b`, `tee out.txt`) is in neither field
|
|
212
222
|
- **Sensitive path detection** -- argv tokens and redirect targets are matched against a denylist of credential paths; a hit floors risk at HIGH and is reported in `sensitive_paths`
|
|
213
223
|
|
|
214
224
|
## Python API
|
|
@@ -330,19 +330,35 @@ Certain expression-level patterns elevate risk to at least `HIGH`:
|
|
|
330
330
|
- Backgrounding (`cmd &`)
|
|
331
331
|
- Output redirects to non-`/dev/null` targets (except when all write targets are under `/tmp` or `/var/tmp`)
|
|
332
332
|
|
|
333
|
+
The system-path elevation reads the operands of a command, never the program it runs. `argv[0]` is the binary being executed rather than a path the command writes to, so `/usr/bin/git add a.txt` gets exactly the verdict `git add a.txt` gets. The exemption covers the program word of every command in the expression, not only the outermost one: a wrapper carries the words of the command it runs in its own argv, so `sudo /usr/bin/git add a.txt` is scanned as `['sudo', '/usr/bin/git', 'add', 'a.txt']` and both `sudo` and `/usr/bin/git` are exempt. Each exempt word is consumed once, so a program word spelled a second time as an operand still counts and `/usr/bin/git add /usr/bin/git` stays `DANGEROUS`.
|
|
334
|
+
|
|
335
|
+
A script handed to a shell is a token holding a whole command line, not a path. `sh -c '/usr/bin/touch /etc/passwd'` would otherwise be read as a path under `/usr/bin`, because the scan compares whole tokens against directory prefixes and only the script's leading word — the program — ever made it look like one. So the script token is not scanned as a path, and **the commands parsed out of it are scanned instead**, each against its own program word and each guarded by its own classification the way a top-level command is. Classification is delegated to the inner commands; this elevation is not, so without that second scan the operands inside a script would be checked nowhere.
|
|
336
|
+
|
|
337
|
+
The consequence is that `sh -c 'X'` gets the verdict `X` gets, in both directions. `sh -c '/usr/bin/git add a.txt'` is `LOCAL_EFFECTS`/`LOW`, and `sh -c 'mkdir -p /usr/lib/x'` is `DANGEROUS`/`HIGH` exactly as `mkdir -p /usr/lib/x` is. In `sh -c 'cat /etc/hosts && touch x'` the `cat` sits below `LOCAL_EFFECTS`, so its `/etc/hosts` is not a hit and the expression stays `LOCAL_EFFECTS` — again what the bare spelling gives.
|
|
338
|
+
|
|
339
|
+
Two limits are worth stating. A script reaches this scan only when the delegating option is recognised, so a clustered shell flag (`bash -lc '...'`) parses no inner command at all and the token is scanned as a path instead. For `sh`, `bash` and `zsh` that is unobservable: they are `DANGEROUS` from their own definitions, and the elevation is gated on the command not already being `DANGEROUS`, so nothing the path scan finds there changes the verdict. For a command declared in a user database with this delegation mode and no `DANGEROUS` floor, the clustered spelling is a genuine miss — `X -c 'mkdir -p /usr/lib/x'` is `DANGEROUS`/`HIGH` and `X -lc 'mkdir -p /usr/lib/x'` is whatever `X` itself is. The second limit is that a redirect written *inside* a script is dropped before the inner command is classified, so `sh -c 'grep foo /etc/hosts > out'` is `READONLY` while the bare `grep foo /etc/hosts > out` is `DANGEROUS`. Both gaps predate this rule and neither is about system paths.
|
|
340
|
+
|
|
341
|
+
The exemption applies to a program word, so it is given only where the inner command really begins with one. The matcher strips `{}` placeholders before building a `find -exec` inner's argv, so in `find . -exec {} /usr/bin/git add \;` the inner `argv[0]` is `/usr/bin/git` — an argument handed to each file `find` matched, not the program being run — and nothing is exempt there. `find . -exec /bin/cp {} /usr/bin/x \;` still exempts `/bin/cp` and still reports `/usr/bin/x`.
|
|
342
|
+
|
|
343
|
+
Both kinds of skip are consumed once, never matched by value. A program word spelled again as an operand counts, and so does an operand that happens to read the same as the script text: `nohup sh -c /bin/ls /bin/ls` runs the first `/bin/ls` as the script and hands it the second as an argument, and the second is a hit.
|
|
344
|
+
|
|
345
|
+
For `args_are_expression` delegation the exemption applies only when the whole script is a single token. `eval 'cp a /usr/bin/b'` exempts that token and scans the `cp` parsed out of it; `eval cp a /usr/bin/b` spreads the script over several tokens, none of which is the script, so every token stays scannable.
|
|
346
|
+
|
|
347
|
+
Redirect targets are unaffected by any of this: `echo x > /etc/hosts` is still `DANGEROUS`.
|
|
348
|
+
|
|
333
349
|
#### Temp path risk lowering
|
|
334
350
|
|
|
335
351
|
When every write target of an expression is under `/tmp` or `/var/tmp`, the risk elevation to `MEDIUM` from output redirects is skipped. `cat > /tmp/foo.txt` stays at `LOW` risk and is still classified as `LOCAL_EFFECTS`. The lowering applies to every write form equally, so `1> /tmp/foo.txt` gets the same verdict as `> /tmp/foo.txt`.
|
|
336
352
|
|
|
337
353
|
### File path detection
|
|
338
354
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
- **`write_paths`**: Targets of output redirects, excluding `/dev/null`, `/dev/stdin`, `/dev/stdout`, `/dev/stderr`, and `/dev/fd/*`.
|
|
355
|
+
- **`write_paths`**: Paths the command names as output. Two sources feed it: the target of an output redirect, excluding `/dev/null`, `/dev/stdin`, `/dev/stdout`, `/dev/stderr` and `/dev/fd/*`; and the value of an option the database marks `names_output_path`, such as `curl -o` or `sort -o`. Redirect targets come after the option values.
|
|
342
356
|
- **`read_paths`**: Targets of input redirects, excluding the same `/dev/*` paths.
|
|
343
357
|
- Which operators those are is one definition, given under [Redirect Classification](#redirect-classification). A redirect that elevates the classification also reports its target here, or the temp path lowering above would never fire for it.
|
|
344
358
|
|
|
345
|
-
|
|
359
|
+
`write_paths` is not the complete set of files a command writes. A destination written as a plain positional is absent — `cp a b`, `tee out.txt` and `sed -i f` all report nothing — because telling a read positional from a write one needs per-command knowledge the database does not carry. Read the field as "paths this command is known to write", never as "the only paths it writes".
|
|
360
|
+
|
|
361
|
+
Paths are reported at both the per-command level (`commands[].write_paths`, `commands[].read_paths`) and the expression level. The expression level aggregates every command, and reaches through wrappers: `sudo curl -o X` names no output path at the `sudo` level, so the expression level takes it from the inner command.
|
|
346
362
|
|
|
347
363
|
### Composite classification
|
|
348
364
|
|
|
@@ -977,9 +993,12 @@ A subcommand entry takes the same fields as the command level, minus `command` a
|
|
|
977
993
|
| `takes_value` | `bool` | Whether the option consumes the next token as its value |
|
|
978
994
|
| `aliases` | `list[str]` | Alternative names for this option (e.g. `-n` for `--namespace`) |
|
|
979
995
|
| `overrides` | `enum` | When this option is present, override the classification to this level |
|
|
980
|
-
| `captures_directory` | `bool` | The value of this option is a working directory (
|
|
996
|
+
| `captures_directory` | `bool` | The value of this option is a directory the command is pointed at: a working directory (`git -C`, `make -C`) or a destination an archive is unpacked into (`tar -C`, `unzip -d`). It lands in the invocation's own `directories`, at whatever depth the invocation sits. |
|
|
997
|
+
| `names_output_path` | `bool` | The tool documents this option's value as a path it writes (`curl -o`, `sort -o`). It lands in `write_paths`, and a sensitive-path hit on it is reported with `source: "argv_write"`. |
|
|
981
998
|
| `delegates_to` | `object` | This option's value(s) form a delegated inner command (e.g. `find -exec`) |
|
|
982
999
|
|
|
1000
|
+
Set `names_output_path` only from the tool's own documentation of that option, and only when it holds in every mode of the command. `curl -T` sends the named file to a server and writes nothing locally, so it stays unmarked. `tar -f` writes the archive under `-c` and reads it under `-x`; one option cannot be conditioned on another, so it stays unmarked too, and the honest answer for `tar` is the destination directory that `-C` already reports.
|
|
1001
|
+
|
|
983
1002
|
## Redirect Classification
|
|
984
1003
|
|
|
985
1004
|
An output redirect elevates the classification to at least `LOCAL_EFFECTS`.
|
|
@@ -1048,6 +1067,12 @@ The floor is deliberately **not** guarded by a minimum classification, unlike th
|
|
|
1048
1067
|
|
|
1049
1068
|
Tokens are scanned one at a time and never joined, so `git config` is two words and not the path `.git/config`.
|
|
1050
1069
|
|
|
1070
|
+
The value of an option marked `names_output_path` is scanned on its own and reported with `source: "argv_write"`, and the argv token that carries it is then skipped. That keeps one file to one hit across the three spellings of an option value: `-o ~/.ssh/x`, `--output=~/.ssh/x` and `-o~/.ssh/x` all report the path alone, in the write direction. Every other argv token keeps `source: "argv"`, whose direction is unknown.
|
|
1071
|
+
|
|
1072
|
+
**Two things a caller reading `source` has to know.** The skip means a marked option's value no longer appears as an `argv` hit at all: `curl -o ~/.ssh/authorized_keys` reports one hit with `source: "argv_write"` and nothing with `source: "argv"`. Code that selects `source == "argv"` and works out the direction itself stops seeing these paths, with nothing to signal that it happened. This changed in the release that introduced `names_output_path`.
|
|
1073
|
+
|
|
1074
|
+
And `argv_write` is not the complete set of writes, permanently rather than for now. It covers an option the tool documents as naming a file it writes, and nothing else. A destination written as a plain positional never carries it — `cp a b`, `tee out.txt`, `split`. Neither does an operand that is not an option, such as `dd of=X`. Neither does an option whose direction depends on another option: `tar -f` writes the archive under `-c` and reads it under `-x`, and `tar -C` is an extraction destination under `-x` and a source directory under `-c`, so marking either would be wrong in half its uses. So `source != "argv_write"` does not mean the command writes nothing, and must not be used as though it did. A caller that needs to cover the cases above has to keep its own reasoning for them; `argv_write` is an additional signal, not a replacement for one.
|
|
1075
|
+
|
|
1051
1076
|
A hit is reported on the invocation that carries it, and again on every level above it up to the expression, deduplicated by token, rule, source and spelling. A caller that reads only `ExpressionResult.sensitive_paths` still sees what a wrapper hid.
|
|
1052
1077
|
|
|
1053
1078
|
### The denylist
|
|
@@ -1099,7 +1124,7 @@ Name these when you describe the feature, so nobody reads it as stronger than it
|
|
|
1099
1124
|
- A path held in a variable: `P=~/.ssh/id_rsa; cat "$P"`.
|
|
1100
1125
|
- Encoding detours: `base64`, `xxd`, `rev`, or a `sed` that reassembles the path.
|
|
1101
1126
|
- A glob below the two-character floor, such as `cat .*`.
|
|
1102
|
-
- The direction of an `argv` hit. `cat X` reads and `tee X` writes; telling them apart needs per-command read/write knowledge that the database
|
|
1127
|
+
- The direction of an `argv` hit. `cat X` reads and `tee X` writes; telling them apart needs per-command read/write knowledge that the database carries only for options marked `names_output_path`, never for a positional.
|
|
1103
1128
|
- A redirect inside a nested expression. `sh -c "cat < ~/.ssh/id_rsa"` is caught through the `-c` argument text, not through the redirect, because inner commands carry no redirects of their own.
|
|
1104
1129
|
- A token that only *mentions* a path. `git commit -m "document ~/.ssh/config setup"`, `grep -rn "\.ssh/config" docs/` and `find . -path "*/.git/config"` are all reported, because the scan reads tokens and not the meaning a command gives them. Note the contrast with `match` mode, which is careful about exactly this: there a heredoc body, an `echo` string or a `grep` pattern that names a command is not an invocation and does not match. The two do not behave alike. Separating a path that a command opens from one it merely carries needs per-command argument knowledge, and that is out of scope here.
|
|
1105
1130
|
|
|
@@ -1107,15 +1132,53 @@ Name these when you describe the feature, so nobody reads it as stronger than it
|
|
|
1107
1132
|
|
|
1108
1133
|
## Directory Detection
|
|
1109
1134
|
|
|
1110
|
-
|
|
1135
|
+
`directories` means something different at the expression level and on a single invocation,
|
|
1136
|
+
and a caller has to pick the one that answers its question.
|
|
1111
1137
|
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1138
|
+
**On an invocation** the list holds the values of that invocation's `captures_directory`
|
|
1139
|
+
options, and nothing else: the destination of `tar -C` or `unzip -d`, the working directory
|
|
1140
|
+
of `git -C`. Every invocation carries it at every depth — a `commands` entry and an
|
|
1141
|
+
`inner_commands` entry in the JSON, `CommandResult.directories` and
|
|
1142
|
+
`InnerCommandResult.directories` in Python — so walking invocations needs no special case
|
|
1143
|
+
for the top level. The JSON omits the key when the list is empty, so a wrapper that names no
|
|
1144
|
+
directory of its own cannot be read as one that does.
|
|
1145
|
+
|
|
1146
|
+
**At the expression level** the list is wider. It collects four kinds of value:
|
|
1147
|
+
|
|
1148
|
+
- the target of a `cd` or `pushd`
|
|
1149
|
+
- the value of a `captures_directory` option on a top-level invocation
|
|
1150
|
+
- the first positional of an `ls` or a `find`
|
|
1151
|
+
- the dirname of the first path holding a `/` that a `cat`, `head`, `tail`, `less` or `more` was handed
|
|
1152
|
+
|
|
1153
|
+
Directories are reported as written, never resolved, because a value may hold a variable
|
|
1154
|
+
or a `~`.
|
|
1155
|
+
|
|
1156
|
+
### A destination below a wrapper stays below it
|
|
1157
|
+
|
|
1158
|
+
`sudo tar -xf e.tar -C ~/.config` reports the destination on the `tar` invocation inside
|
|
1159
|
+
`inner_commands`. The expression-level list stays empty. `write_paths` behaves the opposite
|
|
1160
|
+
way — a wrapper's expression-level `write_paths` does carry what the wrapped command names
|
|
1161
|
+
as output — and the difference is deliberate.
|
|
1162
|
+
|
|
1163
|
+
`write_paths` holds one kind of path: files a command names as output. Merging several of
|
|
1164
|
+
those produces a list that still means one thing, so a caller can act on it directly.
|
|
1165
|
+
`directories` mixes four, and a dirname such as the `/etc` of `cat /etc/config` reads
|
|
1166
|
+
exactly like the `/etc` of `tar -C /etc`. Aggregating that through wrappers would move more
|
|
1167
|
+
ambiguous values into the list a caller reaches for first, which is why the per-invocation
|
|
1168
|
+
list exists at all. A caller after destinations walks the invocations instead —
|
|
1169
|
+
`iter_invocations` in Python, the recursive `inner_commands` in the JSON — and reads each
|
|
1170
|
+
`directories` there.
|
|
1171
|
+
|
|
1172
|
+
Do not "fix" the asymmetry by making the expression-level list reach through wrappers. The
|
|
1173
|
+
tests that pin the current values are there to catch exactly that change.
|
|
1174
|
+
|
|
1175
|
+
### Limit: a sensitive rule under a reported directory is not a hit
|
|
1176
|
+
|
|
1177
|
+
`tar -xf e.tar -C ~/.ssh` hits the `ssh` rule, because the destination itself spells the rule. `tar -xf e.tar -C ~/.config` does not hit `gcloud`, even though the archive may well contain `.config/gcloud/credentials.db`, and `unzip e.zip -d ~` hits nothing at all.
|
|
1178
|
+
|
|
1179
|
+
This is deliberate and it will not change. The contents of an archive are unknowable without opening it, so the only rule the library could apply is "any denylisted path that sits under the destination is a hit". The common destinations are `.`, `..`, `~` and `$PWD`: every rule sits under those, so the check would fire on every extraction anybody ever runs, and a gate that fires on everything gets switched off. `tar -xf e.tar -C .` is the case to keep in mind.
|
|
1117
1180
|
|
|
1118
|
-
|
|
1181
|
+
Extraction into a parent directory is therefore a general way past a path denylist, and closing it is the caller's policy call, not the library's. The destination is in the invocation's `directories` for exactly that reason, whether the invocation is top-level or sits under `sudo`, `sh -c`, `xargs` or `find -exec`. A caller that wants the floor can require the destination to carry some minimum specificity before applying it — at least a few segments, and not the working directory, the home directory or the root — the way the glob matcher requires two literal characters before reading a segment as a pattern.
|
|
1119
1182
|
|
|
1120
1183
|
## Special-cased Commands
|
|
1121
1184
|
|
|
@@ -1170,14 +1233,14 @@ The `commands` list below is recursive — any command entry can contain `inner_
|
|
|
1170
1233
|
{
|
|
1171
1234
|
"expression": "string — the original input",
|
|
1172
1235
|
"classification": "READONLY | LOCAL_EFFECTS | EXTERNAL_EFFECTS | DANGEROUS | UNKNOWN",
|
|
1173
|
-
"directories": ["string —
|
|
1174
|
-
"write_paths": ["string —
|
|
1236
|
+
"directories": ["string — cd and pushd targets, captures_directory values of top-level invocations, the first positional of ls and find, and dirnames of paths handed to cat, head, tail, less and more, mixed in one list; for a destination below a wrapper read the inner command's own directories instead"],
|
|
1237
|
+
"write_paths": ["string — paths the commands name as output: redirect targets and the values of options marked names_output_path (optional, omitted when empty)"],
|
|
1175
1238
|
"read_paths": ["string — files targeted by input redirects (optional, omitted when empty)"],
|
|
1176
1239
|
"sensitive_paths": [
|
|
1177
1240
|
{
|
|
1178
|
-
"token": "string — the
|
|
1241
|
+
"token": "string — the path as written, or the whole argv token that holds it",
|
|
1179
1242
|
"rule": "string — the denylist entry that matched, e.g. ssh",
|
|
1180
|
-
"source": "argv | redirect_read | redirect_write | env_dump",
|
|
1243
|
+
"source": "argv | argv_write | redirect_read | redirect_write | env_dump",
|
|
1181
1244
|
"spelling": "literal | posix_escape | windows | glob"
|
|
1182
1245
|
}
|
|
1183
1246
|
],
|
|
@@ -1193,7 +1256,8 @@ The `commands` list below is recursive — any command entry can contain `inner_
|
|
|
1193
1256
|
"remaining_options": ["string — options that were not in database"],
|
|
1194
1257
|
"classification_reason": "string — why this classification was chosen",
|
|
1195
1258
|
"overriding_option": "string | null — the option that elevated classification",
|
|
1196
|
-
"
|
|
1259
|
+
"directories": ["string — the values of this invocation's captures_directory options (optional, omitted when empty); narrower than the expression-level directories"],
|
|
1260
|
+
"write_paths": ["string — this command's own output paths: option values and redirect targets (optional, omitted when empty)"],
|
|
1197
1261
|
"read_paths": ["string — files targeted by input redirects (optional, omitted when empty)"],
|
|
1198
1262
|
"sensitive_paths": ["... — this command's own hits plus its inner commands'; always present, empty when none"],
|
|
1199
1263
|
"inner_commands": [
|
|
@@ -1206,6 +1270,8 @@ The `commands` list below is recursive — any command entry can contain `inner_
|
|
|
1206
1270
|
"matched_rule": "...",
|
|
1207
1271
|
"options": ["... — same meaning as on the enclosing command"],
|
|
1208
1272
|
"positionals": ["... — same meaning as on the enclosing command"],
|
|
1273
|
+
"directories": ["... — same meaning as on the enclosing command; not aggregated into the expression-level directories"],
|
|
1274
|
+
"write_paths": ["... — option values only; an inner command carries no redirects of its own"],
|
|
1209
1275
|
"sensitive_paths": ["... — same meaning as on the enclosing command"],
|
|
1210
1276
|
"inner_commands": ["... — recursive, can nest further"]
|
|
1211
1277
|
}
|
|
@@ -110,9 +110,20 @@ subcommands:
|
|
|
110
110
|
| `takes_value` | boolean | Whether the option consumes the next token as its value |
|
|
111
111
|
| `aliases` | list | Alternative names (e.g. `-n` for `--namespace`) |
|
|
112
112
|
| `overrides` | enum | When present, override classification to this level |
|
|
113
|
-
| `captures_directory` | boolean | The option's value is a working directory (
|
|
113
|
+
| `captures_directory` | boolean | The option's value is a directory the command is pointed at: a working directory (`git -C`) or an extraction destination (`tar -C`, `unzip -d`). It lands in the `directories` of the invocation that carries the option, wrapped or not. The expression-level `directories` picks it up only for a top-level invocation. |
|
|
114
|
+
| `names_output_path` | boolean | The option's value is a path the command writes (`curl -o`, `sort -o`). It lands in `write_paths`. |
|
|
114
115
|
| `delegates_to` | object | This option triggers delegation (e.g. `find -exec`) |
|
|
115
116
|
|
|
117
|
+
##### Marking an option as an output path
|
|
118
|
+
|
|
119
|
+
`names_output_path` answers one question: does the tool's own documentation say this option's value names a file it writes? Check the man page before you set it, and apply three rules.
|
|
120
|
+
|
|
121
|
+
1. A read is not a write. `curl -T file` uploads the named file to a server and writes nothing locally, so it stays unmarked.
|
|
122
|
+
2. The answer has to hold in every mode of the command. `tar -f` writes the archive under `-c` and reads it under `-x`, and one option cannot be conditioned on another, so it stays unmarked.
|
|
123
|
+
3. A destination named by a positional is out of reach. `cp a b`, `tee out.txt`, `dd of=X` and the prefix of `split` are not options, and nothing in the database describes them.
|
|
124
|
+
|
|
125
|
+
A consumer uses the field to tell a write to a credential from a mention of one, so a wrong mark is worse than a missing one. When in doubt, leave it off.
|
|
126
|
+
|
|
116
127
|
#### The `# $schema:` comment
|
|
117
128
|
|
|
118
129
|
Add `# $schema: ../../../schemas/command.schema.json` as the first line of every YAML file. This enables autocomplete and validation in IDEs that support JSON Schema for YAML files.
|
|
@@ -512,7 +523,7 @@ When a command writes to a file via an output redirect, its risk is normally ele
|
|
|
512
523
|
|
|
513
524
|
This means `cat > /tmp/foo.txt` is classified as `LOCAL_EFFECTS` with risk `LOW`, while `cat > ~/foo.txt` is classified as `LOCAL_EFFECTS` with risk `MEDIUM`.
|
|
514
525
|
|
|
515
|
-
The tool also reports `write_paths` and `read_paths` in the output
|
|
526
|
+
The tool also reports `write_paths` and `read_paths` in the output. `read_paths` comes from input redirects. `write_paths` holds the targets of output redirects and the values of options marked `names_output_path`. Both fields are omitted from the JSON output when empty, and neither is a complete account of what the command touches: a destination named by a plain positional is in neither.
|
|
516
527
|
|
|
517
528
|
## 11. Sensitive Paths
|
|
518
529
|
|
|
@@ -156,7 +156,11 @@
|
|
|
156
156
|
},
|
|
157
157
|
"captures_directory": {
|
|
158
158
|
"type": "boolean",
|
|
159
|
-
"description": "The value of this option is a working directory"
|
|
159
|
+
"description": "The value of this option is a directory the command is pointed at: a working directory (`git -C`) or an extraction destination (`tar -C`, `unzip -d`). It lands in `directories`."
|
|
160
|
+
},
|
|
161
|
+
"names_output_path": {
|
|
162
|
+
"type": "boolean",
|
|
163
|
+
"description": "The tool documents this option's value as a path it writes (`curl -o`, `sort -o`). It lands in `write_paths`, and a sensitive-path hit on it is reported with source `argv_write`. Do not set it on an option whose value is read, or on one that writes only in some modes (`tar -f` writes when creating and reads when extracting)."
|
|
160
164
|
},
|
|
161
165
|
"delegates_to": {
|
|
162
166
|
"$ref": "#/$defs/DelegationConfig"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""bash-classify: Classify bash expressions by their side-effect risk level.
|
|
2
|
+
|
|
3
|
+
`__all__` names every symbol a caller outside the package may rely on: the entry points, and
|
|
4
|
+
the types those entry points accept or return. Anything else is internal and may move.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from bash_classify.classifier import classify_expression, iter_invocations
|
|
8
|
+
from bash_classify.database import CommandDatabase, load_database
|
|
9
|
+
from bash_classify.models import (
|
|
10
|
+
Classification,
|
|
11
|
+
CommandDef,
|
|
12
|
+
CommandResult,
|
|
13
|
+
ExpressionResult,
|
|
14
|
+
InnerCommandResult,
|
|
15
|
+
Redirect,
|
|
16
|
+
Risk,
|
|
17
|
+
SensitiveHit,
|
|
18
|
+
)
|
|
19
|
+
from bash_classify.redirects import (
|
|
20
|
+
is_descriptor_duplication,
|
|
21
|
+
is_read_operator,
|
|
22
|
+
is_write_operator,
|
|
23
|
+
writes_a_file,
|
|
24
|
+
)
|
|
25
|
+
from bash_classify.rules import Match, MatchResult, Rule, RulesError, load_rules, match_expression
|
|
26
|
+
from bash_classify.sensitive import (
|
|
27
|
+
SensitivePathsError,
|
|
28
|
+
SensitiveRule,
|
|
29
|
+
find_path_hits,
|
|
30
|
+
load_sensitive_paths,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
__all__ = [
|
|
34
|
+
"classify_expression",
|
|
35
|
+
"iter_invocations",
|
|
36
|
+
"load_database",
|
|
37
|
+
"CommandDatabase",
|
|
38
|
+
"CommandDef",
|
|
39
|
+
"Classification",
|
|
40
|
+
"Risk",
|
|
41
|
+
"ExpressionResult",
|
|
42
|
+
"CommandResult",
|
|
43
|
+
"InnerCommandResult",
|
|
44
|
+
"Redirect",
|
|
45
|
+
"Rule",
|
|
46
|
+
"RulesError",
|
|
47
|
+
"Match",
|
|
48
|
+
"MatchResult",
|
|
49
|
+
"load_rules",
|
|
50
|
+
"match_expression",
|
|
51
|
+
"SensitiveHit",
|
|
52
|
+
"SensitiveRule",
|
|
53
|
+
"SensitivePathsError",
|
|
54
|
+
"load_sensitive_paths",
|
|
55
|
+
"find_path_hits",
|
|
56
|
+
"is_write_operator",
|
|
57
|
+
"is_read_operator",
|
|
58
|
+
"is_descriptor_duplication",
|
|
59
|
+
"writes_a_file",
|
|
60
|
+
]
|