@probelabs/visor 0.1.124 → 0.1.126
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/dist/config.d.ts.map +1 -1
- package/dist/docs/DEPLOYMENT.md +117 -11
- package/dist/docs/GITHUB_CHECKS.md +18 -4
- package/dist/docs/NPM_USAGE.md +112 -39
- package/dist/docs/action-reference.md +63 -9
- package/dist/docs/advanced-ai.md +58 -51
- package/dist/docs/ai-configuration.md +99 -11
- package/dist/docs/ai-custom-tools-usage.md +70 -33
- package/dist/docs/ai-custom-tools.md +50 -27
- package/dist/docs/architecture.md +1232 -0
- package/dist/docs/bot-transports-rfc.md +13 -3
- package/dist/docs/ci-cli-mode.md +116 -8
- package/dist/docs/claude-code.md +111 -41
- package/dist/docs/command-provider.md +37 -15
- package/dist/docs/commands.md +252 -6
- package/dist/docs/configuration.md +138 -4
- package/dist/docs/contributing.md +737 -0
- package/dist/docs/custom-tools.md +39 -8
- package/dist/docs/dashboards/README.md +33 -19
- package/dist/docs/debug-visualizer-progress.md +14 -13
- package/dist/docs/debug-visualizer-rfc.md +14 -13
- package/dist/docs/debug-visualizer.md +30 -5
- package/dist/docs/debugging.md +73 -8
- package/dist/docs/default-output-schema.md +24 -20
- package/dist/docs/dependencies.md +75 -21
- package/dist/docs/dev-playbook.md +85 -9
- package/dist/docs/engine-pause-resume-rfc.md +11 -11
- package/dist/docs/engine-state-machine-plan.md +10 -3
- package/dist/docs/event-driven-github-integration-rfc.md +20 -11
- package/dist/docs/event-triggers.md +95 -6
- package/dist/docs/execution-statistics-rfc.md +16 -4
- package/dist/docs/fact-validator-gap-analysis.md +12 -1
- package/dist/docs/fact-validator-implementation-plan.md +19 -11
- package/dist/docs/fail-if.md +116 -11
- package/dist/docs/failure-conditions-implementation.md +40 -6
- package/dist/docs/failure-conditions-schema.md +243 -87
- package/dist/docs/failure-routing-rfc.md +43 -18
- package/dist/docs/failure-routing.md +80 -23
- package/dist/docs/faq.md +836 -0
- package/dist/docs/foreach-dependency-propagation.md +32 -15
- package/dist/docs/github-ops.md +6 -5
- package/dist/docs/glossary.md +322 -0
- package/dist/docs/goto-forward-run-plan.md +23 -10
- package/dist/docs/guides/criticality-modes.md +15 -13
- package/dist/docs/guides/fault-management-and-contracts.md +8 -5
- package/dist/docs/guides/workflow-style-guide.md +17 -8
- package/dist/docs/http.md +102 -3
- package/dist/docs/human-input-provider.md +20 -36
- package/dist/docs/index.md +206 -0
- package/dist/docs/lifecycle-hooks.md +322 -2
- package/dist/docs/limits.md +20 -5
- package/dist/docs/liquid-templates.md +86 -14
- package/dist/docs/loop-routing-refactor.md +4 -2
- package/dist/docs/mcp-provider.md +53 -19
- package/dist/docs/mcp.md +27 -1
- package/dist/docs/memory.md +7 -2
- package/dist/docs/migration.md +596 -0
- package/dist/docs/observability.md +227 -6
- package/dist/docs/output-formats.md +388 -9
- package/dist/docs/output-history.md +36 -6
- package/dist/docs/performance.md +510 -4
- package/dist/docs/pluggable.md +95 -4
- package/dist/docs/proposals/snapshot-scope-execution.md +6 -5
- package/dist/docs/providers/git-checkout.md +16 -14
- package/dist/docs/providers/noop.md +696 -0
- package/dist/docs/recipes.md +8 -9
- package/dist/docs/rfc/git-checkout-step.md +3 -1
- package/dist/docs/rfc/on_init-hook.md +18 -5
- package/dist/docs/rfc/workspace-isolation.md +16 -0
- package/dist/docs/roadmap/criticality-implementation-tasks.md +27 -27
- package/dist/docs/router-patterns.md +155 -43
- package/dist/docs/schema-templates.md +51 -15
- package/dist/docs/script.md +162 -13
- package/dist/docs/sdk.md +46 -12
- package/dist/docs/security.md +464 -5
- package/dist/docs/slack-integration.md +481 -0
- package/dist/docs/tag-filtering.md +60 -20
- package/dist/docs/telemetry-setup.md +157 -46
- package/dist/docs/test-framework-rfc.md +37 -36
- package/dist/docs/testing/assertions.md +92 -4
- package/dist/docs/testing/ci.md +56 -7
- package/dist/docs/testing/cli.md +57 -15
- package/dist/docs/testing/cookbook.md +53 -20
- package/dist/docs/testing/dsl-reference.md +110 -9
- package/dist/docs/testing/fixtures-and-mocks.md +28 -3
- package/dist/docs/testing/flows.md +59 -4
- package/dist/docs/testing/getting-started.md +14 -13
- package/dist/docs/testing/troubleshooting.md +39 -2
- package/dist/docs/timeouts.md +174 -18
- package/dist/docs/troubleshooting.md +176 -6
- package/dist/docs/workflow-creation-guide.md +101 -3
- package/dist/docs/workflows.md +138 -41
- package/dist/examples/README.md +169 -4
- package/dist/examples/ai-custom-tools-simple.yaml +2 -3
- package/dist/examples/cron-webhook-config.yaml +15 -0
- package/dist/examples/forEach-example.yaml +6 -0
- package/dist/examples/git-checkout-basic.yaml +4 -0
- package/dist/examples/git-checkout-compare.yaml +6 -0
- package/dist/examples/git-checkout-cross-repo.yaml +7 -0
- package/dist/examples/http-integration-config.yaml +30 -0
- package/dist/examples/https-server-config.yaml +15 -0
- package/dist/examples/mcp-provider-example.yaml +10 -10
- package/dist/examples/transform-example.yaml +3 -0
- package/dist/examples/webhook-pipeline-config.yaml +18 -0
- package/dist/examples/workflows/workflow-composition-example.yaml +4 -0
- package/dist/frontends/slack-frontend.d.ts +2 -0
- package/dist/frontends/slack-frontend.d.ts.map +1 -1
- package/dist/generated/config-schema.d.ts +11 -7
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/generated/config-schema.json +11 -7
- package/dist/index.js +3127 -974
- package/dist/output/traces/{run-2026-01-28T16-15-24-569Z.ndjson → run-2026-01-31T16-37-22-321Z.ndjson} +84 -84
- package/dist/output/traces/{run-2026-01-28T16-16-09-757Z.ndjson → run-2026-01-31T16-38-06-031Z.ndjson} +1013 -1013
- package/dist/providers/ai-check-provider.d.ts +9 -2
- package/dist/providers/ai-check-provider.d.ts.map +1 -1
- package/dist/providers/command-check-provider.d.ts.map +1 -1
- package/dist/providers/mcp-custom-sse-server.d.ts +17 -1
- package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -1
- package/dist/providers/workflow-check-provider.d.ts.map +1 -1
- package/dist/providers/workflow-tool-executor.d.ts +68 -0
- package/dist/providers/workflow-tool-executor.d.ts.map +1 -0
- package/dist/sdk/{check-provider-registry-AQ3JETBG.mjs → check-provider-registry-3KI5RKXT.mjs} +6 -5
- package/dist/sdk/check-provider-registry-IYILYY35.mjs +28 -0
- package/dist/sdk/chunk-2CPMMNIX.mjs +1459 -0
- package/dist/sdk/chunk-2CPMMNIX.mjs.map +1 -0
- package/dist/sdk/chunk-5LI6T4O3.mjs +3600 -0
- package/dist/sdk/chunk-5LI6T4O3.mjs.map +1 -0
- package/dist/sdk/{chunk-YLQ4UN62.mjs → chunk-A4PGHURG.mjs} +6838 -6257
- package/dist/sdk/chunk-A4PGHURG.mjs.map +1 -0
- package/dist/sdk/chunk-EXFGO4FX.mjs +147 -0
- package/dist/sdk/chunk-EXFGO4FX.mjs.map +1 -0
- package/dist/sdk/chunk-PJ7K5UFC.mjs +17732 -0
- package/dist/sdk/chunk-PJ7K5UFC.mjs.map +1 -0
- package/dist/sdk/{chunk-BHZ4CKUS.mjs → chunk-PXFIALUH.mjs} +77 -8
- package/dist/sdk/chunk-PXFIALUH.mjs.map +1 -0
- package/dist/sdk/{chunk-PVITVJ6J.mjs → chunk-RTKJXNZS.mjs} +32 -9
- package/dist/sdk/chunk-RTKJXNZS.mjs.map +1 -0
- package/dist/sdk/chunk-VW2GBXQT.mjs +606 -0
- package/dist/sdk/chunk-VW2GBXQT.mjs.map +1 -0
- package/dist/sdk/{config-RQQPMLRD.mjs → config-5AUYQFHE.mjs} +2 -2
- package/dist/sdk/config-6CUVEH7H.mjs +16 -0
- package/dist/sdk/config-6CUVEH7H.mjs.map +1 -0
- package/dist/sdk/{github-frontend-6Q4BISZX.mjs → github-frontend-BZ4N3BFZ.mjs} +7 -3
- package/dist/sdk/github-frontend-BZ4N3BFZ.mjs.map +1 -0
- package/dist/sdk/host-4MT3EW2I.mjs +52 -0
- package/dist/sdk/{host-P5NQICP7.mjs → host-NYWXLIFC.mjs} +2 -2
- package/dist/sdk/host-NYWXLIFC.mjs.map +1 -0
- package/dist/sdk/{routing-DEY2AIXM.mjs → routing-6R42GXUO.mjs} +2 -2
- package/dist/sdk/routing-6R42GXUO.mjs.map +1 -0
- package/dist/sdk/routing-7FXPULTO.mjs +24 -0
- package/dist/sdk/routing-7FXPULTO.mjs.map +1 -0
- package/dist/sdk/sdk.d.mts +3 -1
- package/dist/sdk/sdk.d.ts +3 -1
- package/dist/sdk/sdk.js +12163 -11204
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +14 -10
- package/dist/sdk/sdk.mjs.map +1 -1
- package/dist/sdk/slack-frontend-JUT3TYVC.mjs +821 -0
- package/dist/sdk/slack-frontend-JUT3TYVC.mjs.map +1 -0
- package/dist/sdk/workflow-check-provider-H3CUOLUD.mjs +28 -0
- package/dist/sdk/workflow-check-provider-H3CUOLUD.mjs.map +1 -0
- package/dist/sdk/workflow-check-provider-YUNNF4KC.mjs +28 -0
- package/dist/sdk/workflow-check-provider-YUNNF4KC.mjs.map +1 -0
- package/dist/sdk/workflow-registry-KFWSDSLM.mjs +12 -0
- package/dist/sdk/workflow-registry-KFWSDSLM.mjs.map +1 -0
- package/dist/slack/socket-runner.d.ts +2 -0
- package/dist/slack/socket-runner.d.ts.map +1 -1
- package/dist/state-machine/context/workflow-inputs.d.ts +20 -0
- package/dist/state-machine/context/workflow-inputs.d.ts.map +1 -0
- package/dist/state-machine/dispatch/execution-invoker.d.ts.map +1 -1
- package/dist/state-machine/dispatch/foreach-processor.d.ts.map +1 -1
- package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -1
- package/dist/state-machine/states/level-dispatch.d.ts.map +1 -1
- package/dist/state-machine/states/routing.d.ts +2 -1
- package/dist/state-machine/states/routing.d.ts.map +1 -1
- package/dist/traces/{run-2026-01-28T16-15-24-569Z.ndjson → run-2026-01-31T16-37-22-321Z.ndjson} +84 -84
- package/dist/traces/{run-2026-01-28T16-16-09-757Z.ndjson → run-2026-01-31T16-38-06-031Z.ndjson} +1013 -1013
- package/dist/types/config.d.ts +3 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/human-id.d.ts +12 -0
- package/dist/utils/human-id.d.ts.map +1 -0
- package/dist/utils/worktree-manager.d.ts +3 -0
- package/dist/utils/worktree-manager.d.ts.map +1 -1
- package/dist/workflow-executor.d.ts.map +1 -1
- package/dist/workflow-registry.d.ts +1 -0
- package/dist/workflow-registry.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/sdk/chunk-BHZ4CKUS.mjs.map +0 -1
- package/dist/sdk/chunk-PVITVJ6J.mjs.map +0 -1
- package/dist/sdk/chunk-YLQ4UN62.mjs.map +0 -1
- package/dist/sdk/github-frontend-6Q4BISZX.mjs.map +0 -1
- /package/dist/sdk/{check-provider-registry-AQ3JETBG.mjs.map → check-provider-registry-3KI5RKXT.mjs.map} +0 -0
- /package/dist/sdk/{config-RQQPMLRD.mjs.map → check-provider-registry-IYILYY35.mjs.map} +0 -0
- /package/dist/sdk/{routing-DEY2AIXM.mjs.map → config-5AUYQFHE.mjs.map} +0 -0
- /package/dist/sdk/{host-P5NQICP7.mjs.map → host-4MT3EW2I.mjs.map} +0 -0
package/dist/docs/security.md
CHANGED
|
@@ -1,7 +1,466 @@
|
|
|
1
|
-
|
|
1
|
+
# Security
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
- Lock remote extends with `--allowed-remote-patterns`; default is off.
|
|
5
|
-
- No external network calls unless configured (providers, HTTP checks, etc.).
|
|
6
|
-
- Document where tokens are used; rotate provider keys regularly.
|
|
3
|
+
This document covers security considerations and best practices for Visor deployments. Security is a critical aspect of any CI/CD tool that interacts with source code, AI providers, and external services.
|
|
7
4
|
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Visor operates in sensitive environments where it has access to:
|
|
8
|
+
- Source code and pull request data
|
|
9
|
+
- AI provider credentials
|
|
10
|
+
- GitHub tokens with repository permissions
|
|
11
|
+
- External service integrations
|
|
12
|
+
|
|
13
|
+
Understanding and properly configuring security controls is essential for safe operation.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Authentication
|
|
18
|
+
|
|
19
|
+
### GitHub Token vs GitHub App
|
|
20
|
+
|
|
21
|
+
Visor supports two authentication methods for GitHub integration:
|
|
22
|
+
|
|
23
|
+
| Method | Use Case | Permissions |
|
|
24
|
+
|--------|----------|-------------|
|
|
25
|
+
| **GitHub Token** | Quick setup, personal repos | Repository-scoped |
|
|
26
|
+
| **GitHub App** | Organizations, fine-grained control | Installation-scoped |
|
|
27
|
+
|
|
28
|
+
**GitHub Token (PAT or default token)**:
|
|
29
|
+
```yaml
|
|
30
|
+
- uses: probelabs/visor@v1
|
|
31
|
+
with:
|
|
32
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**GitHub App** (recommended for organizations):
|
|
36
|
+
```yaml
|
|
37
|
+
- uses: probelabs/visor@v1
|
|
38
|
+
with:
|
|
39
|
+
app-id: ${{ secrets.VISOR_APP_ID }}
|
|
40
|
+
private-key: ${{ secrets.VISOR_PRIVATE_KEY }}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Best Practice**: Prefer GitHub App authentication for:
|
|
44
|
+
- Granular repository permissions
|
|
45
|
+
- Bot identity (separate from user)
|
|
46
|
+
- Organization-wide installations
|
|
47
|
+
- Audit logging and traceability
|
|
48
|
+
|
|
49
|
+
See [GitHub Checks](./GITHUB_CHECKS.md) and [Action Reference](./action-reference.md) for complete authentication setup.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## AI Provider Security
|
|
54
|
+
|
|
55
|
+
AI providers require careful configuration to prevent unintended actions.
|
|
56
|
+
|
|
57
|
+
### File Editing Control (`allowEdit`)
|
|
58
|
+
|
|
59
|
+
By default, AI agents cannot modify files. Enable only when necessary:
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
steps:
|
|
63
|
+
auto-fix:
|
|
64
|
+
type: ai
|
|
65
|
+
prompt: "Fix the security vulnerabilities"
|
|
66
|
+
ai:
|
|
67
|
+
allowEdit: true # Disabled by default
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**When to enable**: Automated fix workflows, code refactoring, sandboxed environments.
|
|
71
|
+
|
|
72
|
+
**When to disable**: Review-only workflows, production environments, untrusted inputs.
|
|
73
|
+
|
|
74
|
+
### Tool Filtering (`allowedTools`, `disableTools`)
|
|
75
|
+
|
|
76
|
+
Control which tools the AI agent can access:
|
|
77
|
+
|
|
78
|
+
```yaml
|
|
79
|
+
steps:
|
|
80
|
+
# Whitelist mode - only specified tools
|
|
81
|
+
restricted:
|
|
82
|
+
type: ai
|
|
83
|
+
ai:
|
|
84
|
+
allowedTools: ['Read', 'Grep', 'Glob']
|
|
85
|
+
|
|
86
|
+
# Exclusion mode - block specific tools
|
|
87
|
+
safe-review:
|
|
88
|
+
type: ai
|
|
89
|
+
ai:
|
|
90
|
+
allowedTools: ['!Edit', '!Write', '!Delete']
|
|
91
|
+
|
|
92
|
+
# Disable all tools (raw AI mode)
|
|
93
|
+
conversational:
|
|
94
|
+
type: ai
|
|
95
|
+
ai:
|
|
96
|
+
disableTools: true
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Bash Command Execution (`allowBash`, `bashConfig`)
|
|
100
|
+
|
|
101
|
+
Bash execution is disabled by default. When enabled, comprehensive allow/deny lists apply:
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
steps:
|
|
105
|
+
# Simple enable with default safe commands
|
|
106
|
+
analysis:
|
|
107
|
+
type: ai
|
|
108
|
+
ai:
|
|
109
|
+
allowBash: true
|
|
110
|
+
|
|
111
|
+
# Advanced configuration
|
|
112
|
+
custom-bash:
|
|
113
|
+
type: ai
|
|
114
|
+
ai:
|
|
115
|
+
allowBash: true
|
|
116
|
+
bashConfig:
|
|
117
|
+
allow: ['npm test', 'npm run lint']
|
|
118
|
+
deny: ['npm install', 'rm -rf']
|
|
119
|
+
timeout: 30000
|
|
120
|
+
workingDirectory: './src'
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Default security**:
|
|
124
|
+
- ~235 safe read-only commands allowed (ls, cat, git status, grep, etc.)
|
|
125
|
+
- ~191 dangerous commands blocked (rm -rf, sudo, curl, npm install, etc.)
|
|
126
|
+
|
|
127
|
+
See [AI Configuration](./ai-configuration.md) for complete AI security options.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## HTTP Security
|
|
132
|
+
|
|
133
|
+
### Authentication Methods
|
|
134
|
+
|
|
135
|
+
The HTTP server supports multiple authentication types:
|
|
136
|
+
|
|
137
|
+
```yaml
|
|
138
|
+
http_server:
|
|
139
|
+
auth:
|
|
140
|
+
# Bearer Token
|
|
141
|
+
type: bearer_token
|
|
142
|
+
secret: "${WEBHOOK_SECRET}"
|
|
143
|
+
|
|
144
|
+
# HMAC-SHA256 Signature (GitHub-compatible)
|
|
145
|
+
type: hmac
|
|
146
|
+
secret: "${WEBHOOK_SECRET}"
|
|
147
|
+
|
|
148
|
+
# Basic Authentication
|
|
149
|
+
type: basic
|
|
150
|
+
username: "${HTTP_USERNAME}"
|
|
151
|
+
password: "${HTTP_PASSWORD}"
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### HMAC Signature Verification
|
|
155
|
+
|
|
156
|
+
For `hmac` authentication:
|
|
157
|
+
- Signature header: `x-webhook-signature`
|
|
158
|
+
- Format: `sha256={hash}`
|
|
159
|
+
- Timing-safe comparison prevents timing attacks
|
|
160
|
+
- Compatible with GitHub webhook signatures
|
|
161
|
+
|
|
162
|
+
### DoS Protection
|
|
163
|
+
|
|
164
|
+
Built-in protections:
|
|
165
|
+
- **Request size limit**: Maximum 1MB request body
|
|
166
|
+
- **Early rejection**: `Content-Length` validation before processing
|
|
167
|
+
- **Graceful errors**: Returns HTTP 413 for oversized requests
|
|
168
|
+
|
|
169
|
+
### TLS/HTTPS Configuration
|
|
170
|
+
|
|
171
|
+
```yaml
|
|
172
|
+
http_server:
|
|
173
|
+
tls:
|
|
174
|
+
enabled: true
|
|
175
|
+
cert: "${TLS_CERT}"
|
|
176
|
+
key: "${TLS_KEY}"
|
|
177
|
+
ca: "${TLS_CA}" # Optional CA certificate
|
|
178
|
+
rejectUnauthorized: true
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**Sources**: Environment variables, file paths, or Let's Encrypt certificates.
|
|
182
|
+
|
|
183
|
+
See [HTTP Integration](./http.md) for complete HTTP security configuration.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Path Traversal Protection
|
|
188
|
+
|
|
189
|
+
Visor validates all local file paths to prevent directory traversal attacks.
|
|
190
|
+
|
|
191
|
+
### Protection Mechanisms
|
|
192
|
+
|
|
193
|
+
1. **Project root boundary**: Paths must remain within the project root (git root or package.json location)
|
|
194
|
+
|
|
195
|
+
2. **Sensitive file blocking**: Access denied to:
|
|
196
|
+
- `/.ssh/` - SSH keys
|
|
197
|
+
- `/.aws/` - AWS credentials
|
|
198
|
+
- `/.env` - Environment files
|
|
199
|
+
- `/etc/passwd` - System files
|
|
200
|
+
- `/etc/shadow` - Password hashes
|
|
201
|
+
- `/private/` - macOS private directory
|
|
202
|
+
|
|
203
|
+
### Example Blocked Paths
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
../../../etc/passwd # Traversal attack
|
|
207
|
+
/home/user/.ssh/id_rsa # SSH key access
|
|
208
|
+
config/../../../.env # Hidden traversal
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
**Error message**: `Security error: Path traversal detected. Cannot access files outside project root`
|
|
212
|
+
|
|
213
|
+
This protection is implemented in the configuration loader and applies to:
|
|
214
|
+
- Configuration file extends
|
|
215
|
+
- Local file references
|
|
216
|
+
- Template file includes
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Command Provider Security
|
|
221
|
+
|
|
222
|
+
The command provider executes shell commands with security safeguards.
|
|
223
|
+
|
|
224
|
+
### Command Injection Prevention
|
|
225
|
+
|
|
226
|
+
**Never use uncontrolled user input directly in commands**:
|
|
227
|
+
|
|
228
|
+
```yaml
|
|
229
|
+
# DANGEROUS - PR title could contain malicious commands
|
|
230
|
+
bad:
|
|
231
|
+
type: command
|
|
232
|
+
exec: "echo '{{ pr.title }}'" # VULNERABLE!
|
|
233
|
+
|
|
234
|
+
# SAFE - Properly escaped
|
|
235
|
+
safe:
|
|
236
|
+
type: command
|
|
237
|
+
exec: "echo '{{ pr.title | escape }}'"
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Escaping Patterns
|
|
241
|
+
|
|
242
|
+
```yaml
|
|
243
|
+
steps:
|
|
244
|
+
# Use Liquid escape filter
|
|
245
|
+
safe-echo:
|
|
246
|
+
type: command
|
|
247
|
+
exec: "echo '{{ pr.title | escape }}'"
|
|
248
|
+
|
|
249
|
+
# Use JSON encoding for complex data
|
|
250
|
+
safe-json:
|
|
251
|
+
type: command
|
|
252
|
+
exec: |
|
|
253
|
+
cat << 'EOF' | jq .
|
|
254
|
+
{ "title": {{ pr.title | json }} }
|
|
255
|
+
EOF
|
|
256
|
+
|
|
257
|
+
# Avoid user input when possible
|
|
258
|
+
safest:
|
|
259
|
+
type: command
|
|
260
|
+
exec: "echo 'PR #{{ pr.number }}'" # Numbers are safe
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Environment Variable Filtering
|
|
264
|
+
|
|
265
|
+
Only safe environment variables are exposed in Liquid templates:
|
|
266
|
+
- **Allowed prefixes**: `CI_`, `GITHUB_`, `RUNNER_`, `NODE_`, `npm_`
|
|
267
|
+
- **Always available**: `PATH`, `HOME`, `USER`, `PWD`
|
|
268
|
+
|
|
269
|
+
**Note**: Shell commands inherit the full process environment, so `$VAR` expansion has access to all variables.
|
|
270
|
+
|
|
271
|
+
### Execution Limits
|
|
272
|
+
|
|
273
|
+
- **Timeout**: 60 seconds default (configurable)
|
|
274
|
+
- **Output limit**: 10MB maximum
|
|
275
|
+
- **Buffer protection**: Prevents memory exhaustion
|
|
276
|
+
|
|
277
|
+
See [Command Provider](./command-provider.md) for complete security documentation.
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## MCP Provider Security
|
|
282
|
+
|
|
283
|
+
### Command Validation
|
|
284
|
+
|
|
285
|
+
For stdio transport, commands are validated to prevent shell injection:
|
|
286
|
+
|
|
287
|
+
```yaml
|
|
288
|
+
steps:
|
|
289
|
+
mcp-check:
|
|
290
|
+
type: mcp
|
|
291
|
+
transport: stdio
|
|
292
|
+
command: npx # Validated command
|
|
293
|
+
args: ["-y", "@probelabs/probe@latest", "mcp"]
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
**Rejected metacharacters**: `;`, `|`, `&`, `` ` ``, `$`, `()`, `{}`, `[]`
|
|
297
|
+
|
|
298
|
+
### Sandboxed JavaScript
|
|
299
|
+
|
|
300
|
+
The `transform_js` context runs in a secure sandbox:
|
|
301
|
+
|
|
302
|
+
**Available**:
|
|
303
|
+
- Standard JavaScript: `Array`, `String`, `Object`, `Math`, `JSON`
|
|
304
|
+
- Context variables: `output`, `pr`, `files`, `outputs`, `env`
|
|
305
|
+
|
|
306
|
+
**Blocked**:
|
|
307
|
+
- `eval`, `Function`, `require`
|
|
308
|
+
- File system access
|
|
309
|
+
- Network access
|
|
310
|
+
- Process control
|
|
311
|
+
|
|
312
|
+
### URL Protocol Validation
|
|
313
|
+
|
|
314
|
+
For SSE and HTTP transports, only `http:` and `https:` protocols are allowed:
|
|
315
|
+
|
|
316
|
+
```yaml
|
|
317
|
+
steps:
|
|
318
|
+
remote-mcp:
|
|
319
|
+
type: mcp
|
|
320
|
+
transport: http
|
|
321
|
+
url: https://mcp-server.example.com/mcp # Only HTTPS allowed
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
See [MCP Provider](./mcp-provider.md) for complete MCP security documentation.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## Custom Tools Security
|
|
329
|
+
|
|
330
|
+
### Execution Context
|
|
331
|
+
|
|
332
|
+
Custom tools execute with the same permissions as the Visor process:
|
|
333
|
+
|
|
334
|
+
```yaml
|
|
335
|
+
tools:
|
|
336
|
+
my-tool:
|
|
337
|
+
name: my-tool
|
|
338
|
+
exec: 'grep -n "{{ args.pattern }}" src/'
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
**Security implications**:
|
|
342
|
+
- Full file system access within process permissions
|
|
343
|
+
- Environment variable access
|
|
344
|
+
- Network access if commands allow
|
|
345
|
+
|
|
346
|
+
### Input Validation
|
|
347
|
+
|
|
348
|
+
Always define `inputSchema` to validate tool inputs:
|
|
349
|
+
|
|
350
|
+
```yaml
|
|
351
|
+
tools:
|
|
352
|
+
search-tool:
|
|
353
|
+
name: search-tool
|
|
354
|
+
inputSchema:
|
|
355
|
+
type: object
|
|
356
|
+
properties:
|
|
357
|
+
pattern:
|
|
358
|
+
type: string
|
|
359
|
+
maxLength: 100
|
|
360
|
+
required: [pattern]
|
|
361
|
+
additionalProperties: false # Reject unknown properties
|
|
362
|
+
exec: 'grep -n "{{ args.pattern | escape }}" src/'
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### Best Practices
|
|
366
|
+
|
|
367
|
+
1. **Use input validation**: Reject malformed or oversized inputs
|
|
368
|
+
2. **Escape arguments**: Use `| escape` filter for shell commands
|
|
369
|
+
3. **Limit scope**: Use `cwd` to restrict working directory
|
|
370
|
+
4. **Set timeouts**: Prevent runaway commands
|
|
371
|
+
5. **Avoid secrets in output**: Filter sensitive data from tool responses
|
|
372
|
+
|
|
373
|
+
See [Custom Tools](./custom-tools.md) for complete custom tools documentation.
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## Remote Configuration Security
|
|
378
|
+
|
|
379
|
+
### Default: Remote URLs Blocked
|
|
380
|
+
|
|
381
|
+
By default, remote configuration URLs are blocked. Use `--allowed-remote-patterns` to enable:
|
|
382
|
+
|
|
383
|
+
```bash
|
|
384
|
+
visor --check all \
|
|
385
|
+
--allowed-remote-patterns "https://github.com/myorg/,https://raw.githubusercontent.com/myorg/"
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### Configuration
|
|
389
|
+
|
|
390
|
+
```yaml
|
|
391
|
+
# Only allowed if URL matches an allowed pattern
|
|
392
|
+
extends: https://raw.githubusercontent.com/myorg/configs/main/base.yaml
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### Disable Remote Entirely
|
|
396
|
+
|
|
397
|
+
```bash
|
|
398
|
+
visor --check all --no-remote-extends
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### Security Features
|
|
402
|
+
|
|
403
|
+
1. **URL allowlist**: Empty by default, must explicitly allow patterns
|
|
404
|
+
2. **Path traversal protection**: Local extends validated against project root
|
|
405
|
+
3. **Protocol restriction**: Only `http:` and `https:` for remote configs
|
|
406
|
+
|
|
407
|
+
See [Configuration](./configuration.md) for complete extends documentation.
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
## Production Security Checklist
|
|
412
|
+
|
|
413
|
+
### Authentication
|
|
414
|
+
|
|
415
|
+
- [ ] Use GitHub App authentication for organizations
|
|
416
|
+
- [ ] Rotate API keys regularly (AI providers, webhooks)
|
|
417
|
+
- [ ] Store secrets in GitHub Secrets, not in code
|
|
418
|
+
- [ ] Use environment-specific tokens (dev/staging/prod)
|
|
419
|
+
|
|
420
|
+
### AI Providers
|
|
421
|
+
|
|
422
|
+
- [ ] Keep `allowEdit: false` unless explicitly needed
|
|
423
|
+
- [ ] Use `allowedTools` to restrict agent capabilities
|
|
424
|
+
- [ ] Keep `allowBash: false` for review-only workflows
|
|
425
|
+
- [ ] Set appropriate timeouts for AI operations
|
|
426
|
+
|
|
427
|
+
### HTTP Endpoints
|
|
428
|
+
|
|
429
|
+
- [ ] Enable TLS for all HTTP servers
|
|
430
|
+
- [ ] Use HMAC or bearer token authentication
|
|
431
|
+
- [ ] Implement request size limits
|
|
432
|
+
- [ ] Monitor for suspicious request patterns
|
|
433
|
+
|
|
434
|
+
### Configuration
|
|
435
|
+
|
|
436
|
+
- [ ] Validate configuration files before deployment: `visor validate`
|
|
437
|
+
- [ ] Block remote extends unless explicitly needed
|
|
438
|
+
- [ ] Review extended configurations for security implications
|
|
439
|
+
- [ ] Use `--allowed-remote-patterns` with specific URLs only
|
|
440
|
+
|
|
441
|
+
### Commands and Tools
|
|
442
|
+
|
|
443
|
+
- [ ] Escape all user input in shell commands
|
|
444
|
+
- [ ] Use input schemas for custom tools
|
|
445
|
+
- [ ] Set appropriate timeouts
|
|
446
|
+
- [ ] Avoid executing code from untrusted PRs
|
|
447
|
+
|
|
448
|
+
### Monitoring
|
|
449
|
+
|
|
450
|
+
- [ ] Enable telemetry for audit trails
|
|
451
|
+
- [ ] Review GitHub Checks for unexpected failures
|
|
452
|
+
- [ ] Monitor AI provider usage and costs
|
|
453
|
+
- [ ] Set up alerts for authentication failures
|
|
454
|
+
|
|
455
|
+
---
|
|
456
|
+
|
|
457
|
+
## Related Documentation
|
|
458
|
+
|
|
459
|
+
- [AI Configuration](./ai-configuration.md) - AI provider security options
|
|
460
|
+
- [HTTP Integration](./http.md) - HTTP authentication and TLS
|
|
461
|
+
- [Command Provider](./command-provider.md) - Command injection prevention
|
|
462
|
+
- [MCP Provider](./mcp-provider.md) - MCP security features
|
|
463
|
+
- [Custom Tools](./custom-tools.md) - Tool execution security
|
|
464
|
+
- [Configuration](./configuration.md) - Remote configuration controls
|
|
465
|
+
- [GitHub Checks](./GITHUB_CHECKS.md) - GitHub authentication
|
|
466
|
+
- [Action Reference](./action-reference.md) - GitHub Action inputs
|