@raishin/vanguard-frontier-agentic 3.15.0 → 3.16.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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/.github/plugin/marketplace.json +1 -1
- package/catalog/AGENTS.md +2 -1
- package/catalog/asset-integrity.json +476 -29
- package/catalog/index.json +3 -2
- package/catalog/mods.json +131 -0
- package/mods/README.md +220 -0
- package/mods/audit-trail/README.md +70 -0
- package/mods/audit-trail/bin/hook.mjs +65 -0
- package/mods/audit-trail/claude-code/UNSUPPORTED.md +11 -0
- package/mods/audit-trail/claude-code/settings.hooks.json +14 -0
- package/mods/audit-trail/codex/hooks.json +14 -0
- package/mods/audit-trail/kiro/UNSUPPORTED.md +7 -0
- package/mods/audit-trail/kiro/audit-trail-post-tool-use-hook.json +14 -0
- package/mods/audit-trail/lib/common.mjs +213 -0
- package/mods/audit-trail/lib/core.mjs +50 -0
- package/mods/audit-trail/lib/runtime.mjs +140 -0
- package/mods/audit-trail/mod.toml +37 -0
- package/mods/blast-radius-guard/.claude-plugin/plugin.json +5 -0
- package/mods/blast-radius-guard/README.md +53 -0
- package/mods/blast-radius-guard/bin/hook.mjs +18 -0
- package/mods/blast-radius-guard/claude-code/settings.hooks.json +14 -0
- package/mods/blast-radius-guard/codex/UNSUPPORTED.md +7 -0
- package/mods/blast-radius-guard/codex/hooks.json +14 -0
- package/mods/blast-radius-guard/hooks/hooks.json +5 -0
- package/mods/blast-radius-guard/hooks/register.test.ts +97 -0
- package/mods/blast-radius-guard/hooks/register.ts +13 -0
- package/mods/blast-radius-guard/kiro/UNSUPPORTED.md +7 -0
- package/mods/blast-radius-guard/kiro/blast-radius-guard-pre-tool-use-hook.json +14 -0
- package/mods/blast-radius-guard/lib/common.mjs +213 -0
- package/mods/blast-radius-guard/lib/core.mjs +66 -0
- package/mods/blast-radius-guard/lib/patterns.mjs +102 -0
- package/mods/blast-radius-guard/lib/runtime.mjs +140 -0
- package/mods/blast-radius-guard/mod.toml +34 -0
- package/mods/blast-radius-guard/patterns.json +101 -0
- package/mods/context-burn/.claude-plugin/plugin.json +5 -0
- package/mods/context-burn/README.md +66 -0
- package/mods/context-burn/bin/hook.mjs +38 -0
- package/mods/context-burn/claude-code/UNSUPPORTED.md +7 -0
- package/mods/context-burn/claude-code/settings.hooks.json +24 -0
- package/mods/context-burn/codex/UNSUPPORTED.md +7 -0
- package/mods/context-burn/codex/hooks.json +24 -0
- package/mods/context-burn/hooks/hooks.json +5 -0
- package/mods/context-burn/hooks/register.test.ts +151 -0
- package/mods/context-burn/hooks/register.ts +35 -0
- package/mods/context-burn/kiro/UNSUPPORTED.md +7 -0
- package/mods/context-burn/kiro/context-burn-post-tool-use-hook.json +14 -0
- package/mods/context-burn/kiro/context-burn-session-start-hook.json +14 -0
- package/mods/context-burn/lib/common.mjs +213 -0
- package/mods/context-burn/lib/core.mjs +79 -0
- package/mods/context-burn/lib/runtime.mjs +140 -0
- package/mods/context-burn/mod.toml +37 -0
- package/mods/live-guard-gate/.claude-plugin/plugin.json +5 -0
- package/mods/live-guard-gate/README.md +43 -0
- package/mods/live-guard-gate/bin/hook.mjs +12 -0
- package/mods/live-guard-gate/claude-code/settings.hooks.json +14 -0
- package/mods/live-guard-gate/codex/UNSUPPORTED.md +7 -0
- package/mods/live-guard-gate/codex/hooks.json +14 -0
- package/mods/live-guard-gate/hooks/hooks.json +5 -0
- package/mods/live-guard-gate/hooks/register.test.ts +59 -0
- package/mods/live-guard-gate/hooks/register.ts +11 -0
- package/mods/live-guard-gate/kiro/UNSUPPORTED.md +7 -0
- package/mods/live-guard-gate/kiro/live-guard-gate-pre-tool-use-hook.json +14 -0
- package/mods/live-guard-gate/lib/common.mjs +213 -0
- package/mods/live-guard-gate/lib/core.mjs +24 -0
- package/mods/live-guard-gate/lib/live-agents.mjs +65 -0
- package/mods/live-guard-gate/lib/patterns.mjs +523 -0
- package/mods/live-guard-gate/lib/runtime.mjs +140 -0
- package/mods/live-guard-gate/mod.toml +34 -0
- package/mods/live-guard-gate/patterns.json +522 -0
- package/mods/secret-redactor/.claude-plugin/plugin.json +5 -0
- package/mods/secret-redactor/README.md +86 -0
- package/mods/secret-redactor/bin/hook.mjs +35 -0
- package/mods/secret-redactor/claude-code/UNSUPPORTED.md +7 -0
- package/mods/secret-redactor/claude-code/settings.hooks.json +24 -0
- package/mods/secret-redactor/codex/UNSUPPORTED.md +11 -0
- package/mods/secret-redactor/codex/hooks.json +14 -0
- package/mods/secret-redactor/hooks/hooks.json +5 -0
- package/mods/secret-redactor/hooks/register.test.ts +150 -0
- package/mods/secret-redactor/hooks/register.ts +19 -0
- package/mods/secret-redactor/kiro/UNSUPPORTED.md +11 -0
- package/mods/secret-redactor/kiro/secret-redactor-pre-tool-use-hook.json +14 -0
- package/mods/secret-redactor/lib/common.mjs +213 -0
- package/mods/secret-redactor/lib/core.mjs +61 -0
- package/mods/secret-redactor/lib/patterns.mjs +75 -0
- package/mods/secret-redactor/lib/runtime.mjs +140 -0
- package/mods/secret-redactor/mod.toml +43 -0
- package/mods/secret-redactor/patterns.json +74 -0
- package/package.json +8 -4
- package/plugins/vanguard-frontier-agentic/.codex-plugin/plugin.json +1 -1
- package/scripts/generate-mods.mjs +784 -0
- package/scripts/mods/common.mjs +213 -0
- package/scripts/mods/runtime.mjs +140 -0
- package/tests/fixtures/README.md +1 -1
- package/tests/fuzz-properties.test.mjs +254 -0
- package/tests/mods.test.mjs +768 -0
- package/tests/validate-asset-integrity.py +1 -0
- package/tests/validate-mods.py +821 -0
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
// Generated by scripts/generate-mods.mjs from patterns.json. Do not edit.
|
|
2
|
+
export default [
|
|
3
|
+
{
|
|
4
|
+
"id": "live-iac-terraform-pulumi",
|
|
5
|
+
"name": "Terraform/OpenTofu/Terragrunt/Pulumi state-changing command",
|
|
6
|
+
"description": "terraform|tofu|terragrunt apply|destroy|import|taint|untaint|force-unlock|state rm|mv|push; pulumi up|destroy|refresh|import|cancel. Cloud is not knowable from the command, so every IaC guard that explicitly covers Terraform/stacks is listed; consult the one for the target cloud.",
|
|
7
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])(?:(?:terraform|tofu|terragrunt)(?![A-Za-z0-9_-])(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,4}[ \\t]+(?:run-all[ \\t]+)?(?:apply|destroy|import|taint|untaint|force-unlock|state[ \\t]+(?:rm|mv|push))(?![^ \\t\\r\\n;&|)])|pulumi(?![A-Za-z0-9_-])(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,4}[ \\t]+(?:up|destroy|refresh|import|cancel)(?![^ \\t\\r\\n;&|)]))",
|
|
8
|
+
"agents": [
|
|
9
|
+
"aws-live-iac-change-guard-agent",
|
|
10
|
+
"oci-live-resource-manager-stack-guard-agent",
|
|
11
|
+
"azure-live-arm-deployment-stack-guard-agent"
|
|
12
|
+
],
|
|
13
|
+
"flags": "",
|
|
14
|
+
"context": [
|
|
15
|
+
"bash"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "live-aws-cloudformation-cdk",
|
|
20
|
+
"name": "CloudFormation / CDK mutation",
|
|
21
|
+
"description": "aws cloudformation create/update/delete-stack[-set], deploy, execute-change-set, update-termination-protection; cdk deploy|destroy|bootstrap.",
|
|
22
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])(?:aws(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t]cloudformation[ \\t]+(?:create-stack|update-stack|delete-stack|create-stack-set|update-stack-set|delete-stack-set|deploy|execute-change-set|update-termination-protection)(?![^ \\t\\r\\n;&|)]))|cdk(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t](?:deploy|destroy|bootstrap)(?![^ \\t\\r\\n;&|)])))",
|
|
23
|
+
"agents": [
|
|
24
|
+
"aws-live-iac-change-guard-agent"
|
|
25
|
+
],
|
|
26
|
+
"flags": "",
|
|
27
|
+
"context": [
|
|
28
|
+
"bash"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "live-aws-ecs",
|
|
33
|
+
"name": "aws ecs mutation",
|
|
34
|
+
"description": "aws ... ecs (create|delete|update|put|run|start|stop|register|deregister)-*.",
|
|
35
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])aws(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t]ecs[ \\t]+(?:create|delete|update|put|run|start|stop|register|deregister)-[a-z0-9-]+(?![^ \\t\\r\\n;&|)]))",
|
|
36
|
+
"agents": [
|
|
37
|
+
"aws-live-ecs-rollout-guard-agent"
|
|
38
|
+
],
|
|
39
|
+
"flags": "",
|
|
40
|
+
"context": [
|
|
41
|
+
"bash"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "live-aws-lambda-apigw-serverless",
|
|
46
|
+
"name": "Lambda / API Gateway / Serverless Framework release",
|
|
47
|
+
"description": "aws lambda (create|delete|update|publish|put|add|remove)-*; aws apigateway|apigatewayv2 (create|delete|update|put|import)-*; serverless|sls deploy|remove|rollback.",
|
|
48
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])(?:aws(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t](?:lambda[ \\t]+(?:create|delete|update|publish|put|add|remove)|apigateway(?:v2)?[ \\t]+(?:create|delete|update|put|import))-[a-z0-9-]+(?![^ \\t\\r\\n;&|)]))|(?:serverless|sls)(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t](?:deploy|remove|rollback)(?![^ \\t\\r\\n;&|)])))",
|
|
49
|
+
"agents": [
|
|
50
|
+
"aws-live-serverless-release-guard-agent"
|
|
51
|
+
],
|
|
52
|
+
"flags": "",
|
|
53
|
+
"context": [
|
|
54
|
+
"bash"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "live-aws-sam",
|
|
59
|
+
"name": "SAM deploy/delete",
|
|
60
|
+
"description": "sam deploy|delete. Both the serverless-release and IaC guards apply (SAM is CloudFormation-backed Lambda).",
|
|
61
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])sam(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t](?:deploy|delete)(?![^ \\t\\r\\n;&|)]))",
|
|
62
|
+
"agents": [
|
|
63
|
+
"aws-live-serverless-release-guard-agent",
|
|
64
|
+
"aws-live-iac-change-guard-agent"
|
|
65
|
+
],
|
|
66
|
+
"flags": "",
|
|
67
|
+
"context": [
|
|
68
|
+
"bash"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": "live-azure-arm-stack",
|
|
73
|
+
"name": "az deployment / stack create|delete",
|
|
74
|
+
"description": "az deployment [sub|group|mg|tenant] create|delete and az stack [sub|group|mg] create|delete. what-if / validate / show / list are excluded.",
|
|
75
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])az(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t](?:deployment|stack)[ \\t]+(?:(?:sub|group|mg|tenant)[ \\t]+)?(?:create|delete)(?![^ \\t\\r\\n;&|)]))",
|
|
76
|
+
"agents": [
|
|
77
|
+
"azure-live-arm-deployment-stack-guard-agent"
|
|
78
|
+
],
|
|
79
|
+
"flags": "",
|
|
80
|
+
"context": [
|
|
81
|
+
"bash"
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"id": "live-azure-aks",
|
|
86
|
+
"name": "az aks mutation",
|
|
87
|
+
"description": "az aks create|delete|update|upgrade|scale|stop|start|rotate-certs|operation-abort and az aks nodepool add|delete|scale|update|upgrade|start|stop.",
|
|
88
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])az(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t]aks[ \\t]+(?:(?:create|delete|update|upgrade|scale|stop|start|rotate-certs|operation-abort)|nodepool[ \\t]+(?:add|delete|scale|update|upgrade|start|stop))(?![^ \\t\\r\\n;&|)]))",
|
|
89
|
+
"agents": [
|
|
90
|
+
"azure-live-aks-rollout-guard-agent"
|
|
91
|
+
],
|
|
92
|
+
"flags": "",
|
|
93
|
+
"context": [
|
|
94
|
+
"bash"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "live-azure-slot-swap",
|
|
99
|
+
"name": "az webapp/functionapp deployment slot swap",
|
|
100
|
+
"description": "az webapp|functionapp deployment slot swap.",
|
|
101
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])az(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t](?:webapp|functionapp)[ \\t]+deployment[ \\t]+slot[ \\t]+swap(?![^ \\t\\r\\n;&|)]))",
|
|
102
|
+
"agents": [
|
|
103
|
+
"azure-live-app-service-slot-swap-guard-agent"
|
|
104
|
+
],
|
|
105
|
+
"flags": "",
|
|
106
|
+
"context": [
|
|
107
|
+
"bash"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"id": "live-azure-keyvault",
|
|
112
|
+
"name": "az keyvault delete/purge/rotate",
|
|
113
|
+
"description": "az keyvault delete|purge and az keyvault key|secret|certificate delete|purge|rotate.",
|
|
114
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])az(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t]keyvault[ \\t]+(?:(?:delete|purge)|(?:key|secret|certificate)[ \\t]+(?:delete|purge|rotate))(?![^ \\t\\r\\n;&|)]))",
|
|
115
|
+
"agents": [
|
|
116
|
+
"azure-live-keyvault-rotation-purge-guard-agent"
|
|
117
|
+
],
|
|
118
|
+
"flags": "",
|
|
119
|
+
"context": [
|
|
120
|
+
"bash"
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "live-azure-role-assignment",
|
|
125
|
+
"name": "az role assignment/definition write",
|
|
126
|
+
"description": "az role assignment|definition create|update|delete.",
|
|
127
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])az(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t]role[ \\t]+(?:assignment|definition)[ \\t]+(?:create|update|delete)(?![^ \\t\\r\\n;&|)]))",
|
|
128
|
+
"agents": [
|
|
129
|
+
"azure-live-entra-role-assignment-guard-agent"
|
|
130
|
+
],
|
|
131
|
+
"flags": "",
|
|
132
|
+
"context": [
|
|
133
|
+
"bash"
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"id": "live-azure-budget",
|
|
138
|
+
"name": "az consumption budget write",
|
|
139
|
+
"description": "az consumption budget create|update|delete.",
|
|
140
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])az(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t]consumption[ \\t]+budget[ \\t]+(?:create|update|delete)(?![^ \\t\\r\\n;&|)]))",
|
|
141
|
+
"agents": [
|
|
142
|
+
"azure-live-cost-budget-action-guard-agent"
|
|
143
|
+
],
|
|
144
|
+
"flags": "",
|
|
145
|
+
"context": [
|
|
146
|
+
"bash"
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"id": "live-gcloud-gke",
|
|
151
|
+
"name": "gcloud container clusters/node-pools mutation",
|
|
152
|
+
"description": "gcloud container clusters|node-pools create|delete|update|upgrade|resize|rollback.",
|
|
153
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])gcloud(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t]container[ \\t]+(?:clusters|node-pools)[ \\t]+(?:create|delete|update|upgrade|resize|rollback)(?![^ \\t\\r\\n;&|)]))",
|
|
154
|
+
"agents": [
|
|
155
|
+
"gcp-live-gke-rollout-guard-agent"
|
|
156
|
+
],
|
|
157
|
+
"flags": "",
|
|
158
|
+
"context": [
|
|
159
|
+
"bash"
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"id": "live-gcloud-run",
|
|
164
|
+
"name": "gcloud run deploy / traffic / delete",
|
|
165
|
+
"description": "gcloud run deploy; gcloud run services update|update-traffic|delete|replace; gcloud run revisions delete.",
|
|
166
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])gcloud(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t]run[ \\t]+(?:deploy|(?:services|revisions)[ \\t]+(?:update|update-traffic|delete|replace))(?![^ \\t\\r\\n;&|)]))",
|
|
167
|
+
"agents": [
|
|
168
|
+
"gcp-live-cloud-run-traffic-migration-guard-agent"
|
|
169
|
+
],
|
|
170
|
+
"flags": "",
|
|
171
|
+
"context": [
|
|
172
|
+
"bash"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"id": "live-gcloud-iam",
|
|
177
|
+
"name": "gcloud IAM binding / policy / SA key / org-policy mutation",
|
|
178
|
+
"description": "*-iam-policy-binding (add|remove|set), set-iam-policy, iam service-accounts keys create, iam roles create|update|delete, org-policies set-policy|delete.",
|
|
179
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])gcloud(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t](?:(?:add|remove)-iam-policy-binding|set-iam-policy|iam[ \\t]+service-accounts[ \\t]+keys[ \\t]+create|iam[ \\t]+roles[ \\t]+(?:create|update|delete)|(?:resource-manager[ \\t]+)?org-policies[ \\t]+(?:set-policy|delete))(?![^ \\t\\r\\n;&|)]))",
|
|
180
|
+
"agents": [
|
|
181
|
+
"gcp-live-iam-policy-change-guard-agent"
|
|
182
|
+
],
|
|
183
|
+
"flags": "",
|
|
184
|
+
"context": [
|
|
185
|
+
"bash"
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"id": "live-gcloud-kms",
|
|
190
|
+
"name": "gcloud kms key version destroy/disable",
|
|
191
|
+
"description": "gcloud kms keys versions destroy|disable.",
|
|
192
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])gcloud(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t]kms[ \\t]+keys[ \\t]+versions[ \\t]+(?:destroy|disable)(?![^ \\t\\r\\n;&|)]))",
|
|
193
|
+
"agents": [
|
|
194
|
+
"gcp-live-kms-key-destruction-guard-agent"
|
|
195
|
+
],
|
|
196
|
+
"flags": "",
|
|
197
|
+
"context": [
|
|
198
|
+
"bash"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"id": "live-gcloud-billing-budget",
|
|
203
|
+
"name": "gcloud billing budgets write",
|
|
204
|
+
"description": "gcloud billing budgets create|update|delete.",
|
|
205
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])gcloud(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t]billing[ \\t]+budgets[ \\t]+(?:create|update|delete)(?![^ \\t\\r\\n;&|)]))",
|
|
206
|
+
"agents": [
|
|
207
|
+
"gcp-live-cost-budget-action-guard-agent"
|
|
208
|
+
],
|
|
209
|
+
"flags": "",
|
|
210
|
+
"context": [
|
|
211
|
+
"bash"
|
|
212
|
+
]
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"id": "live-bq-destructive",
|
|
216
|
+
"name": "bq rm / truncate",
|
|
217
|
+
"description": "bq rm|truncate (dataset/table deletion).",
|
|
218
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])bq(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t](?:rm|truncate)(?![^ \\t\\r\\n;&|)]))",
|
|
219
|
+
"agents": [
|
|
220
|
+
"gcp-live-bigquery-dataset-deletion-guard-agent"
|
|
221
|
+
],
|
|
222
|
+
"flags": "",
|
|
223
|
+
"context": [
|
|
224
|
+
"bash"
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"id": "live-k8s-rbac",
|
|
229
|
+
"name": "kubectl RBAC mutation",
|
|
230
|
+
"description": "kubectl|oc apply|create|delete|patch|replace|edit on role(s)/rolebinding(s)/clusterrole(s)/clusterrolebinding(s) given inline, or kubectl auth reconcile. Resources hidden inside -f manifests are not visible to a regex.",
|
|
231
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])(?:kubectl|oc)(?![A-Za-z0-9_-])(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,8}[ \\t]+(?:(?:apply|create|delete|patch|replace|edit))(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,6}[ \\t]+(?:roles?|rolebindings?|clusterroles?|clusterrolebindings?)(?:\\.[a-z0-9.-]+)?(?:/|,|(?![^ \\t\\r\\n;&|)]))|(?:^|[^A-Za-z0-9_.-])(?:kubectl|oc)(?![A-Za-z0-9_-])(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,8}[ \\t]+(?:auth[ \\t]+reconcile)(?![^ \\t\\r\\n;&|)])",
|
|
232
|
+
"agents": [
|
|
233
|
+
"kubernetes-live-rbac-mutation-guard-agent"
|
|
234
|
+
],
|
|
235
|
+
"flags": "",
|
|
236
|
+
"context": [
|
|
237
|
+
"bash"
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"id": "live-k8s-network-policy",
|
|
242
|
+
"name": "kubectl NetworkPolicy / Cilium policy mutation",
|
|
243
|
+
"description": "kubectl|oc apply|create|delete|patch|replace|edit on networkpolicy/netpol/ciliumnetworkpolicy/cnp/ciliumclusterwidenetworkpolicy/ccnp/ciliumegressgatewaypolicy/cegp.",
|
|
244
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])(?:kubectl|oc)(?![A-Za-z0-9_-])(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,8}[ \\t]+(?:(?:apply|create|delete|patch|replace|edit))(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,6}[ \\t]+(?:networkpolic(?:y|ies)|netpol|ciliumnetworkpolic(?:y|ies)|cnp|ciliumclusterwidenetworkpolic(?:y|ies)|ccnp|ciliumegressgatewaypolic(?:y|ies)|cegp)(?:\\.[a-z0-9.-]+)?(?:/|,|(?![^ \\t\\r\\n;&|)]))",
|
|
245
|
+
"agents": [
|
|
246
|
+
"kubernetes-live-network-policy-guard-agent"
|
|
247
|
+
],
|
|
248
|
+
"flags": "",
|
|
249
|
+
"context": [
|
|
250
|
+
"bash"
|
|
251
|
+
]
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"id": "live-k8s-admission-policy",
|
|
255
|
+
"name": "kubectl admission policy / webhook / Kyverno mutation",
|
|
256
|
+
"description": "kubectl|oc apply|create|delete|patch|replace|edit on validating/mutatingwebhookconfiguration, validating/mutatingadmissionpolicy[binding], clusterpolicy/cpol, policyexception/polex.",
|
|
257
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])(?:kubectl|oc)(?![A-Za-z0-9_-])(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,8}[ \\t]+(?:(?:apply|create|delete|patch|replace|edit))(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,6}[ \\t]+(?:validatingwebhookconfigurations?|mutatingwebhookconfigurations?|validatingadmissionpolic(?:y|ies)|validatingadmissionpolicybindings?|mutatingadmissionpolic(?:y|ies)|mutatingadmissionpolicybindings?|clusterpolic(?:y|ies)|cpol|policyexceptions?|polex)(?:\\.[a-z0-9.-]+)?(?:/|,|(?![^ \\t\\r\\n;&|)]))",
|
|
258
|
+
"agents": [
|
|
259
|
+
"kubernetes-live-admission-policy-guard-agent"
|
|
260
|
+
],
|
|
261
|
+
"flags": "",
|
|
262
|
+
"context": [
|
|
263
|
+
"bash"
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"id": "live-k8s-mesh-policy",
|
|
268
|
+
"name": "kubectl Istio policy mutation",
|
|
269
|
+
"description": "kubectl|oc apply|create|delete|patch|replace|edit on virtualservice, destinationrule, peerauthentication, requestauthentication, authorizationpolicy, serviceentry, envoyfilter.",
|
|
270
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])(?:kubectl|oc)(?![A-Za-z0-9_-])(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,8}[ \\t]+(?:(?:apply|create|delete|patch|replace|edit))(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,6}[ \\t]+(?:virtualservices?|destinationrules?|peerauthentications?|requestauthentications?|authorizationpolic(?:y|ies)|serviceentr(?:y|ies)|envoyfilters?)(?:\\.[a-z0-9.-]+)?(?:/|,|(?![^ \\t\\r\\n;&|)]))",
|
|
271
|
+
"agents": [
|
|
272
|
+
"kubernetes-live-mesh-policy-guard-agent"
|
|
273
|
+
],
|
|
274
|
+
"flags": "",
|
|
275
|
+
"context": [
|
|
276
|
+
"bash"
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"id": "live-argocd-sync",
|
|
281
|
+
"name": "argocd app/proj/appset mutation",
|
|
282
|
+
"description": "argocd app|proj|appset sync|rollback|delete|create|set|patch|edit|terminate-op, or kubectl on application(s).argoproj.io/appproject(s)/applicationset(s).",
|
|
283
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])argocd(?![A-Za-z0-9_-])[ \\t]+(?:app|proj|appset)[ \\t]+(?:sync|rollback|delete|create|set|patch|edit|terminate-op)(?![^ \\t\\r\\n;&|)])|(?:^|[^A-Za-z0-9_.-])(?:kubectl|oc)(?![A-Za-z0-9_-])(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,8}[ \\t]+(?:(?:apply|create|delete|patch|replace|edit))(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,6}[ \\t]+(?:applications?|appprojects?|applicationsets?|[a-z]*applications?[.]argoproj[.]io)(?:\\.[a-z0-9.-]+)?(?:/|,|(?![^ \\t\\r\\n;&|)]))",
|
|
284
|
+
"agents": [
|
|
285
|
+
"kubernetes-live-argocd-sync-guard-agent"
|
|
286
|
+
],
|
|
287
|
+
"flags": "",
|
|
288
|
+
"context": [
|
|
289
|
+
"bash"
|
|
290
|
+
]
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"id": "live-velero-restore",
|
|
294
|
+
"name": "velero restore / backup delete",
|
|
295
|
+
"description": "velero restore create|delete, velero create restore, velero backup|schedule delete, velero delete backup|restore|schedule. Backup create/describe/get excluded.",
|
|
296
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])velero(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t](?:restore[ \\t]+(?:create|delete)|create[ \\t]+restore|(?:backup|schedule)[ \\t]+delete|delete[ \\t]+(?:backup|restore|schedule))(?![^ \\t\\r\\n;&|)]))",
|
|
297
|
+
"agents": [
|
|
298
|
+
"kubernetes-live-velero-restore-guard-agent"
|
|
299
|
+
],
|
|
300
|
+
"flags": "",
|
|
301
|
+
"context": [
|
|
302
|
+
"bash"
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"id": "live-kubectl-mutate",
|
|
307
|
+
"name": "kubectl/oc workload-mutating verb",
|
|
308
|
+
"description": "kubectl|oc apply|create|replace|patch|delete|scale|autoscale|edit|drain|cordon|uncordon|taint|annotate|label|set|expose|rollout restart|undo|pause|resume, unless --dry-run=client|server. Cluster provider unknown, so the managed-Kubernetes rollout guards are listed; consult the one for the cluster. Specific kubernetes-live-* patterns above win (first match).",
|
|
309
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])(?:kubectl|oc)(?![A-Za-z0-9_-])(?![^;&|\\n]*[ \\t]--dry-run(?:=(?:client|server|true))?(?![^ \\t\\r\\n;&|)]))(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,8}[ \\t]+(?:apply|create|replace|patch|delete|scale|autoscale|edit|drain|cordon|uncordon|taint|annotate|label|set|expose|rollout[ \\t]+(?:restart|undo|pause|resume))(?![^ \\t\\r\\n;&|)])",
|
|
310
|
+
"agents": [
|
|
311
|
+
"azure-live-aks-rollout-guard-agent",
|
|
312
|
+
"gcp-live-gke-rollout-guard-agent",
|
|
313
|
+
"oci-live-oke-rollout-guard-agent",
|
|
314
|
+
"huawei-live-cce-rollout-guard-agent",
|
|
315
|
+
"alibaba-live-ack-rollout-guard-agent",
|
|
316
|
+
"scaleway-live-kapsule-rollout-guard-agent"
|
|
317
|
+
],
|
|
318
|
+
"flags": "",
|
|
319
|
+
"context": [
|
|
320
|
+
"bash"
|
|
321
|
+
]
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"id": "live-helm-mutate",
|
|
325
|
+
"name": "helm install/upgrade/uninstall/rollback",
|
|
326
|
+
"description": "helm install|upgrade|uninstall|delete|rollback unless --dry-run. Same managed-Kubernetes rollout guards as live-kubectl-mutate.",
|
|
327
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])helm(?![A-Za-z0-9_-])(?![^;&|\\n]*[ \\t]--dry-run(?:=(?:client|server|true))?(?![^ \\t\\r\\n;&|)]))(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,8}[ \\t]+(?:install|upgrade|uninstall|delete|rollback)(?![^ \\t\\r\\n;&|)])",
|
|
328
|
+
"agents": [
|
|
329
|
+
"azure-live-aks-rollout-guard-agent",
|
|
330
|
+
"gcp-live-gke-rollout-guard-agent",
|
|
331
|
+
"oci-live-oke-rollout-guard-agent",
|
|
332
|
+
"huawei-live-cce-rollout-guard-agent",
|
|
333
|
+
"alibaba-live-ack-rollout-guard-agent",
|
|
334
|
+
"scaleway-live-kapsule-rollout-guard-agent"
|
|
335
|
+
],
|
|
336
|
+
"flags": "",
|
|
337
|
+
"context": [
|
|
338
|
+
"bash"
|
|
339
|
+
]
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"id": "live-oci-network-security-rule",
|
|
343
|
+
"name": "oci network security-list / NSG rule mutation",
|
|
344
|
+
"description": "oci network security-list create|update|delete; oci network nsg rules add|update|remove; oci network nsg create|update|delete. add/update and security-list update are named in the oci-live-network-security-rule-guard-agent docs; the remaining verbs are from OCI CLI knowledge.",
|
|
345
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])oci(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t]network[ \\t]+(?:security-list[ \\t]+(?:create|update|delete)|nsg[ \\t]+rules[ \\t]+(?:add|update|remove)|nsg[ \\t]+(?:create|update|delete))(?![^ \\t\\r\\n;&|)]))",
|
|
346
|
+
"agents": [
|
|
347
|
+
"oci-live-network-security-rule-guard-agent"
|
|
348
|
+
],
|
|
349
|
+
"flags": "",
|
|
350
|
+
"context": [
|
|
351
|
+
"bash"
|
|
352
|
+
]
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"id": "live-oci-iam-policy-compartment",
|
|
356
|
+
"name": "oci iam policy / dynamic-group / compartment mutation",
|
|
357
|
+
"description": "oci iam policy create|update|delete; oci iam dynamic-group create|update|delete; oci iam compartment delete|move. policy update|delete and dynamic-group update are named in the oci-live-iam-policy-compartment-guard-agent docs; the other verbs are from OCI CLI knowledge. Global flags before the service are tolerated by scanning the simple command.",
|
|
358
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])oci(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t]iam[ \\t]+(?:policy[ \\t]+(?:create|update|delete)|dynamic-group[ \\t]+(?:create|update|delete)|compartment[ \\t]+(?:delete|move))(?![^ \\t\\r\\n;&|)]))",
|
|
359
|
+
"agents": [
|
|
360
|
+
"oci-live-iam-policy-compartment-guard-agent"
|
|
361
|
+
],
|
|
362
|
+
"flags": "",
|
|
363
|
+
"context": [
|
|
364
|
+
"bash"
|
|
365
|
+
]
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"id": "live-oci-autonomous-db",
|
|
369
|
+
"name": "oci db autonomous-database lifecycle change",
|
|
370
|
+
"description": "oci db autonomous-database update|restore|start|stop|restart|delete|create-from-clone. update, restore, start and create-from-clone are named in the oci-live-autonomous-db-lifecycle-guard-agent docs; stop, restart and delete are from OCI CLI knowledge.",
|
|
371
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])oci(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t]db[ \\t]+autonomous-database[ \\t]+(?:update|restore|start|stop|restart|delete|create-from-clone)(?![^ \\t\\r\\n;&|)]))",
|
|
372
|
+
"agents": [
|
|
373
|
+
"oci-live-autonomous-db-lifecycle-guard-agent"
|
|
374
|
+
],
|
|
375
|
+
"flags": "",
|
|
376
|
+
"context": [
|
|
377
|
+
"bash"
|
|
378
|
+
]
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"id": "live-oci-budget-quota",
|
|
382
|
+
"name": "oci budgets / limits quota mutation",
|
|
383
|
+
"description": "oci budgets budget|alert-rule|alert create|update|delete; oci limits quota create|update|delete. budgets budget update, budgets alert update and limits quota create are named in the oci-live-cost-budget-runaway-guard-agent docs; the other verbs are from OCI CLI knowledge.",
|
|
384
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])oci(?![A-Za-z0-9_-])(?=[^;&|\\n]*[ \\t](?:budgets[ \\t]+(?:budget|alert-rule|alert)|limits[ \\t]+quota)[ \\t]+(?:create|update|delete)(?![^ \\t\\r\\n;&|)]))",
|
|
385
|
+
"agents": [
|
|
386
|
+
"oci-live-cost-budget-runaway-guard-agent"
|
|
387
|
+
],
|
|
388
|
+
"flags": "",
|
|
389
|
+
"context": [
|
|
390
|
+
"bash"
|
|
391
|
+
]
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"id": "live-snowflake-rbac",
|
|
395
|
+
"name": "snowsql / snow sql GRANT, REVOKE, ALTER ROLE",
|
|
396
|
+
"description": "snowsql or 'snow sql' on the same line as a GRANT|REVOKE statement or ALTER ROLE (flags i). The SQL must be on the command line (-q); statements piped in or read from -f files are invisible. Statements inside string literals match (known false positive).",
|
|
397
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])(?:snowsql|snow[ \\t]+sql)(?![A-Za-z0-9_-])(?=[^\\n]*[\"' \\t;](?:(?:grant|revoke)[ \\t]+[a-z]|alter[ \\t]+role[ \\t]))",
|
|
398
|
+
"agents": [
|
|
399
|
+
"snowflake-live-rbac-grant-guard-agent"
|
|
400
|
+
],
|
|
401
|
+
"flags": "i",
|
|
402
|
+
"context": [
|
|
403
|
+
"bash"
|
|
404
|
+
]
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"id": "live-snowflake-warehouse",
|
|
408
|
+
"name": "snowsql / snow sql warehouse change",
|
|
409
|
+
"description": "snowsql or 'snow sql' with ALTER|DROP|CREATE [OR REPLACE|OR ALTER] WAREHOUSE (flags i). ALTER WAREHOUSE is named in the snowflake-live-warehouse-cost-change-guard-agent docs; CREATE and DROP are from Snowflake SQL knowledge.",
|
|
410
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])(?:snowsql|snow[ \\t]+sql)(?![A-Za-z0-9_-])(?=[^\\n]*[\"' \\t;](?:alter|drop|create(?:[ \\t]+or[ \\t]+(?:replace|alter))?)[ \\t]+warehouse[ \\t])",
|
|
411
|
+
"agents": [
|
|
412
|
+
"snowflake-live-warehouse-cost-change-guard-agent"
|
|
413
|
+
],
|
|
414
|
+
"flags": "i",
|
|
415
|
+
"context": [
|
|
416
|
+
"bash"
|
|
417
|
+
]
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"id": "live-snowflake-failover",
|
|
421
|
+
"name": "snowsql / snow sql failover group change",
|
|
422
|
+
"description": "snowsql or 'snow sql' with ALTER FAILOVER GROUP (flags i), named in the snowflake-live-failover-promotion-guard-agent docs.",
|
|
423
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])(?:snowsql|snow[ \\t]+sql)(?![A-Za-z0-9_-])(?=[^\\n]*[\"' \\t;]alter[ \\t]+failover[ \\t]+group[ \\t])",
|
|
424
|
+
"agents": [
|
|
425
|
+
"snowflake-live-failover-promotion-guard-agent"
|
|
426
|
+
],
|
|
427
|
+
"flags": "i",
|
|
428
|
+
"context": [
|
|
429
|
+
"bash"
|
|
430
|
+
]
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"id": "live-snowflake-auth-network-policy",
|
|
434
|
+
"name": "snowsql / snow sql network or authentication policy change",
|
|
435
|
+
"description": "snowsql or 'snow sql' with ALTER|DROP|CREATE [OR REPLACE] NETWORK|AUTHENTICATION POLICY (flags i). ALTER forms are named in the snowflake-live-auth-network-policy-guard-agent docs; CREATE and DROP are from Snowflake SQL knowledge.",
|
|
436
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])(?:snowsql|snow[ \\t]+sql)(?![A-Za-z0-9_-])(?=[^\\n]*[\"' \\t;](?:alter|drop|create(?:[ \\t]+or[ \\t]+replace)?)[ \\t]+(?:network|authentication)[ \\t]+policy[ \\t])",
|
|
437
|
+
"agents": [
|
|
438
|
+
"snowflake-live-auth-network-policy-guard-agent"
|
|
439
|
+
],
|
|
440
|
+
"flags": "i",
|
|
441
|
+
"context": [
|
|
442
|
+
"bash"
|
|
443
|
+
]
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"id": "live-snowflake-pipeline",
|
|
447
|
+
"name": "snowsql / snow sql pipe, task or dynamic table change",
|
|
448
|
+
"description": "snowsql or 'snow sql' with ALTER PIPE|TASK|DYNAMIC TABLE (flags i), named in the snowflake-live-pipeline-streaming-change-guard-agent docs.",
|
|
449
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])(?:snowsql|snow[ \\t]+sql)(?![A-Za-z0-9_-])(?=[^\\n]*[\"' \\t;]alter[ \\t]+(?:pipe|task|dynamic[ \\t]+table)[ \\t])",
|
|
450
|
+
"agents": [
|
|
451
|
+
"snowflake-live-pipeline-streaming-change-guard-agent"
|
|
452
|
+
],
|
|
453
|
+
"flags": "i",
|
|
454
|
+
"context": [
|
|
455
|
+
"bash"
|
|
456
|
+
]
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"id": "live-snowflake-data-protection",
|
|
460
|
+
"name": "snowsql / snow sql masking or row access policy application",
|
|
461
|
+
"description": "snowsql or 'snow sql' with SET|UNSET|ADD|DROP MASKING POLICY or ROW ACCESS POLICY (flags i), the ALTER TABLE column / row-access forms named in the snowflake-live-data-protection-policy-guard-agent docs. CREATE MASKING POLICY (definition only) is not matched.",
|
|
462
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])(?:snowsql|snow[ \\t]+sql)(?![A-Za-z0-9_-])(?=[^\\n]*[ \\t](?:set|unset|add|drop)[ \\t]+(?:masking|row[ \\t]+access)[ \\t]+policy(?![A-Za-z0-9_]))",
|
|
463
|
+
"agents": [
|
|
464
|
+
"snowflake-live-data-protection-policy-guard-agent"
|
|
465
|
+
],
|
|
466
|
+
"flags": "i",
|
|
467
|
+
"context": [
|
|
468
|
+
"bash"
|
|
469
|
+
]
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"id": "live-aws-cli-mutation",
|
|
473
|
+
"name": "aws CLI mutating operation (fallback)",
|
|
474
|
+
"description": "aws [global flags] <service> <operation> where operation is (create|delete|update|terminate|modify|remove|attach|detach|disable|schedule|revoke|authorize|deregister|associate|disassociate|reboot|stop)-* or put-* (data-plane put-object/put-item/put-metric-data/put-log-events/put-record(s) excluded), plus aws s3 rb|rm|mb. No dedicated guard exists for most services (ec2, rds, iam, s3, ...): all AWS live guards are listed; aws-live-iac-change-guard-agent is the nearest change-control fit. The near-miss aws-live-deployment-guarded-operator-agent is outside the *-live-*-guard-agent glob and therefore not referenced.",
|
|
475
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])aws(?![A-Za-z0-9_-])(?:[ \\t]+-[^ \\t\\r\\n;&|]+(?:[ \\t]+[^ \\t\\r\\n;&|-][^ \\t\\r\\n;&|]*)?){0,8}[ \\t]+(?:s3[ \\t]+(?:rb|rm|mb)|[a-z0-9][a-z0-9-]*[ \\t]+(?:(?:create|delete|update|terminate|modify|remove|attach|detach|disable|schedule|revoke|authorize|deregister|associate|disassociate|reboot|stop)-[a-z0-9-]+|put-(?!(?:object|item|metric-data|log-events|records?)(?![^ \\t\\r\\n;&|)]))[a-z0-9-]+))(?![^ \\t\\r\\n;&|)])",
|
|
476
|
+
"agents": [
|
|
477
|
+
"aws-live-ecs-rollout-guard-agent",
|
|
478
|
+
"aws-live-iac-change-guard-agent",
|
|
479
|
+
"aws-live-serverless-release-guard-agent"
|
|
480
|
+
],
|
|
481
|
+
"flags": "",
|
|
482
|
+
"context": [
|
|
483
|
+
"bash"
|
|
484
|
+
]
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
"id": "live-az-cli-mutation",
|
|
488
|
+
"name": "az CLI mutating verb (fallback)",
|
|
489
|
+
"description": "az <command path of up to 5 words> create|delete|update|purge|deallocate|scale|upgrade|start|stop|restart; the verb must sit in the command path before the first flag, so values of --query/--name are not mistaken for verbs. All Azure live guards listed (no service-specific guard matched).",
|
|
490
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])az(?![A-Za-z0-9_-])(?:[ \\t]+[a-z][a-z0-9-]*){0,5}[ \\t]+(?:create|delete|update|purge|deallocate|scale|upgrade|start|stop|restart)(?![^ \\t\\r\\n;&|)])",
|
|
491
|
+
"agents": [
|
|
492
|
+
"azure-live-aks-rollout-guard-agent",
|
|
493
|
+
"azure-live-app-service-slot-swap-guard-agent",
|
|
494
|
+
"azure-live-arm-deployment-stack-guard-agent",
|
|
495
|
+
"azure-live-cost-budget-action-guard-agent",
|
|
496
|
+
"azure-live-entra-role-assignment-guard-agent",
|
|
497
|
+
"azure-live-keyvault-rotation-purge-guard-agent",
|
|
498
|
+
"azure-live-pim-jit-activation-guard-agent"
|
|
499
|
+
],
|
|
500
|
+
"flags": "",
|
|
501
|
+
"context": [
|
|
502
|
+
"bash"
|
|
503
|
+
]
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"id": "live-gcloud-cli-mutation",
|
|
507
|
+
"name": "gcloud mutating verb (fallback)",
|
|
508
|
+
"description": "gcloud <command path of up to 5 words> create|delete|update|deploy|patch|resize|restore|import|rm, verb in the path before the first flag. All GCP live guards listed (no service-specific guard matched).",
|
|
509
|
+
"regex": "(?:^|[^A-Za-z0-9_.-])gcloud(?![A-Za-z0-9_-])(?:[ \\t]+[a-z][a-z0-9-]*){0,5}[ \\t]+(?:create|delete|update|deploy|patch|resize|restore|import|rm)(?![^ \\t\\r\\n;&|)])",
|
|
510
|
+
"agents": [
|
|
511
|
+
"gcp-live-bigquery-dataset-deletion-guard-agent",
|
|
512
|
+
"gcp-live-cloud-run-traffic-migration-guard-agent",
|
|
513
|
+
"gcp-live-cost-budget-action-guard-agent",
|
|
514
|
+
"gcp-live-gke-rollout-guard-agent",
|
|
515
|
+
"gcp-live-iam-policy-change-guard-agent",
|
|
516
|
+
"gcp-live-kms-key-destruction-guard-agent"
|
|
517
|
+
],
|
|
518
|
+
"flags": "",
|
|
519
|
+
"context": [
|
|
520
|
+
"bash"
|
|
521
|
+
]
|
|
522
|
+
}
|
|
523
|
+
];
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// Command-hook runtime for the mods under mods/. scripts/generate-mods.mjs copies this file
|
|
2
|
+
// byte-for-byte to mods/<id>/lib/runtime.mjs, so edit it here and run `npm run mods:write`.
|
|
3
|
+
//
|
|
4
|
+
// A mod's bin/hook.mjs hands its handlers to runHook, which reads the harness payload from
|
|
5
|
+
// stdin and renders the handler's decision in that harness's protocol. It writes no files
|
|
6
|
+
// and reads no environment; Claude Code's native runtime never imports it.
|
|
7
|
+
import { readFileSync } from 'node:fs'
|
|
8
|
+
import { isAbsolute, resolve, sep } from 'node:path'
|
|
9
|
+
|
|
10
|
+
const HARNESSES = new Set(['claude-code', 'kiro', 'codex'])
|
|
11
|
+
const EVENTS = new Set(['PreToolUse', 'PostToolUse', 'SessionStart'])
|
|
12
|
+
const DECISIONS = new Set(['allow', 'deny', 'ask', 'replace', 'context'])
|
|
13
|
+
|
|
14
|
+
const nodeIo = () => ({
|
|
15
|
+
argv: process.argv.slice(2),
|
|
16
|
+
readStdin: () => readFileSync(0, 'utf8'),
|
|
17
|
+
out: (s) => process.stdout.write(s),
|
|
18
|
+
err: (s) => process.stderr.write(s),
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const message = (err) => (err instanceof Error ? err.message : String(err))
|
|
22
|
+
|
|
23
|
+
// JSON.parse errors quote the text they failed on, and stdin can carry a tool's input or
|
|
24
|
+
// output: report the failure without echoing any of it.
|
|
25
|
+
function parseStdin(text) {
|
|
26
|
+
try {
|
|
27
|
+
return JSON.parse(text)
|
|
28
|
+
} catch {
|
|
29
|
+
throw new Error('stdin is not valid JSON')
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function parseArgs(argv) {
|
|
34
|
+
const usage = 'usage: hook.mjs --harness <claude-code|kiro|codex> --event <PreToolUse|PostToolUse|SessionStart>'
|
|
35
|
+
if (argv.length !== 4) throw new Error(usage)
|
|
36
|
+
const args = {}
|
|
37
|
+
for (let i = 0; i < 4; i += 2) {
|
|
38
|
+
const key = { '--harness': 'harness', '--event': 'event' }[argv[i]]
|
|
39
|
+
if (!key || key in args) throw new Error(usage)
|
|
40
|
+
args[key] = argv[i + 1]
|
|
41
|
+
}
|
|
42
|
+
if (!HARNESSES.has(args.harness)) throw new Error(`unknown harness ${args.harness}; ${usage}`)
|
|
43
|
+
if (!EVENTS.has(args.event)) throw new Error(`unknown event ${args.event}; ${usage}`)
|
|
44
|
+
return args
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Where an observer writes `path`. A relative path resolves against the project root when
|
|
48
|
+
// the hook runs from its install location <root>/.<harness dir>/vanguard-mods/<id>/bin/,
|
|
49
|
+
// otherwise against the working directory. Never CLAUDE_PROJECT_DIR: mods read only their
|
|
50
|
+
// own VANGUARD_<ID>_* variables.
|
|
51
|
+
export function projectPath(path, harness, binDir) {
|
|
52
|
+
if (isAbsolute(path)) return path
|
|
53
|
+
const parts = resolve(binDir).split(sep)
|
|
54
|
+
const n = parts.length
|
|
55
|
+
const dir = { 'claude-code': '.claude', kiro: '.kiro', codex: '.codex' }[harness]
|
|
56
|
+
const installed = n >= 5 && parts[n - 1] === 'bin' && parts[n - 3] === 'vanguard-mods' && parts[n - 4] === dir
|
|
57
|
+
return resolve(installed ? parts.slice(0, n - 4).join(sep) || sep : process.cwd(), path)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Rejects decisions the harness cannot express, so a handler bug surfaces as an error
|
|
61
|
+
// instead of a silently dropped verdict.
|
|
62
|
+
function normalize(d, { harness, event }) {
|
|
63
|
+
if (d === undefined) return { decision: 'allow', log: [] }
|
|
64
|
+
if (d === null || typeof d !== 'object' || !DECISIONS.has(d.decision)) {
|
|
65
|
+
throw new Error(`handler returned an invalid decision: ${JSON.stringify(d)}`)
|
|
66
|
+
}
|
|
67
|
+
const log = d.log ?? []
|
|
68
|
+
if (!Array.isArray(log) || !log.every((l) => typeof l === 'string')) throw new Error('decision log must be a string array')
|
|
69
|
+
const needs = { deny: 'reason', ask: 'reason', context: 'text' }[d.decision]
|
|
70
|
+
if (needs && (typeof d[needs] !== 'string' || d[needs] === '')) throw new Error(`${d.decision} needs a ${needs}`)
|
|
71
|
+
if ((d.decision === 'deny' || d.decision === 'ask') && event !== 'PreToolUse') {
|
|
72
|
+
throw new Error(`${d.decision} is only valid for PreToolUse, not ${event}`)
|
|
73
|
+
}
|
|
74
|
+
if (d.decision === 'replace' && (harness !== 'claude-code' || event !== 'PostToolUse')) {
|
|
75
|
+
throw new Error(`replace is only valid for claude-code PostToolUse, not ${harness} ${event}`)
|
|
76
|
+
}
|
|
77
|
+
return { ...d, log }
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function render(d, { harness, event }, io) {
|
|
81
|
+
const json = (hookSpecificOutput) => io.out(JSON.stringify({ hookSpecificOutput: { hookEventName: event, ...hookSpecificOutput } }) + '\n')
|
|
82
|
+
for (const line of d.log) io.err(line + '\n')
|
|
83
|
+
switch (d.decision) {
|
|
84
|
+
case 'allow':
|
|
85
|
+
return 0
|
|
86
|
+
case 'deny':
|
|
87
|
+
case 'ask':
|
|
88
|
+
if (harness === 'claude-code') {
|
|
89
|
+
json({ permissionDecision: d.decision, permissionDecisionReason: d.reason })
|
|
90
|
+
return 0
|
|
91
|
+
}
|
|
92
|
+
// Kiro and Codex have no confirmation step; exit 2 blocks the call in both.
|
|
93
|
+
io.err(d.decision === 'ask' ? `${d.reason} (confirmation unsupported on ${harness}; denied)\n` : `${d.reason}\n`)
|
|
94
|
+
return 2
|
|
95
|
+
case 'replace':
|
|
96
|
+
json({ updatedToolOutput: d.output })
|
|
97
|
+
return 0
|
|
98
|
+
case 'context':
|
|
99
|
+
if (harness === 'kiro') io.err(d.text + '\n')
|
|
100
|
+
else json({ additionalContext: d.text })
|
|
101
|
+
return 0
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Runs one hook invocation and returns the exit code; bin/hook.mjs sets process.exitCode
|
|
106
|
+
// with it rather than calling process.exit, so buffered stdout is never cut short.
|
|
107
|
+
//
|
|
108
|
+
// - Bad arguments, or an event this mod has no handler for: exit 2, which blocks a
|
|
109
|
+
// PreToolUse call in every harness (a broken install must not allow silently).
|
|
110
|
+
// - Invalid stdin or a throwing handler: `onError(err, payload, ctx)` supplies the decision
|
|
111
|
+
// (guards deny, the redactor withholds). Without onError: stderr and exit 1, which is
|
|
112
|
+
// loud but does not block.
|
|
113
|
+
// - An onError that throws or returns an invalid decision: exit 2.
|
|
114
|
+
export async function runHook({ name, handlers, onError }, io = nodeIo()) {
|
|
115
|
+
let ctx
|
|
116
|
+
try {
|
|
117
|
+
ctx = parseArgs(io.argv)
|
|
118
|
+
if (!Object.hasOwn(handlers, ctx.event)) throw new Error(`no handler for ${ctx.event}`)
|
|
119
|
+
} catch (err) {
|
|
120
|
+
io.err(`${name}: ${message(err)}\n`)
|
|
121
|
+
return 2
|
|
122
|
+
}
|
|
123
|
+
let payload
|
|
124
|
+
let decision
|
|
125
|
+
try {
|
|
126
|
+
payload = parseStdin(io.readStdin())
|
|
127
|
+
if (payload === null || typeof payload !== 'object' || Array.isArray(payload)) throw new Error('stdin is not a JSON object')
|
|
128
|
+
decision = normalize(await handlers[ctx.event](payload, ctx), ctx)
|
|
129
|
+
} catch (err) {
|
|
130
|
+
io.err(`${name}: ${message(err)}\n`)
|
|
131
|
+
if (typeof onError !== 'function') return 1
|
|
132
|
+
try {
|
|
133
|
+
decision = normalize(await onError(err, payload, ctx), ctx)
|
|
134
|
+
} catch (err2) {
|
|
135
|
+
io.err(`${name}: error handler failed: ${message(err2)}\n`)
|
|
136
|
+
return 2
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return render(decision, ctx, io)
|
|
140
|
+
}
|