@seanmozeik/tripwire 0.7.2 → 0.9.0
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.
- package/README.md +20 -2
- package/dist/index.js +22 -27
- package/dist/tripwire-cli.js +1 -1
- package/dist/tripwire-hook.js +1 -1
- package/dist/tripwire-pi.js +16 -6
- package/dist/tripwire.js +109 -121
- package/dist/types/dispatch.d.ts +4 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/lib/bash/analyze.d.ts +3 -0
- package/dist/types/lib/bash/carriers.d.ts +11 -0
- package/dist/types/lib/bash/config.d.ts +17 -0
- package/dist/types/lib/bash/execution-types.d.ts +13 -0
- package/dist/types/lib/bash/execution.d.ts +13 -0
- package/dist/types/lib/bash/index.d.ts +8 -0
- package/dist/types/lib/bash/pipeline-inputs.d.ts +10 -0
- package/dist/types/lib/bash/static-command.d.ts +9 -0
- package/dist/types/lib/bash/types.d.ts +64 -0
- package/dist/types/lib/bash/values.d.ts +25 -0
- package/dist/types/lib/bash/wrappers.d.ts +21 -0
- package/dist/types/lib/code/analyze.d.ts +3 -0
- package/dist/types/lib/code/calls.d.ts +8 -0
- package/dist/types/lib/code/carriers.d.ts +18 -0
- package/dist/types/lib/code/containers.d.ts +4 -0
- package/dist/types/lib/code/control.d.ts +13 -0
- package/dist/types/lib/code/data.d.ts +9 -0
- package/dist/types/lib/code/imports.d.ts +5 -0
- package/dist/types/lib/code/members.d.ts +4 -0
- package/dist/types/lib/code/syntax.d.ts +10 -0
- package/dist/types/lib/code/types.d.ts +51 -0
- package/dist/types/lib/code/uv.d.ts +13 -0
- package/dist/types/lib/code/values.d.ts +9 -0
- package/dist/types/lib/config.d.ts +32 -0
- package/dist/types/lib/event.d.ts +7 -1
- package/dist/types/lib/rule-actions.d.ts +27 -0
- package/dist/types/rules/bash-bypass.d.ts +5 -0
- package/dist/types/rules/bash-deny.d.ts +4 -4
- package/dist/types/rules/bash-git.d.ts +2 -2
- package/dist/types/rules/bash-network-install.d.ts +2 -2
- package/dist/types/rules/bash-redirect.d.ts +2 -2
- package/dist/types/rules/bash-scoped-rm.d.ts +2 -2
- package/dist/types/rules/bash-tar-explosion.d.ts +2 -2
- package/dist/types/rules/config-custom.d.ts +3 -3
- package/dist/types/rules/embedded-code.d.ts +15 -0
- package/dist/types/rules/tool-policy.d.ts +2 -2
- package/package.json +11 -8
- package/dist/types/lib/bash.d.ts +0 -27
package/README.md
CHANGED
|
@@ -126,7 +126,7 @@ Tripwire includes checks for these operations:
|
|
|
126
126
|
|
|
127
127
|
The archive check is narrow. It denies `tar` extraction with `x` or `--extract` when `-C` or `--directory` targets `/` or the home directory. It applies the same destination rule to `unzip -d`. Archive listing, including `tar -tf archive.tar -C /`, is allowed. Tripwire does not inspect archive member paths.
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
Tripwire parses Bash into one unbash AST. It follows executable commands through control flow, loops, groups, subshells, functions, aliases, substitutions, redirects, wrappers, and configured remote execution carriers. It denies a program when an executable branch or policy discriminator remains unknown.
|
|
130
130
|
|
|
131
131
|
Protected-path checks compare the submitted path and its resolved target. New writes resolve the deepest existing parent, which prevents a symlink alias from hiding a protected destination.
|
|
132
132
|
|
|
@@ -156,10 +156,20 @@ Personal workflow preferences belong in `~/.config/tripwire/config.json`. A miss
|
|
|
156
156
|
"allowedCommands": [
|
|
157
157
|
{ "pattern": "project-safe-tool", "message": "This command is allowed by personal config." }
|
|
158
158
|
],
|
|
159
|
-
"
|
|
159
|
+
"ruleActions": { "no-verify": "deny" },
|
|
160
|
+
"secretScanner": { "executable": "betterleaks", "timeoutMs": 5000 },
|
|
161
|
+
"shell": {
|
|
162
|
+
"executionCarrierAliases": [{ "command": ["just", "tailnet", "ssh"], "equivalentTo": "ssh" }]
|
|
163
|
+
}
|
|
160
164
|
}
|
|
161
165
|
```
|
|
162
166
|
|
|
167
|
+
An execution-carrier alias states that a fixed command path has the same nested-shell behavior as `ssh`. Tripwire inspects the remote command with the same parser and rules. A dynamic remote command remains denied.
|
|
168
|
+
|
|
169
|
+
`ruleActions` can set a listed workflow-policy rule to `allow`, `warn`, `ask`, or `deny`. Unknown rule names and safety-invariant rule names fail config validation instead of silently weakening policy.
|
|
170
|
+
|
|
171
|
+
Configurable workflow rules are `brew-mutation`, `chmod-777-recursive`, `defaults-write`, `dscl-mutate`, `launchctl-mutation`, `mas-mutation`, `no-gpg-sign`, `no-verify`, `osascript`, `pmset-write`, `rsync-delete`, `scutil-set`, `security-keychain-add-write`, `softwareupdate-install`, `sudo`, `systemsetup`, and `topgrade`.
|
|
172
|
+
|
|
163
173
|
`toolPolicies` accepts these optional match fields:
|
|
164
174
|
|
|
165
175
|
- `argumentsIncludeAll`
|
|
@@ -197,6 +207,14 @@ tripwire test --post --tool=Bash --stdout='example output'
|
|
|
197
207
|
|
|
198
208
|
The post-tool example requires Betterleaks.
|
|
199
209
|
|
|
210
|
+
For a longer workflow, inspect one file snapshot and execute the same bytes:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
tripwire run-script ./scripts/inspect-and-build.sh -- first-argument
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
The runner reads the file once, checks the exact UTF-8 bytes, and sends those bytes to `/bin/bash -s`. Script arguments are included in value analysis. A denied or approval-required script does not start.
|
|
217
|
+
|
|
200
218
|
## Library API
|
|
201
219
|
|
|
202
220
|
```typescript
|