@agent-custody/receipts 0.13.0 → 0.15.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 +46 -28
- package/dist/check.d.ts +10 -0
- package/dist/check.js +179 -3
- package/dist/claude-init.d.ts +46 -0
- package/dist/claude-init.js +208 -0
- package/dist/cli.js +126 -11
- package/dist/config.d.ts +128 -1
- package/dist/config.js +92 -3
- package/dist/console.js +16 -7
- package/dist/deny-report.d.ts +30 -0
- package/dist/deny-report.js +106 -0
- package/dist/door.d.ts +203 -0
- package/dist/door.js +712 -0
- package/dist/export.d.ts +39 -0
- package/dist/export.js +95 -0
- package/dist/gateway.js +53 -21
- package/dist/index.d.ts +8 -0
- package/dist/index.js +7 -0
- package/dist/issue.js +5 -65
- package/dist/lock.d.ts +12 -0
- package/dist/lock.js +124 -0
- package/dist/log-admin.js +3 -3
- package/dist/log.d.ts +20 -3
- package/dist/log.js +117 -24
- package/dist/opa-server.d.ts +34 -0
- package/dist/opa-server.js +93 -0
- package/dist/policy-rego.d.ts +30 -0
- package/dist/policy-rego.js +114 -0
- package/dist/policy.d.ts +6 -0
- package/dist/policy.js +17 -0
- package/dist/pr-summary.d.ts +25 -0
- package/dist/pr-summary.js +87 -0
- package/dist/receipt.d.ts +3 -1
- package/dist/retention.d.ts +1 -1
- package/dist/retention.js +14 -4
- package/dist/sdk/claude.js +18 -2
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/index.js +11 -2
- package/dist/simulate.d.ts +3 -1
- package/dist/simulate.js +15 -7
- package/dist/verify.js +6 -3
- package/dist/witness.js +3 -3
- package/docs/compliance.md +117 -7
- package/docs/configuration.md +3 -3
- package/docs/door-signals.md +66 -0
- package/docs/door.md +168 -0
- package/docs/github-action.md +164 -0
- package/docs/policies.md +124 -1
- package/docs/sdk.md +99 -1
- package/docs/tutorials.md +5 -0
- package/docs/usage.md +3 -3
- package/docs/verification.md +9 -2
- package/package.json +16 -14
- package/templates/claude-code.cedar +373 -0
- package/vectors/audit.json +27 -27
- package/vectors/canonical.json +5 -5
- package/vectors/merkle.json +123 -0
- package/vectors/receipts.json +1258 -1005
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
// Starter policy for `agent-custody init claude-code`.
|
|
2
|
+
// The policy permits every call and forbids a short list of destructive Bash commands.
|
|
3
|
+
// A pattern matches the text of the command. It is not a sandbox: it catches the plain form of each command.
|
|
4
|
+
// Each rule has a `@reason`. The hook shows it to the agent and to the person who reads the session.
|
|
5
|
+
// The `like` operator is case-sensitive, and `*` is its only wildcard, so each SQL keyword has a rule for each case.
|
|
6
|
+
// A rule id is the place of the rule in this file (policy1, policy2, and so on). Change a rule in place. Add a new rule
|
|
7
|
+
// at the end, so that an id keeps naming the same rule.
|
|
8
|
+
permit(principal, action, resource);
|
|
9
|
+
|
|
10
|
+
// Rewriting shared history.
|
|
11
|
+
// `--force-with-lease` is a force push that fails when the remote has new commits. The policy allows it.
|
|
12
|
+
// A force push has `--force`, `-f`, or a refspec that starts with `+`, such as `git push origin +main`. The push can
|
|
13
|
+
// be `git push` or `git -C <dir> push`.
|
|
14
|
+
// `like` cannot find where one shell command ends. So a flag counts in three cases: it is the first argument of the
|
|
15
|
+
// push, or no `&`, `|`, `;`, or newline follows the push, or one of them follows the flag. In
|
|
16
|
+
// `git push origin main && npm install --force` the flag comes after the operator, and the command passes. A chain with
|
|
17
|
+
// two operators after the push can be denied by mistake: `git push && npm install --force && echo done`.
|
|
18
|
+
|
|
19
|
+
@reason("force push rewrites shared history (git push --force-with-lease is allowed)")
|
|
20
|
+
forbid(principal, action == Action::"Bash", resource)
|
|
21
|
+
when {
|
|
22
|
+
context.args has command && (
|
|
23
|
+
context.args.command like "*git push --force *"
|
|
24
|
+
|| context.args.command like "*git push --force"
|
|
25
|
+
|| context.args.command like "*git push -f*"
|
|
26
|
+
|| context.args.command like "*git push +*"
|
|
27
|
+
|| context.args.command like "*git -* push --force *"
|
|
28
|
+
|| context.args.command like "*git -* push --force"
|
|
29
|
+
|| context.args.command like "*git -* push -f*"
|
|
30
|
+
|| context.args.command like "*git -* push +*"
|
|
31
|
+
|| (!(context.args.command like "*git push*&*" || context.args.command like "*git push*|*" || context.args.command like "*git push*;*" || context.args.command like "*git push*\n*") && (
|
|
32
|
+
context.args.command like "*git push* --force *"
|
|
33
|
+
|| context.args.command like "*git push* --force"
|
|
34
|
+
|| context.args.command like "*git push* -f*"
|
|
35
|
+
|| context.args.command like "*git push* +*"
|
|
36
|
+
))
|
|
37
|
+
|| (!(context.args.command like "*git -* push*&*" || context.args.command like "*git -* push*|*" || context.args.command like "*git -* push*;*" || context.args.command like "*git -* push*\n*") && (
|
|
38
|
+
context.args.command like "*git -* push* --force *"
|
|
39
|
+
|| context.args.command like "*git -* push* --force"
|
|
40
|
+
|| context.args.command like "*git -* push* -f*"
|
|
41
|
+
|| context.args.command like "*git -* push* +*"
|
|
42
|
+
))
|
|
43
|
+
|| context.args.command like "*git push* --force *&*"
|
|
44
|
+
|| context.args.command like "*git push* --force&*"
|
|
45
|
+
|| context.args.command like "*git push* -f*&*"
|
|
46
|
+
|| context.args.command like "*git push* +*&*"
|
|
47
|
+
|| context.args.command like "*git push* --force *|*"
|
|
48
|
+
|| context.args.command like "*git push* --force|*"
|
|
49
|
+
|| context.args.command like "*git push* -f*|*"
|
|
50
|
+
|| context.args.command like "*git push* +*|*"
|
|
51
|
+
|| context.args.command like "*git push* --force *;*"
|
|
52
|
+
|| context.args.command like "*git push* --force;*"
|
|
53
|
+
|| context.args.command like "*git push* -f*;*"
|
|
54
|
+
|| context.args.command like "*git push* +*;*"
|
|
55
|
+
|| context.args.command like "*git push* --force *\n*"
|
|
56
|
+
|| context.args.command like "*git push* --force\n*"
|
|
57
|
+
|| context.args.command like "*git push* -f*\n*"
|
|
58
|
+
|| context.args.command like "*git push* +*\n*"
|
|
59
|
+
|| context.args.command like "*git -* push* --force *&*"
|
|
60
|
+
|| context.args.command like "*git -* push* --force&*"
|
|
61
|
+
|| context.args.command like "*git -* push* -f*&*"
|
|
62
|
+
|| context.args.command like "*git -* push* +*&*"
|
|
63
|
+
|| context.args.command like "*git -* push* --force *|*"
|
|
64
|
+
|| context.args.command like "*git -* push* --force|*"
|
|
65
|
+
|| context.args.command like "*git -* push* -f*|*"
|
|
66
|
+
|| context.args.command like "*git -* push* +*|*"
|
|
67
|
+
|| context.args.command like "*git -* push* --force *;*"
|
|
68
|
+
|| context.args.command like "*git -* push* --force;*"
|
|
69
|
+
|| context.args.command like "*git -* push* -f*;*"
|
|
70
|
+
|| context.args.command like "*git -* push* +*;*"
|
|
71
|
+
|| context.args.command like "*git -* push* --force *\n*"
|
|
72
|
+
|| context.args.command like "*git -* push* --force\n*"
|
|
73
|
+
|| context.args.command like "*git -* push* -f*\n*"
|
|
74
|
+
|| context.args.command like "*git -* push* +*\n*"
|
|
75
|
+
)
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// Deleting the root directory or the home directory.
|
|
79
|
+
// The flags are -rf, -fr, -Rf, -fR, and the separate forms -r -f, -f -r, -R -f, -f -R. The target is the directory, the
|
|
80
|
+
// directory with more arguments after it, or all its files (`/*`). The home directory may be quoted: `"$HOME"`.
|
|
81
|
+
@reason("rm -rf on the root directory")
|
|
82
|
+
forbid(principal, action == Action::"Bash", resource)
|
|
83
|
+
when {
|
|
84
|
+
context.args has command && (
|
|
85
|
+
context.args.command like "*rm -rf /"
|
|
86
|
+
|| context.args.command like "*rm -rf / *"
|
|
87
|
+
|| context.args.command like "*rm -rf /\*"
|
|
88
|
+
|| context.args.command like "*rm -fr /"
|
|
89
|
+
|| context.args.command like "*rm -fr / *"
|
|
90
|
+
|| context.args.command like "*rm -fr /\*"
|
|
91
|
+
|| context.args.command like "*rm -Rf /"
|
|
92
|
+
|| context.args.command like "*rm -Rf / *"
|
|
93
|
+
|| context.args.command like "*rm -Rf /\*"
|
|
94
|
+
|| context.args.command like "*rm -fR /"
|
|
95
|
+
|| context.args.command like "*rm -fR / *"
|
|
96
|
+
|| context.args.command like "*rm -fR /\*"
|
|
97
|
+
|| context.args.command like "*rm -r -f /"
|
|
98
|
+
|| context.args.command like "*rm -r -f / *"
|
|
99
|
+
|| context.args.command like "*rm -r -f /\*"
|
|
100
|
+
|| context.args.command like "*rm -f -r /"
|
|
101
|
+
|| context.args.command like "*rm -f -r / *"
|
|
102
|
+
|| context.args.command like "*rm -f -r /\*"
|
|
103
|
+
|| context.args.command like "*rm -R -f /"
|
|
104
|
+
|| context.args.command like "*rm -R -f / *"
|
|
105
|
+
|| context.args.command like "*rm -R -f /\*"
|
|
106
|
+
|| context.args.command like "*rm -f -R /"
|
|
107
|
+
|| context.args.command like "*rm -f -R / *"
|
|
108
|
+
|| context.args.command like "*rm -f -R /\*"
|
|
109
|
+
)
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
@reason("rm -rf on the home directory")
|
|
113
|
+
forbid(principal, action == Action::"Bash", resource)
|
|
114
|
+
when {
|
|
115
|
+
context.args has command && (
|
|
116
|
+
context.args.command like "*rm -rf ~"
|
|
117
|
+
|| context.args.command like "*rm -rf ~ *"
|
|
118
|
+
|| context.args.command like "*rm -rf ~/"
|
|
119
|
+
|| context.args.command like "*rm -rf ~/ *"
|
|
120
|
+
|| context.args.command like "*rm -rf ~/\*"
|
|
121
|
+
|| context.args.command like "*rm -fr ~"
|
|
122
|
+
|| context.args.command like "*rm -fr ~ *"
|
|
123
|
+
|| context.args.command like "*rm -fr ~/"
|
|
124
|
+
|| context.args.command like "*rm -fr ~/ *"
|
|
125
|
+
|| context.args.command like "*rm -fr ~/\*"
|
|
126
|
+
|| context.args.command like "*rm -Rf ~"
|
|
127
|
+
|| context.args.command like "*rm -Rf ~ *"
|
|
128
|
+
|| context.args.command like "*rm -Rf ~/"
|
|
129
|
+
|| context.args.command like "*rm -Rf ~/ *"
|
|
130
|
+
|| context.args.command like "*rm -Rf ~/\*"
|
|
131
|
+
|| context.args.command like "*rm -fR ~"
|
|
132
|
+
|| context.args.command like "*rm -fR ~ *"
|
|
133
|
+
|| context.args.command like "*rm -fR ~/"
|
|
134
|
+
|| context.args.command like "*rm -fR ~/ *"
|
|
135
|
+
|| context.args.command like "*rm -fR ~/\*"
|
|
136
|
+
|| context.args.command like "*rm -r -f ~"
|
|
137
|
+
|| context.args.command like "*rm -r -f ~ *"
|
|
138
|
+
|| context.args.command like "*rm -r -f ~/"
|
|
139
|
+
|| context.args.command like "*rm -r -f ~/ *"
|
|
140
|
+
|| context.args.command like "*rm -r -f ~/\*"
|
|
141
|
+
|| context.args.command like "*rm -f -r ~"
|
|
142
|
+
|| context.args.command like "*rm -f -r ~ *"
|
|
143
|
+
|| context.args.command like "*rm -f -r ~/"
|
|
144
|
+
|| context.args.command like "*rm -f -r ~/ *"
|
|
145
|
+
|| context.args.command like "*rm -f -r ~/\*"
|
|
146
|
+
|| context.args.command like "*rm -R -f ~"
|
|
147
|
+
|| context.args.command like "*rm -R -f ~ *"
|
|
148
|
+
|| context.args.command like "*rm -R -f ~/"
|
|
149
|
+
|| context.args.command like "*rm -R -f ~/ *"
|
|
150
|
+
|| context.args.command like "*rm -R -f ~/\*"
|
|
151
|
+
|| context.args.command like "*rm -f -R ~"
|
|
152
|
+
|| context.args.command like "*rm -f -R ~ *"
|
|
153
|
+
|| context.args.command like "*rm -f -R ~/"
|
|
154
|
+
|| context.args.command like "*rm -f -R ~/ *"
|
|
155
|
+
|| context.args.command like "*rm -f -R ~/\*"
|
|
156
|
+
)
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
@reason("rm -rf on the home directory")
|
|
160
|
+
forbid(principal, action == Action::"Bash", resource)
|
|
161
|
+
when {
|
|
162
|
+
context.args has command && (
|
|
163
|
+
context.args.command like "*rm -rf $HOME"
|
|
164
|
+
|| context.args.command like "*rm -rf $HOME *"
|
|
165
|
+
|| context.args.command like "*rm -rf $HOME/"
|
|
166
|
+
|| context.args.command like "*rm -rf $HOME/ *"
|
|
167
|
+
|| context.args.command like "*rm -rf $HOME/\*"
|
|
168
|
+
|| context.args.command like "*rm -rf ${HOME}"
|
|
169
|
+
|| context.args.command like "*rm -rf ${HOME} *"
|
|
170
|
+
|| context.args.command like "*rm -rf ${HOME}/"
|
|
171
|
+
|| context.args.command like "*rm -rf ${HOME}/ *"
|
|
172
|
+
|| context.args.command like "*rm -rf ${HOME}/\*"
|
|
173
|
+
|| context.args.command like "*rm -rf \"$HOME\""
|
|
174
|
+
|| context.args.command like "*rm -rf \"$HOME\" *"
|
|
175
|
+
|| context.args.command like "*rm -rf \"$HOME\"/"
|
|
176
|
+
|| context.args.command like "*rm -rf \"$HOME\"/ *"
|
|
177
|
+
|| context.args.command like "*rm -rf \"$HOME\"/\*"
|
|
178
|
+
|| context.args.command like "*rm -rf \"${HOME}\""
|
|
179
|
+
|| context.args.command like "*rm -rf \"${HOME}\" *"
|
|
180
|
+
|| context.args.command like "*rm -rf \"${HOME}\"/"
|
|
181
|
+
|| context.args.command like "*rm -rf \"${HOME}\"/ *"
|
|
182
|
+
|| context.args.command like "*rm -rf \"${HOME}\"/\*"
|
|
183
|
+
|| context.args.command like "*rm -rf \"$HOME/\""
|
|
184
|
+
|| context.args.command like "*rm -rf \"$HOME/\" *"
|
|
185
|
+
|| context.args.command like "*rm -rf \"${HOME}/\""
|
|
186
|
+
|| context.args.command like "*rm -rf \"${HOME}/\" *"
|
|
187
|
+
|| context.args.command like "*rm -fr $HOME"
|
|
188
|
+
|| context.args.command like "*rm -fr $HOME *"
|
|
189
|
+
|| context.args.command like "*rm -fr $HOME/"
|
|
190
|
+
|| context.args.command like "*rm -fr $HOME/ *"
|
|
191
|
+
|| context.args.command like "*rm -fr $HOME/\*"
|
|
192
|
+
|| context.args.command like "*rm -fr ${HOME}"
|
|
193
|
+
|| context.args.command like "*rm -fr ${HOME} *"
|
|
194
|
+
|| context.args.command like "*rm -fr ${HOME}/"
|
|
195
|
+
|| context.args.command like "*rm -fr ${HOME}/ *"
|
|
196
|
+
|| context.args.command like "*rm -fr ${HOME}/\*"
|
|
197
|
+
|| context.args.command like "*rm -fr \"$HOME\""
|
|
198
|
+
|| context.args.command like "*rm -fr \"$HOME\" *"
|
|
199
|
+
|| context.args.command like "*rm -fr \"$HOME\"/"
|
|
200
|
+
|| context.args.command like "*rm -fr \"$HOME\"/ *"
|
|
201
|
+
|| context.args.command like "*rm -fr \"$HOME\"/\*"
|
|
202
|
+
|| context.args.command like "*rm -fr \"${HOME}\""
|
|
203
|
+
|| context.args.command like "*rm -fr \"${HOME}\" *"
|
|
204
|
+
|| context.args.command like "*rm -fr \"${HOME}\"/"
|
|
205
|
+
|| context.args.command like "*rm -fr \"${HOME}\"/ *"
|
|
206
|
+
|| context.args.command like "*rm -fr \"${HOME}\"/\*"
|
|
207
|
+
|| context.args.command like "*rm -fr \"$HOME/\""
|
|
208
|
+
|| context.args.command like "*rm -fr \"$HOME/\" *"
|
|
209
|
+
|| context.args.command like "*rm -fr \"${HOME}/\""
|
|
210
|
+
|| context.args.command like "*rm -fr \"${HOME}/\" *"
|
|
211
|
+
|| context.args.command like "*rm -Rf $HOME"
|
|
212
|
+
|| context.args.command like "*rm -Rf $HOME *"
|
|
213
|
+
|| context.args.command like "*rm -Rf $HOME/"
|
|
214
|
+
|| context.args.command like "*rm -Rf $HOME/ *"
|
|
215
|
+
|| context.args.command like "*rm -Rf $HOME/\*"
|
|
216
|
+
|| context.args.command like "*rm -Rf ${HOME}"
|
|
217
|
+
|| context.args.command like "*rm -Rf ${HOME} *"
|
|
218
|
+
|| context.args.command like "*rm -Rf ${HOME}/"
|
|
219
|
+
|| context.args.command like "*rm -Rf ${HOME}/ *"
|
|
220
|
+
|| context.args.command like "*rm -Rf ${HOME}/\*"
|
|
221
|
+
|| context.args.command like "*rm -Rf \"$HOME\""
|
|
222
|
+
|| context.args.command like "*rm -Rf \"$HOME\" *"
|
|
223
|
+
|| context.args.command like "*rm -Rf \"$HOME\"/"
|
|
224
|
+
|| context.args.command like "*rm -Rf \"$HOME\"/ *"
|
|
225
|
+
|| context.args.command like "*rm -Rf \"$HOME\"/\*"
|
|
226
|
+
|| context.args.command like "*rm -Rf \"${HOME}\""
|
|
227
|
+
|| context.args.command like "*rm -Rf \"${HOME}\" *"
|
|
228
|
+
|| context.args.command like "*rm -Rf \"${HOME}\"/"
|
|
229
|
+
|| context.args.command like "*rm -Rf \"${HOME}\"/ *"
|
|
230
|
+
|| context.args.command like "*rm -Rf \"${HOME}\"/\*"
|
|
231
|
+
|| context.args.command like "*rm -Rf \"$HOME/\""
|
|
232
|
+
|| context.args.command like "*rm -Rf \"$HOME/\" *"
|
|
233
|
+
|| context.args.command like "*rm -Rf \"${HOME}/\""
|
|
234
|
+
|| context.args.command like "*rm -Rf \"${HOME}/\" *"
|
|
235
|
+
|| context.args.command like "*rm -fR $HOME"
|
|
236
|
+
|| context.args.command like "*rm -fR $HOME *"
|
|
237
|
+
|| context.args.command like "*rm -fR $HOME/"
|
|
238
|
+
|| context.args.command like "*rm -fR $HOME/ *"
|
|
239
|
+
|| context.args.command like "*rm -fR $HOME/\*"
|
|
240
|
+
|| context.args.command like "*rm -fR ${HOME}"
|
|
241
|
+
|| context.args.command like "*rm -fR ${HOME} *"
|
|
242
|
+
|| context.args.command like "*rm -fR ${HOME}/"
|
|
243
|
+
|| context.args.command like "*rm -fR ${HOME}/ *"
|
|
244
|
+
|| context.args.command like "*rm -fR ${HOME}/\*"
|
|
245
|
+
|| context.args.command like "*rm -fR \"$HOME\""
|
|
246
|
+
|| context.args.command like "*rm -fR \"$HOME\" *"
|
|
247
|
+
|| context.args.command like "*rm -fR \"$HOME\"/"
|
|
248
|
+
|| context.args.command like "*rm -fR \"$HOME\"/ *"
|
|
249
|
+
|| context.args.command like "*rm -fR \"$HOME\"/\*"
|
|
250
|
+
|| context.args.command like "*rm -fR \"${HOME}\""
|
|
251
|
+
|| context.args.command like "*rm -fR \"${HOME}\" *"
|
|
252
|
+
|| context.args.command like "*rm -fR \"${HOME}\"/"
|
|
253
|
+
|| context.args.command like "*rm -fR \"${HOME}\"/ *"
|
|
254
|
+
|| context.args.command like "*rm -fR \"${HOME}\"/\*"
|
|
255
|
+
|| context.args.command like "*rm -fR \"$HOME/\""
|
|
256
|
+
|| context.args.command like "*rm -fR \"$HOME/\" *"
|
|
257
|
+
|| context.args.command like "*rm -fR \"${HOME}/\""
|
|
258
|
+
|| context.args.command like "*rm -fR \"${HOME}/\" *"
|
|
259
|
+
|| context.args.command like "*rm -r -f $HOME"
|
|
260
|
+
|| context.args.command like "*rm -r -f $HOME *"
|
|
261
|
+
|| context.args.command like "*rm -r -f $HOME/"
|
|
262
|
+
|| context.args.command like "*rm -r -f $HOME/ *"
|
|
263
|
+
|| context.args.command like "*rm -r -f $HOME/\*"
|
|
264
|
+
|| context.args.command like "*rm -r -f ${HOME}"
|
|
265
|
+
|| context.args.command like "*rm -r -f ${HOME} *"
|
|
266
|
+
|| context.args.command like "*rm -r -f ${HOME}/"
|
|
267
|
+
|| context.args.command like "*rm -r -f ${HOME}/ *"
|
|
268
|
+
|| context.args.command like "*rm -r -f ${HOME}/\*"
|
|
269
|
+
|| context.args.command like "*rm -r -f \"$HOME\""
|
|
270
|
+
|| context.args.command like "*rm -r -f \"$HOME\" *"
|
|
271
|
+
|| context.args.command like "*rm -r -f \"$HOME\"/"
|
|
272
|
+
|| context.args.command like "*rm -r -f \"$HOME\"/ *"
|
|
273
|
+
|| context.args.command like "*rm -r -f \"$HOME\"/\*"
|
|
274
|
+
|| context.args.command like "*rm -r -f \"${HOME}\""
|
|
275
|
+
|| context.args.command like "*rm -r -f \"${HOME}\" *"
|
|
276
|
+
|| context.args.command like "*rm -r -f \"${HOME}\"/"
|
|
277
|
+
|| context.args.command like "*rm -r -f \"${HOME}\"/ *"
|
|
278
|
+
|| context.args.command like "*rm -r -f \"${HOME}\"/\*"
|
|
279
|
+
|| context.args.command like "*rm -r -f \"$HOME/\""
|
|
280
|
+
|| context.args.command like "*rm -r -f \"$HOME/\" *"
|
|
281
|
+
|| context.args.command like "*rm -r -f \"${HOME}/\""
|
|
282
|
+
|| context.args.command like "*rm -r -f \"${HOME}/\" *"
|
|
283
|
+
|| context.args.command like "*rm -f -r $HOME"
|
|
284
|
+
|| context.args.command like "*rm -f -r $HOME *"
|
|
285
|
+
|| context.args.command like "*rm -f -r $HOME/"
|
|
286
|
+
|| context.args.command like "*rm -f -r $HOME/ *"
|
|
287
|
+
|| context.args.command like "*rm -f -r $HOME/\*"
|
|
288
|
+
|| context.args.command like "*rm -f -r ${HOME}"
|
|
289
|
+
|| context.args.command like "*rm -f -r ${HOME} *"
|
|
290
|
+
|| context.args.command like "*rm -f -r ${HOME}/"
|
|
291
|
+
|| context.args.command like "*rm -f -r ${HOME}/ *"
|
|
292
|
+
|| context.args.command like "*rm -f -r ${HOME}/\*"
|
|
293
|
+
|| context.args.command like "*rm -f -r \"$HOME\""
|
|
294
|
+
|| context.args.command like "*rm -f -r \"$HOME\" *"
|
|
295
|
+
|| context.args.command like "*rm -f -r \"$HOME\"/"
|
|
296
|
+
|| context.args.command like "*rm -f -r \"$HOME\"/ *"
|
|
297
|
+
|| context.args.command like "*rm -f -r \"$HOME\"/\*"
|
|
298
|
+
|| context.args.command like "*rm -f -r \"${HOME}\""
|
|
299
|
+
|| context.args.command like "*rm -f -r \"${HOME}\" *"
|
|
300
|
+
|| context.args.command like "*rm -f -r \"${HOME}\"/"
|
|
301
|
+
|| context.args.command like "*rm -f -r \"${HOME}\"/ *"
|
|
302
|
+
|| context.args.command like "*rm -f -r \"${HOME}\"/\*"
|
|
303
|
+
|| context.args.command like "*rm -f -r \"$HOME/\""
|
|
304
|
+
|| context.args.command like "*rm -f -r \"$HOME/\" *"
|
|
305
|
+
|| context.args.command like "*rm -f -r \"${HOME}/\""
|
|
306
|
+
|| context.args.command like "*rm -f -r \"${HOME}/\" *"
|
|
307
|
+
|| context.args.command like "*rm -R -f $HOME"
|
|
308
|
+
|| context.args.command like "*rm -R -f $HOME *"
|
|
309
|
+
|| context.args.command like "*rm -R -f $HOME/"
|
|
310
|
+
|| context.args.command like "*rm -R -f $HOME/ *"
|
|
311
|
+
|| context.args.command like "*rm -R -f $HOME/\*"
|
|
312
|
+
|| context.args.command like "*rm -R -f ${HOME}"
|
|
313
|
+
|| context.args.command like "*rm -R -f ${HOME} *"
|
|
314
|
+
|| context.args.command like "*rm -R -f ${HOME}/"
|
|
315
|
+
|| context.args.command like "*rm -R -f ${HOME}/ *"
|
|
316
|
+
|| context.args.command like "*rm -R -f ${HOME}/\*"
|
|
317
|
+
|| context.args.command like "*rm -R -f \"$HOME\""
|
|
318
|
+
|| context.args.command like "*rm -R -f \"$HOME\" *"
|
|
319
|
+
|| context.args.command like "*rm -R -f \"$HOME\"/"
|
|
320
|
+
|| context.args.command like "*rm -R -f \"$HOME\"/ *"
|
|
321
|
+
|| context.args.command like "*rm -R -f \"$HOME\"/\*"
|
|
322
|
+
|| context.args.command like "*rm -R -f \"${HOME}\""
|
|
323
|
+
|| context.args.command like "*rm -R -f \"${HOME}\" *"
|
|
324
|
+
|| context.args.command like "*rm -R -f \"${HOME}\"/"
|
|
325
|
+
|| context.args.command like "*rm -R -f \"${HOME}\"/ *"
|
|
326
|
+
|| context.args.command like "*rm -R -f \"${HOME}\"/\*"
|
|
327
|
+
|| context.args.command like "*rm -R -f \"$HOME/\""
|
|
328
|
+
|| context.args.command like "*rm -R -f \"$HOME/\" *"
|
|
329
|
+
|| context.args.command like "*rm -R -f \"${HOME}/\""
|
|
330
|
+
|| context.args.command like "*rm -R -f \"${HOME}/\" *"
|
|
331
|
+
|| context.args.command like "*rm -f -R $HOME"
|
|
332
|
+
|| context.args.command like "*rm -f -R $HOME *"
|
|
333
|
+
|| context.args.command like "*rm -f -R $HOME/"
|
|
334
|
+
|| context.args.command like "*rm -f -R $HOME/ *"
|
|
335
|
+
|| context.args.command like "*rm -f -R $HOME/\*"
|
|
336
|
+
|| context.args.command like "*rm -f -R ${HOME}"
|
|
337
|
+
|| context.args.command like "*rm -f -R ${HOME} *"
|
|
338
|
+
|| context.args.command like "*rm -f -R ${HOME}/"
|
|
339
|
+
|| context.args.command like "*rm -f -R ${HOME}/ *"
|
|
340
|
+
|| context.args.command like "*rm -f -R ${HOME}/\*"
|
|
341
|
+
|| context.args.command like "*rm -f -R \"$HOME\""
|
|
342
|
+
|| context.args.command like "*rm -f -R \"$HOME\" *"
|
|
343
|
+
|| context.args.command like "*rm -f -R \"$HOME\"/"
|
|
344
|
+
|| context.args.command like "*rm -f -R \"$HOME\"/ *"
|
|
345
|
+
|| context.args.command like "*rm -f -R \"$HOME\"/\*"
|
|
346
|
+
|| context.args.command like "*rm -f -R \"${HOME}\""
|
|
347
|
+
|| context.args.command like "*rm -f -R \"${HOME}\" *"
|
|
348
|
+
|| context.args.command like "*rm -f -R \"${HOME}\"/"
|
|
349
|
+
|| context.args.command like "*rm -f -R \"${HOME}\"/ *"
|
|
350
|
+
|| context.args.command like "*rm -f -R \"${HOME}\"/\*"
|
|
351
|
+
|| context.args.command like "*rm -f -R \"$HOME/\""
|
|
352
|
+
|| context.args.command like "*rm -f -R \"$HOME/\" *"
|
|
353
|
+
|| context.args.command like "*rm -f -R \"${HOME}/\""
|
|
354
|
+
|| context.args.command like "*rm -f -R \"${HOME}/\" *"
|
|
355
|
+
)
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
// Destroying infrastructure or a database.
|
|
359
|
+
@reason("terraform destroy deletes infrastructure")
|
|
360
|
+
forbid(principal, action == Action::"Bash", resource)
|
|
361
|
+
when { context.args has command && context.args.command like "*terraform destroy*" };
|
|
362
|
+
|
|
363
|
+
@reason("terraform apply -destroy deletes infrastructure")
|
|
364
|
+
forbid(principal, action == Action::"Bash", resource)
|
|
365
|
+
when { context.args has command && context.args.command like "*terraform apply* -destroy*" };
|
|
366
|
+
|
|
367
|
+
@reason("drop database deletes a database")
|
|
368
|
+
forbid(principal, action == Action::"Bash", resource)
|
|
369
|
+
when { context.args has command && context.args.command like "*drop database*" };
|
|
370
|
+
|
|
371
|
+
@reason("drop database deletes a database")
|
|
372
|
+
forbid(principal, action == Action::"Bash", resource)
|
|
373
|
+
when { context.args has command && context.args.command like "*DROP DATABASE*" };
|
package/vectors/audit.json
CHANGED
|
@@ -7,26 +7,26 @@
|
|
|
7
7
|
"description": "The tree head from the first remote receipt and the log's later head, with the proof the log served.",
|
|
8
8
|
"older": {
|
|
9
9
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
10
|
-
"payload": "
|
|
10
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiMjk5YTk4YjA3NTFkNzdiN2UyNzgxZGU2MzMwMzhkYWZmYjYxYmEwM2FhZWJhZjZiMDE3ZGI3OTE5ZTk4ZDliNCIsInRpbWVzdGFtcCI6IjIwMjYtMTEtMDFUMTA6MTA6MDMuMzQzWiIsInRyZWVTaXplIjoxfQ==",
|
|
11
11
|
"signatures": [
|
|
12
12
|
{
|
|
13
|
-
"keyid": "
|
|
14
|
-
"sig": "
|
|
13
|
+
"keyid": "c4de6d4c1616938f8c8c679ebed89781d2fa1565d536032d9054f6c73461df57",
|
|
14
|
+
"sig": "jPpTYFCQs7cl08hkhs/5J6oMD3BPqbuO97znCbfjBKquXlpmtC+HEb/dhmC0BeJdsi3v3UiMyFJvZT2ffzrfBA=="
|
|
15
15
|
}
|
|
16
16
|
]
|
|
17
17
|
},
|
|
18
18
|
"newer": {
|
|
19
19
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
20
|
-
"payload": "
|
|
20
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiN2E3MWJlOTczY2JkODY5N2M3OGQxMDk0MDQ0MzA0YzNhYzMyZTZkNmNlNGNlNmEwNzI5ZjZjOGE5MTYxZDIzZCIsInRpbWVzdGFtcCI6IjIwMjYtMTEtMDFUMTA6MTA6MDMuMzQ4WiIsInRyZWVTaXplIjoyfQ==",
|
|
21
21
|
"signatures": [
|
|
22
22
|
{
|
|
23
|
-
"keyid": "
|
|
24
|
-
"sig": "
|
|
23
|
+
"keyid": "c4de6d4c1616938f8c8c679ebed89781d2fa1565d536032d9054f6c73461df57",
|
|
24
|
+
"sig": "UbFM1MwVOvPUQsFzVAAxWBNkvIiJBKAey/q5ta5e6nR1Hfk1nGcFvjgqxUB02rPr7PZTZ9Q0eOMXPq1SnJbuCA=="
|
|
25
25
|
}
|
|
26
26
|
]
|
|
27
27
|
},
|
|
28
28
|
"proof": [
|
|
29
|
-
"
|
|
29
|
+
"2b8ebb8443eaff76abdec18e26dbaf2aecf78dabf94b4c8a08acfe4f7ca541c5"
|
|
30
30
|
],
|
|
31
31
|
"keys": [
|
|
32
32
|
"log"
|
|
@@ -41,26 +41,26 @@
|
|
|
41
41
|
"description": "The same heads the wrong way round.",
|
|
42
42
|
"older": {
|
|
43
43
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
44
|
-
"payload": "
|
|
44
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiN2E3MWJlOTczY2JkODY5N2M3OGQxMDk0MDQ0MzA0YzNhYzMyZTZkNmNlNGNlNmEwNzI5ZjZjOGE5MTYxZDIzZCIsInRpbWVzdGFtcCI6IjIwMjYtMTEtMDFUMTA6MTA6MDMuMzQ4WiIsInRyZWVTaXplIjoyfQ==",
|
|
45
45
|
"signatures": [
|
|
46
46
|
{
|
|
47
|
-
"keyid": "
|
|
48
|
-
"sig": "
|
|
47
|
+
"keyid": "c4de6d4c1616938f8c8c679ebed89781d2fa1565d536032d9054f6c73461df57",
|
|
48
|
+
"sig": "UbFM1MwVOvPUQsFzVAAxWBNkvIiJBKAey/q5ta5e6nR1Hfk1nGcFvjgqxUB02rPr7PZTZ9Q0eOMXPq1SnJbuCA=="
|
|
49
49
|
}
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
52
|
"newer": {
|
|
53
53
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
54
|
-
"payload": "
|
|
54
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiMjk5YTk4YjA3NTFkNzdiN2UyNzgxZGU2MzMwMzhkYWZmYjYxYmEwM2FhZWJhZjZiMDE3ZGI3OTE5ZTk4ZDliNCIsInRpbWVzdGFtcCI6IjIwMjYtMTEtMDFUMTA6MTA6MDMuMzQzWiIsInRyZWVTaXplIjoxfQ==",
|
|
55
55
|
"signatures": [
|
|
56
56
|
{
|
|
57
|
-
"keyid": "
|
|
58
|
-
"sig": "
|
|
57
|
+
"keyid": "c4de6d4c1616938f8c8c679ebed89781d2fa1565d536032d9054f6c73461df57",
|
|
58
|
+
"sig": "jPpTYFCQs7cl08hkhs/5J6oMD3BPqbuO97znCbfjBKquXlpmtC+HEb/dhmC0BeJdsi3v3UiMyFJvZT2ffzrfBA=="
|
|
59
59
|
}
|
|
60
60
|
]
|
|
61
61
|
},
|
|
62
62
|
"proof": [
|
|
63
|
-
"
|
|
63
|
+
"2b8ebb8443eaff76abdec18e26dbaf2aecf78dabf94b4c8a08acfe4f7ca541c5"
|
|
64
64
|
],
|
|
65
65
|
"keys": [
|
|
66
66
|
"log"
|
|
@@ -77,26 +77,26 @@
|
|
|
77
77
|
"description": "Tree heads checked against the app key, which did not sign them.",
|
|
78
78
|
"older": {
|
|
79
79
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
80
|
-
"payload": "
|
|
80
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiMjk5YTk4YjA3NTFkNzdiN2UyNzgxZGU2MzMwMzhkYWZmYjYxYmEwM2FhZWJhZjZiMDE3ZGI3OTE5ZTk4ZDliNCIsInRpbWVzdGFtcCI6IjIwMjYtMTEtMDFUMTA6MTA6MDMuMzQzWiIsInRyZWVTaXplIjoxfQ==",
|
|
81
81
|
"signatures": [
|
|
82
82
|
{
|
|
83
|
-
"keyid": "
|
|
84
|
-
"sig": "
|
|
83
|
+
"keyid": "c4de6d4c1616938f8c8c679ebed89781d2fa1565d536032d9054f6c73461df57",
|
|
84
|
+
"sig": "jPpTYFCQs7cl08hkhs/5J6oMD3BPqbuO97znCbfjBKquXlpmtC+HEb/dhmC0BeJdsi3v3UiMyFJvZT2ffzrfBA=="
|
|
85
85
|
}
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
88
|
"newer": {
|
|
89
89
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
90
|
-
"payload": "
|
|
90
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiN2E3MWJlOTczY2JkODY5N2M3OGQxMDk0MDQ0MzA0YzNhYzMyZTZkNmNlNGNlNmEwNzI5ZjZjOGE5MTYxZDIzZCIsInRpbWVzdGFtcCI6IjIwMjYtMTEtMDFUMTA6MTA6MDMuMzQ4WiIsInRyZWVTaXplIjoyfQ==",
|
|
91
91
|
"signatures": [
|
|
92
92
|
{
|
|
93
|
-
"keyid": "
|
|
94
|
-
"sig": "
|
|
93
|
+
"keyid": "c4de6d4c1616938f8c8c679ebed89781d2fa1565d536032d9054f6c73461df57",
|
|
94
|
+
"sig": "UbFM1MwVOvPUQsFzVAAxWBNkvIiJBKAey/q5ta5e6nR1Hfk1nGcFvjgqxUB02rPr7PZTZ9Q0eOMXPq1SnJbuCA=="
|
|
95
95
|
}
|
|
96
96
|
]
|
|
97
97
|
},
|
|
98
98
|
"proof": [
|
|
99
|
-
"
|
|
99
|
+
"2b8ebb8443eaff76abdec18e26dbaf2aecf78dabf94b4c8a08acfe4f7ca541c5"
|
|
100
100
|
],
|
|
101
101
|
"keys": [
|
|
102
102
|
"app"
|
|
@@ -114,21 +114,21 @@
|
|
|
114
114
|
"description": "A proof with a hash removed.",
|
|
115
115
|
"older": {
|
|
116
116
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
117
|
-
"payload": "
|
|
117
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiMjk5YTk4YjA3NTFkNzdiN2UyNzgxZGU2MzMwMzhkYWZmYjYxYmEwM2FhZWJhZjZiMDE3ZGI3OTE5ZTk4ZDliNCIsInRpbWVzdGFtcCI6IjIwMjYtMTEtMDFUMTA6MTA6MDMuMzQzWiIsInRyZWVTaXplIjoxfQ==",
|
|
118
118
|
"signatures": [
|
|
119
119
|
{
|
|
120
|
-
"keyid": "
|
|
121
|
-
"sig": "
|
|
120
|
+
"keyid": "c4de6d4c1616938f8c8c679ebed89781d2fa1565d536032d9054f6c73461df57",
|
|
121
|
+
"sig": "jPpTYFCQs7cl08hkhs/5J6oMD3BPqbuO97znCbfjBKquXlpmtC+HEb/dhmC0BeJdsi3v3UiMyFJvZT2ffzrfBA=="
|
|
122
122
|
}
|
|
123
123
|
]
|
|
124
124
|
},
|
|
125
125
|
"newer": {
|
|
126
126
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
127
|
-
"payload": "
|
|
127
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiN2E3MWJlOTczY2JkODY5N2M3OGQxMDk0MDQ0MzA0YzNhYzMyZTZkNmNlNGNlNmEwNzI5ZjZjOGE5MTYxZDIzZCIsInRpbWVzdGFtcCI6IjIwMjYtMTEtMDFUMTA6MTA6MDMuMzQ4WiIsInRyZWVTaXplIjoyfQ==",
|
|
128
128
|
"signatures": [
|
|
129
129
|
{
|
|
130
|
-
"keyid": "
|
|
131
|
-
"sig": "
|
|
130
|
+
"keyid": "c4de6d4c1616938f8c8c679ebed89781d2fa1565d536032d9054f6c73461df57",
|
|
131
|
+
"sig": "UbFM1MwVOvPUQsFzVAAxWBNkvIiJBKAey/q5ta5e6nR1Hfk1nGcFvjgqxUB02rPr7PZTZ9Q0eOMXPq1SnJbuCA=="
|
|
132
132
|
}
|
|
133
133
|
]
|
|
134
134
|
},
|
package/vectors/canonical.json
CHANGED
|
@@ -53,18 +53,18 @@
|
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
55
|
"keyid": {
|
|
56
|
-
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\
|
|
57
|
-
"keyid": "
|
|
56
|
+
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAEj8F+jbisOb9+9zlHGSGBI14LeUTnJG1DuQXfOiWuRQ=\n-----END PUBLIC KEY-----\n",
|
|
57
|
+
"keyid": "7a94ecb793868213306a0aff643ced9c6ff265503ab77e9cfb149b8208400eb9"
|
|
58
58
|
},
|
|
59
59
|
"dsse": {
|
|
60
|
-
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\
|
|
60
|
+
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAEj8F+jbisOb9+9zlHGSGBI14LeUTnJG1DuQXfOiWuRQ=\n-----END PUBLIC KEY-----\n",
|
|
61
61
|
"envelope": {
|
|
62
62
|
"payloadType": "application/vnd.example+json",
|
|
63
63
|
"payload": "eyJoZWxsbyI6IndvcmxkIn0=",
|
|
64
64
|
"signatures": [
|
|
65
65
|
{
|
|
66
|
-
"keyid": "
|
|
67
|
-
"sig": "
|
|
66
|
+
"keyid": "7a94ecb793868213306a0aff643ced9c6ff265503ab77e9cfb149b8208400eb9",
|
|
67
|
+
"sig": "k8FdQAn72W3S594mZvtnWX2UTROvZUIFg/R5OXPwpevPMEhrV29XHILvXo/C0vv3YsdVmkItAOK2rrW7HnDtBg=="
|
|
68
68
|
}
|
|
69
69
|
]
|
|
70
70
|
},
|