-
Notifications
You must be signed in to change notification settings - Fork 1.1k
refactor(wrangler): add safe command/args handling for telemetry #12063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: pbd/wrangler/migrate-containers-to-define-command
Are you sure you want to change the base?
refactor(wrangler): add safe command/args handling for telemetry #12063
Conversation
🦋 Changeset detectedLatest commit: 5a78386 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
| // (used when yargs validation errors occur before handler runs) | ||
| command = `wrangler ${args._.join(" ")}`; | ||
| metricsArgs = args; | ||
| safeCommand = args._.join(" "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MattieTK - do we want this just to be "" since we cannot guarantee that the args don't contain something sensitive?
3fd5325 to
7e9344a
Compare
bd603d8 to
2e40a31
Compare
a073093 to
db843d1
Compare
2e40a31 to
3ad4dd8
Compare
- Rename 'command' to 'safeCommand' (without 'wrangler ' prefix) and 'args' to 'safeArgs' in telemetry events - Add 'logArgs' boolean to control whether command arguments are included in telemetry - Commands must explicitly opt-in via metadata.logArgs: true to log arguments - Safe commands (list, info, get, etc.) that don't handle sensitive data opt-in to logging - Sensitive commands (secret put/delete/bulk, hyperdrive create) intentionally do not opt-in - Update fallback telemetry in index.ts to use new format with logArgs: false
3ad4dd8 to
5a78386
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR improves telemetry safety by introducing explicit control over which command arguments are included in telemetry events, preventing accidental capture of sensitive data like secrets and credentials.
Replaces #11856
Builds on top of #12069 and Builds on top of #12071
Renamed telemetry fields for clarity:
Added logArgs control:
Opted-in safe commands (~100 commands) that don't handle sensitive input:
Intentionally excluded sensitive commands:
Tests
Public documentation
A picture of a cute animal (not mandatory, but encouraged)